Scene.set() JS lifecycle, UI sprite caching, emulator test scripts
- Add Scene.set(module) so JerryScript can switch scenes via
require()'d {init, update, dispose} modules; wire it into
engineUpdate() and rework overworldscene.js/init.js to the new shape.
- Fix scriptManagerExecFile() never pushing its own file's directory
onto the require() dir stack, breaking relative require() calls from
a top-level entry script (e.g. init.js -> ./overworldscene.js).
- Cache sprite geometry across frames for uislider/uitab/uiframe
(dialogs/textbox/settings) and give uitextbox a per-page glyph cache
instead of one spriteBatchBuffer call per visible character. uiconsole
drops its alloc/free vertex buffer for a fixed-size one. uifps skips
rebuilding its label when the text hasn't changed.
- Add PSP_OPTIMIZATION_PLAN.md and a handful of UI/spritebatch unit
tests covering the new caching logic.
- Add Dolphin/PPSSPP emulator smoke-test scripts (+ Docker variants and
CI jobs) for GameCube/Wii/PSP.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Vendored
+33
@@ -24,4 +24,37 @@ declare class Scene {
|
||||
|
||||
/** Gets the currently active scene, or undefined if none is active. */
|
||||
static getActive(): Scene | undefined;
|
||||
|
||||
/**
|
||||
* Installs a scene module as the current scene, the mechanism for
|
||||
* switching scenes from script. Tears down whatever module a previous
|
||||
* Scene.set() call installed (calling its dispose(), then destroying
|
||||
* the scene it owned), then creates and activates a fresh Scene and
|
||||
* calls the new module's init() with it active -- so init() can use
|
||||
* `new Entity()`/etc. as usual. The module's update() (if defined) is
|
||||
* then called once per engine frame until Scene.set() is called again.
|
||||
*
|
||||
* Typical usage (see require.d.ts):
|
||||
* ```js
|
||||
* var myScene = require('./myscene.js');
|
||||
* Scene.set(myScene);
|
||||
* ```
|
||||
*/
|
||||
static set(module: SceneModule): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The shape a scene module's `module.exports` should have to be usable
|
||||
* with Scene.set(). All three are optional -- a module that never moves
|
||||
* anything, for instance, can omit update().
|
||||
*/
|
||||
interface SceneModule {
|
||||
/** Called once, right after Scene.set() creates and activates the scene. */
|
||||
init?(): void;
|
||||
|
||||
/** Called once per engine frame while this module is the active scene. */
|
||||
update?(): void;
|
||||
|
||||
/** Called once when this module is replaced by another Scene.set() call. */
|
||||
dispose?(): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user