From fa7384109830a843c80b2834fd253c3f435fe291 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Sun, 15 Mar 2026 17:44:43 +0100 Subject: [PATCH] fix(3d-nds): set camera to null when switching to 2d, don't check for lags before app is booted and lower fps threshold to 30 --- app/components/NDS3D.vue | 4 ++-- app/stores/app.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/components/NDS3D.vue b/app/components/NDS3D.vue index 62826eb..6f080df 100644 --- a/app/components/NDS3D.vue +++ b/app/components/NDS3D.vue @@ -199,7 +199,7 @@ watch( const { onRender, onBeforeRender } = useLoop(); -const LAG_FPS_THRESHOLD = 40; +const LAG_FPS_THRESHOLD = 30; const LAG_DURATION_SECS = 5; let lagSeconds = 0; let lagCheckDone = false; @@ -352,7 +352,7 @@ onBeforeRender(() => { const delta = (now - lastFrameTime) / 1000; lastFrameTime = now; - if (document.hidden || delta > 0.5) { + if (document.hidden || delta > 0.5 || !app.booted) { lagSeconds = 0; return; } diff --git a/app/stores/app.ts b/app/stores/app.ts index 384136a..ff5afb9 100644 --- a/app/stores/app.ts +++ b/app/stores/app.ts @@ -70,6 +70,7 @@ export const useAppStore = defineStore("app", { this.ready = mode === "2d"; this.settings.renderingMode = mode; this.lagDetected = false; + if (mode === "2d") this.camera = null; this.save(); },