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

Macros

#define MAX_ITEM_ENTITIES   256
 
#define WD_VAR1   54
 
#define WD_VAR2   30
 
#define WD_VAR3   30
 
#define X_VAR1   20
 
#define HT_VAR1   height
 
#define WD_VAR4   280
 
#define X_PICKUP_ITEM_1   15
 
#define X_PICKUP_ITEM_2   40
 
#define X_PICKUP_THREW   40
 
#define Y_PICKUP_ITEM_1   offsetY
 
#define Y_PICKUP_ITEM_2   offsetY
 
#define Y_PICKUP_THREW   4
 

Functions

void item_entity_update (ItemEntity *)
 
void appendGfx_item_entity (void *)
 
void draw_item_entities (void)
 
void draw_ui_item_entities (void)
 
s32 test_item_player_collision (ItemEntity *)
 
void update_item_entity_collectable (ItemEntity *)
 
void draw_ui_item_entity_collectable (ItemEntity *)
 
void update_item_entity_stationary (ItemEntity *)
 
void draw_ui_item_entity_stationary (ItemEntity *)
 
void update_item_entity_no_pickup (ItemEntity *)
 
void draw_ui_item_entity_no_pickup (ItemEntity *)
 
void func_801363A0 (ItemEntity *)
 
void update_item_entity_pickup (ItemEntity *)
 
void draw_content_pickup_item_header (ItemEntity *item, s32 posX, s32 posY)
 
void draw_content_cant_carry_more (ItemEntity *item, s32 posX, s32 posY)
 
void draw_content_pickup_item_desc (ItemEntity *item, s32 posX, s32 posY)
 
void sparkle_script_init (ItemEntity *item, SparkleScript *script)
 
s32 sparkle_script_step (ItemEntity *item)
 
void sparkle_script_update (ItemEntity *item)
 
void draw_coin_sparkles (ItemEntity *item)
 
ItemEntityget_item_entity (s32 itemEntityIndex)
 
void hide_item_entity (ItemEntity *item)
 
void reveal_item_entity (ItemEntity *item)
 
void clear_item_entity_data (void)
 
void init_item_entity_list (void)
 
void item_entity_load (ItemEntity *item)
 
s32 make_item_entity (s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupDelay, s32 angle, s32 pickupFlagIndex)
 
s32 make_item_entity_nodelay (s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupVar)
 
s32 make_item_entity_delayed (s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupDelay, s32 pickupVar)
 
s32 make_item_entity_at_player (s32 itemID, s32 category, s32 pickupMsgFlags)
 
void update_item_entities (void)
 
void render_item_entities (void)
 
void remove_item_entity_by_reference (ItemEntity *entity)
 
void remove_item_entity_by_index (s32 index)
 
void func_80133A94 (s32 idx, s32 itemID)
 
s32 test_item_entity_position (f32 x, f32 y, f32 z, f32 dist)
 
void set_item_entity_flags (s32 index, s32 flags)
 
void clear_item_entity_flags (s32 index, s32 flags)
 
void auto_collect_item_entity (s32 index)
 
b32 is_picking_up_item (void)
 
void set_item_entity_position (s32 itemEntityIndex, f32 x, f32 y, f32 z)
 
void set_current_item_entity_render_group (s32 group)
 
s32 get_current_item_entity_render_group (void)
 

Variables

SparkleScript SparkleScript_Coin
 
Gfx Gfx_RM1_ALPHATEST []
 
Gfx Gfx_RM2_ALPHATEST []
 
Lights1 ItemEntityLights = gdSPDefLights1(255, 255, 255, 0, 0, 0, 0, 0, 0)
 
HudCacheEntrygHudElementCacheTableRaster
 
HudCacheEntrygHudElementCacheTablePalette
 
u8 * gHudElementCacheBuffer
 
s32 * gHudElementCacheSize
 
s32 ItemEntitiesCreated
 
BSS s32 UnusedItemPhysicsScriptID
 
BSS s32 ItemEntityAlternatingSpawn
 
BSS s32 ItemEntityRenderGroup
 
BSS s16 CoinSparkleCenterX
 
BSS s16 CoinSparkleCenterY
 
BSS s16 CoinSparkleCenterZ
 
BSS s32 pad_ItemEntity [3]
 
BSS ItemEntityWorldItemEntities [256]
 
BSS ItemEntityBattleItemEntities [256]
 
BSS ItemEntity ** gCurrentItemEntities
 
BSS s16 isPickingUpItem
 
BSS s16 ItemSpawnWithinPlayerPickupDelay
 
BSS s16 D_801565A8
 
BSS s32 D_801565AC
 
BSS PopupMenu ItemPickupMenu
 
BSS HudElemID ItemPickupIconHID
 
BSS s32 ItemPickupStateDelay
 
BSS s32 ThrowAwayMenuIdx
 
BSS s32 ThrowAwayItemID
 
BSS EffectInstanceItemPickupGotOutline
 
BSS MessagePrintStateGotItemTutorialPrinter
 
BSS b32 GotItemTutorialClosed
 
Vtx D_8014C5A0 [4]
 
Vtx D_8014C5E0 [4]
 
Gfx D_8014C620 []
 
Gfx D_8014C678 []
 
Gfx D_8014C6A0 []
 
s16 PickupHeaderWindowHeight [] = { 32, 40 }
 
s16 PickupMessageWindowYOffsets [] = { 8, 4 }
 
s32 * gItemEntityScripts []
 

Macro Definition Documentation

◆ HT_VAR1

#define HT_VAR1   height

Referenced by func_801363A0().

◆ MAX_ITEM_ENTITIES

◆ WD_VAR1

#define WD_VAR1   54

Referenced by func_801363A0().

◆ WD_VAR2

#define WD_VAR2   30

Referenced by func_801363A0().

◆ WD_VAR3

#define WD_VAR3   30

Referenced by func_801363A0().

◆ WD_VAR4

#define WD_VAR4   280

Referenced by func_801363A0().

◆ X_PICKUP_ITEM_1

#define X_PICKUP_ITEM_1   15

◆ X_PICKUP_ITEM_2

#define X_PICKUP_ITEM_2   40

◆ X_PICKUP_THREW

#define X_PICKUP_THREW   40

◆ X_VAR1

#define X_VAR1   20

Referenced by func_801363A0().

◆ Y_PICKUP_ITEM_1

#define Y_PICKUP_ITEM_1   offsetY

◆ Y_PICKUP_ITEM_2

#define Y_PICKUP_ITEM_2   offsetY

◆ Y_PICKUP_THREW

#define Y_PICKUP_THREW   4

Function Documentation

◆ appendGfx_item_entity()

void appendGfx_item_entity ( void * data)

Referenced by draw_item_entities().

◆ auto_collect_item_entity()

void auto_collect_item_entity ( s32 index)

◆ clear_item_entity_data()

◆ clear_item_entity_flags()

void clear_item_entity_flags ( s32 index,
s32 flags )

◆ draw_coin_sparkles()

void draw_coin_sparkles ( ItemEntity * item)

Referenced by appendGfx_item_entity().

◆ draw_content_cant_carry_more()

void draw_content_cant_carry_more ( ItemEntity * item,
s32 posX,
s32 posY )

Referenced by func_801363A0().

◆ draw_content_pickup_item_desc()

void draw_content_pickup_item_desc ( ItemEntity * item,
s32 posX,
s32 posY )

Referenced by func_801363A0().

◆ draw_content_pickup_item_header()

void draw_content_pickup_item_header ( ItemEntity * item,
s32 posX,
s32 posY )

Referenced by func_801363A0().

◆ draw_item_entities()

void draw_item_entities ( void )

Referenced by clear_item_entity_data().

◆ draw_ui_item_entities()

void draw_ui_item_entities ( void )

Referenced by clear_item_entity_data().

◆ draw_ui_item_entity_collectable()

void draw_ui_item_entity_collectable ( ItemEntity * item)

Referenced by draw_ui_item_entities().

◆ draw_ui_item_entity_no_pickup()

void draw_ui_item_entity_no_pickup ( ItemEntity * item)

Referenced by draw_ui_item_entities().

◆ draw_ui_item_entity_stationary()

void draw_ui_item_entity_stationary ( ItemEntity * item)

Referenced by draw_ui_item_entities().

◆ func_80133A94()

void func_80133A94 ( s32 idx,
s32 itemID )

◆ func_801363A0()

void func_801363A0 ( ItemEntity * item)

◆ get_current_item_entity_render_group()

s32 get_current_item_entity_render_group ( void )

◆ get_item_entity()

◆ hide_item_entity()

void hide_item_entity ( ItemEntity * item)

◆ init_item_entity_list()

void init_item_entity_list ( void )

◆ is_picking_up_item()

◆ item_entity_load()

void item_entity_load ( ItemEntity * item)

◆ item_entity_update()

void item_entity_update ( ItemEntity * entity)

◆ make_item_entity()

s32 make_item_entity ( s32 itemID,
f32 x,
f32 y,
f32 z,
s32 itemSpawnMode,
s32 pickupDelay,
s32 angle,
s32 pickupFlagIndex )

◆ make_item_entity_at_player()

s32 make_item_entity_at_player ( s32 itemID,
s32 category,
s32 pickupMsgFlags )

◆ make_item_entity_delayed()

s32 make_item_entity_delayed ( s32 itemID,
f32 x,
f32 y,
f32 z,
s32 itemSpawnMode,
s32 pickupDelay,
s32 pickupVar )

◆ make_item_entity_nodelay()

s32 make_item_entity_nodelay ( s32 itemID,
f32 x,
f32 y,
f32 z,
s32 itemSpawnMode,
s32 pickupVar )

◆ remove_item_entity_by_index()

void remove_item_entity_by_index ( s32 index)

◆ remove_item_entity_by_reference()

void remove_item_entity_by_reference ( ItemEntity * entity)

◆ render_item_entities()

void render_item_entities ( void )

Referenced by render_frame().

◆ reveal_item_entity()

void reveal_item_entity ( ItemEntity * item)

◆ set_current_item_entity_render_group()

void set_current_item_entity_render_group ( s32 group)

◆ set_item_entity_flags()

void set_item_entity_flags ( s32 index,
s32 flags )

◆ set_item_entity_position()

void set_item_entity_position ( s32 itemEntityIndex,
f32 x,
f32 y,
f32 z )

Referenced by entity_GiantChest_open().

◆ sparkle_script_init()

void sparkle_script_init ( ItemEntity * item,
SparkleScript * script )

◆ sparkle_script_step()

s32 sparkle_script_step ( ItemEntity * item)

Referenced by sparkle_script_update().

◆ sparkle_script_update()

void sparkle_script_update ( ItemEntity * item)

◆ test_item_entity_position()

s32 test_item_entity_position ( f32 x,
f32 y,
f32 z,
f32 dist )

◆ test_item_player_collision()

b32 test_item_player_collision ( ItemEntity * item)

◆ update_item_entities()

void update_item_entities ( void )

◆ update_item_entity_collectable()

void update_item_entity_collectable ( ItemEntity * item)

Referenced by update_item_entities().

◆ update_item_entity_no_pickup()

void update_item_entity_no_pickup ( ItemEntity * item)

Referenced by update_item_entities().

◆ update_item_entity_pickup()

void update_item_entity_pickup ( ItemEntity * item)

Referenced by update_item_entities().

◆ update_item_entity_stationary()

void update_item_entity_stationary ( ItemEntity * item)

Referenced by update_item_entities().

Variable Documentation

◆ BattleItemEntities

BSS ItemEntity* BattleItemEntities[256]

◆ CoinSparkleCenterX

BSS s16 CoinSparkleCenterX

◆ CoinSparkleCenterY

BSS s16 CoinSparkleCenterY

◆ CoinSparkleCenterZ

BSS s16 CoinSparkleCenterZ

◆ D_8014C5A0

Vtx D_8014C5A0[4]
Initial value:
= {
{{{ -12, 0, 0 }, 0, { 0x2300, 0x2300 }, { 0, 0, 0, 255 }}},
{{{ 11, 0, 0 }, 0, { 0x2000, 0x2300 }, { 0, 0, 0, 255 }}},
{{{ 11, 23, 0 }, 0, { 0x2000, 0x2000 }, { 0, 0, 0, 255 }}},
{{{ -12, 23, 0 }, 0, { 0x2300, 0x2000 }, { 0, 0, 0, 255 }}},
}

◆ D_8014C5E0

Vtx D_8014C5E0[4]
Initial value:
= {
{{{ -16, 0, 0 }, 0, { 0x2400, 0x2400 }, { 0, 0, 0, 255 }}},
{{{ 15, 0, 0 }, 0, { 0x2000, 0x2400 }, { 0, 0, 0, 255 }}},
{{{ 15, 31, 0 }, 0, { 0x2000, 0x2000 }, { 0, 0, 0, 255 }}},
{{{ -16, 31, 0 }, 0, { 0x2400, 0x2000 }, { 0, 0, 0, 255 }}},
}

◆ D_8014C620

Gfx D_8014C620[]
Initial value:
= {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTexturePersp(G_TP_PERSP),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_BILERP),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsSPEndDisplayList(),
}

Referenced by appendGfx_item_entity(), and render_item_entities().

◆ D_8014C678

Gfx D_8014C678[]
Initial value:
= {
gsSPClearGeometryMode(G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(D_8014C5A0, 4, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
}
Vtx D_8014C5A0[4]
Definition item_entity.c:72

Referenced by appendGfx_item_entity(), and render_item_entities().

◆ D_8014C6A0

Gfx D_8014C6A0[]
Initial value:
= {
gsSPClearGeometryMode(G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPVertex(D_8014C5E0, 4, 0),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
}
Vtx D_8014C5E0[4]
Definition item_entity.c:79

Referenced by appendGfx_item_entity(), and render_item_entities().

◆ D_801565A8

◆ D_801565AC

BSS s32 D_801565AC

◆ gCurrentItemEntities

◆ Gfx_RM1_ALPHATEST

Gfx Gfx_RM1_ALPHATEST[]
extern

◆ Gfx_RM2_ALPHATEST

Gfx Gfx_RM2_ALPHATEST
extern
Initial value:
= {
gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCycleType(G_CYC_2CYCLE),
gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
}

Referenced by appendGfx_item_entity(), and render_item_entities().

◆ gHudElementCacheBuffer

◆ gHudElementCacheSize

◆ gHudElementCacheTablePalette

◆ gHudElementCacheTableRaster

◆ gItemEntityScripts

s32* gItemEntityScripts[]
extern

Referenced by item_entity_load().

◆ GotItemTutorialClosed

BSS b32 GotItemTutorialClosed

◆ GotItemTutorialPrinter

BSS MessagePrintState* GotItemTutorialPrinter

◆ isPickingUpItem

◆ ItemEntitiesCreated

◆ ItemEntityAlternatingSpawn

◆ ItemEntityLights

Lights1 ItemEntityLights = gdSPDefLights1(255, 255, 255, 0, 0, 0, 0, 0, 0)

Referenced by draw_coin_sparkles().

◆ ItemEntityRenderGroup

◆ ItemPickupGotOutline

BSS EffectInstance* ItemPickupGotOutline

◆ ItemPickupIconHID

◆ ItemPickupMenu

BSS PopupMenu ItemPickupMenu

◆ ItemPickupStateDelay

BSS s32 ItemPickupStateDelay

◆ ItemSpawnWithinPlayerPickupDelay

BSS s16 ItemSpawnWithinPlayerPickupDelay

◆ pad_ItemEntity

BSS s32 pad_ItemEntity[3]

◆ PickupHeaderWindowHeight

s16 PickupHeaderWindowHeight[] = { 32, 40 }

Referenced by func_801363A0().

◆ PickupMessageWindowYOffsets

s16 PickupMessageWindowYOffsets[] = { 8, 4 }

◆ SparkleScript_Coin

◆ ThrowAwayItemID

◆ ThrowAwayMenuIdx

BSS s32 ThrowAwayMenuIdx

◆ UnusedItemPhysicsScriptID

BSS s32 UnusedItemPhysicsScriptID

◆ WorldItemEntities

BSS ItemEntity* WorldItemEntities[256]