mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-11-25 14:52:30 +01:00
RsMouseSetPos call for III
This commit is contained in:
parent
1a5e22d7a5
commit
ee0adecc4b
@ -17,6 +17,11 @@ struct RsGlobalType
|
||||
void* pad;
|
||||
};
|
||||
|
||||
struct RwV2d
|
||||
{
|
||||
float x; /**< X value*/
|
||||
float y; /**< Y value */
|
||||
};
|
||||
|
||||
|
||||
static void (*DrawRect)(const CRect&,const CRGBA&);
|
||||
@ -65,6 +70,15 @@ void PurpleNinesGlitchFix()
|
||||
pGangModelOverrides[i * 16] = -1;
|
||||
}
|
||||
|
||||
static void (* const ConstructRenderList)() = AddressByVersion<void(*)()>(0x4A76B0, 0x4A77A0, 0x4A7730);
|
||||
static void (* const RsMouseSetPos)(RwV2d*) = AddressByVersion<void(*)(RwV2d*)>(0x580D20, 0x581070, 0x580F70);
|
||||
void ResetMousePos()
|
||||
{
|
||||
RwV2d vecPos = { RsGlobal->MaximumWidth * 0.5f, RsGlobal->MaximumHeight * 0.5f };
|
||||
RsMouseSetPos(&vecPos);
|
||||
ConstructRenderList();
|
||||
}
|
||||
|
||||
void __declspec(naked) M16StatsFix()
|
||||
{
|
||||
_asm
|
||||
@ -257,6 +271,9 @@ void Patch_III_10()
|
||||
InjectHook(0x50A142, AlteredPrintStringXOnly<0x50A139>);
|
||||
InjectHook(0x57E9F5, AlteredPrintString<0x57E9EE,0x57E9CD>);
|
||||
|
||||
// RsMouseSetPos call (SA style fix)
|
||||
InjectHook(0x48E539, ResetMousePos);
|
||||
|
||||
// Armour cheat as TORTOISE - like in 1.1 and Steam
|
||||
Patch<const char*>(0x4925FB, "ESIOTROT");
|
||||
|
||||
@ -366,6 +383,9 @@ void Patch_III_11()
|
||||
InjectHook(0x509B45, AlteredPrintStringMinus<0x509B3E,0x509B1D>);
|
||||
InjectHook(0x50A222, AlteredPrintStringXOnly<0x50A219>);
|
||||
InjectHook(0x57ED45, AlteredPrintString<0x57ED3E,0x57ED1D>);
|
||||
|
||||
// RsMouseSetPos call (SA style fix)
|
||||
InjectHook(0x48E5F9, ResetMousePos);
|
||||
}
|
||||
|
||||
void Patch_III_Steam()
|
||||
@ -466,6 +486,9 @@ void Patch_III_Steam()
|
||||
InjectHook(0x509AD5, AlteredPrintStringMinus<0x509ACE,0x509AAD>);
|
||||
InjectHook(0x50A1B2, AlteredPrintStringXOnly<0x50A1A9>);
|
||||
InjectHook(0x57EC45, AlteredPrintString<0x57EC3E,0x57EC1D>);
|
||||
|
||||
// RsMouseSetPos call (SA style fix)
|
||||
InjectHook(0x48E589, ResetMousePos);
|
||||
}
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
#include <windows.h>
|
||||
#include <mmsystem.h>
|
||||
#include <cassert>
|
||||
|
||||
#include "MemoryMgr.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user