papermario
Decompilation of Paper Mario
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Loading...
Searching...
No Matches
imgfx.c File Reference

Data Structures

union  ImgFXIntVars
 
union  ImgFXFloatVars
 
struct  ImgFXState
 
struct  ImgFXCacheEntry
 
struct  ImgFXRenderMode
 
struct  ImgFXIntVars.args
 
struct  ImgFXIntVars.anim
 
struct  ImgFXIntVars.wavy
 
struct  ImgFXIntVars.color
 
struct  ImgFXIntVars.hologram
 
struct  ImgFXIntVars.overlay
 
struct  ImgFXFloatVars.anim
 
struct  ImgFXFloatVars.wavy
 
struct  ImgFXFloatVars.overlay
 

Typedefs

typedef ImgFXState ImgFXInstanceList[MAX_IMGFX_INSTANCES]
 

Enumerations

enum  ImgFXAnimFlags { IMGFX_ANIM_FLAG_ABSOLUTE_COORDS = 1 }
 

Functions

void imgfx_cache_instance_data (ImgFXState *state)
 
void imgfx_clear_instance_data (ImgFXState *state)
 
void imgfx_init_instance (ImgFXState *state)
 
void imgfx_make_mesh (ImgFXState *state)
 
void imgfx_appendGfx_mesh (ImgFXState *state, Matrix4f mtx)
 
void imgfx_mesh_make_strip (ImgFXState *state)
 
void imgfx_mesh_make_grid (ImgFXState *state)
 
void imgfx_mesh_anim_update (ImgFXState *state)
 
void imgfx_appendGfx_mesh_basic (ImgFXState *, Matrix4f mtx)
 
void imgfx_appendGfx_mesh_grid (ImgFXState *, Matrix4f mtx)
 
void imgfx_appendGfx_mesh_anim (ImgFXState *, Matrix4f mtx)
 
void imgfx_appendGfx_mesh_strip (ImgFXState *, Matrix4f mtx)
 
void imgfx_wavy_init (ImgFXState *state)
 
void imgfx_mesh_make_wavy (ImgFXState *state)
 
void imgfx_mesh_load_colors (ImgFXState *state)
 
void imgfx_set_vtx_buf_capacity (s16 arg0)
 
void imgfx_init (void)
 
void func_8013A4D0 (void)
 
void imgfx_add_to_cache (void *data, s8 usingContextualHeap)
 
void imgfx_update_cache_impl (void)
 
void imgfx_update_cache (void)
 
s32 imgfx_get_free_instances (s32 count)
 
void imgfx_release_instance (u32 idx)
 
void imgfx_release_instance_chain (u32 idx)
 
s32 imgfx_get_next_instance (s32 idx)
 
ImgFXStateimgfx_get_instance (s32 idx)
 
void imgfx_update (u32 idx, ImgFXType type, s32 imgfxArg1, s32 imgfxArg2, s32 imgfxArg3, s32 imgfxArg4, s32 flags)
 
void imgfx_set_state_flags (s32 idx, u16 flagBits, s32 mode)
 
s32 imgfx_appendGfx_component (s32 idx, ImgFXTexture *ifxImg, u32 flagBits, Matrix4f mtx)
 
ImgFXAnimHeaderimgfx_load_anim (ImgFXState *state)
 

Variables

HeapNode heap_spriteHead
 
BSS ImgFXWorkingTexture ImgFXCurrentTexture
 
BSS Vtx * ImgFXVtxBuffers [2]
 
BSS Vtx * imgfx_vtxBuf
 
BSS ImgFXInstanceListImgFXInstances
 
BSS s8 D_80156958 [2]
 
BSS s32 D_8015695C
 
BSS s32 D_80156960 [2]
 
BSS s32 D_80156968 [2]
 
BSS s8 D_80156970
 
BSS s32 D_80156974 [3]
 
BSS ImgFXAnimHeader ImgFXAnimHeaders [MAX_IMGFX_INSTANCES]
 
BSS ImgFXCacheEntry ImgFXDataCache [8]
 
ImgFXWorkingTextureImgFXCurrentTexturePtr = &ImgFXCurrentTexture
 
u16 imgfx_vtxCount = 0
 
Lights2 ImgFXLights = gdSPDefLights2(144, 144, 144, 255, 255, 255, 0, 0, 120, 255, 255, 255, 0, 0, 136)
 
Vp D_8014EE40
 
Vp D_8014EE50
 
u16 ImgFXVtxBufferCapacity = 300
 
Gfx DefaultImgFXSetupGfx []
 
ImgFXRenderMode ImgFXRenderModes []
 
Addr shock_header
 
Addr shiver_header
 
Addr vertical_pipe_curl_header
 
Addr horizontal_pipe_curl_header
 
Addr startle_header
 
Addr flutter_down_header
 
Addr unfurl_header
 
Addr get_in_bed_header
 
Addr spirit_capture_header
 
Addr unused_1_header
 
Addr unused_2_header
 
Addr unused_3_header
 
Addr tutankoopa_gather_header
 
Addr tutankoopa_swirl_2_header
 
Addr tutankoopa_swirl_1_header
 
Addr shuffle_cards_header
 
Addr flip_card_1_header
 
Addr flip_card_2_header
 
Addr flip_card_3_header
 
Addr cymbal_crush_header
 
u8 * ImgFXAnimOffsets []
 

Data Structure Documentation

◆ ImgFXIntVars

union ImgFXIntVars
Data Fields
struct ImgFXIntVars.anim anim
struct ImgFXIntVars.args args
struct ImgFXIntVars.color color
struct ImgFXIntVars.hologram hologram
struct ImgFXIntVars.overlay overlay
s32 raw[2][4]
struct ImgFXIntVars.wavy wavy

◆ ImgFXFloatVars

union ImgFXFloatVars
Data Fields
struct ImgFXFloatVars.anim anim
struct ImgFXFloatVars.overlay overlay
f32 raw[2][4]
struct ImgFXFloatVars.wavy wavy

◆ ImgFXState

struct ImgFXState
Data Fields
u8 arrayIdx
Color_RGBA8 * colorBuf
u16 colorBufCount
u8 * curAnimOffset
u16 firstVtxIdx
s32 flags
ImgFXFloatVars floats
Gfx * gfxBufs[2]
ImgFXIntVars ints
s8 lastAnimCmd
s8 lastColorCmd
u16 lastVtxIdx
u8 meshType
s16 nextIdx
s32 otherModeL
u8 renderType
u8 subdivX
u8 subdivY
char unk_07[0x1]
u16 unk_0C
s16 unk_0E
char unk_18[0x4]
char unk_62[0x2]
Vtx * vtxBufs[2]

◆ ImgFXCacheEntry

struct ImgFXCacheEntry
Data Fields
s32 * data
u8 staleCooldownTimer
char unk_06[0x2]
u8 usingContextualHeap

◆ ImgFXRenderMode

struct ImgFXRenderMode
Data Fields
u8 flags
s32 mode1
s32 mode2

◆ ImgFXIntVars.args

struct ImgFXIntVars.args
Data Fields
s32 anim[4]
s32 color[4]

◆ ImgFXIntVars.anim

struct ImgFXIntVars.anim
Data Fields
s32 interval
s32 step
s32 type

◆ ImgFXIntVars.wavy

struct ImgFXIntVars.wavy
Data Fields
Vec3i mag

◆ ImgFXIntVars.color

struct ImgFXIntVars.color
Data Fields
s32 a
s32 b
s32 g
s32 r
char unk_00[0x10]

◆ ImgFXIntVars.hologram

struct ImgFXIntVars.hologram
Data Fields
s32 alphaAmt
s32 mode
s32 noiseAmt
char unk_00[0x10]
char unk_18[4]

◆ ImgFXIntVars.overlay

struct ImgFXIntVars.overlay
Data Fields
s32 alpha
ImgFXOverlayTexture * pattern
char unk_00[0x10]

◆ ImgFXFloatVars.anim

struct ImgFXFloatVars.anim
Data Fields
f32 curFrame
f32 curIdx

◆ ImgFXFloatVars.wavy

struct ImgFXFloatVars.wavy
Data Fields
f32 phase1
f32 phase2
f32 phase3

◆ ImgFXFloatVars.overlay

struct ImgFXFloatVars.overlay
Data Fields
f32 posX
f32 posY
char unk_00[0x10]

Typedef Documentation

◆ ImgFXInstanceList

typedef ImgFXState ImgFXInstanceList[MAX_IMGFX_INSTANCES]

Enumeration Type Documentation

◆ ImgFXAnimFlags

Enumerator
IMGFX_ANIM_FLAG_ABSOLUTE_COORDS 

Function Documentation

◆ func_8013A4D0()

void func_8013A4D0 ( void )

◆ imgfx_add_to_cache()

void imgfx_add_to_cache ( void * data,
s8 usingContextualHeap )

◆ imgfx_appendGfx_component()

◆ imgfx_appendGfx_mesh()

void imgfx_appendGfx_mesh ( ImgFXState * state,
Matrix4f mtx )

◆ imgfx_appendGfx_mesh_anim()

void imgfx_appendGfx_mesh_anim ( ImgFXState * state,
Matrix4f mtx )

Referenced by imgfx_appendGfx_mesh().

◆ imgfx_appendGfx_mesh_basic()

void imgfx_appendGfx_mesh_basic ( ImgFXState * state,
Matrix4f mtx )

Referenced by imgfx_appendGfx_mesh().

◆ imgfx_appendGfx_mesh_grid()

void imgfx_appendGfx_mesh_grid ( ImgFXState * state,
Matrix4f mtx )

Referenced by imgfx_appendGfx_mesh().

◆ imgfx_appendGfx_mesh_strip()

void imgfx_appendGfx_mesh_strip ( ImgFXState * state,
Matrix4f mtx )

Referenced by imgfx_appendGfx_mesh().

◆ imgfx_cache_instance_data()

void imgfx_cache_instance_data ( ImgFXState * state)

◆ imgfx_clear_instance_data()

void imgfx_clear_instance_data ( ImgFXState * state)

Referenced by imgfx_init().

◆ imgfx_get_free_instances()

s32 imgfx_get_free_instances ( s32 count)

◆ imgfx_get_instance()

ImgFXState * imgfx_get_instance ( s32 idx)

◆ imgfx_get_next_instance()

s32 imgfx_get_next_instance ( s32 idx)

◆ imgfx_init()

void imgfx_init ( void )

Referenced by spr_init_sprites().

◆ imgfx_init_instance()

void imgfx_init_instance ( ImgFXState * state)

◆ imgfx_load_anim()

ImgFXAnimHeader * imgfx_load_anim ( ImgFXState * state)

Referenced by imgfx_mesh_anim_update().

◆ imgfx_make_mesh()

void imgfx_make_mesh ( ImgFXState * state)

◆ imgfx_mesh_anim_update()

void imgfx_mesh_anim_update ( ImgFXState * state)

Referenced by imgfx_make_mesh().

◆ imgfx_mesh_load_colors()

void imgfx_mesh_load_colors ( ImgFXState * state)

Referenced by imgfx_make_mesh().

◆ imgfx_mesh_make_grid()

void imgfx_mesh_make_grid ( ImgFXState * state)

Referenced by imgfx_make_mesh().

◆ imgfx_mesh_make_strip()

void imgfx_mesh_make_strip ( ImgFXState * state)

Referenced by imgfx_make_mesh().

◆ imgfx_mesh_make_wavy()

void imgfx_mesh_make_wavy ( ImgFXState * state)
Bug
? should be sin_deg?

Referenced by imgfx_make_mesh().

◆ imgfx_release_instance()

void imgfx_release_instance ( u32 idx)

◆ imgfx_release_instance_chain()

void imgfx_release_instance_chain ( u32 idx)

◆ imgfx_set_state_flags()

void imgfx_set_state_flags ( s32 idx,
u16 flagBits,
s32 mode )

◆ imgfx_set_vtx_buf_capacity()

void imgfx_set_vtx_buf_capacity ( s16 arg0)

◆ imgfx_update()

◆ imgfx_update_cache()

void imgfx_update_cache ( void )

Referenced by state_drawUI_world().

◆ imgfx_update_cache_impl()

void imgfx_update_cache_impl ( void )

Referenced by imgfx_update_cache().

◆ imgfx_wavy_init()

void imgfx_wavy_init ( ImgFXState * state)

Referenced by imgfx_update().

Variable Documentation

◆ cymbal_crush_header

Addr cymbal_crush_header
extern

◆ D_8014EE40

Vp D_8014EE40
Initial value:
= {
.vp = {
.vscale = { 640, 480, 511, 0 },
.vtrans = { 640, 480, 511, 0 },
}
}

Referenced by imgfx_appendGfx_mesh_basic().

◆ D_8014EE50

Vp D_8014EE50
Initial value:
= {
.vp = {
.vscale = { 640, 480, 511, 0 },
.vtrans = { 640, 480, 512, 0 },
}
}

Referenced by imgfx_appendGfx_mesh_basic().

◆ D_80156958

BSS s8 D_80156958[2]

Referenced by imgfx_init().

◆ D_8015695C

BSS s32 D_8015695C

◆ D_80156960

BSS s32 D_80156960[2]

Referenced by imgfx_init().

◆ D_80156968

BSS s32 D_80156968[2]

Referenced by imgfx_init().

◆ D_80156970

BSS s8 D_80156970

Referenced by imgfx_init().

◆ D_80156974

BSS s32 D_80156974[3]

◆ DefaultImgFXSetupGfx

Gfx DefaultImgFXSetupGfx[]
Initial value:
= {
gsSPClearGeometryMode(G_CULL_BOTH | G_LIGHTING),
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
gsSPTexture(-1, -1, 0, G_TX_RENDERTILE, G_ON),
gsDPSetAlphaCompare(G_AC_NONE),
gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 18,
G_AD_DISABLE | G_CD_DISABLE | G_TC_FILT | G_TF_BILERP | G_TP_PERSP),
gsSPEndDisplayList(),
}

Referenced by imgfx_appendGfx_mesh().

◆ flip_card_1_header

Addr flip_card_1_header
extern

◆ flip_card_2_header

Addr flip_card_2_header
extern

◆ flip_card_3_header

Addr flip_card_3_header
extern

◆ flutter_down_header

Addr flutter_down_header
extern

◆ get_in_bed_header

Addr get_in_bed_header
extern

◆ heap_spriteHead

HeapNode heap_spriteHead
extern

Referenced by imgfx_init().

◆ horizontal_pipe_curl_header

Addr horizontal_pipe_curl_header
extern

◆ imgfx_vtxBuf

◆ imgfx_vtxCount

u16 imgfx_vtxCount = 0

◆ ImgFXAnimHeaders

Referenced by imgfx_load_anim().

◆ ImgFXAnimOffsets

u8* ImgFXAnimOffsets[]
Initial value:
= {
}
@ IMGFX_ANIM_VERTICAL_PIPE_CURL
Definition enums.h:5140
@ IMGFX_ANIM_HORIZONTAL_PIPE_CURL
Definition enums.h:5141
@ IMGFX_ANIM_SHIVER
Definition enums.h:5139
@ IMGFX_ANIM_FLIP_CARD_1
Definition enums.h:5154
@ IMGFX_ANIM_FLUTTER_DOWN
Definition enums.h:5143
@ IMGFX_ANIM_SHUFFLE_CARDS
Definition enums.h:5153
@ IMGFX_ANIM_STARTLE
Definition enums.h:5142
@ IMGFX_ANIM_SPIRIT_CAPTURE
Definition enums.h:5146
@ IMGFX_ANIM_UNUSED_2
Definition enums.h:5148
@ IMGFX_ANIM_FLIP_CARD_2
Definition enums.h:5155
@ IMGFX_ANIM_UNUSED_1
Definition enums.h:5147
@ IMGFX_ANIM_TUTANKOOPA_SWIRL_1
Definition enums.h:5152
@ IMGFX_ANIM_FLIP_CARD_3
Definition enums.h:5156
@ IMGFX_ANIM_TUTANKOOPA_SWIRL_2
Definition enums.h:5151
@ IMGFX_ANIM_UNFURL
Definition enums.h:5144
@ IMGFX_ANIM_CYMBAL_CRUSH
Definition enums.h:5157
@ IMGFX_ANIM_SHOCK
Definition enums.h:5138
@ IMGFX_ANIM_TUTANKOOPA_GATHER
Definition enums.h:5150
@ IMGFX_ANIM_UNUSED_3
Definition enums.h:5149
@ IMGFX_ANIM_GET_IN_BED
Definition enums.h:5145
Addr startle_header
Addr unfurl_header
Addr vertical_pipe_curl_header
Addr shuffle_cards_header
Addr unused_2_header
Addr flip_card_2_header
Addr horizontal_pipe_curl_header
Addr flip_card_1_header
Addr shiver_header
Addr tutankoopa_gather_header
Addr unused_3_header
Addr get_in_bed_header
Addr unused_1_header
Addr flutter_down_header
Addr flip_card_3_header
Addr tutankoopa_swirl_2_header
Addr shock_header
Addr cymbal_crush_header
Addr tutankoopa_swirl_1_header
Addr spirit_capture_header

Referenced by imgfx_load_anim().

◆ ImgFXCurrentTexture

BSS ImgFXWorkingTexture ImgFXCurrentTexture

◆ ImgFXCurrentTexturePtr

◆ ImgFXDataCache

◆ ImgFXInstances

◆ ImgFXLights

Lights2 ImgFXLights = gdSPDefLights2(144, 144, 144, 255, 255, 255, 0, 0, 120, 255, 255, 255, 0, 0, 136)

Referenced by imgfx_appendGfx_mesh().

◆ ImgFXRenderModes

ImgFXRenderMode ImgFXRenderModes[]
Initial value:
= {
[IMGFX_RENDER_DEFAULT] { 0x00441208, 0x00111208, 0 },
[IMGFX_RENDER_MULTIPLY_RGB] { 0x00441208, 0x00111208, 0 },
[IMGFX_RENDER_MODULATE_PRIM_RGB] { 0x00441208, 0x00111208, 0 },
[IMGFX_RENDER_MULTIPLY_SHADE_RGB] { 0x00441208, 0x00111208, 0 },
[IMGFX_RENDER_MODULATE_SHADE_RGB] { 0x00441208, 0x00111208, 0 },
[IMGFX_RENDER_ANIM] { 0x00441208, 0x00111208, 0 },
[IMGFX_RENDER_HOLOGRAM] { 0x00404B40, 0x00104B40, IMGFX_RENDER_NO_OVERRIDE },
[IMGFX_RENDER_COLOR_FILL] { 0x00441208, 0x00111208, 0 },
[IMGFX_RENDER_OVERLAY_RGB] { 0x00441208, 0x00111208, 0 },
[IMGFX_RENDER_OVERLAY_RGBA] { 0x00404B40, 0x00104B40, IMGFX_RENDER_NO_OVERRIDE },
[IMGFX_RENDER_UNUSED] { 0x00441208, 0x00111208, 0 },
}
@ IMGFX_RENDER_MULTIPLY_RGBA
Definition enums.h:5164
@ IMGFX_RENDER_MULTIPLY_SHADE_ALPHA
Definition enums.h:5168
@ IMGFX_RENDER_HOLOGRAM
Definition enums.h:5173
@ IMGFX_RENDER_MULTIPLY_SHADE_RGB
Definition enums.h:5167
@ IMGFX_RENDER_OVERLAY_RGBA
Definition enums.h:5176
@ IMGFX_RENDER_MODULATE_PRIM_RGBA
Definition enums.h:5166
@ IMGFX_RENDER_MULTIPLY_RGB
Definition enums.h:5162
@ IMGFX_RENDER_ANIM
Definition enums.h:5172
@ IMGFX_RENDER_DEFAULT
Definition enums.h:5161
@ IMGFX_RENDER_MULTIPLY_SHADE_RGBA
Definition enums.h:5169
@ IMGFX_RENDER_OVERLAY_RGB
Definition enums.h:5175
@ IMGFX_RENDER_MODULATE_PRIM_RGB
Definition enums.h:5165
@ IMGFX_RENDER_MULTIPLY_ALPHA
Definition enums.h:5163
@ IMGFX_RENDER_MODULATE_SHADE_RGB
Definition enums.h:5170
@ IMGFX_RENDER_MODULATE_SHADE_RGBA
Definition enums.h:5171
@ IMGFX_RENDER_COLOR_FILL
Definition enums.h:5174
@ IMGFX_RENDER_UNUSED
Definition enums.h:5177
@ IMGFX_RENDER_NO_OVERRIDE
Definition enums.h:5181

Referenced by imgfx_appendGfx_mesh().

◆ ImgFXVtxBufferCapacity

u16 ImgFXVtxBufferCapacity = 300

◆ ImgFXVtxBuffers

BSS Vtx* ImgFXVtxBuffers[2]

Referenced by func_8013A4D0(), and imgfx_init().

◆ shiver_header

Addr shiver_header
extern

◆ shock_header

Addr shock_header
extern

◆ shuffle_cards_header

Addr shuffle_cards_header
extern

◆ spirit_capture_header

Addr spirit_capture_header
extern

◆ startle_header

Addr startle_header
extern

◆ tutankoopa_gather_header

Addr tutankoopa_gather_header
extern

◆ tutankoopa_swirl_1_header

Addr tutankoopa_swirl_1_header
extern

◆ tutankoopa_swirl_2_header

Addr tutankoopa_swirl_2_header
extern

◆ unfurl_header

Addr unfurl_header
extern

◆ unused_1_header

Addr unused_1_header
extern

◆ unused_2_header

Addr unused_2_header
extern

◆ unused_3_header

Addr unused_3_header
extern

◆ vertical_pipe_curl_header

Addr vertical_pipe_curl_header
extern