Skip to content

Commit

Permalink
Fix framerate throttling in Emscripten builds
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jdarpinian committed Jun 22, 2024
1 parent c1ab47a commit 035da58
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions code/qcommon/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 035da58

Please sign in to comment.