diff --git a/SilentPatch/Patterns.h b/SilentPatch/Patterns.h index 41c1331..edb3a5f 100644 --- a/SilentPatch/Patterns.h +++ b/SilentPatch/Patterns.h @@ -10,6 +10,9 @@ #include #include +#pragma warning(push) +#pragma warning(disable:4201) + #define PATTERNS_USE_HINTS 0 namespace hook @@ -204,4 +207,6 @@ namespace hook { return pattern(pattern_string).get_first(offset); } -} \ No newline at end of file +} + +#pragma warning(pop) \ No newline at end of file diff --git a/SilentPatch/StdAfx.h b/SilentPatch/StdAfx.h index a53c636..acda869 100644 --- a/SilentPatch/StdAfx.h +++ b/SilentPatch/StdAfx.h @@ -1,9 +1,3 @@ -#pragma warning(disable:4481) // nonstandard extension used: override specifier 'override' -#pragma warning(disable:4401) // member is bit field -#pragma warning(disable:4733) // handler not registered as safe handler -#pragma warning(disable:4725) // instruction may be inaccurate on some Pentiums -#pragma warning(disable:4201) // nonstandard extension used: nameless struct/union - #define WIN32_LEAN_AND_MEAN #define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index 3dfc062..259138f 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -20,6 +20,8 @@ #include "Patterns.h" #include "DelimStringReader.h" +#pragma warning(disable:4733) + // RW wrappers static void* varAtomicDefaultRenderCallBack = AddressByVersion(0x7491C0, 0x749AD0, 0x783180); WRAPPER RpAtomic* AtomicDefaultRenderCallBack(RpAtomic* atomic) { WRAPARG(atomic); VARJMP(varAtomicDefaultRenderCallBack); } @@ -674,12 +676,12 @@ bool GetCurrentZoneLockedOrUnlocked(float fPosX, float fPosY) // Exploit RAII really bad static const float GridXOffset = **(float**)(0x572135+2), GridYOffset = **(float**)(0x57214A+2); static const float GridXSize = **(float**)(0x57213B+2), GridYSize = **(float**)(0x572153+2); - static const int GridXNum = (2.0f*GridXOffset) * GridXSize, GridYNum = (2.0f*GridYOffset) * GridYSize; + static const int GridXNum = static_cast((2.0f*GridXOffset) * GridXSize), GridYNum = static_cast((2.0f*GridYOffset) * GridYSize); static unsigned char* const ZonesVisited = *(unsigned char**)(0x57216A) - (GridYNum-1); // 1.01 fixed it! - int Xindex = (fPosX+GridXOffset) * GridXSize; - int Yindex = (fPosY+GridYOffset) * GridYSize; + int Xindex = static_cast((fPosX+GridXOffset) * GridXSize); + int Yindex = static_cast((fPosY+GridYOffset) * GridYSize); // "Territories fix" if ( (Xindex >= 0 && Xindex < GridXNum) && (Yindex >= 0 && Yindex < GridYNum) ) @@ -693,8 +695,8 @@ bool GetCurrentZoneLockedOrUnlocked_Steam(float fPosX, float fPosY) { static unsigned char* const ZonesVisited = *(unsigned char**)(0x5870E8) - 9; - int Xindex = (fPosX+3000.0f) / 600.0f; - int Yindex = (fPosY+3000.0f) / 600.0f; + int Xindex = static_cast((fPosX+3000.0f) / 600.0f); + int Yindex = static_cast((fPosY+3000.0f) / 600.0f); // "Territories fix" if ( (Xindex >= 0 && Xindex < 10) && (Yindex >= 0 && Yindex < 10) ) @@ -760,7 +762,7 @@ void DrawMoonWithPhases(int moonColor, float* screenPos, float sizeX, float size RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, 0); - RenderOneXLUSprite(screenPos[0], screenPos[1], fFarClipZ, sizeX * size, sizeY * size, moonColor, moonColor, moonColor * 0.85f, 255, a10, -1, 0, 0); + RenderOneXLUSprite(screenPos[0], screenPos[1], fFarClipZ, sizeX * size, sizeY * size, moonColor, moonColor, static_cast(moonColor * 0.85f), 255, a10, -1, 0, 0); RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE); @@ -1111,8 +1113,10 @@ bool __stdcall CheckDoubleRWheelsList( void* modelInfo, uint8_t* handlingData ) return lastResult; } - +#pragma warning(push) +#pragma warning(disable:4838) #include +#pragma warning(pop) static void* pNVCShader = nullptr; static bool bRenderNVC = false; diff --git a/SilentPatchSA/StdAfxSA.h b/SilentPatchSA/StdAfxSA.h index fd30662..7ebef04 100644 --- a/SilentPatchSA/StdAfxSA.h +++ b/SilentPatchSA/StdAfxSA.h @@ -1,8 +1,6 @@ -#pragma warning(disable:4481) // nonstandard extension used: override specifier 'override' -#pragma warning(disable:4401) // member is bit field -#pragma warning(disable:4733) // handler not registered as safe handler -#pragma warning(disable:4725) // instruction may be inaccurate on some Pentiums -#pragma warning(disable:4201) // nonstandard extension used: nameless struct/union +#pragma warning(disable:4458) // declaration hides class member +#pragma warning(disable:4201) // nonatandard extension user: nameless struct/union +#pragma warning(disable:4100) // unreferenced formal parameter #define WIN32_LEAN_AND_MEAN #define _CRT_SECURE_NO_WARNINGS