Builds and works on Gamecube

This commit is contained in:
2026-06-02 09:53:56 -05:00
parent a25871a849
commit 36f6ac65f2
12 changed files with 138 additions and 76 deletions
+18 -14
View File
@@ -32,27 +32,31 @@ interface RenderableMaterial extends Renderable {
/**
* Renderable in `SPRITEBATCH` mode.
* Activated by calling `setTexture`.
*
* Set `texture` to activate spritebatch rendering (also switches `type`
* to `Renderable.SPRITEBATCH` automatically).
*/
interface RenderableSpritebatch extends Renderable {
/**
* Assigns a texture and switches to `SPRITEBATCH` mode.
* The Texture object is pinned (GC-safe) for the component's lifetime.
* The bound texture. Assigning a `Texture` switches the renderable to
* `SPRITEBATCH` mode and pins the object against GC. Reading returns the
* same `Texture` instance that was assigned, or `undefined` if none.
*/
setTexture(texture: Texture): void;
texture: Texture | undefined;
/**
* Adds a sprite quad to the spritebatch.
* Sprite list. Reading returns a JS array of 10-element sub-arrays
* `[x1,y1,z1, x2,y2,z2, u1,v1, u2,v2]` — one per sprite.
*
* 3D form (10 args): `addSprite(x1,y1,z1, x2,y2,z2, u1,v1, u2,v2)`
* 2D form (8 args): `addSprite(x1,y1, x2,y2, u1,v1, u2,v2)` — z defaults to 0
* Assigning an array replaces all sprites. Each element may be:
* - 10 numbers (3D): `[x1,y1,z1, x2,y2,z2, u1,v1, u2,v2]`
* - 8 numbers (2D, z defaults to 0): `[x1,y1, x2,y2, u1,v1, u2,v2]`
*
* @example
* r.sprites = [[-0.5, 0, 0.5, 1, 0, 0, 1, 1]];
* r.sprites = []; // clear
*/
addSprite(
x1: number, y1: number, z1OrX2: number,
x2OrY2: number, y2OrZ2?: number, z2?: number,
u1?: number, v1?: number, u2?: number, v2?: number
): void;
/** Resets the sprite count to zero. */
clearSprites(): void;
sprites: number[][];
}
/**