summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libphysics/tick.c8
1 files changed, 7 insertions, 1 deletions
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)