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

The training's sprites (TrainSprite), which begin STGTRAIN.PRO's first object. More...

#include "menus/gym.h"
Include dependency graph for sprite.c:

Go to the source code of this file.

Functions

void STGTRAIN_setSpriteBank (TrainSprite *sprite, TrainSpriteBank *bank, s32 offset)
 Sets the sprite bank and where the sprites start in it.
 
void STGTRAIN_setSpriteAnim (TrainSprite *sprite, TrainAnim *anim)
 Starts an animation from its first frame.
 
void STGTRAIN_setSpriteLayer (TrainSprite *sprite, s32 layerId, s32 depth)
 Sets the layer and depth the sprite is drawn at.
 
void STGTRAIN_setSpritePos (TrainSprite *sprite, s32 x, s32 y)
 Sets where the sprite is drawn.
 
void STGTRAIN_setSpriteImagePos (TrainSprite *sprite, s32 x, s32 y)
 Sets where the sprite's image is in VRAM.
 
void STGTRAIN_setSpriteClutPos (TrainSprite *sprite, s32 x, s32 y)
 Sets where the sprite's CLUT is in VRAM.
 
void STGTRAIN_setSpriteScale (TrainSprite *sprite, s32 x, s32 y, s32 z)
 Scales the sprite (0x1000 is its size), drawing it as quads.
 
void STGTRAIN_setSpritePivot (TrainSprite *sprite, s32 x, s32 y)
 Sets the point the sprite scales and turns about.
 
void STGTRAIN_setSpriteRotation (TrainSprite *sprite, s16 x, s16 y, s16 z)
 Turns the sprite, drawing it as quads.
 
s32 STGTRAIN_getSpriteFlags (TrainSprite *sprite)
 Whether the animation has ended (the flags but for the pause)
 
void STGTRAIN_setSpritePaused (TrainSprite *sprite, s32 paused)
 Pauses the animation (paused) or plays it on.
 
static void STGTRAIN_addSpriteSprt (TrainSprite *sprite, SPRT *sprt, TrainSpritePart *part, TrainAnimFrame *frame, s32 x, s32 y, u8 u, u8 v, u16 w, u16 h, u16 clut)
 Fills in a part of the sprite as a sprite, and adds it to the sprite's ordering table.
 
static void STGTRAIN_addSpriteQuad (TrainSprite *sprite, POLY_FT4 *ft4, TrainSpritePart *part, TrainAnimFrame *frame, s32 x, s32 y, u8 u, u8 v, u16 w, u16 h, u16 tpage, u16 clut)
 Fills in a part of the sprite as a quad, scaled and rotated about the pivot, and adds it to the sprite's ordering table.
 
void STGTRAIN_updateSprite (TrainSprite *sprite)
 The animated sprite's update: state 1 advances the animation, unless it is paused, and draws the frame's sprite, its parts from the last to the first, as sprites or, scaled and rotated about the pivot, as quads.
 
TrainSprite * STGTRAIN_createSprite (void)
 Creates an animated sprite.
 

Detailed Description

The training's sprites (TrainSprite), which begin STGTRAIN.PRO's first object.

STGTRAIN.PRO was at least three objects: each one's jump tables are aligned to 8 from the start of its own rodata, and the tables at 0x8008251C and 0x800825E8 (USA) each start right where the one before ends, 4 bytes past a multiple of 8, so each one starts a new object. Where each object's code starts is only known to be between the function with the last jump table of the object before and the one with its first: here at the training result (result.c) and the session (session.c). Each object's data is in its last module

Definition in file sprite.c.

Function Documentation

◆ STGTRAIN_setSpriteBank()

void STGTRAIN_setSpriteBank ( TrainSprite *  sprite,
TrainSpriteBank *  bank,
s32  offset 
)

Sets the sprite bank and where the sprites start in it.

sprite.c

Definition at line 14 of file sprite.c.

Referenced by STGTRAIN_createSprite().

Here is the caller graph for this function:

◆ STGTRAIN_setSpriteAnim()

void STGTRAIN_setSpriteAnim ( TrainSprite *  sprite,
TrainAnim *  anim 
)

Starts an animation from its first frame.

Definition at line 22 of file sprite.c.

Referenced by STGTRAIN_createSprite().

Here is the caller graph for this function:

◆ STGTRAIN_setSpriteLayer()

void STGTRAIN_setSpriteLayer ( TrainSprite *  sprite,
s32  layerId,
s32  depth 
)

Sets the layer and depth the sprite is drawn at.

Definition at line 33 of file sprite.c.

Referenced by STGTRAIN_createSprite().

Here is the caller graph for this function:

◆ STGTRAIN_setSpritePos()

void STGTRAIN_setSpritePos ( TrainSprite *  sprite,
s32  x,
s32  y 
)

Sets where the sprite is drawn.

Definition at line 39 of file sprite.c.

Referenced by STGTRAIN_createSprite().

Here is the caller graph for this function:

◆ STGTRAIN_setSpriteImagePos()

void STGTRAIN_setSpriteImagePos ( TrainSprite *  sprite,
s32  x,
s32  y 
)

Sets where the sprite's image is in VRAM.

Definition at line 45 of file sprite.c.

Referenced by STGTRAIN_createSprite().

Here is the caller graph for this function:

◆ STGTRAIN_setSpriteClutPos()

void STGTRAIN_setSpriteClutPos ( TrainSprite *  sprite,
s32  x,
s32  y 
)

Sets where the sprite's CLUT is in VRAM.

Definition at line 51 of file sprite.c.

Referenced by STGTRAIN_createSprite().

Here is the caller graph for this function:

◆ STGTRAIN_setSpriteScale()

void STGTRAIN_setSpriteScale ( TrainSprite *  sprite,
s32  x,
s32  y,
s32  z 
)

Scales the sprite (0x1000 is its size), drawing it as quads.

Definition at line 57 of file sprite.c.

Referenced by STGTRAIN_createSprite().

Here is the caller graph for this function:

◆ STGTRAIN_setSpritePivot()

void STGTRAIN_setSpritePivot ( TrainSprite *  sprite,
s32  x,
s32  y 
)

Sets the point the sprite scales and turns about.

Definition at line 65 of file sprite.c.

Referenced by STGTRAIN_createSprite().

Here is the caller graph for this function:

◆ STGTRAIN_setSpriteRotation()

void STGTRAIN_setSpriteRotation ( TrainSprite *  sprite,
s16  x,
s16  y,
s16  z 
)

Turns the sprite, drawing it as quads.

Definition at line 71 of file sprite.c.

Referenced by STGTRAIN_createSprite().

Here is the caller graph for this function:

◆ STGTRAIN_getSpriteFlags()

s32 STGTRAIN_getSpriteFlags ( TrainSprite *  sprite)

Whether the animation has ended (the flags but for the pause)

Definition at line 79 of file sprite.c.

Referenced by STGTRAIN_createSprite().

Here is the caller graph for this function:

◆ STGTRAIN_setSpritePaused()

void STGTRAIN_setSpritePaused ( TrainSprite *  sprite,
s32  paused 
)

Pauses the animation (paused) or plays it on.

Definition at line 84 of file sprite.c.

Referenced by STGTRAIN_createSprite().

Here is the caller graph for this function:

◆ STGTRAIN_addSpriteSprt()

static void STGTRAIN_addSpriteSprt ( TrainSprite *  sprite,
SPRT *  sprt,
TrainSpritePart *  part,
TrainAnimFrame *  frame,
s32  x,
s32  y,
u8  u,
u8  v,
u16  w,
u16  h,
u16  clut 
)
inlinestatic

Fills in a part of the sprite as a sprite, and adds it to the sprite's ordering table.

Definition at line 94 of file sprite.c.

Referenced by STGTRAIN_updateSprite().

Here is the caller graph for this function:

◆ STGTRAIN_addSpriteQuad()

static void STGTRAIN_addSpriteQuad ( TrainSprite *  sprite,
POLY_FT4 *  ft4,
TrainSpritePart *  part,
TrainAnimFrame *  frame,
s32  x,
s32  y,
u8  u,
u8  v,
u16  w,
u16  h,
u16  tpage,
u16  clut 
)
inlinestatic

Fills in a part of the sprite as a quad, scaled and rotated about the pivot, and adds it to the sprite's ordering table.

Definition at line 114 of file sprite.c.

Referenced by STGTRAIN_updateSprite().

Here is the caller graph for this function:

◆ STGTRAIN_updateSprite()

void STGTRAIN_updateSprite ( TrainSprite *  sprite)

The animated sprite's update: state 1 advances the animation, unless it is paused, and draws the frame's sprite, its parts from the last to the first, as sprites or, scaled and rotated about the pivot, as quads.

The match depends on cur holding the animation before its frames.

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

Definition at line 151 of file sprite.c.

Referenced by STGTRAIN_createSprite().

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

◆ STGTRAIN_createSprite()

TrainSprite * STGTRAIN_createSprite ( void  )

Creates an animated sprite.

Definition at line 287 of file sprite.c.

Referenced by STGTRAIN_setUpActor().

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