One last timer fix to fix the slowness reported by Ompronce.

This commit is contained in:
OBattler
2023-08-20 04:58:51 +02:00
parent c16e151365
commit f1174247fa

View File

@@ -15,8 +15,6 @@ pc_timer_t *timer_head = NULL;
/* Are we initialized? */ /* Are we initialized? */
int timer_inited = 0; int timer_inited = 0;
static int timer_in_process = 0;
static void timer_advance_ex(pc_timer_t *timer, int start); static void timer_advance_ex(pc_timer_t *timer, int start);
void void
@@ -116,8 +114,6 @@ timer_process(void)
if (!timer_head) if (!timer_head)
return; return;
timer_in_process = 0;
while (1) { while (1) {
timer = timer_head; timer = timer_head;
@@ -141,8 +137,6 @@ timer_process(void)
} }
timer_target = timer_head->ts.ts32.integer; timer_target = timer_head->ts.ts32.integer;
timer_in_process = 1;
} }
void void
@@ -250,7 +244,7 @@ timer_on_auto(pc_timer_t *timer, double period)
return; return;
if (period > 0.0) if (period > 0.0)
timer_on(timer, period, !timer_in_process && (timer->period <= 0.0)); timer_on(timer, period, timer->period <= 0.0);
else else
timer_stop(timer); timer_stop(timer);
} }