DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
CSpriteTable Class Reference

#include <spritetable.hpp>

Public Member Functions

 CSpriteTable ()
 
void DrawTable ()
 
void AddTable (int x, int y, MG_SPRITE *sprite, int layer, int align_flags)
 
void AddTable (int x, int y, sceGsTex0 *tex0, RECT *source, int layer, int align_flags)
 
void Initialize (SPRITE_TABLE *new_pool, int entry_count, int layer_count)
 
SPRITE_TABLE * GetNext ()
 
void ClearPointer ()
 

Public Attributes

SPRITE_TABLE * pool
 
s32 list_count
 
s32 pool_count
 
SPRITE_TABLE * heads [16]
 
SPRITE_TABLE * tails [16]
 
SPRITE_TABLE * current
 
SPRITE_TABLE * end
 

Detailed Description

Collects layered sprite commands from a fixed entry pool.

Definition at line 50 of file spritetable.hpp.

Constructor & Destructor Documentation

◆ CSpriteTable()

CSpriteTable::CSpriteTable ( )
inline

Starts with no command pool and no active layers.

Definition at line 63 of file spritetable.hpp.

Member Function Documentation

◆ DrawTable()

void CSpriteTable::DrawTable ( )

Draws every queued sprite layer and restores the graphics register state.

Mangled name:
DrawTable__12CSpriteTableFv
Address:
0x12BA20
Size:
0x46C

Definition at line 8 of file spritetable.cpp.

◆ AddTable() [1/2]

void CSpriteTable::AddTable ( int  x,
int  y,
MG_SPRITE *  sprite,
int  layer,
int  align_flags 
)

Queues a textured sprite on one clamped layer.

Mangled name:
AddTable__12CSpriteTableFiiP9MG_SPRITEii
Address:
0x12BE90
Size:
0x15C

Definition at line 92 of file spritetable.cpp.

◆ AddTable() [2/2]

void CSpriteTable::AddTable ( int  x,
int  y,
sceGsTex0 *  tex0,
RECT *  source,
int  layer,
int  align_flags 
)

Queues a texture rectangle with neutral colour on one clamped layer.

Mangled name:
AddTable__12CSpriteTableFiiP9sceGsTex0P4RECTii
Address:
0x12BFF0
Size:
0x70

< Sprite handed to the other AddTable.

< Pads the sprite's stack slot to 48 bytes.

Definition at line 153 of file spritetable.cpp.

◆ Initialize()

void CSpriteTable::Initialize ( SPRITE_TABLE *  new_pool,
int  entry_count,
int  layer_count 
)

Assigns a command pool and initializes up to sixteen sprite layers.

Mangled name:
Initialize__12CSpriteTableFP12SPRITE_TABLEii
Address:
0x12C060
Size:
0x58

Definition at line 168 of file spritetable.cpp.

◆ GetNext()

SPRITE_TABLE * CSpriteTable::GetNext ( )

Returns the next unused sprite command, or null when the pool is full.

Mangled name:
GetNext__12CSpriteTableFv
Address:
0x12C0C0
Size:
0x2C

Definition at line 181 of file spritetable.cpp.

◆ ClearPointer()

void CSpriteTable::ClearPointer ( )

Resets every sprite layer and rewinds the command pool.

Mangled name:
ClearPointer__12CSpriteTableFv
Address:
0x12C0F0
Size:
0x7C

Definition at line 192 of file spritetable.cpp.

Member Data Documentation

◆ pool

SPRITE_TABLE* CSpriteTable::pool

First entry in the command pool.

Definition at line 52 of file spritetable.hpp.

◆ list_count

s32 CSpriteTable::list_count

Number of active sprite layers.

Definition at line 53 of file spritetable.hpp.

◆ pool_count

s32 CSpriteTable::pool_count

Number of entries in the command pool.

Definition at line 54 of file spritetable.hpp.

◆ heads

SPRITE_TABLE* CSpriteTable::heads[16]

Sentinel at the head of each layer.

Definition at line 55 of file spritetable.hpp.

◆ tails

SPRITE_TABLE* CSpriteTable::tails[16]

Next free entry for each layer.

Definition at line 56 of file spritetable.hpp.

◆ current

SPRITE_TABLE* CSpriteTable::current

Next unused entry in the command pool.

Definition at line 57 of file spritetable.hpp.

◆ end

SPRITE_TABLE* CSpriteTable::end

Address just past the command pool.

Definition at line 58 of file spritetable.hpp.