- SR3 Pause will now freeze timer until un-paused
This commit is contained in:
parent
db441edb0a
commit
429ec65f78
21
OpenParrot/src/Functions/Games/Other/PauseGameFixes.cpp
Normal file
21
OpenParrot/src/Functions/Games/Other/PauseGameFixes.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include <StdInc.h>
|
||||
#include "Utility/GameDetect.h"
|
||||
#include "Utility/InitFunction.h"
|
||||
#include "Functions/Global.h"
|
||||
#include "Utility/Helper.h"
|
||||
|
||||
bool PauseGameFixInit;
|
||||
static DWORD TimerValue;
|
||||
|
||||
void PauseGameFixes(Helpers* helpers)
|
||||
{
|
||||
if (GameDetect::currentGame == GameID::SR3)
|
||||
{
|
||||
if (!PauseGameFixInit)
|
||||
{
|
||||
PauseGameFixInit = true;
|
||||
TimerValue = helpers->ReadIntPtr(0x9C4A07, false);
|
||||
}
|
||||
helpers->WriteIntPtr(0x9C4A07, TimerValue, false);
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@
|
||||
#include "Utility/Hooking.Patterns.h"
|
||||
#include <shlwapi.h>
|
||||
#include <Windows.h>
|
||||
#include "Utility/Helper.h"
|
||||
#include <TlHelp32.h>
|
||||
#include "mmeapi.h"
|
||||
|
||||
@ -27,6 +28,8 @@ static char PauseKeyChar[256];
|
||||
static char ExitKeyChar[256];
|
||||
static int PauseKeyValue;
|
||||
static int ExitKeyValue;
|
||||
extern bool PauseGameFixInit;
|
||||
extern void PauseGameFixes(Helpers* helpers);
|
||||
|
||||
void *__cdecl memcpy_0(void *a1, const void *a2, size_t a3)
|
||||
{
|
||||
@ -108,6 +111,8 @@ static BOOL SuspendProcess(DWORD ProcessId, bool Suspend)
|
||||
DisableGhosting = true;
|
||||
DisableProcessWindowsGhosting();
|
||||
}
|
||||
|
||||
PauseGameFixes(0);
|
||||
#ifndef _DEBUG
|
||||
if (GetAsyncKeyState(ExitKeyValue))
|
||||
{
|
||||
@ -120,6 +125,7 @@ static BOOL SuspendProcess(DWORD ProcessId, bool Suspend)
|
||||
if (SuspendPressedOff)
|
||||
{
|
||||
SuspendPressedOff = false;
|
||||
PauseGameFixInit = false;
|
||||
waveOutSetVolume(NULL, dwVolume);
|
||||
SuspendProcess(ProcessID, false);
|
||||
break;
|
||||
@ -130,7 +136,7 @@ static BOOL SuspendProcess(DWORD ProcessId, bool Suspend)
|
||||
if (SuspendPressedOn)
|
||||
SuspendPressedOff = true;
|
||||
}
|
||||
Sleep(64);
|
||||
Sleep(16);
|
||||
}
|
||||
}
|
||||
CloseHandle(hThread);
|
||||
|
Loading…
x
Reference in New Issue
Block a user