MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / HandleInactiveChanged

Function HandleInactiveChanged

src/Game.c:311–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311static void HandleInactiveChanged(void* obj) {
312 if (Window_Main.Inactive) {
313 Chat_AddOf(&Gfx_LowPerfMessage, MSG_TYPE_EXTRASTATUS_2);
314 Gfx_SetVSync(false);
315 Game_SetMinFrameTime(1000 / 1.0f);
316 Gfx.ReducedPerfMode = true;
317 } else {
318 Chat_AddOf(&String_Empty, MSG_TYPE_EXTRASTATUS_2);
319 Game_SetFpsLimit(Game_FpsLimit);
320
321 Gfx.ReducedPerfMode = false;
322 Gfx.ReducedPerfModeCooldown = 2;
323 }
324
325#ifdef CC_BUILD_WEB
326 extern void emscripten_resume_main_loop(void);
327 emscripten_resume_main_loop();
328#endif
329}
330
331static void Game_WarnFunc(const cc_string* msg) {
332 cc_string str = *msg, line;

Callers

nothing calls this directly

Calls 4

Chat_AddOfFunction · 0.85
Game_SetMinFrameTimeFunction · 0.85
Game_SetFpsLimitFunction · 0.85
Gfx_SetVSyncFunction · 0.70

Tested by

no test coverage detected