Compare commits

..

19 commits

Author SHA1 Message Date
Echo J.
4a0882a55b
Merge a8c40aabde into 50c3a47cd3 2024-11-28 19:02:44 +01:00
Echo J
a8c40aabde SilentPatchVC: Add GCC-style inline assembly statements
This also includes a small wrapper to call a C++ function from GCC-style inline ASM

These statements almost work on llvm-mingw too (but there's some stubborn call instructions)
2024-11-28 19:59:07 +02:00
Echo J
c3570a9d89 SilentPatchIII: Add GCC-style inline assembly statements
These almost work on llvm-mingw too (but there's some stubborn call instructions)
2024-11-28 19:59:07 +02:00
Echo J
9a3e90f7c9 SilentPatchIII: Add a missing functional header include
MinGW GCC doesn't implicitly include it either
2024-11-28 19:59:07 +02:00
Echo J
6af4fcc0ee SilentPatch: Add missing cmath header include
It's required for the modf() function (and it isn't implicitly
included on MinGW GCC)
2024-11-28 19:59:07 +02:00
Echo J
33c1ec00d6 SilentPatch: Move a header include in SVF
This makes sure the fixed-width integer types are included in SVF.h
2024-11-28 19:59:07 +02:00
Echo J
e270bf652c SilentPatch: Define a replacement for _stricmp() on non-MSVC
MinGW GCC doesn't have this MSVC-specific function
2024-11-28 19:59:07 +02:00
Echo J
24719bb98e SilentPatch: Move RwEngineInstance definition to headers
MinGW GCC can't locate it in some files otherwise
2024-11-28 19:59:07 +02:00
Echo J
77765c3fa5 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)
2024-11-28 19:59:07 +02:00
Echo J
4e2f4f8e03 SilentPatch: Don't define certain Rw* functions if not needed
Redefining them can cause strange compile errors with MinGW GCC
2024-11-28 19:59:07 +02:00
Echo J
cf57f43e19 DDraw: Cast the memcpy() source argument
This works around the MinGW GCC type strictness
2024-11-28 19:59:07 +02:00
Echo J
ba76a0ed9e DDraw: Use a pragma for DirectDrawCreateEx export on MSVC
The .def file is either going to have issues on MSVC or MinGW GCC
(so replace it with a pragma on MSVC)
2024-11-28 19:59:07 +02:00
Echo J
dbe21b8556 SilentPatchIII/VC/SA: Mark some function pointers as inline
MinGW GCC's linker can't find them otherwise
2024-11-28 19:59:00 +02:00
Echo J
109e1c67f4 SilentPatchIII/VC: Remove extern from ppUserFilesDir variable definitions
This fixes compile warnings with MinGW GCC
2024-11-28 19:51:47 +02:00
Echo J
a3d9c73a8b SilentPatchIII/VC/SA: Add GCC/Clang-compatible safebuffers equivalent
And switch to a common define for this attribute (this fixes
compile warnings on MinGW GCC)
2024-11-28 19:51:47 +02:00
Echo J
84a737fb88 Use reinterpret_cast for function pointer casts
MSVC (wrongly) allows those casts to succeed with static_cast:
https://stackoverflow.com/questions/74002657/why-cant-i-static-cast-a-void-to-a-pointer-to-function
(so adjust those casts for better compiler compatibility including MinGW GCC)
2024-11-28 19:51:47 +02:00
Echo J
d9e8480b6d Set Windows defines earlier
This avoids compile warnings on MinGW GCC (because standard C++
headers eventually import the Windows stuff)
2024-11-28 19:51:47 +02:00
Echo J
0bf574a5b8 Use lowercase names for Windows headers
This fixes missing header issues on a case-sensitive filesystem
with MinGW GCC
2024-11-28 19:51:47 +02:00
Echo J
730afa5848 Remove unused dllmain.cpp file
It seems to be used in the early days of SilentPatch (but it's
no longer included since the III/VC/SA code split and serves no purpose)
2024-11-28 19:51:47 +02:00

View file

@ -302,7 +302,7 @@ public:
private:
template<std::size_t Index>
STATIC_INLINE void (CVehicle::*orgDoHeadLightBeam)(int type, CMatrix& m, bool right);
static void (CVehicle::*orgDoHeadLightBeam)(int type, CMatrix& m, bool right);
template<std::size_t Index>
void DoHeadLightBeam_LightBeamFixSaveObj(int type, CMatrix& m, bool right)
@ -337,7 +337,7 @@ public:
public:
template<std::size_t Index>
STATIC_INLINE void (CAutomobile::*orgAutomobilePreRender)();
static void (CAutomobile::*orgAutomobilePreRender)();
template<std::size_t Index>
void PreRender_SilentPatch()
@ -352,7 +352,7 @@ public:
void HideDestroyedWheels_SilentPatch(void (CAutomobile::*spawnFlyingComponentCB)(int, unsigned int), int nodeID, unsigned int modelID);
template<std::size_t Index>
STATIC_INLINE void (CAutomobile::*orgSpawnFlyingComponent)(int, unsigned int);
static void (CAutomobile::*orgSpawnFlyingComponent)(int, unsigned int);
template<std::size_t Index>
void SpawnFlyingComponent_HideWheels(int nodeID, unsigned int modelID)
@ -448,7 +448,7 @@ private:
private:
template<std::size_t Index>
STATIC_INLINE CVehicle* (CStoredCar::*orgRestoreCar)();
static CVehicle* (CStoredCar::*orgRestoreCar)();
template<std::size_t Index>
CVehicle* RestoreCar_SilentPatch()