Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(game/five): updateBusySpinner thread constraint check #2952

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ static InitFunction initFunction([] ()
{
if (*g_scaleformMgr)
{
if (GetCurrentThreadId() != g_mainThreadId)
{
trace("Error: BusySpinner update called from non-main thread!\n");
return;
}

setupBusySpinner(1);
*spinnerDep = true;
updateBusySpinner();
Expand Down
2 changes: 0 additions & 2 deletions code/components/rage-input-five/src/InputHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,6 @@ static hook::cdecl_stub<bool(wchar_t, int)> ProcessWMChar([]()
static ReverseGameInputState lastInput;
static ReverseGameInputState curInput;

static bool g_mainThreadId;

#include <queue>

extern void DoPatchMouseScrollDelta();
Expand Down
2 changes: 2 additions & 0 deletions code/components/rage-nutsnbolts-five/include/nutsnbolts.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#define HAS_EARLY_GAME_FRAME

extern NUTSNBOLTS_EXPORT DWORD g_mainThreadId;

extern NUTSNBOLTS_EXPORT fwEvent<> OnLookAliveFrame;
extern NUTSNBOLTS_EXPORT fwEvent<> OnGameFrame;
extern NUTSNBOLTS_EXPORT fwEvent<> OnEarlyGameFrame;
Expand Down
3 changes: 2 additions & 1 deletion code/components/rage-nutsnbolts-five/src/FrameHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include <ICoreGameInit.h>
#include <CrossBuildRuntime.h>

DWORD g_mainThreadId;

fwEvent<> OnLookAliveFrame;
fwEvent<> OnEarlyGameFrame;
fwEvent<> OnGameFrame;
Expand Down Expand Up @@ -64,7 +66,6 @@ static uint32_t g_lastCriticalFrame;
static std::mutex g_gameFrameMutex;
static std::mutex g_earlyGameFrameMutex;
static std::mutex g_criticalFrameMutex;
static DWORD g_mainThreadId;
static bool g_executedOnMainThread;

// NOTE: depends indirectly on GameProfiling.cpp in gta:core!
Expand Down
Loading