|
Scarab
A thin, game-agnostic 2D engine host built on the sunlight tile-map engine
|
Sprite handle pool + rendering Lua primitives. More...
#include <luaspriteapi.h>
Static Public Member Functions | |
| static void | Register (lua_State *pLuaState) |
| Register the sprite pool Lua-callable functions and enums. | |
Sprite handle pool + rendering Lua primitives.
Backed by Scarab::Engine::SpritePool — a fixed-capacity pool of sprite slots, not a dynamically-growing list. Every sprite in the game (enemies, bullets, the player ship) is acquired from this same pool.
sprite_acquire returns an opaque integer handle, not an object. 0 always means "invalid" (INVALID_SPRITE_HANDLE) — check for it after sprite_acquire in case the pool for that type is exhausted. A handle from a released slot doesn't silently alias a new sprite that reuses the same slot — every operation on a stale handle simply fails (returns false/nil) instead of touching the wrong sprite, since each slot's internal generation counter is bumped on release.
|
static |
Register the sprite pool Lua-callable functions and enums.