Added new function to calculate common timesteps; Increased MAXIMUM_FPS to 200 for release and 1000 for debug; Used fixed sim_time for do_physics_sim and Interpolating to ensure collisions stay accurate at high FPS; New code and faster code for dot products by The_Lion; Disabled Nice-FPS and common Frame-Loop if VSync is active; More accurate delta timer for mouse (consider overhead); Added SDL_(Un)LockAudio for old SDL Audio interface; General support for up to 16 mouse buttons; Code cleanup; Made some AI movement and Player shaking FPS-independent

This commit is contained in:
zicodxx 2008-09-30 00:18:39 +00:00
parent 63d2c4a2cf
commit 6054bf7e90
2 changed files with 8 additions and 13 deletions

View file

@ -38,12 +38,10 @@ void timer_delay2(int fps)
static u_int32_t FrameStart=0;
u_int32_t FrameLoop=0;
if (GameCfg.VSync)
return;
while (FrameLoop < 1000/fps)
while (FrameLoop < 1000/(GameCfg.VSync?MAXIMUM_FPS:fps))
{
SDL_Delay(1);
if (!GameCfg.VSync)
SDL_Delay(1);
FrameLoop=SDL_GetTicks()-FrameStart;
}

View file

@ -736,15 +736,12 @@ void calc_frame_time()
timer_value = timer_get_fixed_seconds();
FrameTime = timer_value - last_timer_value;
if (!GameCfg.VSync)
while (FrameTime < f1_0 / (GameCfg.VSync?MAXIMUM_FPS:GameArg.SysMaxFPS))
{
while (FrameTime < f1_0 / GameArg.SysMaxFPS)
{
if (GameArg.SysUseNiceFPS)
timer_delay(f1_0 / GameArg.SysMaxFPS - FrameTime);
timer_value = timer_get_fixed_seconds();
FrameTime = timer_value - last_timer_value;
}
if (GameArg.SysUseNiceFPS && !GameCfg.VSync)
timer_delay(f1_0 / GameArg.SysMaxFPS - FrameTime);
timer_value = timer_get_fixed_seconds();
FrameTime = timer_value - last_timer_value;
}
if ( Game_turbo_mode )