Skip to content

Commit

Permalink
Import Get_RelativeMouseMode
Browse files Browse the repository at this point in the history
  • Loading branch information
Exlodium committed Jun 14, 2024
1 parent 963b87d commit 5465e51
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cstrike/sdk/interfaces/iinputsystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class IInputSystem
bool IsRelativeMouseMode()
{
// @ida: 'IInputSystem::SetRelativeMouseMode'.
return *reinterpret_cast<bool*>(reinterpret_cast<std::uintptr_t>(this) + 0x53);
return MEM::fnGetRelativeMouseMode();
}

void* GetSDLWindow()
Expand Down
3 changes: 3 additions & 0 deletions cstrike/utilities/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ bool MEM::Setup()
fnSetRelativeMouseMode = reinterpret_cast<decltype(fnSetRelativeMouseMode)>(GetExportAddress(hSDL3, CS_XOR("SDL_SetRelativeMouseMode")));
bSuccess &= (fnSetRelativeMouseMode != nullptr);

fnGetRelativeMouseMode = reinterpret_cast<decltype(fnGetRelativeMouseMode)>(GetExportAddress(hSDL3, CS_XOR("SDL_GetRelativeMouseMode")));
bSuccess &= (fnGetRelativeMouseMode != nullptr);

fnSetWindowMouseGrab = reinterpret_cast<decltype(fnSetWindowMouseGrab)>(GetExportAddress(hSDL3, CS_XOR("SDL_SetWindowMouseGrab")));
bSuccess &= (fnSetWindowMouseGrab != nullptr);

Expand Down
1 change: 1 addition & 0 deletions cstrike/utilities/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ namespace MEM
// @note: helpful for doing our mouse cursor like force show it when our menu is opened
inline int(CS_STDCALL* fnSetRelativeMouseMode)(int) = nullptr;
inline int(CS_STDCALL* fnSetWindowMouseGrab)(void*, int) = nullptr;
inline bool(CS_STDCALL* fnGetRelativeMouseMode)(void) = nullptr;
inline int(CS_STDCALL* fnWarpMouseInWindow)(void*, float, float) = nullptr;
inline bool(CS_FASTCALL* fnLoadKV3)(CKeyValues3*, void*, const char*, const KV3ID_t*, const char*);
inline std::int64_t(CS_FASTCALL* fnCreateMaterial)(void*, void*, const char*, void*, unsigned int, unsigned int);
Expand Down

0 comments on commit 5465e51

Please sign in to comment.