From 273e7c1790e121c5806ee06c8136755832de269a Mon Sep 17 00:00:00 2001 From: Echo J Date: Thu, 7 Nov 2024 09:13:58 +0200 Subject: [PATCH] SilentPatch: Move RwEngineInstance definition to separate headers MinGW GCC's linker will fail to find it in Common.cpp/SilentPatchVC.cpp otherwise --- SilentPatch/Common.h | 6 +++++- SilentPatch/RWGTA.cpp | 2 -- SilentPatch/RWGTA.h | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/SilentPatch/Common.h b/SilentPatch/Common.h index 8565cf8..763df2e 100644 --- a/SilentPatch/Common.h +++ b/SilentPatch/Common.h @@ -2,6 +2,10 @@ #include +#define RwEngineInstance (*rwengine) + +extern "C" void** rwengine; + namespace ExtraCompSpecularity { void ReadExtraCompSpecularityExceptions(const wchar_t* pPath); @@ -15,4 +19,4 @@ namespace Common void III_VC_Common(); void III_VC_SetDelayedPatchesFunc( void(*func)() ); } -}; \ No newline at end of file +}; diff --git a/SilentPatch/RWGTA.cpp b/SilentPatch/RWGTA.cpp index cb5cad6..245777e 100644 --- a/SilentPatch/RWGTA.cpp +++ b/SilentPatch/RWGTA.cpp @@ -1,8 +1,6 @@ #include "Utils/MemoryMgr.h" #include "Utils/Patterns.h" -#define RwEngineInstance (*rwengine) - #include #include "RWGTA.h" diff --git a/SilentPatch/RWGTA.h b/SilentPatch/RWGTA.h index e184dc9..8a3c34c 100644 --- a/SilentPatch/RWGTA.h +++ b/SilentPatch/RWGTA.h @@ -1,5 +1,9 @@ #pragma once +#define RwEngineInstance (*rwengine) + +extern void** rwengine; + namespace RWGTA::Patches { bool TryLocateRwD3D8();