Fix periodic window update function being called every frame

This commit is contained in:
Matthias Moninger 2023-06-22 16:52:14 +03:00 committed by GitHub
parent 95463c015c
commit 42ff471617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View File

@ -104,8 +104,6 @@ static void InputUpdateTooltip(WindowBase* w, WidgetIndex widgetIndex, const Scr
*/
void GameHandleInput()
{
WindowVisitEach([](WindowBase* w) { WindowEventPeriodicUpdateCall(w); });
InvalidateAllWindowsAfterInput();
MouseState state;

View File

@ -129,13 +129,10 @@ void WindowUpdateAllViewports()
*/
void WindowUpdateAll()
{
// WindowUpdateAllViewports();
// 1000 tick update
gWindowUpdateTicks += gCurrentDeltaTime;
if (gWindowUpdateTicks >= 1000)
// Periodic update happens every second so 40 ticks.
if (gCurrentRealTimeTicks >= gWindowUpdateTicks)
{
gWindowUpdateTicks = 0;
gWindowUpdateTicks = gCurrentRealTimeTicks + GAME_UPDATE_FPS;
WindowVisitEach([](WindowBase* w) { WindowEventPeriodicUpdateCall(w); });
}