From 39c9a0582700ab7242272952edbe211a4dd13935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Sat, 28 Mar 2020 23:28:36 +0300 Subject: [PATCH] Limit frontend FPS to 100 --- src/skel/win/win.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index f05580cd..4e5dccff 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -2056,7 +2056,13 @@ _WinMain(HINSTANCE instance, { GetWindowPlacement(PSGLOBAL(window), &wp); - if ( wp.showCmd != SW_SHOWMINIMIZED ) + // Famous transparent menu bug. Also see the fix in Frontend.cpp +#ifdef FIX_BUGS + float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond(); + if ((1000.0f / 100.0f) < ms && wp.showCmd != SW_SHOWMINIMIZED) +#else + if (wp.showCmd != SW_SHOWMINIMIZED) +#endif RsEventHandler(rsFRONTENDIDLE, nil); if ( !FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bLoadingSavedGame )