diff --git a/Quake/host.c b/Quake/host.c index 70d1e29f..b964494a 100644 --- a/Quake/host.c +++ b/Quake/host.c @@ -242,6 +242,7 @@ void Host_InitLocal (void) Cvar_RegisterVariable (&devstats, NULL); //johnfitz Cvar_RegisterVariable (&sys_ticrate, NULL); + Cvar_RegisterVariable (&sys_throttle, NULL); Cvar_RegisterVariable (&serverprofile, NULL); Cvar_RegisterVariable (&fraglimit, NULL); diff --git a/Quake/main_sdl.c b/Quake/main_sdl.c index 9e562111..aafd6ad6 100644 --- a/Quake/main_sdl.c +++ b/Quake/main_sdl.c @@ -170,8 +170,10 @@ int main(int argc, char *argv[]) time = newtime - oldtime; Host_Frame(time); - // throttle the game loop just a little bit - noone needs more than 1000fps, I think - if (newtime - oldtime < 1) + /* throttle the game loop just a little bit + and make the game run a little cooler: + noone needs more than 1000fps, I think */ + if (time < sys_throttle.value) SDL_Delay(1); oldtime = newtime; diff --git a/Quake/quakedef.h b/Quake/quakedef.h index f100f815..12394484 100644 --- a/Quake/quakedef.h +++ b/Quake/quakedef.h @@ -268,6 +268,7 @@ extern qboolean noclip_anglehack; extern quakeparms_t host_parms; extern cvar_t sys_ticrate; +extern cvar_t sys_throttle; extern cvar_t sys_nostdout; extern cvar_t developer; extern cvar_t max_edicts; //johnfitz diff --git a/Quake/sys_sdl_unix.c b/Quake/sys_sdl_unix.c index ec0abf35..f0f1586c 100644 --- a/Quake/sys_sdl_unix.c +++ b/Quake/sys_sdl_unix.c @@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. qboolean isDedicated; +cvar_t sys_throttle = {"sys_throttle", "0.02", true}; #define MAX_HANDLES 32 /* johnfitz -- was 10 */ static FILE *sys_handles[MAX_HANDLES]; diff --git a/Quake/sys_sdl_win.c b/Quake/sys_sdl_win.c index 4ecfba1a..da42a778 100644 --- a/Quake/sys_sdl_win.c +++ b/Quake/sys_sdl_win.c @@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. qboolean isDedicated; qboolean Win95, Win95old, WinNT, WinVista; +cvar_t sys_throttle = {"sys_throttle", "0.02", true}; static HANDLE hinput, houtput;