18 if (task->
pos.vz != 0x7FFF && task->
pos.vz != -1) {
21 screen.
x = task->
pos.vx;
22 screen.
y = task->
pos.vy;
23 if (task->
pos.vz != 0x7FFF) {
55 switch (task->
state) {
61 for (i = 0; i < 9; i++) {
68 if (task->
flags & 1) {
69 task->
frame = *data++;
71 if (task->
flags & 2) {
74 if (task->
flags & 4) {
77 if (task->
flags & 8) {
80 if (task->
flags & 0x10) {
81 task->
scale.
v[0] = *data++;
83 if (task->
flags & 0x20) {
84 task->
scale.
v[1] = *data++;
86 if (task->
flags & 0x40) {
87 task->
rot.
v[0] = *data++;
89 if (task->
flags & 0x80) {
90 task->
rot.
v[1] = *data++;
92 if (task->
flags & 0x100) {
Battle FIGHTSTG_battle
the battle: its fighters, speed and drawing functions
FIGHTSTG.PRO: the battle.
GfxState GFX
GFX: the graphics state and its methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
FileCache FILE_CACHE
The file cache.
void FIGHTSTG_updateSpriteAnim(SpriteAnim *task)
A frame-by-frame animation of a 2D effect: reads its flags, stride, duration and first values from da...
SpriteAnim * FIGHTSTG_createSpriteAnim(s16 *data, SVECTOR *pos, s32 sheet, Vec2 *texPos, s32 layerId)
Creates a sprite animation from data at pos, with frames of sheet (textures at texPos) on layer layer...
void FIGHTSTG_drawSpriteAnim(void *arg, Layer *layer)
A layer callback that draws a sprite animation's frame: at its projected position,...
void FIGHTSTG_nop(void)
Empty, and nothing calls it.
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
s32 frames
since the last update
void(* project)(Layer *layer, SVECTOR *pos, ShortVec3 *out)
FIGHTSTG_projectPoint.
void *(* getEntry)(u32 fileAndIndex)
struct Layer *(* getLayer)(s32 id)
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
A position or rotation, without the SVECTOR pad.
One animation of a 2D effect (FIGHTSTG_createSpriteAnim), drawn by a layer callback.
void(* setState)(struct SpriteAnim *task, s32 state)
SVECTOR pos
vz 0x7FFF: on screen in front, -1: on screen
void(* nextState)(struct SpriteAnim *task)
s32 stride
of a frame's values
s16 v[2]
x, y; 0x1000 = 1.0
union SpriteAnim::@0 scale
s32 both
to test the two at once
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
void(* setLayer)()
(layer, depth)
void(* setScale)()
(x, y, z), ONE = 1.0
void(* setClutRow)()
(row)
void(* draw)()
(sheet, frame, x, y)
void(* setRotation)()
(x, y, z); no prototype: callers would truncate s16 args
void(* setTexture)()
(x, y)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find