71 ids = (
u8 *)sheet + sheet[1];
73 for (i = 0; ids[i] != frame; i++) {
75 p = (
s16 *)((
u8 *)sheet + sheet[i + 2]);
100 p += (count - 1) * 3;
109 for (i = 0; i < count; i++) {
119 if (prevTpage != tpage) {
120 SetDrawTPage(prim.
tpage, 0, 1, prevTpage);
129 setSemiTrans(prim.
sprt, 1);
131 prim.
sprt->x0 = p[1] + x - scroll.
x;
132 prim.
sprt->y0 = p[2] + y - scroll.
y;
134 prim.
sprt->u0 = part->
u & 0x7F;
136 prim.
sprt->u0 = part->
u;
138 prim.
sprt->v0 = part->
v;
139 prim.
sprt->w = part->
w;
140 prim.
sprt->h = part->
h;
141 prim.
sprt->clut = clut;
146 SetDrawTPage(prim.
tpage, 0, 1, tpage);
153 for (i = 0; i < count; i++) {
162 setPolyFT4(prim.
ft4);
164 setSemiTrans(prim.
ft4, 1);
167 in[1].vx = in[3].vx = in[0].vx + part->
w;
169 in[2].vy = in[3].vy = in[0].vy + part->
h;
170 in[0].vz = in[1].vz = in[2].vz = in[3].vz = 0;
171 for (k = 0; k < 4; k++) {
181 prim.
ft4->u0 = prim.
ft4->u2 = u;
182 prim.
ft4->u1 = prim.
ft4->u3 = u + part->
w - 1;
184 prim.
ft4->v0 = prim.
ft4->v1 = v;
185 prim.
ft4->v2 = prim.
ft4->v3 = v + part->
h - 1;
186 prim.
ft4->tpage = tpage;
187 prim.
ft4->clut = clut;
GfxState GFX
GFX: the graphics state and its methods.
Heap HEAP
The functions that return what a call left in v0 (allocMemHigh, findTask) and the ones that take othe...
void spriteDrawerSetFollowScroll(s32 on)
Sprite drawer method: whether the sprites move with the layer's scroll.
void spriteDrawerSetRotation(s16 x, s16 y, s16 z)
Sprite drawer method: rotates the sprites.
void spriteDrawerSetClutRow(s32 row)
Sprite drawer method: the CLUT row added to every part's.
void spriteDrawerSetColor(CVECTOR *color)
Sprite drawer method: the color the sprites are tinted with.
void spriteDrawerSetTexture(s32 x, s32 y)
Sprite drawer method: the VRAM position of the sheet's texture and CLUTs.
void spriteDrawerSetScale(s32 x, s32 y, s32 z)
Sprite drawer method: scales the sprites (ONE: as they are)
void spriteDrawerSetLayer(Layer *layer, s32 depth)
Sprite drawer method: the layer and depth to draw to.
void bindSpriteDrawer(SpriteDrawer *obj)
Makes obj the sprite drawer the methods work on.
void spriteDrawerSetLayerId(s32 id, s32 depth)
Sprite drawer method: the layer (by id) and depth to draw to.
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
static SpriteDrawer * SPRITE_DRAWER
Small variables, addressed through $gp (see the Makefile)
void spriteDrawerSetPivot(s32 x, s32 y)
Sprite drawer method: the point the sprites scale and rotate around.
void spriteDrawerSetAltClut(s32 x, s32 y)
Sprite drawer method: the other CLUT area, for parts that ask for it.
void spriteDrawerDraw(s32 *sheet, s32 frame, s32 x, s32 y)
Draws frame frame of a sprite sheet (see SpritePart) at (x, y): as sprites, changing the texture page...
struct Layer *(* getLayer)(s32 id)
void(* setPrim)(void *next)
void(* zero)(void *ptr, s32 size)
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
u_long *(* getOtEntry)(struct Layer *, s32 depth)
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
s32 clutRow
added to the CLUT y: palette animations
void(* setAltClut)()
(x, y)
void(* setLayer)()
(layer, depth)
s32 altClutX
for the parts that are flagged
s32 followScroll
offset by the layer's scroll
void(* setScale)()
(x, y, z), ONE = 1.0
void(* setColor)()
(CVECTOR *)
void(* setLayerId)()
(id, depth)
s32 tpageX
VRAM position of the sheet's texture.
void(* setFollowScroll)()
(on)
void(* setClutRow)()
(row)
VECTOR scale
ScaleMatrix's.
void(* draw)()
(sheet, frame, x, y)
void(* setRotation)()
(x, y, z); no prototype: callers would truncate s16 args
void(* setTexture)()
(x, y)
One part of a sprite sheet, a rectangle of its texture.
s16 clutX
added to the drawer's CLUT position
s16 mode
0: 4-bit texture, 1: 8-bit, with the drawer's other CLUT
The next free primitive of the packet buffer (getPrim), written as the kind that is drawn next.