Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
sprite.h File Reference

Go to the source code of this file.

Data Structures

struct  SpriteComponent
 
struct  PlayerCurrentAnimInfo
 
struct  SpriteAnimComponent
 
struct  SpriteRasterCacheEntry
 
struct  SpriteAnimData
 Sprite data header. More...
 
struct  SpriteInstance
 
struct  PlayerRastersHeader
 
struct  PlayerSpriteSet
 
struct  PlayerSpriteCacheEntry
 
struct  Quad
 

Macros

#define SPR_PLAYER_COLOR_VARIATIONS   6
 
#define SPR_PEACH_BTL_PAL_STRIDE   4
 
#define SPR_UNPACK_SPR(animID)   (((animID) >> 16) & 0xFF)
 
#define SPR_UNPACK_PAL(animID)   (((animID) >> 8) & 0xFF)
 
#define SPR_UNPACK_ANIM(animID)   ((animID) & 0xFF)
 

Enumerations

enum  SpriteIDFields {
  SPRITE_ID_ANIM_MASK = 0x000000FF , SPRITE_ID_PAL_MASK = 0x0000FF00 , SPRITE_ID_SPR_MASK = 0x00FF0000 , SPRITE_ID_BACK_FACING = 0x01000000 ,
  SPRITE_ID_TAIL_ALLOCATE = 0x80000000
}
 
enum  DrawSpriteOptions {
  DRAW_SPRITE_USE_PLAYER_RASTERS = 0x08000000 , DRAW_SPRITE_UPSIDE_DOWN = 0x10000000 , DRAW_SPRITE_OVERRIDE_PALETTES = 0x20000000 , DRAW_SPRITE_OVERRIDE_YAW = 0x40000000 ,
  DRAW_SPRITE_OVERRIDE_ALPHA = 0x80000000
}
 
enum  { PLAYER_SPRITE_MAIN = 0 , PLAYER_SPRITE_AUX1 = 1 , PLAYER_SPRITE_AUX2 = 2 }
 
enum  { SPRITE_MODE_PLAYER = 0 , SPRITE_MODE_NPC = 1 }
 

Functions

void imgfx_init (void)
 
void spr_init_sprites (s32 playerSpriteSet)
 
void spr_render_init (void)
 
void spr_update_player_raster_cache (void)
 
s32 spr_update_player_sprite (s32 arg0, s32 arg1, f32 timescale)
 
s32 spr_draw_player_sprite (s32 spriteInstanceID, s32 yaw, s32 arg2, PAL_PTR *paletteList, Matrix4f mtx)
 
s32 func_802DDEC4 (s32 arg0)
 
void set_player_imgfx_comp (s32, s32, ImgFXType, s32, s32, s32, s32, s32)
 
void set_player_imgfx_all (s32, ImgFXType, s32, s32, s32, s32, s32)
 
IMG_PTR spr_get_player_raster (s32 rasterIndex, s32 playerSpriteID)
 
void spr_get_player_raster_info (SpriteRasterInfo *out, s32 playerSpriteID, s32 rasterIndex)
 
PAL_PTRspr_get_player_palettes (s32 spriteIndex)
 
s32 spr_load_npc_sprite (s32 animID, u32 *extraAnimList)
 
s32 spr_update_sprite (s32 spriteInstanceID, s32 animID, f32 timeScale)
 
s32 spr_draw_npc_sprite (s32 spriteInstanceID, s32 yaw, s32 alphaIn, PAL_PTR *paletteList, Matrix4f mtx)
 
s32 spr_get_notify_value (s32 spriteInstanceID)
 
s32 spr_free_sprite (s32 spriteInstanceID)
 
s32 get_npc_comp_imgfx_idx (s32, s32)
 
void set_npc_imgfx_comp (s32, s32, ImgFXType, s32, s32, s32, s32, s32)
 
void set_npc_imgfx_all (s32 arg0, ImgFXType arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6)
 
s32 spr_get_comp_position (s32 spriteIdx, s32 compListIdx, s32 *outX, s32 *outY, s32 *outZ)
 
s32 spr_get_npc_raster_info (SpriteRasterInfo *out, s32 npcSpriteID, s32 rasterIndex)
 
PAL_PTRspr_get_npc_palettes (s32 npcSpriteID)
 
s32 spr_get_npc_color_variations (s32 npcSpriteID)
 
void create_shading_palette (Matrix4f mtx, s32 uls, s32 ult, s32 lrs, s32 lrt, s32 alpha, s32)
 
void func_801491E4 (Matrix4f mtx, s32, s32, s32, s32, s32 alpha)
 
SpriteAnimDataspr_load_sprite (s32 idx, s32 arg1, s32 arg2)
 

Data Structure Documentation

◆ SpriteComponent

struct SpriteComponent
Data Fields
s32 initialized
s32 properties AABBCCCC : AA = unused?, BB = parent, CCCC = notify value.
s16 * readPos
f32 waitTime
s32 loopCounter
s32 curRaster
s32 curPalette
Vec3f posOffset
Vec3f compPos
Vec3i rot
Vec3f scale
s32 imgfxIdx

◆ PlayerCurrentAnimInfo

struct PlayerCurrentAnimInfo
Data Fields
SpriteComponent ** componentList
s32 animID
s32 notifyValue

◆ SpriteAnimComponent

struct SpriteAnimComponent
Data Fields
u16 * cmdList
s16 cmdListSize
Vec3s compOffset

◆ SpriteRasterCacheEntry

struct SpriteRasterCacheEntry
Data Fields
IMG_PTR image
u8 width
u8 height
s8 palette
s8 quadCacheIndex

◆ SpriteAnimData

struct SpriteAnimData
Data Fields
SpriteRasterCacheEntry ** rastersOffset
PAL_PTR * palettesOffset
s32 maxComponents
s32 colorVariations
SpriteAnimComponent ** animListStart[VLA]

◆ SpriteInstance

struct SpriteInstance
Data Fields
s32 spriteIndex
SpriteComponent ** componentList
SpriteAnimData * spriteData
s32 curAnimID
s32 notifyValue

◆ PlayerRastersHeader

struct PlayerRastersHeader
Data Fields
s32 indexRanges
s32 loadDescriptors
s32 imageData

◆ PlayerSpriteSet

struct PlayerSpriteSet
Data Fields
s32 cacheSize Number of cache entries.
s32 rasterSize Maximum raster size.
s32 initiallyLoaded Flags saying which rasters to load into the cache in spr_init_sprites(), with each bit corresponding to the Nth raster (with LSB = raster 0).

◆ PlayerSpriteCacheEntry

struct PlayerSpriteCacheEntry
Data Fields
s32 lazyDeleteTime
s32 rasterIndex
s32 spriteIndex
IMG_PTR raster

◆ Quad

struct Quad
Data Fields
Vtx v[4]

Macro Definition Documentation

◆ SPR_PLAYER_COLOR_VARIATIONS

◆ SPR_PEACH_BTL_PAL_STRIDE

#define SPR_PEACH_BTL_PAL_STRIDE   4

Definition at line 7 of file sprite.h.

Referenced by render_with_player_debuff_palettes().

◆ SPR_UNPACK_SPR

#define SPR_UNPACK_SPR ( animID)    (((animID) >> 16) & 0xFF)

Definition at line 9 of file sprite.h.

Referenced by spr_draw_player_sprite(), and spr_update_player_sprite().

◆ SPR_UNPACK_PAL

#define SPR_UNPACK_PAL ( animID)    (((animID) >> 8) & 0xFF)

Definition at line 10 of file sprite.h.

Referenced by spr_update_sprite().

◆ SPR_UNPACK_ANIM

#define SPR_UNPACK_ANIM ( animID)    ((animID) & 0xFF)

Enumeration Type Documentation

◆ SpriteIDFields

Enumerator
SPRITE_ID_ANIM_MASK 
SPRITE_ID_PAL_MASK 
SPRITE_ID_SPR_MASK 
SPRITE_ID_BACK_FACING 
SPRITE_ID_TAIL_ALLOCATE 

Definition at line 13 of file sprite.h.

13 {
14 SPRITE_ID_ANIM_MASK = 0x000000FF,
15 SPRITE_ID_PAL_MASK = 0x0000FF00,
16 SPRITE_ID_SPR_MASK = 0x00FF0000,
17 SPRITE_ID_BACK_FACING = 0x01000000,
18 SPRITE_ID_TAIL_ALLOCATE = 0x80000000,
19};
@ SPRITE_ID_SPR_MASK
Definition sprite.h:16
@ SPRITE_ID_ANIM_MASK
Definition sprite.h:14
@ SPRITE_ID_TAIL_ALLOCATE
Definition sprite.h:18
@ SPRITE_ID_PAL_MASK
Definition sprite.h:15
@ SPRITE_ID_BACK_FACING
Definition sprite.h:17

◆ DrawSpriteOptions

Enumerator
DRAW_SPRITE_USE_PLAYER_RASTERS 
DRAW_SPRITE_UPSIDE_DOWN 
DRAW_SPRITE_OVERRIDE_PALETTES 
DRAW_SPRITE_OVERRIDE_YAW 
DRAW_SPRITE_OVERRIDE_ALPHA 

Definition at line 21 of file sprite.h.

21 {
23 DRAW_SPRITE_UPSIDE_DOWN = 0x10000000,
25 DRAW_SPRITE_OVERRIDE_YAW = 0x40000000,
26 DRAW_SPRITE_OVERRIDE_ALPHA = 0x80000000,
27};
@ DRAW_SPRITE_OVERRIDE_YAW
Definition sprite.h:25
@ DRAW_SPRITE_OVERRIDE_ALPHA
Definition sprite.h:26
@ DRAW_SPRITE_OVERRIDE_PALETTES
Definition sprite.h:24
@ DRAW_SPRITE_UPSIDE_DOWN
Definition sprite.h:23
@ DRAW_SPRITE_USE_PLAYER_RASTERS
Definition sprite.h:22

◆ anonymous enum

Enumerator
PLAYER_SPRITE_MAIN 
PLAYER_SPRITE_AUX1 
PLAYER_SPRITE_AUX2 

Definition at line 29 of file sprite.h.

29 {
33};
@ PLAYER_SPRITE_AUX1
Definition sprite.h:31
@ PLAYER_SPRITE_AUX2
Definition sprite.h:32
@ PLAYER_SPRITE_MAIN
Definition sprite.h:30

◆ anonymous enum

Enumerator
SPRITE_MODE_PLAYER 
SPRITE_MODE_NPC 

Definition at line 36 of file sprite.h.

36 {
39};
@ SPRITE_MODE_NPC
Definition sprite.h:38
@ SPRITE_MODE_PLAYER
Definition sprite.h:37

Function Documentation

◆ imgfx_init()

void imgfx_init ( void )

Definition at line 242 of file imgfx.c.

242 {
243 s32 i;
244
245 for (i = 0; i < ARRAY_COUNT(ImgFXVtxBuffers); i++) {
247 }
248
250
251 for (i = 0; i < ARRAY_COUNT(*ImgFXInstances); i++) {
254 }
255
256 for (i = 0; i < ARRAY_COUNT(ImgFXDataCache); i++) {
260 }
261
262 imgfx_vtxCount = 0;
264}
BSS s32 PopupMenu_SelectedIndex
void * _heap_malloc(HeapNode *head, u32 size)
Definition 43F0.c:77
ImgFXState ImgFXInstanceList[MAX_IMGFX_INSTANCES]
Definition imgfx.c:111
void imgfx_clear_instance_data(ImgFXState *state)
Definition imgfx.c:442
u16 imgfx_vtxCount
Definition imgfx.c:125
BSS Vtx * ImgFXVtxBuffers[2]
Definition imgfx.c:116
u8 usingContextualHeap
Definition imgfx.c:97
BSS ImgFXInstanceList * ImgFXInstances
Definition imgfx.c:118
BSS Vtx * imgfx_vtxBuf
Definition imgfx.c:117
s32 * data
Definition imgfx.c:95
u16 ImgFXVtxBufferCapacity
Definition imgfx.c:143
HeapNode heap_spriteHead
Definition heaps3.c:4
void imgfx_init_instance(ImgFXState *state)
Definition imgfx.c:452
BSS ImgFXCacheEntry ImgFXDataCache[8]
Definition imgfx.c:120
u8 staleCooldownTimer
Definition imgfx.c:96
#define ARRAY_COUNT(arr)
Definition macros.h:40
s32 gCurrentDisplayContextIndex
Definition main_loop.c:46

Referenced by spr_init_sprites().

◆ spr_init_sprites()

void spr_init_sprites ( s32 playerSpriteSet)

Definition at line 765 of file sprite.c.

765 {
767 s32 i;
768
771 imgfx_init();
772
773 for (i = 0; i < ARRAY_COUNT(PlayerSprites); i++) {
775 playerSprites[i] = 0;
776 }
777
779
781 playerSpriteSet = PLAYER_SPRITES_PEACH_WORLD;
782 }
783
784 loadedFlags = (&PlayerSpriteSets[playerSpriteSet])->initiallyLoaded;
785 spr_init_player_raster_cache((&PlayerSpriteSets[playerSpriteSet])->cacheSize,
786 (&PlayerSpriteSets[playerSpriteSet])->rasterSize);
787
788 for (i = 1; i <= SPR_Peach3; i++) {
789 if ((loadedFlags >> i) & 1) {
791 }
792 }
793
794 for (i = 0; i < ARRAY_COUNT(CurPlayerAnimInfo); i++) {
797 }
798
799 for (i = 0; i < ARRAY_COUNT(NpcSpriteData); i++) {
800 NpcSpriteData[i] = NULL;
802 }
803
804 for (i = 0; i < ARRAY_COUNT(SpriteInstances); i++) {
810 }
811
813}
@ PEACH_FLAG_IS_PEACH
Definition enums.h:2474
PlayerSpriteSets
Definition enums.h:5930
@ PLAYER_SPRITES_PEACH_WORLD
Definition enums.h:5935
HeapNode * _heap_create(HeapNode *addr, u32 size)
Definition 43F0.c:62
void imgfx_init(void)
Definition imgfx.c:242
#define SPRITE_HEAP_SIZE
Definition macros.h:125
BSS b32 SpriteUseGeneralHeap
Definition sprite.c:10
void spr_init_quad_cache(void)
Definition sprite.c:125
BSS SpriteAnimData * NpcSpriteData[0xFF]
Definition sprite.c:17
BSS PlayerCurrentAnimInfo CurPlayerAnimInfo[3]
Definition sprite.c:16
BSS SpriteInstance SpriteInstances[51]
Definition sprite.c:19
BSS u8 NpcSpriteInstanceCount[0xFF]
Definition sprite.c:18
void spr_load_player_sprite(s32 spriteIndex)
Definition sprite.c:756
HeapNode heap_spriteHead
Definition heaps3.c:4
BSS SpriteAnimData * PlayerSprites[13]
Definition sprite.c:13
BSS s32 MaxPlayerSpriteComponents
Definition sprite.c:15
void spr_init_player_raster_cache(s32 cacheSize, s32 maxRasterSize)
SpriteAnimData * spriteData
Definition sprite.h:89
s32 spriteIndex
Definition sprite.h:87
s32 curAnimID
Definition sprite.h:90
SpriteComponent ** componentList
Definition sprite.h:88
SpriteComponent ** componentList
Definition sprite.h:57
s32 notifyValue
Definition sprite.h:91
Sprite data header.
Definition sprite.h:78
GameStatus * gGameStatusPtr
Definition main_loop.c:31

Referenced by load_demo_battle(), load_engine_data(), load_map_by_IDs(), state_init_logos(), state_init_title_screen(), state_step_battle(), state_step_demo(), state_step_end_battle(), state_step_intro(), state_step_pause(), state_step_startup(), state_step_title_screen(), and state_step_unpause().

◆ spr_render_init()

void spr_render_init ( void )

Definition at line 815 of file sprite.c.

815 {
818}
void spr_update_player_raster_cache(void)
void spr_clear_quad_cache(void)
Definition sprite.c:206

Referenced by gfx_draw_frame().

◆ spr_update_player_raster_cache()

void spr_update_player_raster_cache ( void )

Definition at line 217 of file 101b90_len_8f0.c.

217 {
218 s32 i;
219
221
222 for (i = 0; i < PlayerRasterCacheSize; i++) {
223 if (PlayerRasterCache[i].lazyDeleteTime != 0) {
225 }
226 }
227}
BSS s32 PlayerRasterCacheSize
BSS PlayerSpriteCacheEntry PlayerRasterCache[18]
void func_8013A4D0(void)
Definition imgfx.c:266

Referenced by spr_render_init().

◆ spr_update_player_sprite()

s32 spr_update_player_sprite ( s32 arg0,
s32 arg1,
f32 timescale )

Definition at line 820 of file sprite.c.

820 {
821 SpriteAnimData* spriteData;
824 SpriteAnimComponent** animList;
826 s32 spriteID = SPR_UNPACK_SPR(animID);
827 s32 instanceIdx = spriteInstanceID & 0xFF;
829
830 if (CurPlayerAnimInfo[instanceIdx].componentList == NULL) {
833 while (*compList != PTR_LIST_END) {
836 compList++;
837 }
838 }
839
842
843 if (spriteData == NULL) {
844 return 0;
845 }
846
847 rasterList = spriteData->rastersOffset;
848 animList = spriteData->animListStart[SPR_UNPACK_ANIM(animID)];
849
850 spr_set_anim_timescale(timeScale);
851 if ((spriteInstanceID & DRAW_SPRITE_OVERRIDE_ALPHA) ||
853 {
854 spr_init_anim_state(compList, animList);
856 }
857
859
860 if (!(spriteInstanceID & DRAW_SPRITE_OVERRIDE_YAW)) {
862 compList, animList, rasterList, 0);
863 }
865}
s32 imgfx_get_free_instances(s32)
Definition imgfx.c:337
#define PTR_LIST_END
Definition macros.h:42
void spr_set_anim_timescale(f32 timescale)
Definition sprite.c:752
s32 spr_component_update(s32 curNotifyValue, SpriteComponent **compList, SpriteAnimComponent **animList, SpriteRasterCacheEntry **rasterCache, s32 overridePalette)
Definition sprite.c:693
SpriteComponent ** spr_allocate_components(s32)
void spr_init_anim_state(SpriteComponent **compList, SpriteAnimComponent **animList)
Definition sprite.c:742
BSS s32 CurPlayerSpriteIndex
Definition sprite.c:14
SpriteAnimComponent ** animListStart[VLA]
Definition sprite.h:83
#define SPR_UNPACK_ANIM(animID)
Definition sprite.h:11
SpriteRasterCacheEntry ** rastersOffset
Definition sprite.h:79
#define SPR_UNPACK_SPR(animID)
Definition sprite.h:9

Referenced by appendGfx_player_actor(), player_update_sprite(), set_actor_anim(), set_actor_anim_by_ref(), update_npcs(), and update_player_actor_shadow().

◆ spr_draw_player_sprite()

s32 spr_draw_player_sprite ( s32 spriteInstanceID,
s32 yaw,
s32 arg2,
PAL_PTR * paletteList,
Matrix4f mtx )

Definition at line 867 of file sprite.c.

867 {
868 SpriteAnimData* spriteData;
870 SpriteAnimComponent** animList;
873 f32 zscale;
874 u32 alpha;
876 s32 instanceIdx = spriteInstanceID & 0xFF;
878
879 if (animID == ANIM_LIST_END) {
880 return FALSE;
881 }
882
883 spriteID = SPR_UNPACK_SPR(animID);
885
887 if (spriteData == NULL) {
888 return FALSE;
889 }
890
891 rasterList = spriteData->rastersOffset;
892 palettes = spriteData->palettesOffset;
893 animList = spriteData->animListStart[SPR_UNPACK_ANIM(animID)];
894
895 if (animID & SPRITE_ID_BACK_FACING) {
896 switch (spriteID) {
897 case SPR_Mario1:
898 case SPR_MarioW1:
899 case SPR_Peach1:
900 CurPlayerSpriteIndex++; // use the following sprite index if using back sprite
902 break;
903 }
904 }
905
906 if (yaw > 90 && yaw <= 270 || yaw >= -270 && yaw < -90) {
907 zscale = -1.5f;
908 } else {
909 zscale = 1.5f;
910 }
911
912 if (spriteInstanceID & DRAW_SPRITE_UPSIDE_DOWN) {
913 zscale = -zscale;
914 }
915
916 if (!(spriteInstanceID & DRAW_SPRITE_OVERRIDE_YAW)) {
918 if (yaw > 360) {
919 yaw -= 360;
920 }
921 if (yaw < -360) {
922 yaw += 360;
923 }
924 }
925
926 SpriteCurBaseRot[0] = 0;
927 SpriteCurBaseRot[1] = yaw;
928 SpriteCurBaseRot[2] = 0;
929
930 if (spriteInstanceID & DRAW_SPRITE_OVERRIDE_ALPHA) {
931 alpha = alphaIn & 0xFF;
932 if (alphaIn == 0) {
933 return FALSE;
934 }
935 } else {
936 alpha = 255;
937 }
938
940 if (spriteInstanceID & DRAW_SPRITE_OVERRIDE_PALETTES) {
942 }
943
944 while (*compList != PTR_LIST_END) {
946 if (*animList != PTR_LIST_END) {
947 animList++;
948 }
949 }
950
951 return TRUE;
952}
#define PAL_PTR
void spr_draw_component(s32 drawOpts, SpriteComponent *component, SpriteAnimComponent *anim, SpriteRasterCacheEntry **cache, PAL_PTR *palettes, f32 zscale, Matrix4f mtx)
Definition sprite.c:426
BSS s32 SpriteCurBaseRot[3]
Definition sprite.c:22
PAL_PTR * palettesOffset
Definition sprite.h:80
#define ANIM_LIST_END
Terminates an extraAnimationList.
Definition types.h:22
Camera gCameras[4]
Definition cam_main.c:16
s16 gCurrentCamID
Definition cam_main.c:12

Referenced by appendGfx_npc(), appendGfx_npc_blur(), appendGfx_player(), appendGfx_player_spin(), func_unkA_draw_player(), func_unkB_draw_player(), npc_render_without_adjusted_palettes(), and render_with_adjusted_palettes().

◆ func_802DDEC4()

s32 func_802DDEC4 ( s32 arg0)

Definition at line 954 of file sprite.c.

954 {
956}

Referenced by appendGfx_npc().

◆ set_player_imgfx_comp()

void set_player_imgfx_comp ( s32 spriteIdx,
s32 compIdx,
ImgFXType imgfx,
s32 imgfxArg1,
s32 imgfxArg2,
s32 imgfxArg3,
s32 imgfxArg4,
s32 flags )

Definition at line 958 of file sprite.c.

958 {
961 s32 i;
962
963 if (CurPlayerAnimInfo[spriteIdx].componentList != NULL) {
965 i = 0;
966
967 while (*componentListIt != PTR_LIST_END) {
969 if (compIdx == -1 || i == compIdx) {
970 imgfx_update(component->imgfxIdx & 0xFF, imgfx, imgfxArg1, imgfxArg2, imgfxArg3, imgfxArg4, flags);
971 if (imgfx != IMGFX_CLEAR) {
973 } else {
974 component->imgfxIdx &= ~SPR_IMGFX_FLAG_ALL;
975 }
976 }
978 i++;
979 }
980 }
981}
s8 flags
Definition demo_api.c:15
@ IMGFX_CLEAR
Definition enums.h:4702
@ SPR_IMGFX_FLAG_10000000
Definition enums.h:4784
void imgfx_update(u32, ImgFXType, s32, s32, s32, s32, s32)
Definition imgfx.c:486

Referenced by appendGfx_player(), appendGfx_player_spin(), entity_CymbalPlant_idle(), render_player_model(), reset_outta_sight_alpha_on_menu_close(), and set_player_imgfx_all().

◆ set_player_imgfx_all()

void set_player_imgfx_all ( s32 animID,
ImgFXType imgfxType,
s32 arg2,
s32 arg3,
s32 arg4,
s32 arg5,
s32 arg6 )

Definition at line 984 of file sprite.c.

984 {
985 set_player_imgfx_comp(PLAYER_SPRITE_MAIN, -1, imgfxType, arg2, arg3, arg4, arg5, arg6);
986}
void set_player_imgfx_comp(s32 spriteIdx, s32 compIdx, ImgFXType imgfx, s32 imgfxArg1, s32 imgfxArg2, s32 imgfxArg3, s32 imgfxArg4, s32 flags)
Definition sprite.c:958

Referenced by appendGfx_player(), appendGfx_player_spin(), entity_BlueWarpPipe_enter_pipe_init(), entity_BlueWarpPipe_enter_pipe_update(), entity_CymbalPlant_idle(), part_glow_off(), part_glow_on(), and update_riding_physics().

◆ spr_get_player_raster()

IMG_PTR spr_get_player_raster ( s32 rasterIndex,
s32 playerSpriteID )

Definition at line 184 of file 101b90_len_8f0.c.

184 {
187 s32 idx = -1;
188 s32 i;
189
190 for (i = 0; i < PlayerRasterCacheSize; i++) {
191 if (PlayerRasterCache[i].lazyDeleteTime != 0) {
192 if (PlayerRasterCache[i].rasterIndex == rasterIndex && PlayerRasterCache[i].spriteIndex == playerSpriteID) {
194 return PlayerRasterCache[i].raster;
195 }
196 } else if (idx == -1) {
197 idx = i;
198 }
199 }
200
201 if (idx == -1) {
202 return NULL;
203 }
204
206 cacheEntry->rasterIndex = rasterIndex;
207 cacheEntry->spriteIndex = playerSpriteID;
208 cacheEntry->lazyDeleteTime = 2;
209
210 // each player raster load descriptor has image size (in bytes) and relative offset packed into one word
211 // upper three nibbles give size / 16, lower 5 give offset
213 nuPiReadRom(SpriteDataHeader[0] + (playerRasterInfo & 0xFFFFF), cacheEntry->raster, (playerRasterInfo >> 0x10) & 0xFFF0);
214 return cacheEntry->raster;
215}
BSS s32 SpriteDataHeader[3]
BSS s32 PlayerRasterLoadDesc[0x2E0]
BSS s32 PlayerRasterLoadDescBeginSpriteIndex[SPR_Peach3]

Referenced by spr_draw_component(), and spr_get_player_raster_info().

◆ spr_get_player_raster_info()

void spr_get_player_raster_info ( SpriteRasterInfo * out,
s32 playerSpriteID,
s32 rasterIndex )

Definition at line 988 of file sprite.c.

988 {
992
995 if (sprite != NULL) {
997 cache = sprite->rastersOffset[rasterIndex];
998 out->width = cache->width;
999 out->height = cache->height;
1000 out->defaultPal = paletteOffsetCopy[cache->palette];
1001 out->raster = spr_get_player_raster(rasterIndex, playerSpriteID);
1002 }
1003}
IMG_PTR spr_get_player_raster(s32 rasterIndex, s32 playerSpriteID)

Referenced by gfx_build_knocked_down_player().

◆ spr_get_player_palettes()

◆ spr_load_npc_sprite()

s32 spr_load_npc_sprite ( s32 animID,
u32 * extraAnimList )
Parameters
animID- Set MSB for tail allocation (i.e. 0x80XXYYZZ)

Definition at line 1015 of file sprite.c.

1015 {
1016 SpriteAnimData* header;
1018 s32 listIndex;
1019 s32 i;
1020
1021 s32 spriteIndex = (animID >> 0x10) & 0x7FFF;
1022 s32 useTailAlloc = (u32)animID >> 0x1F;
1023
1024 for (i = 0; i < ARRAY_COUNT(SpriteInstances); i++) {
1025 if (SpriteInstances[i].spriteIndex == 0) {
1026 break;
1027 }
1028 }
1029 if (MaxLoadedSpriteInstanceID < i) {
1031 }
1032 if (i == ARRAY_COUNT(SpriteInstances)) {
1033 return -1;
1034 }
1035 listIndex = i;
1036 if (NpcSpriteData[spriteIndex] != NULL) {
1037 NpcSpriteInstanceCount[spriteIndex]++;
1038 header = NpcSpriteData[spriteIndex];
1039 SpriteInstances[listIndex].spriteData = header;
1040 } else {
1041 NpcSpriteInstanceCount[spriteIndex] = 1;
1042 header = spr_load_sprite(spriteIndex - 1, FALSE, useTailAlloc);
1043 SpriteInstances[listIndex].spriteData = header;
1044 NpcSpriteData[spriteIndex] = header;
1045 if (extraAnimList != NULL) {
1046 spr_load_npc_extra_anims(header, extraAnimList);
1047 }
1048 }
1051 while (*compList != PTR_LIST_END) {
1054 compList++;
1055 }
1056 SpriteInstances[listIndex].spriteIndex = spriteIndex;
1057 SpriteInstances[listIndex].curAnimID = -1;
1058 return listIndex;
1059}
SpriteAnimData * spr_load_sprite(s32 idx, s32 isPlayerSprite, s32 useTailAlloc)
void spr_load_npc_extra_anims(SpriteAnimData *, u32 *)
BSS s32 MaxLoadedSpriteInstanceID
Definition sprite.c:11
s32 maxComponents
Definition sprite.h:81

Referenced by create_actor(), create_npc_impl(), load_partner_actor(), npc_reload_all(), pause_init(), pause_partners_init(), pause_spirits_init(), set_npc_sprite(), and update_npcs().

◆ spr_update_sprite()

s32 spr_update_sprite ( s32 spriteInstanceID,
s32 animID,
f32 timeScale )

Definition at line 1061 of file sprite.c.

1061 {
1062 SpriteAnimData* spriteData;
1064 SpriteAnimComponent** animList;
1066
1067 s32 palID;
1068 s32 i = spriteInstanceID & 0xFF;
1069 s32 animIndex = SPR_UNPACK_ANIM(animID);
1070
1071 ASSERT_MSG(i <= MaxLoadedSpriteInstanceID, "Invalid sprite instance ID %x", spriteInstanceID);
1072
1074 spriteData = SpriteInstances[i].spriteData;
1075
1076 rasterList = spriteData->rastersOffset;
1077 animList = spriteData->animListStart[animIndex];
1078
1079 palID = SPR_UNPACK_PAL(animID);
1080 spr_set_anim_timescale(timeScale);
1081 if ((spriteInstanceID & DRAW_SPRITE_OVERRIDE_ALPHA) || (SPR_UNPACK_ANIM(SpriteInstances[i].curAnimID) != animIndex)) {
1082 ASSERT_MSG(animList != -1, "Anim %lx is not loaded", animID);
1083 spr_init_anim_state(compList, animList);
1086 }
1087 if (!(spriteInstanceID & DRAW_SPRITE_OVERRIDE_YAW)) {
1089 compList, animList, rasterList, palID);
1090 }
1091 return SpriteInstances[i].notifyValue;
1092}
#define ASSERT_MSG(condition, msg, args...)
Definition macros.h:66
#define SPR_UNPACK_PAL(animID)
Definition sprite.h:10

Referenced by appendGfx_npc_actor(), pause_handle_input(), pause_partners_update(), pause_spirits_update(), set_actor_anim(), set_actor_anim_by_ref(), set_npc_sprite(), update_nonplayer_actor_shadow(), and update_npcs().

◆ spr_draw_npc_sprite()

s32 spr_draw_npc_sprite ( s32 spriteInstanceID,
s32 yaw,
s32 alphaIn,
PAL_PTR * paletteList,
Matrix4f mtx )

Definition at line 1094 of file sprite.c.

1094 {
1095 SpriteAnimData* spriteData;
1098 SpriteRasterCacheEntry** rasters;
1100 f32 zscale;
1101 u32 alpha;
1102 s32 instanceIdx = spriteInstanceID & 0xFF;
1104
1105 if (animID == ANIM_LIST_END) {
1106 return FALSE;
1107 }
1108
1110 rasters = spriteData->rastersOffset;
1111 palettes = spriteData->palettesOffset;
1112 animComps = spriteData->animListStart[SPR_UNPACK_ANIM(animID)];
1113
1114 SpriteCurBaseRot[0] = 0;
1115 SpriteCurBaseRot[1] = yaw;
1116 SpriteCurBaseRot[2] = 0;
1117
1118 if (!(spriteInstanceID & DRAW_SPRITE_OVERRIDE_YAW)) {
1120 if (yaw > 360) {
1121 yaw -= 360;
1122 }
1123 if (yaw < -360) {
1124 yaw += 360;
1125 }
1126 }
1127
1128 if (yaw > 90 && yaw <= 270 || yaw >= -270 && yaw < -90) {
1129 zscale = -1.5f;
1130 } else {
1131 zscale = 1.5f;
1132 }
1133
1134 if (spriteInstanceID & DRAW_SPRITE_OVERRIDE_ALPHA) {
1135 alpha = alphaIn & 0xFF;
1136 if (alphaIn == 0) {
1137 return FALSE;
1138 }
1139 } else {
1140 alpha = 255;
1141 }
1142
1144 if (spriteInstanceID & DRAW_SPRITE_OVERRIDE_PALETTES) {
1146 }
1147
1148 while (*components != PTR_LIST_END) {
1149 spr_draw_component(alpha, *components++, *animComps, rasters, palettes, zscale, mtx);
1150 if (*animComps != PTR_LIST_END) {
1151 animComps++;
1152 }
1153 }
1154
1155 return TRUE;
1156}

Referenced by appendGfx_nonplayer_actor_blur(), appendGfx_npc(), appendGfx_npc_blur(), func_unkA_draw_npc(), func_unkB_draw_npc(), npc_render_with_double_pal_blending(), npc_render_with_single_pal_blending(), npc_render_with_watt_idle_palettes(), npc_render_without_adjusted_palettes(), pause_partners_draw_contents(), pause_spirits_draw_contents(), pause_tutorial_draw_contents(), and render_with_adjusted_palettes().

◆ spr_get_notify_value()

s32 spr_get_notify_value ( s32 spriteInstanceID)

Definition at line 1158 of file sprite.c.

1158 {
1159 return SpriteInstances[spriteInstanceID].notifyValue;
1160}

Referenced by appendGfx_npc(), appendGfx_npc_actor(), set_actor_anim(), set_actor_anim_by_ref(), and update_nonplayer_actor_shadow().

◆ spr_free_sprite()

s32 spr_free_sprite ( s32 spriteInstanceID)

Definition at line 1162 of file sprite.c.

1162 {
1163 SpriteInstance* sprite = &SpriteInstances[spriteInstanceID];
1164 SpriteAnimData* spriteData;
1166 s32 spriteIndex = sprite->spriteIndex;
1167
1168 if (spriteIndex == 0 || spriteIndex >= ARRAY_COUNT(NpcSpriteData)) {
1169 return spriteInstanceID;
1170 }
1171
1172 NpcSpriteInstanceCount[spriteIndex]--;
1173 spriteData = sprite->spriteData;
1174
1175 compList = sprite->componentList;
1176 while (*compList != PTR_LIST_END) {
1178 imgfx_release_instance(comp->imgfxIdx & 0xFF);
1179 compList++;
1180 }
1181
1182 compList = SpriteInstances[spriteInstanceID].componentList;
1183
1184 if (NpcSpriteInstanceCount[spriteIndex] == 0) {
1185 NpcSpriteData[spriteIndex] = NULL;
1186 _heap_free(&heap_spriteHead, spriteData);
1187 }
1188
1191 } else {
1193 }
1194
1195 SpriteInstances[spriteInstanceID].spriteIndex = 0;
1196 SpriteInstances[spriteInstanceID].componentList = NULL;
1197 SpriteInstances[spriteInstanceID].spriteData = NULL;
1198 SpriteInstances[spriteInstanceID].curAnimID = -1;
1199 return 0;
1200}
u32 _heap_free(HeapNode *heapNodeList, void *addrToFree)
Definition 43F0.c:219
void imgfx_release_instance(u32)
Definition imgfx.c:385
HeapNode heap_generalHead
Definition heaps3.c:3

Referenced by btl_delete_actor(), free_npc(), free_npc_by_index(), pause_cleanup(), pause_partners_cleanup(), pause_spirits_cleanup(), and set_npc_sprite().

◆ get_npc_comp_imgfx_idx()

s32 get_npc_comp_imgfx_idx ( s32 spriteIdx,
s32 compIdx )

Definition at line 1202 of file sprite.c.

1202 {
1204
1205 if (componentList == NULL) {
1206 return -1;
1207 } else {
1208 return componentList[compIdx]->imgfxIdx & 0xFF;
1209 }
1210}

◆ set_npc_imgfx_comp()

void set_npc_imgfx_comp ( s32 spriteIdx,
s32 compIdx,
ImgFXType imgfx,
s32 imgfxArg1,
s32 imgfxArg2,
s32 imgfxArg3,
s32 imgfxArg4,
s32 imgfxArg5 )

Definition at line 1212 of file sprite.c.

1212 {
1214 SpriteComponent** componentList;
1215 s32 i;
1216
1217 if (sprite->componentList != NULL) {
1218 componentList = sprite->componentList;
1219 i = 0;
1220
1221 while (*componentList != PTR_LIST_END) {
1222 SpriteComponent* comp = *componentList;
1223
1224 if (compIdx == -1 || i == compIdx) {
1225 imgfx_update((u8)comp->imgfxIdx, imgfx, imgfxArg1, imgfxArg2, imgfxArg3, imgfxArg4, imgfxArg5);
1226 if (imgfx != IMGFX_CLEAR) {
1227 comp->imgfxIdx |= SPR_IMGFX_FLAG_10000000;
1228 } else {
1229 comp->imgfxIdx &= ~SPR_IMGFX_FLAG_ALL;
1230 }
1231 }
1232 componentList++;
1233 i++;
1234 }
1235 }
1236}

Referenced by set_npc_imgfx_all().

◆ set_npc_imgfx_all()

void set_npc_imgfx_all ( s32 arg0,
ImgFXType arg1,
s32 arg2,
s32 arg3,
s32 arg4,
s32 arg5,
s32 arg6 )

Definition at line 1238 of file sprite.c.

1238 {
1239 set_npc_imgfx_comp(spriteIdx, -1, imgfxType, imgfxArg1, imgfxArg2, imgfxArg3, imgfxArg4, imgfxArg5);
1240}
void set_npc_imgfx_comp(s32 spriteIdx, s32 compIdx, ImgFXType imgfx, s32 imgfxArg1, s32 imgfxArg2, s32 imgfxArg3, s32 imgfxArg4, s32 imgfxArg5)
Definition sprite.c:1212

Referenced by appendGfx_npc_blur(), btl_delete_actor(), MagikoopaAI_11(), npc_imgfx_update(), npc_update_decoration_charged(), part_glow_off(), part_glow_on(), pause_partners_draw_contents(), pause_spirits_draw_contents(), pause_tutorial_draw_contents(), SentinelAI_Descend(), and SentinelAI_LosePlayerInit().

◆ spr_get_comp_position()

s32 spr_get_comp_position ( s32 spriteIdx,
s32 compListIdx,
s32 * outX,
s32 * outY,
s32 * outZ )

Definition at line 1242 of file sprite.c.

1242 {
1248 u8 animID;
1249 s32 i;
1250
1251 if (sprite->componentList == NULL) {
1252 return -1;
1253 }
1254
1255 animID = sprite->curAnimID;
1256 if (animID != 255) {
1257 animComps = sprite->spriteData->animListStart[animID];
1258 compList = sprite->componentList;
1259 i = 0;
1260 while (*compList != PTR_LIST_END) {
1261 if (i == compListIdx) {
1263 comp = *compList;
1264 *outX = comp->compPos.x + animComp->compOffset.x;
1265 *outY = comp->compPos.y + animComp->compOffset.y;
1266 *outZ = comp->compPos.z + animComp->compOffset.z;
1267 return 0;
1268 }
1269 i++;
1270 compList++;
1271 if (*animComps != PTR_LIST_END) {
1272 animComps++;
1273 }
1274 }
1275 }
1276 return -1;
1277}
Vec3f compPos
Definition sprite.h:50

◆ spr_get_npc_raster_info()

s32 spr_get_npc_raster_info ( SpriteRasterInfo * out,
s32 npcSpriteID,
s32 rasterIndex )

Definition at line 1279 of file sprite.c.

1279 {
1283
1284 if (sprite != NULL) {
1285 paletteOffsetCopy = sprite->palettesOffset;
1286 cache = sprite->rastersOffset[rasterIndex];
1287 out->raster = cache->image;
1288 out->width = cache->width;
1289 out->height = cache->height;
1290 out->defaultPal = paletteOffsetCopy[cache->palette];
1291 return TRUE;
1292 }
1293 return FALSE;
1294}

Referenced by appendGfx_message().

◆ spr_get_npc_palettes()

◆ spr_get_npc_color_variations()

◆ create_shading_palette()

void create_shading_palette ( Matrix4f mtx,
s32 uls,
s32 ult,
s32 lrs,
s32 lrt,
s32 alpha,
s32 otherModeLBits )

Definition at line 66 of file sprite_shading.c.

66 {
70 f32 posX, posY, posZ;
72 f32 Mxz, Myz, Mzz;
82 f32 distSq;
83 f32 dx, dy, dz;
84 f32 dist;
86 f32 qx, qy, qz;
87 f32 wx, wy, wz;
88 f32 ex, ey, ez;
89 f32 Pxz, Pzz;
90 s32 i;
91
92 shadowDirX = 0.0f;
93 shadowDirY = 0.0f;
94 shadowDirZ = 0.0f;
95
96 posX = mtx[3][0];
97 posY = mtx[3][1];
98 posZ = mtx[3][2];
99
100 Mxz = mtx[0][2];
101 Myz = mtx[1][2];
102 Mzz = mtx[2][2];
103
104 commonColorR = 0.0f;
105 commonColorG = 0.0f;
106 commonColorB = 0.0f;
107
108 backColorR = 0.0f;
109 backColorG = 0.0f;
110 backColorB = 0.0f;
111
112 frontColorR = 0.0f;
113 frontColorG = 0.0f;
114 frontColorB = 0.0f;
115
119
120 Pxz = camera->mtxPerspective[0][2];
121 Pzz = camera->mtxPerspective[2][2];
122
123 if ((-Mxz * Pxz + Mzz * Pzz) < 0.0f) {
124 facingDir = 1.0f;
125 } else {
126 facingDir = -1.0f;
127 }
128
129 for (i = 0; i < ARRAY_COUNT(gSpriteShadingProfile->sources); i++) {
131 if (lightSource->flags & LIGHT_SOURCE_ENABLED) {
132 dx = posX - lightSource->pos.x;
133 dy = posY - lightSource->pos.y;
134 dz = posZ - lightSource->pos.z;
135
136 distSq = SQ(dx) + SQ(dy) + SQ(dz);
137
138 if (distSq != 0.0f) {
139 dist = sqrtf(distSq);
140 invDist = 1.0f / dist;
141 } else {
142 dist = 0.0f;
143 invDist = 0.0f;
144 }
145
146 // normalize dx/dy/dz
147 // they now form a normal vector pointing from light source to sprite
148 dx *= invDist;
149 dy *= invDist;
150 dz *= invDist;
151
152 // apply falloff from light source
154 if ((dist == 0.0f) && (lightSource->falloff == 0.0f)) {
155 intensityScale = 1.0f;
156 } else {
157 intensityScale = 1.0f / (dist * lightSource->falloff);
161 }
162 } else if (lightSource->flags & LIGHT_SOURCE_QUADRATIC_FALLOFF) {
163 if ((distSq == 0.0f) && (lightSource->falloff == 0.0f)) {
164 intensityScale = 1.0f;
165 } else {
166 intensityScale = 1.0f / (distSq * lightSource->falloff);
170 }
171 } else {
172 intensityScale = 1.0f;
173 }
174
175 if (intensityScale > 1.0f) {
176 intensityScale = 1.0f;
177 }
178
179 shadowDirX += dx;
180 shadowDirY += dy;
181 shadowDirZ += dz;
182
183 if (facingDir < 0.0f) {
184 ex = Mxz;
185 ey = Myz;
186 ez = -Mzz;
187 } else {
188 ex = -Mxz;
189 ey = Myz;
190 ez = Mzz;
191 }
192 temp_f10 = ex * dx + ey * dy + ez * dz;
193
194 if (facingDir < 0.0f) {
195 wx = Mzz;
196 wy = Myz;
197 wz = Mxz;
198 } else {
199 wx = -Mzz;
200 wy = Myz;
201 wz = -Mxz;
202 }
203 temp_f16 = wx * dx + wy * dy + wz * dz;
204
207 if (temp_f10 > 0.0f) {
211 if (temp_f16 > 0.0f) {
215 } else {
219 }
220 } else {
224 if (temp_f16 > 0.0f) {
228 } else {
232 }
233 }
234 }
235 }
236
237 if (facingDir < 0.0f) {
238 qx = Mzz;
239 qy = Myz;
240 qz = Mxz;
241 } else {
242 qx = -Mzz;
243 qy = Myz;
244 qz = -Mxz;
245 }
246
247 if (qx * shadowDirX + qy * shadowDirY + qz * shadowDirZ > 0.0f) {
249 mtx,
250 uls, ult, lrs, lrt,
251 alpha,
259 );
260 } else {
262 mtx,
263 uls, ult, lrs, lrt,
264 alpha,
272 );
273 }
274}
SpriteShadingLightSource sources[7]
#define sqrtf
@ LIGHT_SOURCE_ENABLED
Definition enums.h:2406
@ LIGHT_SOURCE_QUADRATIC_FALLOFF
Definition enums.h:2408
@ LIGHT_SOURCE_LINEAR_FALLOFF
Definition enums.h:2407
f32 fabsf(f32 f)
#define SQ(x)
Definition macros.h:178
SpriteShadingProfile * gSpriteShadingProfile
void appendGfx_shading_palette(Matrix4f mtx, s32 uls, s32 ult, s32 lrs, s32 lrt, s32 alpha, f32 shadowX, f32 shadowY, f32 shadowZ, s32 shadowR, s32 shadowG, s32 shadowB, s32 highlightR, s32 highlightG, s32 highlightB, s32 ambientPower, s32 otherModeLBits)
s32 gCurrentCameraID
Definition cam_math.c:5

Referenced by imgfx_appendGfx_mesh_anim(), imgfx_appendGfx_mesh_basic(), imgfx_appendGfx_mesh_grid(), and spr_appendGfx_component_flat().

◆ func_801491E4()

void func_801491E4 ( Matrix4f mtx,
s32 arg1,
s32 arg2,
s32 arg3,
s32 arg4,
s32 alpha )

Definition at line 415 of file sprite_shading.c.

415 {
416 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha);
417
418 if (alpha == 255) {
420 } else {
422 }
423}
#define PM_CC_WINDOW_5
Definition macros.h:454
#define PM_CC_02
Definition macros.h:289
Gfx * gMainGfxPos
Definition cam_main.c:14

Referenced by appendGfx_item_entity(), and render_item_entities().

◆ spr_load_sprite()

SpriteAnimData * spr_load_sprite ( s32 idx,
s32 arg1,
s32 arg2 )

Definition at line 69 of file 101b90_len_8f0.c.

69 {
71 s32 base;
72 s32 i;
74 s32* ptr1;
75 IMG_PTR image;
76 s32 count;
77 s32** data;
78 s32** palettes;
79
80 if (isPlayerSprite) {
81 base = SpriteDataHeader[1];
82 } else {
83 base = SpriteDataHeader[2];
84 }
85
86 // read current and next sprite offsets, so we can find the difference
87 nuPiReadRom(base + idx * 4, &spr_asset_entry, sizeof(spr_asset_entry));
88
92
93 ptr1 = (s32*)data;
94 // skip 4 bytes: 'YAY0' signature
95 ptr1++;
96
97 if (useTailAlloc) {
99 } else {
101 }
102 ASSERT_MSG(animData, "out of sprite memory");
103 decode_yay0(data, animData);
104 general_heap_free(data);
105
106 // swizzle raster array
107 data = (s32**)animData->rastersOffset;
108 data = SPR_SWIZZLE(ALIGN4(animData), data);
109 animData->rastersOffset = (SpriteRasterCacheEntry**)data;
110
111 while (TRUE) {
112 ptr1 = *data;
113 if (ptr1 == PTR_LIST_END) {
114 break;
115 }
116 // swizzle each raster cache entry
118 *data++ = ptr1;
119 image = ((SpriteRasterCacheEntry*)ptr1)->image;
120
121 if (!isPlayerSprite) {
122 // swizzle image pointer in the cache entry
123 image = SPR_SWIZZLE(ALIGN4(animData), image);
124 *ptr1 = (s32)image;
125 }
126 }
127
128 if (isPlayerSprite) {
131 // load a range of raster loading desciptors to a buffer and copy contents into PlayerRasterLoadDesc
134 for (i = 0; i < count; i++) {
136 }
137 }
138
139 // swizzle palettes array
140 palettes = SPR_SWIZZLE(ALIGN4(animData), animData->palettesOffset);
141 animData->palettesOffset = (PAL_PTR*)palettes;
142 while (TRUE) {
143 ptr1 = *palettes;
144 if (ptr1 == PTR_LIST_END) {
145 break;
146 }
147 // swizzle each palette pointer
149 *palettes++ = ptr1;
150 }
151
153 return animData;
154}
BSS PlayerRastersHeader PlayerRasterHeader
BSS s32 spr_asset_entry[2]
#define ALIGN4(v)
#define SPR_SWIZZLE(base, offset)
BSS s32 PlayerRasterLoadDescBuffer[101]
HeapNode heap_spriteHead
Definition heaps3.c:4
BSS s32 PlayerSpriteRasterSets[SPR_Peach3+1]
BSS s32 PlayerRasterLoadDescNumLoaded
void spr_swizzle_anim_offsets(s32 arg0, s32 base, void *spriteData)
#define IMG_PTR
#define general_heap_malloc
void * _heap_malloc_tail(HeapNode *head, u32 size)
Definition 43F0.c:151
s32 general_heap_free(void *data)
Definition heap.c:18
void decode_yay0(void *src, void *dst)
#define ALIGN8(val)
Definition macros.h:21

Referenced by spr_load_npc_sprite(), and spr_load_player_sprite().