Improved mouse pos fix

This commit is contained in:
Silent 2014-09-16 16:47:25 +02:00
parent 048999d74a
commit 94637d52f9
2 changed files with 24 additions and 5 deletions

View file

@ -77,7 +77,7 @@
<MinimumRequiredVersion>5.0</MinimumRequiredVersion>
<EntryPointSymbol>
</EntryPointSymbol>
<AdditionalDependencies>Winmm.lib</AdditionalDependencies>
<AdditionalDependencies>Winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy /y "$(TargetPath)" "D:\gry\Steam\steamapps\common\Grand Theft Auto 3\SilentPatchIII.asi"</Command>
@ -108,7 +108,7 @@
<MinimumRequiredVersion>5.0</MinimumRequiredVersion>
<EntryPointSymbol>
</EntryPointSymbol>
<AdditionalDependencies>Winmm.lib</AdditionalDependencies>
<AdditionalDependencies>Winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy /y "$(TargetPath)" "D:\gry\Steam\steamapps\common\Grand Theft Auto 3\SilentPatchIII.asi"</Command>

View file

@ -3,6 +3,20 @@
#include "General.h"
#include "Timer.h"
struct PsGlobalType
{
HWND window;
DWORD instance;
DWORD fullscreen;
DWORD lastMousePos_X;
DWORD lastMousePos_Y;
DWORD unk;
DWORD diInterface;
DWORD diMouse;
void* diDevice1;
void* diDevice2;
};
struct RsGlobalType
{
const char* AppName;
@ -11,12 +25,14 @@ struct RsGlobalType
signed int MaximumHeight;
unsigned int frameLimit;
BOOL quit;
void* ps;
PsGlobalType* ps;
void* keyboard;
void* mouse;
void* pad;
};
struct RwV2d
{
float x; /**< X value*/
@ -87,8 +103,11 @@ static void (* const ConstructRenderList)() = AddressByVersion<void(*)()>(0x4A76
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);
if ( RsGlobal->ps->window == GetFocus() )
{
RwV2d vecPos = { RsGlobal->MaximumWidth * 0.5f, RsGlobal->MaximumHeight * 0.5f };
RsMouseSetPos(&vecPos);
}
ConstructRenderList();
}