mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -04:00
Fix not working in webclient
This commit is contained in:
parent
7b8469573f
commit
cafd511d75
@ -275,12 +275,17 @@ static void HandleLowVRAMDetected(void* obj) {
|
||||
|
||||
static void HandleInactiveChanged(void* obj) {
|
||||
if (WindowInfo.Inactive) {
|
||||
Chat_AddRaw("&cHIDE");
|
||||
Chat_AddRaw(LOWPERF_ENTER_MESSAGE);
|
||||
Gfx_SetFpsLimit(false, 1000 / 1.0f);
|
||||
} else {
|
||||
Chat_AddRaw("&aSHOW");
|
||||
Chat_AddRaw(LOWPERF_EXIT_MESSAGE);
|
||||
Game_SetFpsLimit(Game_FpsLimit);
|
||||
}
|
||||
|
||||
#ifdef CC_BUILD_WEB
|
||||
extern void emscripten_resume_main_loop(void);
|
||||
emscripten_resume_main_loop();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void Game_WarnFunc(const cc_string* msg) {
|
||||
|
@ -60,6 +60,9 @@ extern GfxResourceID Gfx_quadVb, Gfx_texVb;
|
||||
/* Texture should allow updating via Gfx_UpdateTexture */
|
||||
#define TEXTURE_FLAG_DYNAMIC 0x02
|
||||
|
||||
#define LOWPERF_ENTER_MESSAGE "&eEntering reduced performance mode (game minimised or hidden)"
|
||||
#define LOWPERF_EXIT_MESSAGE "&eExited reduced performance mode"
|
||||
|
||||
void Gfx_RecreateDynamicVb(GfxResourceID* vb, VertexFormat fmt, int maxVertices);
|
||||
void Gfx_RecreateTexture(GfxResourceID* tex, struct Bitmap* bmp, cc_uint8 flags, cc_bool mipmaps);
|
||||
void* Gfx_RecreateAndLockVb(GfxResourceID* vb, VertexFormat fmt, int count);
|
||||
|
@ -116,13 +116,13 @@ static void TickReducedPerformance(void) {
|
||||
|
||||
if (reducedPerformance) return;
|
||||
reducedPerformance = true;
|
||||
Chat_AddRaw("&eEntering reduced performance mode (game minimised or hidden)");
|
||||
Chat_AddRaw(LOWPERF_ENTER_MESSAGE);
|
||||
}
|
||||
|
||||
static void EndReducedPerformance(void) {
|
||||
if (!reducedPerformance) return;
|
||||
reducedPerformance = false;
|
||||
Chat_AddRaw("&eExited reduced performance mode");
|
||||
Chat_AddRaw(LOWPERF_EXIT_MESSAGE);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user