forked from PhlexPlexico/mm3dr
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring in rough chest content matching for future purposes.
- Loading branch information
1 parent
b689f62
commit 7268f7f
Showing
9 changed files
with
186 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#ifndef _GAME_ACTORS_CHEST_H | ||
#define _GAME_ACTORS_CHEST_H | ||
|
||
#include "game/actor.h" | ||
#include "game/as.h" | ||
#include "game/collision.h" | ||
#include "game/skelanime.h" | ||
#include "rnd/item_override.h" | ||
|
||
namespace game::actors { | ||
enum class EnBoxType : u8 { | ||
ENBOX_TYPE_BIG = 0, // E.g. Hookshot Chest | ||
ENBOX_TYPE_BIG_ROOM_CLEAR = 1, | ||
ENBOX_TYPE_BIG_ORNATE = 2, // E.g. Boss Key Chests | ||
ENBOX_TYPE_BIG_SWITCH_FLAG_FALL = 3, | ||
ENBOX_TYPE_BIG_INVISIBLE = 4, | ||
ENBOX_TYPE_SMALL = 5, | ||
ENBOX_TYPE_SMALL_INVISIBLE = 6, | ||
ENBOX_TYPE_SMALL_ROOM_CLEAR = 7, | ||
ENBOX_TYPE_SMALL_SWITCH_FLAG_FALL = 8, | ||
ENBOX_TYPE_BIG_SONG_ZELDAS_LULLABY = 9, | ||
ENBOX_TYPE_BIG_SONG_SUNS = 10, | ||
ENBOX_TYPE_BIG_SWITCH_FLAG = 11, | ||
ENBOX_TYPE_SMALL_SWITCH_FLAG = 12 | ||
}; | ||
|
||
struct En_Box { | ||
game::act::DynaPolyActor dyna; | ||
SkelAnime* skel_anime; | ||
u8 gap_210[52]; | ||
CollisionInfoCylinder* collision_cylinder; | ||
u8 gap_248[84]; | ||
int field_29C; | ||
u8 gap_2A0[8]; | ||
void* some_fn; | ||
u8 gap_2AC[312]; | ||
u16 some_item_check; | ||
u8 movement_flags; | ||
u8 alpha; | ||
u8 switch_flag; | ||
EnBoxType chest_type; | ||
u8 iceSmokeTImer; | ||
s8 field_3EB; | ||
u8 gap_3EC[16]; | ||
void* field_3fc; | ||
u8 gap_400[16]; | ||
game::act::Actor* field_410; | ||
int csId2; | ||
rnd::GetItemID GetItemID; | ||
s32 collectableFlag; | ||
u8 gap_420[8]; | ||
}; | ||
} // namespace game::actors | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#ifndef _GAME_SKELANIME_H | ||
#define _GAME_SKELANIME_H | ||
|
||
#include "common/types.h" | ||
#include "game/context.h" | ||
#include "z3d/z3DVec.h" | ||
|
||
namespace game { | ||
|
||
struct SkelAnime { | ||
u8 limb_count; | ||
u8 mode; | ||
u8 d_list_count; | ||
s8 taper; | ||
void** skeleton; /* An array of pointers to limbs. Can be StandardLimb, LodLimb, or SkinLimb. */ | ||
void* animation; /* Can be an AnimationHeader or PlayerAnimationHeader. */ | ||
float start_frame; | ||
float end_frame; | ||
float animation_length; | ||
float cur_frame; | ||
float play_speed; | ||
z3dVec3s* joint_table; | ||
z3dVec3s* morph_table; | ||
float morph_weight; | ||
float morph_rate; | ||
union { | ||
s32 (*normal)(struct SkelAnime*); // Can be Loop, Partial loop, Play once, Morph, or Tapered morph | ||
s32 (*player)(struct game::GlobalContext*, struct SkelAnime*); // Loop, Play once, and Morph | ||
} update; | ||
s8 init_flags; | ||
u8 move_flags; | ||
s16 prev_yaw; | ||
z3dVec3s prev_transl; | ||
z3dVec3s base_transl; | ||
}; | ||
|
||
} // namespace game | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "rnd/chest.h" | ||
#include "rnd/item_table.h" | ||
|
||
namespace rnd { | ||
extern "C" { | ||
game::actors::EnBoxType Chest_OverrideTexture(game::actors::En_Box* actor, game::GlobalContext* gctx, s16 gid) { | ||
// First check to see if setting is enabled. | ||
// TODO: Create setting | ||
if (gSettingsContext.chestSize == 0) { | ||
return (game::actors::EnBoxType)0xFF; | ||
} | ||
game::SceneId scene = gctx->scene; | ||
ItemOverride override = ItemOverride_Lookup((game::act::Actor*)&actor->dyna, (u16)scene, gid); | ||
if (override.key.all != 0 &&) { | ||
ItemRow* itemToBeGiven = ItemTable_GetItemRow(override.value.getItemId); | ||
if (actor->chest_type == game::actors::EnBoxType::ENBOX_TYPE_SMALL || | ||
actor->chest_type == game::actors::EnBoxType::ENBOX_TYPE_BIG || | ||
actor->chest_type == game::actors::EnBoxType::ENBOX_TYPE_BIG_ORNATE) { | ||
if (itemToBeGiven->baseItemId == 0x02) | ||
return game::actors::EnBoxType::ENBOX_TYPE_SMALL; | ||
else if (itemToBeGiven->baseItemId == 0x2B) | ||
return game::actors::EnBoxType::ENBOX_TYPE_BIG; | ||
else if (itemToBeGiven->baseItemId == 0x78) | ||
return game::actors::EnBoxType::ENBOX_TYPE_BIG_ORNATE; | ||
} else if (actor->chest_type == game::actors::EnBoxType::ENBOX_TYPE_BIG_INVISIBLE || | ||
actor->chest_type == game::actors::EnBoxType::ENBOX_TYPE_SMALL_INVISIBLE) { | ||
if (itemToBeGiven->baseItemId == 0x02) | ||
return game::actors::EnBoxType::ENBOX_TYPE_SMALL_INVISIBLE; | ||
else if (itemToBeGiven->baseItemId == 0x2B || itemToBeGiven->baseItemId == 0x78) | ||
return game::actors::EnBoxType::ENBOX_TYPE_BIG_INVISIBLE; | ||
} | ||
} else { | ||
return (game::actors::EnBoxType)0xFF; | ||
} | ||
return (game::actors::EnBoxType)0xFF; | ||
} | ||
} | ||
|
||
} // namespace rnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters