From 5459cbf037a59ef5194746f308ccb71bd731c256 Mon Sep 17 00:00:00 2001 From: Echo J Date: Thu, 7 Nov 2024 00:49:10 +0200 Subject: [PATCH] SilentPatch: Simplify RwIm2DRenderLine function pointer declaration MinGW GCC doesn't seem to unwind the layers of the macro define properly (which causes it to not find the declaration type) --- SilentPatch/Common.cpp | 4 ++-- SilentPatch/Common.h | 4 ++++ SilentPatch/RWGTA.cpp | 2 -- SilentPatch/RWGTA.h | 4 ++++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/SilentPatch/Common.cpp b/SilentPatch/Common.cpp index e64f88b..0851950 100644 --- a/SilentPatch/Common.cpp +++ b/SilentPatch/Common.cpp @@ -34,7 +34,7 @@ namespace HandlingNameLoadFix // ============= Corona lines rendering fix ============= namespace CoronaLinesFix { - static decltype(RwIm2DRenderLine)* orgRwIm2DRenderLine; + static RwIm2DRenderLineFunction orgRwIm2DRenderLine; static RwBool RenderLine_SetRecipZ( RwIm2DVertex *vertices, RwInt32 numVertices, RwInt32 vert1, RwInt32 vert2 ) { const RwReal nearScreenZ = RwIm2DGetNearScreenZ(); @@ -379,4 +379,4 @@ namespace Common { TXN_CATCH(); } } -} \ No newline at end of file +} diff --git a/SilentPatch/Common.h b/SilentPatch/Common.h index 3b8b203..1a634d2 100644 --- a/SilentPatch/Common.h +++ b/SilentPatch/Common.h @@ -9,6 +9,10 @@ #define STATIC_INLINE static inline #endif +#define RwEngineInstance (*rwengine) + +extern "C" void** rwengine; + namespace ExtraCompSpecularity { void ReadExtraCompSpecularityExceptions(const wchar_t* pPath); 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();