Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(quality): a level can skip every effect there is, where past thirty-two the rest quietly kept running

yhhd2bae44d6560
diff --git a/desktop b/desktop
index 790c1af68..7b96b53b2 160000
--- a/desktop
+++ b/desktop
@@ -1 +1 @@
-Subproject commit 790c1af68818154462a999025087f0b89988440e
+Subproject commit 7b96b53b2342e28173d9eb7af410b880d6c7556e
diff --git a/sdk/src/render/quality.ts b/sdk/src/render/quality.ts
index 1be8b1bae..a42a424e3 100644
--- a/sdk/src/render/quality.ts
+++ b/sdk/src/render/quality.ts
@@ -2,6 +2,9 @@
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
import type { PowerPolicy } from './power';
+/** A bound on a hand-edited file, well past the effects that exist: one lower quietly left the effects past it running. */
+const MAX_SKIPPED_EFFECTS = 1024;
+
export type QualityLevel = 'low' | 'medium' | 'high';
export type QualityMode = 'off' | 'auto' | QualityLevel;
@@ -266,7 +269,7 @@ function resolveProfile(level: QualityLevel, value: unknown): QualityProfile {
waterCaustics: typeof r.waterCaustics === 'boolean' ? r.waterCaustics : base.waterCaustics,
skipEffects: Array.isArray(r.skipEffects)
? r.skipEffects.filter((e): e is string => typeof e === 'string' && e.trim() !== '')
- .map((e) => e.trim()).slice(0, 32)
+ .map((e) => e.trim()).slice(0, MAX_SKIPPED_EFFECTS)
: base.skipEffects,
shelterMaskSize: Math.round(finite(r.shelterMaskSize, base.shelterMaskSize, 64, 2048)),
shadowSoftSamples: Math.round(finite(r.shadowSoftSamples, base.shadowSoftSamples, 1, 32)),
diff --git a/sdk/tests/quality.test.ts b/sdk/tests/quality.test.ts
index 24a435a97..5a51c06f5 100644
--- a/sdk/tests/quality.test.ts
+++ b/sdk/tests/quality.test.ts
@@ -116,6 +116,12 @@ describe('dynamic resolution', () => {
});
describe('what a quality level lets the chain run', () => {
+ it('honours a list of every effect there is, however many that has become', () => {
+ const all = Array.from({ length: 64 }, (_, i) => `effect${i}`);
+ const q = new QualityController({ mode: 'low', profiles: { low: { skipEffects: all } } });
+ expect(q.profile.skipEffects).toHaveLength(64);
+ });
+
const level = (skipEffects: string[], extra: object = {}) => new QualityController({
mode: 'low', profiles: { low: { skipEffects, ...extra } },
}).profile;