From b236900a14a1aa7a9a7355cdea8f75fcd68c6c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Tue, 20 Oct 2020 20:18:47 +0200 Subject: [PATCH] Move wrong init --- game.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game.h b/game.h index b79b8fc..2fb4ff4 100755 --- a/game.h +++ b/game.h @@ -1320,8 +1320,6 @@ void SFG_initPlayer() { RCL_initCamera(&SFG_player.camera); - SFG_game.frameTime = SFG_getTimeMs(); - SFG_player.camera.resolution.x = SFG_GAME_RESOLUTION_X / SFG_RAYCASTING_SUBSAMPLE; @@ -1632,6 +1630,7 @@ void SFG_init() SFG_LOG("initializing game") SFG_game.frame = 0; + SFG_game.frameTime = 0; SFG_game.currentRandom = 0; SFG_game.continues = 1; @@ -4763,6 +4762,7 @@ uint8_t SFG_mainLoopBody() Each game logic (physics) frame is performed with the SFG_MS_PER_FRAME delta time. */ uint32_t timeNow = SFG_getTimeMs(); + int32_t timeSinceLastFrame = timeNow - SFG_game.frameTime; if (timeSinceLastFrame >= SFG_MS_PER_FRAME)