mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
Fix framerate throttling in Emscripten builds
Default com_maxfps to 0 under Emscripten. Under Emscripten the browser handles throttling the frame rate. Manual framerate throttling interacts poorly with Emscripten's browser-driven event loop.
This commit is contained in:
parent
99be1151f7
commit
e505e34d79
2 changed files with 14 additions and 0 deletions
|
@ -2741,7 +2741,14 @@ void Com_Init( char *commandLine ) {
|
||||||
// init commands and vars
|
// init commands and vars
|
||||||
//
|
//
|
||||||
com_altivec = Cvar_Get ("com_altivec", "1", CVAR_ARCHIVE);
|
com_altivec = Cvar_Get ("com_altivec", "1", CVAR_ARCHIVE);
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
// Under Emscripten the browser handles throttling the frame rate.
|
||||||
|
// Manual framerate throttling interacts poorly with Emscripten's
|
||||||
|
// browser-driven event loop. So default throttling to off.
|
||||||
|
com_maxfps = Cvar_Get ("com_maxfps", "0", CVAR_ARCHIVE);
|
||||||
|
#else
|
||||||
com_maxfps = Cvar_Get ("com_maxfps", "85", CVAR_ARCHIVE);
|
com_maxfps = Cvar_Get ("com_maxfps", "85", CVAR_ARCHIVE);
|
||||||
|
#endif
|
||||||
com_blood = Cvar_Get ("com_blood", "1", CVAR_ARCHIVE);
|
com_blood = Cvar_Get ("com_blood", "1", CVAR_ARCHIVE);
|
||||||
|
|
||||||
com_logfile = Cvar_Get ("logfile", "0", CVAR_TEMP );
|
com_logfile = Cvar_Get ("logfile", "0", CVAR_TEMP );
|
||||||
|
|
|
@ -1365,8 +1365,15 @@ void R_Register( void )
|
||||||
r_dlightBacks = ri.Cvar_Get( "r_dlightBacks", "1", CVAR_ARCHIVE );
|
r_dlightBacks = ri.Cvar_Get( "r_dlightBacks", "1", CVAR_ARCHIVE );
|
||||||
r_finish = ri.Cvar_Get ("r_finish", "0", CVAR_ARCHIVE);
|
r_finish = ri.Cvar_Get ("r_finish", "0", CVAR_ARCHIVE);
|
||||||
r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE );
|
r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE );
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
// Under Emscripten we don't throttle framerate with com_maxfps by default, so enable
|
||||||
|
// vsync by default instead.
|
||||||
|
r_swapInterval = ri.Cvar_Get( "r_swapInterval", "1",
|
||||||
|
CVAR_ARCHIVE | CVAR_LATCH );
|
||||||
|
#else
|
||||||
r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0",
|
r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0",
|
||||||
CVAR_ARCHIVE | CVAR_LATCH );
|
CVAR_ARCHIVE | CVAR_LATCH );
|
||||||
|
#endif
|
||||||
r_gamma = ri.Cvar_Get( "r_gamma", "1", CVAR_ARCHIVE );
|
r_gamma = ri.Cvar_Get( "r_gamma", "1", CVAR_ARCHIVE );
|
||||||
r_facePlaneCull = ri.Cvar_Get ("r_facePlaneCull", "1", CVAR_ARCHIVE );
|
r_facePlaneCull = ri.Cvar_Get ("r_facePlaneCull", "1", CVAR_ARCHIVE );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue