mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
cvar'ize the game loop throttling by adding the new sys_throttle with
a default value of 0.02. changing its value to 0 disables throttling. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@427 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
7ae84d838c
commit
c53dd74e4d
5 changed files with 8 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue