SGDK
A free and open development kit for the Sega Mega Drive
Loading...
Searching...
No Matches
Sprite Struct Reference

Sprite structure used by the Sprite Engine to store state for a sprite.
WARNING: always use the SPR_addSprite(..) method to allocate Sprite object.
More...

#include <sprite_eng.h>

Collaboration diagram for Sprite:
[legend]

Public Attributes

u16 status
 
u16 visibility
 
const SpriteDefinitiondefinition
 
void(* onFrameChange )(struct Sprite *sprite)
 
Animationanimation
 
AnimationFrameframe
 
s16 animInd
 
s16 frameInd
 
s16 timer
 
s16 x
 
s16 y
 
s16 depth
 
u16 attribut
 
u32 data
 
struct Spriteprev
 
struct Spritenext
 

Detailed Description

Sprite structure used by the Sprite Engine to store state for a sprite.
WARNING: always use the SPR_addSprite(..) method to allocate Sprite object.

Parameters
statusInternal state and automatic allocation information (internal)
visibilityvisibility information of current frame for each VDP sprite (max = 16)
spriteDefSprite definition pointer
onFrameChangeCustom callback on frame change event (see SPR_setFrameChangeCallback(..) method)
animationAnimation pointer cache (internal)
frameAnimationFrame pointer cache (internal)
animIndcurrent animation index (internal)
frameIndcurrent frame animation index (internal)
timertimer for current frame (internal)
xcurrent sprite X position on screen offseted by 0x80 (internal VDP position)
ycurrent sprite Y position on screen offseted by 0x80 (internal VDP position)
depthcurrent sprite depth (Z) position used for Z sorting
attributsprite specific attribut and allocated VRAM tile index (see TILE_ATTR_FULL() macro)
datathis is a free field for user data, use it for whatever you want (flags, pointer...)
prevpointer on previous Sprite in list
nextpointer on next Sprite in list

Used to manage an active sprite in game condition.


The documentation for this struct was generated from the following file: