From 690d2cea53eb403fc8177212385c16837030c6a0 Mon Sep 17 00:00:00 2001 From: esquizo Date: Tue, 19 May 2026 13:45:57 -0300 Subject: libphysics: diminuida a taxa de atualização do blockmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libphysics/tick.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libphysics/tick.c') diff --git a/libphysics/tick.c b/libphysics/tick.c index 2a2e009..40b3a2c 100644 --- a/libphysics/tick.c +++ b/libphysics/tick.c @@ -19,10 +19,17 @@ void phxtick(float delta) { static float time; + static int count = 0; time += delta; if(time >= PHX_TICK_TIME) { + phxmakeblkmap(); while(time >= PHX_TICK_TIME) { + if(count++ > 4) { + phxmakeblkmap(); + count = 0; + } + tick(); time -= PHX_TICK_TIME; } @@ -48,7 +55,6 @@ tick(void) vec2_add_scaled(b->vel, b->vel, b->accel, PHX_TICK_TIME); } - phxmakeblkmap(); for(int i = 0; i < phxbodypoolsize; i++) { Body *b = phxbodypool + i; if(!b->active) -- cgit v1.2.3