Skip to content

Commit

Permalink
Fix WaitVBL() not waiting the first time its called
Browse files Browse the repository at this point in the history
  • Loading branch information
erysdren committed Jul 10, 2024
1 parent 589b7b2 commit e20702a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions rott/modexlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,6 @@ void TurnOffTextCursor ( void )

static Uint64 next_time = 0;

static void time_start(void)
{
next_time = SDL_GetTicks() + VBLCOUNTER;
}

static Uint64 time_left(void)
{
Uint64 now = SDL_GetTicks();
Expand All @@ -235,10 +230,7 @@ void WaitVBL( void )
// SDL_Delay (16667/1000);

if (next_time == 0)
{
time_start();
return;
}
next_time = SDL_GetTicks() + VBLCOUNTER;

SDL_Delay(time_left());
next_time += VBLCOUNTER;
Expand Down

0 comments on commit e20702a

Please sign in to comment.