// <ZZ> This file contains stuff for figgering out how many updates to do between displays...

//-----------------------------------------------------------------------------------------------
unsigned int timer_start_time;
void timer_start()
{
    // <ZZ> Start the timer
    timer_start_time = SDL_GetTicks();
}

//-----------------------------------------------------------------------------------------------
unsigned int timer_poll()
{
    // <ZZ> Returns number of updates to perform before drawing
    unsigned int timer_end_time;
    unsigned int updates_to_perform;

    timer_end_time = SDL_GetTicks();
    updates_to_perform = (timer_end_time-timer_start_time) * UPDATES_PER_SECOND / 1000;
    timer_start_time = timer_end_time - ((timer_end_time-timer_start_time) - updates_to_perform * (1000 / UPDATES_PER_SECOND));
    return updates_to_perform;
}

//-----------------------------------------------------------------------------------------------
