From cb9a6e326ef89b7c05930a8af685e78d16a82a90 Mon Sep 17 00:00:00 2001 From: Miran Date: Sat, 16 May 2026 00:29:35 +0200 Subject: [PATCH] Enable precompiled header for all platforms. --- plugin_II/game_II/cSampleManager.h | 8 ++++---- shared/Audio.cpp | 2 -- shared/Audio.h | 5 +---- shared/RefListUtils.h | 3 +++ shared/game/CVector.h | 2 +- shared/game/CVector2D.h | 2 +- tools/premake/premake5.lua | 2 +- tools/premake/stdafx_template.h | 15 ++++++++++++--- 8 files changed, 23 insertions(+), 16 deletions(-) diff --git a/plugin_II/game_II/cSampleManager.h b/plugin_II/game_II/cSampleManager.h index 921ad4bfd..a5fb33188 100644 --- a/plugin_II/game_II/cSampleManager.h +++ b/plugin_II/game_II/cSampleManager.h @@ -7,12 +7,12 @@ #pragma once #include "PluginBase.h" -typedef void* HSTREAM; +typedef DWORD HSTREAM; typedef unsigned int HPROVIDER; -typedef void* H3DPOBJECT; +typedef DWORD H3DPOBJECT; typedef H3DPOBJECT H3DSAMPLE; -typedef void* HSAMPLE; -typedef void* HDIGDRIVER; +typedef DWORD HSAMPLE; +typedef DWORD HDIGDRIVER; struct tSample { int offset; diff --git a/shared/Audio.cpp b/shared/Audio.cpp index a3fe46e5c..4d9c21ced 100644 --- a/shared/Audio.cpp +++ b/shared/Audio.cpp @@ -16,8 +16,6 @@ #include "Rage.h" #endif -#include "CVector.h" - #include "CCamera.h" #pragma comment(lib, "bass.lib") // #pragma comment(lib, "bass_fx.lib") diff --git a/shared/Audio.h b/shared/Audio.h index 0ecaf512a..349d435d3 100644 --- a/shared/Audio.h +++ b/shared/Audio.h @@ -7,13 +7,10 @@ #pragma once #if defined(GTA2) || defined(GTA3) || defined(GTAVC) || defined(GTASA) || defined(GTAIV) #include "PluginBase.h" +#include #include "bass/bass.h" #include -#ifndef GTA2 -#include "CMatrix.h" -#endif - namespace plugin { class BassSampleManager { public: diff --git a/shared/RefListUtils.h b/shared/RefListUtils.h index 81c7ef3dd..c8ffa4410 100644 --- a/shared/RefListUtils.h +++ b/shared/RefListUtils.h @@ -61,6 +61,9 @@ struct RefListUtils> { #elif GTAIV if (gameid == GAME_CE) result += "GAME_CE"; +#elif GAME_UNREAL + if (true) + result += std::to_string(gameid); #else if (gameid == GAME_10EN) result += "GAME_10EN"; diff --git a/shared/game/CVector.h b/shared/game/CVector.h index f17ef84e7..a0627317c 100644 --- a/shared/game/CVector.h +++ b/shared/game/CVector.h @@ -7,7 +7,7 @@ #pragma once #include "PluginBase.h" -#ifdef RW +#if defined(RW) || defined(UNREAL) #include "RenderWare.h" #else struct RwV3d diff --git a/shared/game/CVector2D.h b/shared/game/CVector2D.h index f6083f01d..27012de61 100644 --- a/shared/game/CVector2D.h +++ b/shared/game/CVector2D.h @@ -7,7 +7,7 @@ #pragma once #include "PluginBase.h" -#ifdef RW +#if defined(RW) || defined(UNREAL) #include "RenderWare.h" #else struct RwV2d diff --git a/tools/premake/premake5.lua b/tools/premake/premake5.lua index b8f489a07..190b0147f 100644 --- a/tools/premake/premake5.lua +++ b/tools/premake/premake5.lua @@ -368,7 +368,7 @@ function pluginSdkStaticLibProject(projectName, sdkdir, outName, isPluginProject end -- precompiled header - if msbuild and (projNameLower == "plugin_iii" or projNameLower == "plugin_vc" or projNameLower == "plugin_sa" or projNameLower == "plugin_iv") then + if msbuild then pchheader "stdafx.h" forceincludes "stdafx.h" pchsource (path.getrelative(path.getabsolute("."), sdkdir .. "/shared/stdafx.cpp")) diff --git a/tools/premake/stdafx_template.h b/tools/premake/stdafx_template.h index 67b534a26..017c70aef 100644 --- a/tools/premake/stdafx_template.h +++ b/tools/premake/stdafx_template.h @@ -1,6 +1,8 @@ #pragma once #ifdef USE_PCH + #define NO_STRICT // fix minwindef.h + #include #include #include @@ -29,9 +31,16 @@ #include #include -#ifdef RW - #include -#endif + #ifdef GTA2 + // #include "GBH.h" TODO: fix d3dutil.h problems + #elif defined(RW) || defined(UNREAL) + #include "RenderWare.h" + #elif defined(RAGE) + #include "Rage.h" + #endif +#ifndef GTA2 // TODO: fix d3dutil.h problems GENERATED_LIST +#endif + #endif \ No newline at end of file