Skip to content
Merged
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
14 changes: 14 additions & 0 deletions src/Misc/Bugfixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <Utilities/Macro.h>
#include <SessionClass.h>
#include <Unsorted.h>
#include <WWMouseClass.h>

// skip error "А mouse is required for playing Yurts Revenge" - remove the GetSystemMetrics check
DEFINE_JUMP(LJMP, 0x6BD8A4, 0x6BD8C2); // WinMain
Expand Down Expand Up @@ -51,3 +52,16 @@ DEFINE_HOOK(0x55E08F, KeyboardProcess_PressTab, 0x5)

return 0x55E099;
}

// Do_Blit's 50ms wait guards the cursor restore after the primary-surface blit, but that restore
// (0x7B92D0) and the draw before it (0x7B90C0) are both no-ops unless IsCaptured(). Loading screens
// pass mouse_captured = true while the mouse is uncaptured, so vanilla sleeps 40+ times per scenario
// load guarding nothing - about two seconds. When captured, this is the vanilla path unchanged.
DEFINE_HOOK(0x4F4B8E, GScreenClass_DoBlit_SkipUncapturedCursorWait, 0x8)
{
// Do_Blit already tested WWMouse for null at 0x4F4B8A.
if (WWMouseClass::Instance->IsCaptured())
Sleep(50);

return 0x4F4B96;
}
Loading