Compare commits

..

11 commits

Author SHA1 Message Date
Echo J
870e3d63a1 SilentPatchVC: Add GCC/Clang-specific inline assembly statements
This also includes a small wrapper to call a C++ function from inline ASM

(From III: This change also matches the MSVC statements more closely to
the GCC/Clang ones)
2024-11-13 21:17:52 +02:00
Echo J
3f26e0045e SilentPatchIII: Add GCC/Clang-specific inline assembly statements
This also matches the MSVC statements more closely to the GCC/Clang
ones
2024-11-13 21:17:49 +02:00
Echo J
b7a08843be SilentPatchIII: Add a missing functional header include
MinGW GCC doesn't implicitly include it either
2024-11-13 21:09:26 +02:00
Echo J
fd395f3c6a SilentPatch: Add missing cmath header include
It's required for the modf() function (and it isn't implicitly
included on MinGW GCC)
2024-11-13 21:09:26 +02:00
Echo J
d9c3561d7b SilentPatch: Move a header include in SVF
This makes sure the fixed-width integer types are included in SVF.h
2024-11-13 21:09:26 +02:00
Echo J
8a930e6e4b SilentPatch: Define a replacement for _stricmp() on non-MSVC
MinGW GCC doesn't have this MSVC-specific function
2024-11-13 21:09:26 +02:00
Echo J
90e5ba15ab SilentPatch: Move RwEngineInstance definition to headers
MinGW GCC can't locate it in some files otherwise
2024-11-13 21:09:26 +02:00
Echo J
f9adddf0e1 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-13 21:09:26 +02:00
Echo J
d49e03e372 SilentPatch: Don't define certain Rw* functions if not needed
Redefining them can cause strange compile errors with MinGW GCC
2024-11-13 21:09:26 +02:00
Echo J
4445c9e24a DDraw: Cast the memcpy() source argument
This works around the MinGW GCC type strictness
2024-11-13 21:09:26 +02:00
Echo J
23af8cd7ca 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-13 21:06:45 +02:00
7 changed files with 10 additions and 12 deletions

View file

@ -1,3 +1,3 @@
LIBRARY DDRAW
EXPORTS
DirectDrawCreateEx=DirectDrawCreateEx@16 @10
DirectDrawCreateEx = DirectDrawCreateEx@16

View file

@ -83,7 +83,6 @@
<AdditionalOptions>/Zc:threadSafeInit- /Zc:strictStrings %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<ModuleDefinitionFile>ddraw.def</ModuleDefinitionFile>
<SubSystem>Windows</SubSystem>
<DelayLoadDLLs>shell32.dll;shlwapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<LargeAddressAware>true</LargeAddressAware>
@ -113,7 +112,6 @@
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<ModuleDefinitionFile>ddraw.def</ModuleDefinitionFile>
<SubSystem>Windows</SubSystem>
<DelayLoadDLLs>shell32.dll;shlwapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<LargeAddressAware>true</LargeAddressAware>
@ -143,7 +141,6 @@
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<ModuleDefinitionFile>ddraw.def</ModuleDefinitionFile>
<SubSystem>Windows</SubSystem>
<DelayLoadDLLs>shell32.dll;shlwapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<LargeAddressAware>true</LargeAddressAware>
@ -172,4 +169,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View file

@ -14,6 +14,7 @@
#include "Desktop.h"
#pragma comment(lib, "shlwapi.lib")
#pragma comment(linker, "/EXPORT:DirectDrawCreateEx=_DirectDrawCreateEx@16")
extern "C" HRESULT WINAPI DirectDrawCreateEx(GUID FAR *lpGUID, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter)
{

View file

@ -9,10 +9,6 @@
#define STATIC_INLINE static inline
#endif
#define RwEngineInstance (*rwengine)
extern "C" void** rwengine;
namespace ExtraCompSpecularity
{
void ReadExtraCompSpecularityExceptions(const wchar_t* pPath);

View file

@ -3,6 +3,10 @@
#include <rwcore.h>
#include <rpworld.h>
#define RwEngineInstance (*rwengine)
extern void** rwengine;
template<RwRenderState State>
class RwScopedRenderState
{
@ -68,4 +72,4 @@ Pred RpGeometryForAllMaterials(RpGeometry* geometry, Pred callback)
break;
}
return callback;
}
}

View file

@ -3,7 +3,7 @@
#include <algorithm>
#include <map>
#ifndef _stricmp
#ifndef _MSC_VER
#include <cstring>
#define _stricmp strcasecmp
#endif

View file

@ -978,7 +978,7 @@ namespace GenerateNewPickup_ReuseObjectFix
mov edi, eax
push edi
call offset WorldRemove
call WorldRemove
add esp, 4
// Call dtor