From 46e077ba635e2156fda2c6dd44203e06ff079ed6 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Sat, 11 Jan 2025 17:33:05 +0300 Subject: [PATCH] make ctx.frame_number overflow to 0 --- src/twn_loop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/twn_loop.c b/src/twn_loop.c index 56c2dcb..1f1fdcc 100644 --- a/src/twn_loop.c +++ b/src/twn_loop.c @@ -237,6 +237,9 @@ static void main_loop(void) { ctx.frame_accumulator -= ctx.desired_frametime; ctx.game.frame_number++; + /* TODO: should we ask for reinitialization in such case? */ + if (ctx.game.frame_number > 16777216) + ctx.game.frame_number = 0; ctx.game.initialization_needed = false; } }