35 x = (screen->
time >> 1) & 0x3F;
54 value = number->
value;
55 for (i = 0; i < number->
digits; i++) {
57 if (i == 0 || number->
leadingZeros != 0 || digit != 0 || value / 10 != 0) {
59 number->
x + (number->
digits - 1 - i) * 7, number->
y);
108 for (i = 0; i < 3; i++) {
122 number.
x = window->
x + 0x18;
123 number.
y = window->
y + 4;
137 window->
x + 6, window->
y + 2);
158 if (window->
from != 0x1000) {
164 window->
x + offset, window->
y);
169 if (window->
from != 0x1000) {
175 window->
x + offset, window->
y);
185 values[0] = window->
numbers[0];
186 values[1] = window->
numbers[1];
187 for (i = 0; i < 2; i++) {
197 if (window->
value != 0) {
211 if (window->
value != 0) {
215 if (window->
value == 0x1F) {
221 text->
setPos(text, 0xA0 - width / 2, window->
y + 4);
229 if (window->
state == 0) {
232 switch (window->
state) {
237 if (window->
time <= 0) {
250 if (window->
layout == 5) {
263 window->
from = 0x1000;
272 if (window->
value == 0x1F4) {
274 window->
value = 0x2A;
277 window->
value = 0x40;
312 if (window->
time <= 0) {
325 for (i = 0; i < 6; i++) {
CARDGAME.PRO: the card battle (mode 0x700).
u16 CARDGAME_windowTextOffsets[]
a window's text x, by CARDGAME_drawWindowText's index
CardOffset CARDGAME_gaugePositions[]
where the three CardGauge gauges are
CardWindowLayout CARDGAME_windowLayouts[]
GfxState GFX
GFX: the graphics state and its methods.
#define TEXT_CARD_GAME
CARDGM: the card battle's.
#define TEXT_CARD_NAMES
CARDNM.
#define TEXT_CARD_EFFECTS
CARDST.
FileCache FILE_CACHE
The file cache.
#define FILE_CARDGAME_TIMS
CARDGAME's own pictures, a TIM archive.
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
A value that goes from from to to (0x1000 is 1) over duration frames.
A number drawn with the TIM archive's digits (CARDGAME_drawNumber)
The battle screen's task items.
TextWindow * moreTexts[8]
The battle screen (created by CARDGAME_createScreen): the two panels, the cards on the table and the ...
u8 fadeRow
the background's palette row, 0 to 11
u8 fadeTime
four frames a row
u8 fadeState
0 dark, 1 fading in, 2 shown
u8 kind
2: a sprite of the fourth TIM, else of the third
s16 x
its pivot, from the window's corner
A window that opens (its scale goes from from to to)
u8 numbers[3]
two numbers, and whether they are shown
s32 value
by its layout: a string, a card, or points | colour << 4
s16 layout
in CARDGAME_windowLayouts
void *(* getEntry)(u32 fileAndIndex)
s32(* getFrameTime)(void)
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
void(* setScale)()
(x, y, z), ONE = 1.0
void(* setLayerId)()
(id, depth)
void(* setClutRow)()
(row)
void(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
Text helpers (initTextTools)
s32(* measure)()
(TextBuffer *, style, spacing)
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
void(* setPalette)(struct TextWindow *obj, u8 arg)
void(* setRightAlign)()
no prototype: callers would truncate u8 args
void(* setPos)(struct TextWindow *obj, s16 x, s16 y)
void(* setVisible)(struct TextWindow *obj, u8 arg)
#define PALETTE_WHITE
The text windows' palettes (TextWindow.palette, setPalette): rows of the font's CLUTs,...
void initTextTools(TextTools *obj)
Clears a text tools object, gives it its methods and binds it.
void CARDGAME_drawWindowNumbers(CardScreen *screen, CardScreenItems *items, CardWindow *window)
Puts a window's two numbers (numbers) on its texts, right aligned.
void CARDGAME_drawCenteredText(CardScreen *screen, CardScreenItems *items, CardWindow *window, TextWindow *text, s32 file)
Puts a window's string value of file on text, centred on the screen (string 0x1F in palette 3),...
void CARDGAME_drawWindowFrame(CardScreen *screen, CardScreenItems *items, CardWindow *window)
Draws a window's frame (CARDGAME_windowLayouts), scaled while it opens, and its count.
void CARDGAME_updateWindows(CardScreen *screen, CardScreenItems *items)
Runs and draws the six windows.
void CARDGAME_drawNumber(CardNumber *number, s32 scaled)
Draws a number with the TIM archive's digits, seven pixels apart, without leading zeros unless asked;...
void CARDGAME_drawBackground(CardScreen *screen)
Draws the scrolling background, which fades in through its palettes (fadeState 1) and then stays.
static void drawWindowCount(CardWindow *window)
Draws the number in a type 3 window: its low four bits, and the sprite for its high bits.
void CARDGAME_updateGauges(CardScreen *screen, CardScreenItems *items)
Runs and draws the three gauges.
void CARDGAME_updateGauge(CardScreen *screen, CardScreenItems *items, s32 index, CardGauge *p)
Grows (state 1), holds (2) or shrinks (3) a gauge, and draws it.
void CARDGAME_drawWindowText(CardScreen *screen, CardWindow *window, TextWindow *text, s32 file, s32 index)
Puts a window's string value of file on text, or hides text when it has none.
void CARDGAME_drawGauge(CardScreen *screen, CardScreenItems *items, s32 index, CardGauge *p)
Draws a gauge at its place (CARDGAME_gaugePositions), at its scale.
void CARDGAME_updateWindow(CardScreen *screen, CardScreenItems *items, CardWindow *window, s32 index)
Opens (state 1), shows (2) or closes (3) window index, each its own way.