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:
James Darpinian authored and GitHub committed 2024-06-25 02:52:11 -04:00
1 parent 99be1151f7
commit e505e34d79
2 files changed
+14

No files matched your search

+7
View File
@@ -2741,7 +2741,14 @@ void Com_Init( char *commandLine ) {
// init commands and vars
//
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);
#endif
com_blood = Cvar_Get ("com_blood", "1", CVAR_ARCHIVE);
com_logfile = Cvar_Get ("logfile", "0", CVAR_TEMP );