1
0
mirror of synced 2025-02-23 05:29:15 +01:00

Fix build if atlstr.h is missing

This commit is contained in:
Poliwrath 2021-08-19 13:34:30 -04:00
parent a1c6059ecd
commit 43cfbcba3a
7 changed files with 20 additions and 4 deletions

View File

@ -1,4 +1,5 @@
#include <StdInc.h> #if __has_include(<atlstr.h>)
#include <StdInc.h>
#include "Utility/InitFunction.h" #include "Utility/InitFunction.h"
#include "Functions/Global.h" #include "Functions/Global.h"
#include "Utility\Hooking.Patterns.h" #include "Utility\Hooking.Patterns.h"
@ -1072,3 +1073,4 @@ static InitFunction DirtyDrivinFunc([]()
}, GameID::DirtyDrivin); }, GameID::DirtyDrivin);
#endif #endif
#pragma optimize("", on) #pragma optimize("", on)
#endif

View File

@ -1,3 +1,4 @@
#if __has_include(<atlstr.h>)
#include <StdInc.h> #include <StdInc.h>
#include "Utility/InitFunction.h" #include "Utility/InitFunction.h"
#include "Functions/Global.h" #include "Functions/Global.h"
@ -435,3 +436,4 @@ static InitFunction FNFSBFunc([]()
} }
}, GameID::FNFSB); }, GameID::FNFSB);
#endif

View File

@ -1,4 +1,5 @@
#include <StdInc.h> #if __has_include(<atlstr.h>)
#include <StdInc.h>
#include "Utility/InitFunction.h" #include "Utility/InitFunction.h"
#include "Functions/Global.h" #include "Functions/Global.h"
#include "Functions/GlobalRegHooks.h" #include "Functions/GlobalRegHooks.h"
@ -512,3 +513,4 @@ static InitFunction GHAFunc([]()
} }
}, GameID::GHA); }, GameID::GHA);
#endif

View File

@ -1,4 +1,5 @@
#include <StdInc.h> #if __has_include(<atlstr.h>)
#include <StdInc.h>
#include "Utility/InitFunction.h" #include "Utility/InitFunction.h"
#include "Functions/Global.h" #include "Functions/Global.h"
#include "Utility\Hooking.Patterns.h" #include "Utility\Hooking.Patterns.h"
@ -208,3 +209,4 @@ static InitFunction JLeagueFunc([]()
}, GameID::JLeague); }, GameID::JLeague);
#endif #endif
#endif

View File

@ -1,3 +1,4 @@
#if __has_include(<atlstr.h>)
#include <StdInc.h> #include <StdInc.h>
#include "Utility/InitFunction.h" #include "Utility/InitFunction.h"
#include "Functions/Global.h" #include "Functions/Global.h"
@ -2118,3 +2119,4 @@ static InitFunction SFVFunc([]()
MH_EnableHook(MH_ALL_HOOKS); MH_EnableHook(MH_ALL_HOOKS);
}, GameID::SFV); }, GameID::SFV);
#endif #endif
#endif

View File

@ -5,7 +5,9 @@
#include <objbase.h> #include <objbase.h>
#include "Utility/GameDetect.h" #include "Utility/GameDetect.h"
#include <string> #include <string>
#if __has_include(<atlstr.h>)
#include <atlstr.h> #include <atlstr.h>
#endif
#include <windows.h> #include <windows.h>
LSTATUS(__stdcall *orig_RegOpenKeyExA)( LSTATUS(__stdcall *orig_RegOpenKeyExA)(
@ -188,6 +190,7 @@ LSTATUS __stdcall RegQueryValueExWGlobalWrap(
LPDWORD lpcbData LPDWORD lpcbData
) )
{ {
#if __has_include(<atlstr.h>)
if (GameDetect::currentGame == GameID::GHA) if (GameDetect::currentGame == GameID::GHA)
{ {
if (_wcsicmp(lpValueName, L"Language") == 0) if (_wcsicmp(lpValueName, L"Language") == 0)
@ -210,6 +213,7 @@ LSTATUS __stdcall RegQueryValueExWGlobalWrap(
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
} }
#endif
return orig_RegQueryValueExW(hKey, lpValueName, lpReserved, lpType, lpData, lpcbData); return orig_RegQueryValueExW(hKey, lpValueName, lpReserved, lpType, lpData, lpcbData);
} }

View File

@ -85,10 +85,12 @@ DWORD WINAPI XInputGetState
{ {
gamepadState.wButtons = *ffbOffset; gamepadState.wButtons = *ffbOffset;
} }
#if __has_include(<atlstr.h>)
else if (GameDetect::currentGame == GameID::GHA) else if (GameDetect::currentGame == GameID::GHA)
{ {
GHAInputs(); GHAInputs();
} }
#endif
else if (GameDetect::currentGame == GameID::JLeague) else if (GameDetect::currentGame == GameID::JLeague)
{ {
gamepadState.wButtons = 0; gamepadState.wButtons = 0;