Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
sprites.c File Reference

CARDGAME's card sprites: their moves, effects and drawing. More...

Include dependency graph for sprites.c:

Go to the source code of this file.

Functions

static s32 isScaled (CardSprite *sprite)
 Whether sprite is scaled: its scaleX and scaleY, read as one word, aren't both 0x1000.
 
void CARDGAME_moveSprite (CardScreen *screen, CardSprite *sprite)
 Moves and scales a sprite towards its targets; at the end it plays a sound (unless in state 3) and goes to state 1.
 
s32 CARDGAME_flySprite (CardScreen *screen, CardSprite *sprite)
 Flies a sprite from start to target along an arc while scaling it; at the end it swaps start and target, goes to state 2 with 2.5 times the time, and returns 1.
 
s32 CARDGAME_shakeSprite (CardScreen *screen, CardSprite *sprite)
 Shakes a sprite sideways and stretches it, for 12 frames: 1 at the end.
 
static void resetSprite (CardSprite *sprite, s32 state)
 Ends a sprite's move and puts it in STATE.
 
s32 CARDGAME_holdSpriteThenBlink (CardScreen *screen, CardSprite *sprite)
 Holds a sprite for 10 frames, then starts its blink: 1 at the end.
 
s32 CARDGAME_holdSprite (CardScreen *screen, CardSprite *sprite, s32 duration)
 Holds a sprite for duration frames, then ends its effect: 1 at the end.
 
s32 CARDGAME_jitterSprite (CardScreen *screen, CardSprite *sprite)
 Jitters a sprite about where it started and squashes it, for 12 frames: 1 at the end.
 
static void endSpriteFlip (CardSprite *sprite, s32 state)
 The end of a sprite's flip (CARDGAME_flipSprite)
 
s32 CARDGAME_flipSprite (CardScreen *screen, CardSprite *sprite)
 Turns a sprite over for 12 frames, its side swapped after 7: 1 at the end.
 
static void * getSheetPart (s32 *sheet, s32 offset)
 The part of a sprite sheet at offset, one of the offsets it starts with.
 
void CARDGAME_drawCardPicture (CardSprite *sprite)
 Draws a card's picture: a one-part sprite sheet (CARDGAME_pictureSheet) made on the fly, the 32x32 cell index of an 8-row grid with the card's own CLUT row.
 
void CARDGAME_drawSpriteEffect (CardScreen *screen, CardSprite *sprite)
 Draws a sprite's effect animation (1-4, frames 0x28-0x4C of the fourth TIM) and ends it when its time runs out.
 
void CARDGAME_drawSpriteHighlights (CardScreen *screen, CardSprite *sprite)
 Draws the highlights over a sprite (highlight bits 0-2), with a cycling palette.
 
void CARDGAME_drawSpriteOrder (CardScreen *screen, CardSprite *sprite)
 Draws a sprite's order number (order), the place of its card in the record.
 
void CARDGAME_drawSpriteMarks (CardScreen *screen, CardSprite *sprite)
 Draws a card's marks that are set (marks[0..2]: sprites 0x37 to 0x39), in a row 8 pixels apart.
 
static void drawCardNumbers (CardSprite *sprite)
 Draws a card's two numbers (ap and hp) and the sprite between them.
 
static void drawCardMark (CardSprite *sprite)
 Draws the mark (sprite 0x1E) of a card that is not of kind 16.
 
void CARDGAME_drawSpriteCard (CardScreen *screen, CardSprite *sprite)
 Draws a card sprite: its frame (visible 1, with the numbers or the mark and the image) or its back (visible 2 or 3)
 
void CARDGAME_drawSpriteDim (CardScreen *screen, CardSprite *sprite)
 Draws the shade over a dimmed sprite.
 
void CARDGAME_drawSpriteBlink (CardScreen *screen, CardSprite *sprite)
 Draws a blinking sprite's flash (state 11), its CLUT row changing.
 
void CARDGAME_animateSprite (CardScreen *screen, CardScreenItems *items, CardSprite *sprite)
 Runs a sprite's animation for its state; sets bit 0 of spriteFlags while one runs.
 
void CARDGAME_drawSprite (CardScreen *screen, CardSprite *sprite)
 Draws a sprite and its marks, unless it is scaled to nothing.
 
void CARDGAME_updateSprites (CardScreen *screen, CardScreenItems *items)
 Animates the sprites, then draws them: the moving ones first.
 

Detailed Description

CARDGAME's card sprites: their moves, effects and drawing.

Definition in file sprites.c.

Function Documentation

◆ isScaled()

static s32 isScaled ( CardSprite *  sprite)
inlinestatic

Whether sprite is scaled: its scaleX and scaleY, read as one word, aren't both 0x1000.

Definition at line 7 of file sprites.c.

Referenced by CARDGAME_drawCardPicture(), CARDGAME_drawSpriteCard(), CARDGAME_drawSpriteDim(), CARDGAME_drawSpriteEffect(), CARDGAME_drawSpriteHighlights(), CARDGAME_drawSpriteMarks(), CARDGAME_drawSpriteOrder(), drawCardMark(), and drawCardNumbers().

Here is the caller graph for this function:

◆ CARDGAME_moveSprite()

void CARDGAME_moveSprite ( CardScreen *  screen,
CardSprite *  sprite 
)

Moves and scales a sprite towards its targets; at the end it plays a sound (unless in state 3) and goes to state 1.

Definition at line 12 of file sprites.c.

Referenced by CARDGAME_animateSprite().

Here is the caller graph for this function:

◆ CARDGAME_flySprite()

s32 CARDGAME_flySprite ( CardScreen *  screen,
CardSprite *  sprite 
)

Flies a sprite from start to target along an arc while scaling it; at the end it swaps start and target, goes to state 2 with 2.5 times the time, and returns 1.

Definition at line 42 of file sprites.c.

Referenced by CARDGAME_animateSprite().

Here is the caller graph for this function:

◆ CARDGAME_shakeSprite()

s32 CARDGAME_shakeSprite ( CardScreen *  screen,
CardSprite *  sprite 
)

Shakes a sprite sideways and stretches it, for 12 frames: 1 at the end.

Definition at line 101 of file sprites.c.

Referenced by CARDGAME_animateSprite().

Here is the caller graph for this function:

◆ resetSprite()

static void resetSprite ( CardSprite *  sprite,
s32  state 
)
inlinestatic

Ends a sprite's move and puts it in STATE.

Definition at line 119 of file sprites.c.

Referenced by CARDGAME_holdSprite(), and CARDGAME_holdSpriteThenBlink().

Here is the caller graph for this function:

◆ CARDGAME_holdSpriteThenBlink()

s32 CARDGAME_holdSpriteThenBlink ( CardScreen *  screen,
CardSprite *  sprite 
)

Holds a sprite for 10 frames, then starts its blink: 1 at the end.

Definition at line 128 of file sprites.c.

Referenced by CARDGAME_animateSprite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_holdSprite()

s32 CARDGAME_holdSprite ( CardScreen *  screen,
CardSprite *  sprite,
s32  duration 
)

Holds a sprite for duration frames, then ends its effect: 1 at the end.

Definition at line 140 of file sprites.c.

Referenced by CARDGAME_animateSprite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_jitterSprite()

s32 CARDGAME_jitterSprite ( CardScreen *  screen,
CardSprite *  sprite 
)

Jitters a sprite about where it started and squashes it, for 12 frames: 1 at the end.

Definition at line 153 of file sprites.c.

Referenced by CARDGAME_animateSprite().

Here is the caller graph for this function:

◆ endSpriteFlip()

static void endSpriteFlip ( CardSprite *  sprite,
s32  state 
)
inlinestatic

The end of a sprite's flip (CARDGAME_flipSprite)

Definition at line 174 of file sprites.c.

Referenced by CARDGAME_flipSprite().

Here is the caller graph for this function:

◆ CARDGAME_flipSprite()

s32 CARDGAME_flipSprite ( CardScreen *  screen,
CardSprite *  sprite 
)

Turns a sprite over for 12 frames, its side swapped after 7: 1 at the end.

Definition at line 181 of file sprites.c.

Referenced by CARDGAME_animateSprite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSheetPart()

static void * getSheetPart ( s32 *  sheet,
s32  offset 
)
inlinestatic

The part of a sprite sheet at offset, one of the offsets it starts with.

Definition at line 198 of file sprites.c.

Referenced by CARDGAME_drawCardPicture().

Here is the caller graph for this function:

◆ CARDGAME_drawCardPicture()

void CARDGAME_drawCardPicture ( CardSprite *  sprite)

Draws a card's picture: a one-part sprite sheet (CARDGAME_pictureSheet) made on the fly, the 32x32 cell index of an 8-row grid with the card's own CLUT row.

Definition at line 204 of file sprites.c.

Referenced by CARDGAME_drawSpriteCard().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_drawSpriteEffect()

void CARDGAME_drawSpriteEffect ( CardScreen *  screen,
CardSprite *  sprite 
)

Draws a sprite's effect animation (1-4, frames 0x28-0x4C of the fourth TIM) and ends it when its time runs out.

Definition at line 242 of file sprites.c.

Referenced by CARDGAME_drawSprite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_drawSpriteHighlights()

void CARDGAME_drawSpriteHighlights ( CardScreen *  screen,
CardSprite *  sprite 
)

Draws the highlights over a sprite (highlight bits 0-2), with a cycling palette.

Definition at line 291 of file sprites.c.

Referenced by CARDGAME_drawSprite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_drawSpriteOrder()

void CARDGAME_drawSpriteOrder ( CardScreen *  screen,
CardSprite *  sprite 
)

Draws a sprite's order number (order), the place of its card in the record.

Definition at line 327 of file sprites.c.

Referenced by CARDGAME_drawSprite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_drawSpriteMarks()

void CARDGAME_drawSpriteMarks ( CardScreen *  screen,
CardSprite *  sprite 
)

Draws a card's marks that are set (marks[0..2]: sprites 0x37 to 0x39), in a row 8 pixels apart.

Definition at line 344 of file sprites.c.

Referenced by CARDGAME_drawSprite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawCardNumbers()

static void drawCardNumbers ( CardSprite *  sprite)
inlinestatic

Draws a card's two numbers (ap and hp) and the sprite between them.

Definition at line 368 of file sprites.c.

Referenced by CARDGAME_drawSpriteCard().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawCardMark()

static void drawCardMark ( CardSprite *  sprite)
inlinestatic

Draws the mark (sprite 0x1E) of a card that is not of kind 16.

Definition at line 403 of file sprites.c.

Referenced by CARDGAME_drawSpriteCard().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_drawSpriteCard()

void CARDGAME_drawSpriteCard ( CardScreen *  screen,
CardSprite *  sprite 
)

Draws a card sprite: its frame (visible 1, with the numbers or the mark and the image) or its back (visible 2 or 3)

Definition at line 418 of file sprites.c.

Referenced by CARDGAME_drawSprite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_drawSpriteDim()

void CARDGAME_drawSpriteDim ( CardScreen *  screen,
CardSprite *  sprite 
)

Draws the shade over a dimmed sprite.

Definition at line 480 of file sprites.c.

Referenced by CARDGAME_drawSprite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_drawSpriteBlink()

void CARDGAME_drawSpriteBlink ( CardScreen *  screen,
CardSprite *  sprite 
)

Draws a blinking sprite's flash (state 11), its CLUT row changing.

Definition at line 497 of file sprites.c.

Referenced by CARDGAME_updateSprites().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_animateSprite()

void CARDGAME_animateSprite ( CardScreen *  screen,
CardScreenItems *  items,
CardSprite *  sprite 
)

Runs a sprite's animation for its state; sets bit 0 of spriteFlags while one runs.

Definition at line 512 of file sprites.c.

Referenced by CARDGAME_updateSprites().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_drawSprite()

void CARDGAME_drawSprite ( CardScreen *  screen,
CardSprite *  sprite 
)

Draws a sprite and its marks, unless it is scaled to nothing.

Definition at line 565 of file sprites.c.

Referenced by CARDGAME_updateSprites().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_updateSprites()

void CARDGAME_updateSprites ( CardScreen *  screen,
CardScreenItems *  items 
)

Animates the sprites, then draws them: the moving ones first.

Definition at line 577 of file sprites.c.

Referenced by CARDGAME_updateScreen().

Here is the call graph for this function:
Here is the caller graph for this function: