mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Fix periodic window update function being called every frame
This commit is contained in:
committed by
GitHub
parent
95463c015c
commit
42ff471617
@@ -104,8 +104,6 @@ static void InputUpdateTooltip(WindowBase* w, WidgetIndex widgetIndex, const Scr
|
|||||||
*/
|
*/
|
||||||
void GameHandleInput()
|
void GameHandleInput()
|
||||||
{
|
{
|
||||||
WindowVisitEach([](WindowBase* w) { WindowEventPeriodicUpdateCall(w); });
|
|
||||||
|
|
||||||
InvalidateAllWindowsAfterInput();
|
InvalidateAllWindowsAfterInput();
|
||||||
|
|
||||||
MouseState state;
|
MouseState state;
|
||||||
|
|||||||
@@ -129,13 +129,10 @@ void WindowUpdateAllViewports()
|
|||||||
*/
|
*/
|
||||||
void WindowUpdateAll()
|
void WindowUpdateAll()
|
||||||
{
|
{
|
||||||
// WindowUpdateAllViewports();
|
// Periodic update happens every second so 40 ticks.
|
||||||
|
if (gCurrentRealTimeTicks >= gWindowUpdateTicks)
|
||||||
// 1000 tick update
|
|
||||||
gWindowUpdateTicks += gCurrentDeltaTime;
|
|
||||||
if (gWindowUpdateTicks >= 1000)
|
|
||||||
{
|
{
|
||||||
gWindowUpdateTicks = 0;
|
gWindowUpdateTicks = gCurrentRealTimeTicks + GAME_UPDATE_FPS;
|
||||||
|
|
||||||
WindowVisitEach([](WindowBase* w) { WindowEventPeriodicUpdateCall(w); });
|
WindowVisitEach([](WindowBase* w) { WindowEventPeriodicUpdateCall(w); });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user