static TreeInfo *level_number = NULL;
static TreeInfo *level_number_current = NULL;
+static unsigned int sync_frame_delay = 0;
+static unsigned int sync_frame_delay_value = GAME_FRAME_DELAY;
+
static struct
{
int value;
DoAnimation();
BackToFront();
- /* don't eat all CPU time */
- Delay(10);
+ WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
}
return key;
DoAnimation();
BackToFront();
- /* don't eat all CPU time */
- Delay(10);
+ WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
}
/* write new key bindings back to player setup */
DoAnimation();
BackToFront();
- /* don't eat all CPU time */
- Delay(10);
+ WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
}
/* calibrated center position (joystick should now be centered) */
NextEvent(&event);
HandleOtherEvents(&event);
- Delay(10);
+ WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
}
}
static struct GadgetInfo *tool_gadget[NUM_TOOL_BUTTONS];
static int request_gadget_id = -1;
+static unsigned int sync_frame_delay = 0;
+static unsigned int sync_frame_delay_value = GAME_FRAME_DELAY;
+
static char *print_if_not_empty(int element)
{
static char *s = NULL;
DoAnimation();
- /* don't eat all CPU time */
- Delay(10);
+ WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
}
}
else
{
DoAnimation();
-
- if (!PendingEvent()) /* delay only if no pending events */
- Delay(10);
}
BackToFront();
+
+ WaitUntilDelayReached(&sync_frame_delay, sync_frame_delay_value);
}
return result;