Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
draw_timer.inc.c
Go to the documentation of this file.
1/*
2 * Draws the timer: its frame and the three digits of GAME.countdown, from
3 * the sprites of the stage's TIMER_SHEET
4 */
5void drawTimer(StageTask *task) {
6 SpriteDrawer drawer;
7 Vec2 scroll;
8 s32 i;
10
11 layer->getScroll(layer, &scroll);
12 initSpriteDrawer(&drawer);
13 drawer.setLayer(layer, 0);
14 drawer.setTexture(0x140, 0x100);
15 drawer.setAltClut(0, 0x1F0);
16 drawer.draw(FILE_CACHE.getEntry(TIMER_SHEET << 16), 1, scroll.x + 0xE0, scroll.y + 0x16);
17 scroll.y += 0x19;
18 for (i = 0; i < 3; i++) {
19 drawer.draw(FILE_CACHE.getEntry(TIMER_SHEET << 16), GAME.countdown[i] + 2, scroll.x + timerDigitX[i], scroll.y);
20 }
21}
signed int s32
Definition common.h:11
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
void drawTimer(StageTask *task)
Draws the timer: its frame and the three digits of GAME.countdown, from the sprites of the stage's TI...
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
#define FIELD_LAYER_MAP
the map, its objects and characters, and the menus
Definition field_map.h:20
FileCache FILE_CACHE
The file cache.
Definition file_cache.c:7
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
void *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
u8 countdown[4]
Definition game_state.h:572
struct Layer *(* getLayer)(s32 id)
Definition gfx.h:28
GfxFuncs funcs
Definition gfx.h:77
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
Definition gfx.h:128
void(* getScroll)()
Definition gfx.h:148
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
Definition gfx.h:223
void(* setAltClut)()
(x, y)
Definition gfx.h:243
void(* setLayer)()
(layer, depth)
Definition gfx.h:245
void(* draw)()
(sheet, frame, x, y)
Definition gfx.h:246
void(* setTexture)()
(x, y)
Definition gfx.h:242
The task a stage starts (startStage), updated by its updateStage.
Definition stage.h:26
Definition gfx.h:352
s32 y
Definition gfx.h:354
s32 x
Definition gfx.h:353
#define TIMER_SHEET
Definition wstag795.c:11
s16 timerDigitX[]
Defined below, after the code that uses them.
Definition wstag795.c:345