Show info if your game has problems with sync #497
removed minDelay, and soundblit() calls after screen is rendered
This commit is contained in:
parent
cee75df3bb
commit
b9310a496b
|
@ -2429,8 +2429,6 @@ static void renderStudio()
|
||||||
|
|
||||||
studio.tic->api.tick_end(studio.tic);
|
studio.tic->api.tick_end(studio.tic);
|
||||||
|
|
||||||
blitSound();
|
|
||||||
|
|
||||||
if(studio.mode != TIC_RUN_MODE)
|
if(studio.mode != TIC_RUN_MODE)
|
||||||
useSystemPalette();
|
useSystemPalette();
|
||||||
|
|
||||||
|
@ -2546,6 +2544,8 @@ static void tick()
|
||||||
SDL_SetCursor(SDL_CreateSystemCursor(studio.mouse.system));
|
SDL_SetCursor(SDL_CreateSystemCursor(studio.mouse.system));
|
||||||
|
|
||||||
SDL_RenderPresent(studio.renderer);
|
SDL_RenderPresent(studio.renderer);
|
||||||
|
|
||||||
|
blitSound();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void initSound()
|
static void initSound()
|
||||||
|
@ -2796,8 +2796,6 @@ s32 main(s32 argc, char **argv)
|
||||||
useDelay = !(info.flags & SDL_RENDERER_PRESENTVSYNC) || mode.refresh_rate != TIC_FRAMERATE;
|
useDelay = !(info.flags & SDL_RENDERER_PRESENTVSYNC) || mode.refresh_rate != TIC_FRAMERATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum{MinDelay = 10};
|
|
||||||
|
|
||||||
u64 nextTick = SDL_GetPerformanceCounter();
|
u64 nextTick = SDL_GetPerformanceCounter();
|
||||||
const u64 Delta = SDL_GetPerformanceFrequency() / TIC_FRAMERATE;
|
const u64 Delta = SDL_GetPerformanceFrequency() / TIC_FRAMERATE;
|
||||||
|
|
||||||
|
@ -2816,12 +2814,11 @@ s32 main(s32 argc, char **argv)
|
||||||
if(studio.deSync < DESYNC_FRAMES)
|
if(studio.deSync < DESYNC_FRAMES)
|
||||||
studio.deSync++;
|
studio.deSync++;
|
||||||
}
|
}
|
||||||
else if(delay >= MinDelay)
|
else
|
||||||
{
|
{
|
||||||
if(useDelay || SDL_GetWindowFlags(studio.window) & SDL_WINDOW_MINIMIZED)
|
if(useDelay || SDL_GetWindowFlags(studio.window) & SDL_WINDOW_MINIMIZED)
|
||||||
SDL_Delay((u32)(delay * 1000 / SDL_GetPerformanceFrequency()));
|
SDL_Delay((u32)(delay * 1000 / SDL_GetPerformanceFrequency()));
|
||||||
}
|
}
|
||||||
else nextTick -= delay;
|
|
||||||
|
|
||||||
if(delay >= 0 && studio.deSync > 0)
|
if(delay >= 0 && studio.deSync > 0)
|
||||||
studio.deSync--;
|
studio.deSync--;
|
||||||
|
|
Loading…
Reference in New Issue