diff --git a/SilentPatch/Common.h b/SilentPatch/Common.h index 8565cf8..3b8b203 100644 --- a/SilentPatch/Common.h +++ b/SilentPatch/Common.h @@ -2,6 +2,13 @@ #include +// Workaround for old MSVC inline function bugs +#if defined(_MSC_VER) && _MSC_VER < 1930 +#define STATIC_INLINE static +#else +#define STATIC_INLINE static inline +#endif + namespace ExtraCompSpecularity { void ReadExtraCompSpecularityExceptions(const wchar_t* pPath); @@ -15,4 +22,4 @@ namespace Common void III_VC_Common(); void III_VC_SetDelayedPatchesFunc( void(*func)() ); } -}; \ No newline at end of file +}; diff --git a/SilentPatchIII/SilentPatchIII.cpp b/SilentPatchIII/SilentPatchIII.cpp index ca12002..689f314 100644 --- a/SilentPatchIII/SilentPatchIII.cpp +++ b/SilentPatchIII/SilentPatchIII.cpp @@ -1040,7 +1040,7 @@ namespace SlidingTextsScalingFixes static inline float** pHorShadowValue; template - static void (*orgPrintString)(float,float,const wchar_t*); + STATIC_INLINE void (*orgPrintString)(float,float,const wchar_t*); template static void PrintString_Slide(float fX, float fY, const wchar_t* pText) @@ -1067,7 +1067,7 @@ namespace SlidingTextsScalingFixes static inline bool bSlidingEnabled = false; template - static void (*orgPrintString)(float,float,const wchar_t*); + STATIC_INLINE void (*orgPrintString)(float,float,const wchar_t*); template static void PrintString_Slide(float fX, float fY, const wchar_t* pText) diff --git a/SilentPatchSA/GeneralSA.h b/SilentPatchSA/GeneralSA.h index 2b082dc..d3d041e 100644 --- a/SilentPatchSA/GeneralSA.h +++ b/SilentPatchSA/GeneralSA.h @@ -2,6 +2,7 @@ #define __GENERAL #include +#include "Common.h" #include "TheFLAUtils.h" class CSimpleTransform @@ -570,4 +571,4 @@ static_assert(sizeof(CPhysical) == 0x138, "Wrong size: CPhysical"); static_assert(sizeof(CObject) == 0x17C, "Wrong size: CObject"); static_assert(sizeof(CEscalator) == 0x150, "Wrong size: CEscalator"); -#endif \ No newline at end of file +#endif diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index 1175233..5f95eb5 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -2851,7 +2851,7 @@ namespace CreditsScalingFixes static const unsigned int FIXED_RES_HEIGHT_SCALE = 448; template - static void (*orgPrintString)(float,float,const wchar_t*); + STATIC_INLINE void (*orgPrintString)(float,float,const wchar_t*); template static void PrintString_ScaleY(float fX, float fY, const wchar_t* pText) @@ -2888,7 +2888,7 @@ namespace SlidingTextsScalingFixes static inline bool bSlidingEnabled = false; template - static void (*orgPrintString)(float,float,const wchar_t*); + STATIC_INLINE void (*orgPrintString)(float,float,const wchar_t*); template static void PrintString_Slide(float fX, float fY, const wchar_t* pText) @@ -2898,7 +2898,7 @@ namespace SlidingTextsScalingFixes } template - static void (*orgSetRightJustifyWrap)(float wrap); + STATIC_INLINE void (*orgSetRightJustifyWrap)(float wrap); template static void SetRightJustifyWrap_Slide(float wrap) @@ -2915,7 +2915,7 @@ namespace SlidingTextsScalingFixes static inline bool bSlidingEnabled = false; template - static void (*orgPrintString)(float,float,const wchar_t*); + STATIC_INLINE void (*orgPrintString)(float,float,const wchar_t*); template static void PrintString_Slide(float fX, float fY, const wchar_t* pText) diff --git a/SilentPatchSA/VehicleSA.h b/SilentPatchSA/VehicleSA.h index eeda440..330000a 100644 --- a/SilentPatchSA/VehicleSA.h +++ b/SilentPatchSA/VehicleSA.h @@ -302,7 +302,7 @@ public: private: template - static void (CVehicle::*orgDoHeadLightBeam)(int type, CMatrix& m, bool right); + STATIC_INLINE void (CVehicle::*orgDoHeadLightBeam)(int type, CMatrix& m, bool right); template void DoHeadLightBeam_LightBeamFixSaveObj(int type, CMatrix& m, bool right) @@ -337,7 +337,7 @@ public: public: template - static void (CAutomobile::*orgAutomobilePreRender)(); + STATIC_INLINE void (CAutomobile::*orgAutomobilePreRender)(); template void PreRender_SilentPatch() @@ -352,7 +352,7 @@ public: void HideDestroyedWheels_SilentPatch(void (CAutomobile::*spawnFlyingComponentCB)(int, unsigned int), int nodeID, unsigned int modelID); template - static void (CAutomobile::*orgSpawnFlyingComponent)(int, unsigned int); + STATIC_INLINE void (CAutomobile::*orgSpawnFlyingComponent)(int, unsigned int); template void SpawnFlyingComponent_HideWheels(int nodeID, unsigned int modelID) @@ -448,7 +448,7 @@ private: private: template - static CVehicle* (CStoredCar::*orgRestoreCar)(); + STATIC_INLINE CVehicle* (CStoredCar::*orgRestoreCar)(); template CVehicle* RestoreCar_SilentPatch() @@ -477,4 +477,4 @@ static_assert(sizeof(CVehicle) == 0x5A0, "Wrong size: CVehicle"); static_assert(sizeof(CAutomobile) == 0x988, "Wrong size: CAutomobile"); static_assert(sizeof(CStoredCar) == 0x40, "Wrong size: CStoredCar"); -#endif \ No newline at end of file +#endif diff --git a/SilentPatchVC/SilentPatchVC.cpp b/SilentPatchVC/SilentPatchVC.cpp index cfda70c..2209169 100644 --- a/SilentPatchVC/SilentPatchVC.cpp +++ b/SilentPatchVC/SilentPatchVC.cpp @@ -356,7 +356,7 @@ namespace RadarTraceOutlineFixes } template - static void (*orgShowRadarTraceWithHeight)(float, float, unsigned int, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char); + STATIC_INLINE void (*orgShowRadarTraceWithHeight)(float, float, unsigned int, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char); template static void ShowRadarTraceWithHeight_RecalculatePositions(float a1, float a2, unsigned int a3, unsigned char a4, unsigned char a5, unsigned char a6, unsigned char a7, unsigned char a8) @@ -456,7 +456,7 @@ namespace SlidingTextsScalingFixes static inline bool bSlidingEnabled = false; template - static void (*orgPrintString)(float,float,const wchar_t*); + STATIC_INLINE void (*orgPrintString)(float,float,const wchar_t*); template static void PrintString_Slide(float fX, float fY, const wchar_t* pText) @@ -466,7 +466,7 @@ namespace SlidingTextsScalingFixes } template - static void (*orgSetRightJustifyWrap)(float wrap); + STATIC_INLINE void (*orgSetRightJustifyWrap)(float wrap); template static void SetRightJustifyWrap_Slide(float wrap) @@ -483,7 +483,7 @@ namespace SlidingTextsScalingFixes static inline bool bSlidingEnabled = false; template - static void (*orgPrintString)(float,float,const wchar_t*); + STATIC_INLINE void (*orgPrintString)(float,float,const wchar_t*); template static void PrintString_Slide(float fX, float fY, const wchar_t* pText)