diff --git a/src/Misc/Bugfixes.cpp b/src/Misc/Bugfixes.cpp index 327c56f2..ee44fbf1 100644 --- a/src/Misc/Bugfixes.cpp +++ b/src/Misc/Bugfixes.cpp @@ -20,6 +20,7 @@ #include #include #include +#include // skip error "А mouse is required for playing Yurts Revenge" - remove the GetSystemMetrics check DEFINE_JUMP(LJMP, 0x6BD8A4, 0x6BD8C2); // WinMain @@ -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; +}