From dcbd4116209f8326a7f40f01b1214aefda4bd79b Mon Sep 17 00:00:00 2001 From: Luminyx <27lumi@protonmail.com> Date: Tue, 27 Oct 2026 21:10:46 -0400 Subject: [PATCH] actor folder Co-Authored-By: Ryguy <118482718+Ryguy0777@users.noreply.github.com> Co-Authored-By: domthewiz <81938723+Domthewiz@users.noreply.github.com> --- actor/Actor.h | 148 +- actor/ActorAdditionalHeap.h | 8 +- actor/ActorBase.h | 72 +- actor/ActorCollision.h | 94 +- actor/ActorCreateMgr.h | 177 + ...orCreateParam.h => ActorCreateParameter.h} | 53 +- actor/ActorCullRange.h | 12 - actor/ActorCullUtil.h | 16 - actor/ActorCulling.h | 36 + actor/ActorFindFunc.h | 12 +- actor/ActorMgr.h | 60 +- actor/ActorPtrCache.h | 17 +- actor/ActorResLoader.h | 13 +- actor/ActorState.h | 8 +- actor/{ActorStatus.h => ActorSubMgr.h} | 56 +- actor/ActorUtil.h | 25 +- actor/{AttentionLookat.h => AttentionInfo.h} | 35 +- actor/AttentionMgr.h | 18 +- actor/BgActorBase.h | 84 - ...ChibiYoshiEatData.h => ChibiEatCallback.h} | 31 +- actor/{EatData.h => EatCallback.h} | 27 +- actor/LineManager.h | 352 ++ actor/LineMgr.h | 169 - actor/MapActor.h | 28 - actor/MapObj.h | 6 + actor/Profile.h | 40 +- actor/ProfileInfo.h | 3340 +++++++++-------- actor/PropelParts.h | 45 +- actor/ScoreMgr.h | 44 +- actor/{ActorUniqueID.h => UniqueID.h} | 31 +- ami/AmiUtil.h => actor/ZposPriority.h | 4 +- boss/Boss.h | 4 +- boss/BossDemo.h | 4 +- bullet/FireBallBase.h | 10 +- bullet/FireBallBros.h | 2 +- bullet/IceBallBase.h | 10 +- bullet/IceBallBros.h | 2 +- bullet/IceBallPakkun.h | 6 +- collision/ActorBgCollisionCheck.h | 4 +- course_select/CourseSelectActor.h | 2 +- course_select/CourseSelectCollisionCheck.h | 8 +- course_select/CourseSelectCoursePoint.h | 2 +- course_select/CourseSelectDemoActor.h | 2 +- course_select/CourseSelectObjActor.h | 2 +- enemy/Birikyu.h | 12 +- enemy/Bomhei.h | 4 +- enemy/BrosBase.h | 8 +- enemy/CarryEnemy.h | 4 +- enemy/Enemy.h | 2 +- enemy/EnemyChibiYoshiEatData.h | 8 +- enemy/EnemyEatData.h | 8 +- enemy/IceMgr.h | 4 +- enemy/KillerHoudai.h | 6 +- enemy/Koton.h | 8 +- enemy/Kuribo.h | 4 +- enemy/KuriboBase.h | 4 +- enemy/MechaKoopa.h | 4 +- enemy/PataKuribo.h | 2 +- enemy/Shell.h | 8 +- enemy/SnakeBlock.h | 2 +- fragment/BigBlockFragment.h | 0 fragment/BlockFragment.h | 0 fragment/ChainFragment.h | 0 fragment/Fragment.h | 28 + fragment/FragmentMgr.h | 28 +- fragment/IcicleDew.h | 0 fragment/WaterSplash.h | 0 fukidashi/FukidashiType.h | 5 + game/BalloonMgr.h | 4 +- item/ItemBase.h | 6 +- item/ItemObj.h | 2 +- layout/GamesceneBase.h | 4 +- map/Bg.h | 20 +- map/CourseData.h | 20 +- map/WaveType.h | 5 + map_obj/ActorBlockAngle.h | 2 +- map_obj/ActorBlockBase.h | 32 +- map_obj/ActorBlockHatena.h | 2 +- map_obj/ActorBlockRenga.h | 2 +- map_obj/ActorBlockSwitch.h | 4 +- map_obj/ActorCoin.h | 2 +- map_obj/ActorCoinBase.h | 6 +- map_obj/ActorCoinDemoBase.h | 2 +- map_obj/ActorCoinDemoJump.h | 2 +- map_obj/ActorCoinShowerJump.h | 2 +- map_obj/BgActorBase.h | 196 + map_obj/BlockCoinBase.h | 2 +- map_obj/BlockMgr.h | 94 +- map_obj/CarryBlockBase.h | 2 +- map_obj/CarryObjBase.h | 2 +- map_obj/ChangeBlockCoinBase.h | 2 +- map_obj/ChibiYoshiAwa.h | 2 +- map_obj/ChibiYoshiAwaData.h | 8 +- map_obj/ChikuwaBlockBase.h | 2 +- map_obj/Freezer.h | 2 +- map_obj/ParentMovementMgr.h | 6 +- map_obj/PlayerRideUtil.h | 8 +- map_obj/PropBlock.h | 2 +- map_obj/RingBase.h | 2 +- map_obj/RouletteBlock.h | 4 +- map_obj/TarzanIvy.h | 4 +- player/PlayerBase.h | 16 +- player/PlayerEatData.h | 8 +- player/PlayerObject.h | 18 +- system/SaveMgr.h | 2 +- tag/BgCenter.h | 2 +- 106 files changed, 3245 insertions(+), 2524 deletions(-) create mode 100644 actor/ActorCreateMgr.h rename actor/{ActorCreateParam.h => ActorCreateParameter.h} (65%) delete mode 100644 actor/ActorCullRange.h delete mode 100644 actor/ActorCullUtil.h create mode 100644 actor/ActorCulling.h rename actor/{ActorStatus.h => ActorSubMgr.h} (52%) rename actor/{AttentionLookat.h => AttentionInfo.h} (54%) delete mode 100644 actor/BgActorBase.h rename actor/{ChibiYoshiEatData.h => ChibiEatCallback.h} (65%) rename actor/{EatData.h => EatCallback.h} (78%) create mode 100644 actor/LineManager.h delete mode 100644 actor/LineMgr.h delete mode 100644 actor/MapActor.h create mode 100644 actor/MapObj.h rename actor/{ActorUniqueID.h => UniqueID.h} (76%) rename ami/AmiUtil.h => actor/ZposPriority.h (53%) create mode 100644 fragment/BigBlockFragment.h create mode 100644 fragment/BlockFragment.h create mode 100644 fragment/ChainFragment.h create mode 100644 fragment/Fragment.h create mode 100644 fragment/IcicleDew.h create mode 100644 fragment/WaterSplash.h create mode 100644 fukidashi/FukidashiType.h create mode 100644 map/WaveType.h create mode 100644 map_obj/BgActorBase.h diff --git a/actor/Actor.h b/actor/Actor.h index 43c3758d..7da2bd15 100644 --- a/actor/Actor.h +++ b/actor/Actor.h @@ -1,20 +1,22 @@ #pragma once #include -#include +#include #include #include +#include +#include #include #include -constexpr f32 ACTOR_DEFAULT_GRAVITY = -0.1875f; -constexpr f32 ACTOR_DEFAULT_MAX_FALL_SPEED = -4.0f; +#define ACTOR_DEFAULT_GRAVITY -0.1875f +#define ACTOR_DEFAULT_MAX_FALL_SPEED -4.0f class ActorBgCollisionCheck; class BgCollision; class ChibiYoshiAwaData; -class ChibiYoshiEatData; -class EatData; +class ChibiEatCallback; +class EatCallback; class PropelParts; // vtbl Address: 0x10000268 @@ -45,34 +47,34 @@ class Actor : public ActorBase }; /** - * @brief Flags to pass to `screenOutCheck` to skip checks or actions during the evaluation. + * @brief Flags to pass to `actorExecCullCheck` to skip checks or actions during the evaluation. */ - enum ScreenOutFlag : u16 + enum ExecCullFlag : u16 { - cScreenOutFlag_SkipNone = 0, ///< Perform all checks and delete the actor if they pass. - cScreenOutFlag_SkipDeletion = 1 << 1, ///< Skip deleting the actor if the checks do pass. - cScreenOutFlag_SkipCameraCheck = 1 << 2, ///< Skip checking if the actor is outside of the visible camera. - cScreenOutFlag_SkipRideCheck = 1 << 3, ///< Skip checking if the actor is riding another actor/platform. - cScreenOutFlag_SkipTottenCheck = 1 << 4 ///< Skip checking if Nabbit has passed to the right of the actor's visible range. + cExecCullFlag_SkipNone = 0, ///< Perform all checks and delete the actor if they pass. + cExecCullFlag_SkipDeletion = 1 << 1, ///< Skip deleting the actor if the checks do pass. + cExecCullFlag_SkipCameraCheck = 1 << 2, ///< Skip checking if the actor is outside of the visible camera. + cExecCullFlag_SkipRideCheck = 1 << 3, ///< Skip checking if the actor is riding another actor/platform. + cExecCullFlag_SkipTottenCheck = 1 << 4 ///< Skip checking if Nabbit has passed to the right of the actor's visible range. }; public: - virtual void setPlayerNo(s8 id) + virtual void setPlrNo(s32 id) { mPlayerNo = id; } - s8 getPlayerNo() const + s8 getPlrNo() const { return mPlayerNo; } // Address: 0x020002CC - virtual void removeCollisionCheck(); + virtual void removeCc(); // Address: 0x02000328 - virtual void reviveCollisionCheck(); + virtual void reviveCc(); - virtual ActorBgCollisionCheck* getBgCheck() + virtual const ActorBgCollisionCheck* getBcConstPtr() const { return nullptr; } @@ -81,7 +83,7 @@ class Actor : public ActorBase { } - virtual bool isSpinLiftUpEnable() + virtual bool isSpinLiftUpEnable() const { return true; } @@ -93,19 +95,19 @@ class Actor : public ActorBase /** * @brief Called by Group Controller when "activating" the target group. */ - virtual void groupActivate() + virtual void startGroupid() { } /** * @brief Called by Group Controller when "deactivating" the target group. */ - virtual void groupDeactivate() + virtual void stopGroupid() { } // Address: 0x02000394 - bool checkCarried(s32* player_no); + bool checkCarried(s32* player_no) const; s32 getComboCnt() const { @@ -121,26 +123,26 @@ class Actor : public ActorBase void slideComboSE(s32 combo_cnt, bool combo_type_2); // Address: 0x020005A4 - s32 searchNearPlayer(sead::Vector2f& out); // Returns -1 if no player found + s32 searchNearPlayer(sead::Vector2f* out) const; // Returns -1 if no player found // Address: 0x020005EC - DirType getPlayerDirLR(const sead::Vector3f& position); + DirType getDir2PlayerLR(const sead::Vector3f& position) const; // Address: 0x020006B4 - DirType getPlayerDirUD(const sead::Vector3f& position); + DirType getDir2PlayerUD(const sead::Vector3f& position) const; - DirType getPlayerDirLR() + DirType getDir2PlayerLR() { - return getPlayerDirLR(mPos); + return getDir2PlayerLR(mPos); } - DirType getPlayerDirUD() + DirType getDir2PlayerUD() { - return getPlayerDirUD(mPos); + return getDir2PlayerUD(mPos); } /** * @brief Checks if the actor is out of gameplay and optionally deletes it. - * @param flag Specify checks to skip, and whether to delete the actor if they all passed. + * @param flag Specify checks to skip, and whether to delete the actor if they all passed. See @c ExecCullFlag * @return Whether the actor is out of gameplay. * @details The actor is considered "out of gameplay" if: * * It has not been eaten. @@ -149,7 +151,7 @@ class Actor : public ActorBase * * The actor is out of the zone bounds OR the actor is outside of the visible camera. * @par Address: 0x020007A0 */ - bool screenOutCheck(ScreenOutFlag flag); + bool actorExecCullCheck(u16 flag); // Address: 0x02002AD8 virtual void allEnemyDeathEffSet(); // Spawn burst effect at instances where all enemies die (such as touching goal pole or defeating boss), called if profile flag bit 4, 5 or 7 is set @@ -163,17 +165,17 @@ class Actor : public ActorBase virtual void poisonSplashEffect(const sead::Vector3f& pos); // Address: 0x02000970 - f32 getEffectZPos() const; + f32 getEffectZpos_() const; // Address: 0x02000A70 - bool checkEat() const; + bool checkEatenYoshi() const; /** * @brief Schedule this actor for deletion on the next frame. * @param manual_deleted Prevents respawning. * @par Address: 0x02000774 */ - void deleteActor(bool manual_deleted); + void deleteActor_(bool manual_deleted); public: ActorCollisionCheck& getCollisionCheck() @@ -429,7 +431,7 @@ class Actor : public ActorBase protected: // Address: 0x02000AC8 - Actor(const ActorCreateParam& param); + Actor(const ActorCreateParameter& param); // Address: 0x02000F18 ~Actor() override; @@ -446,14 +448,14 @@ class Actor : public ActorBase bool preDraw() override; // Address: 0x02001254 - virtual bool drawCullCheck_(); + virtual bool actorDrawCullCheck(); - virtual void blockHitInit_() + virtual void blockHitInit() { } // Address: 0x02001304 - void splashEffect_(const sead::Vector3f& pos, EffectID effect_id, u8 wave_scale, const char* sound_label); + void waterSplashCommon_(const sead::Vector3f& pos, s32 effect_id, WaveType wave_type, const char* sound_label); // Address: 0x020013D4 void setAreaNo_(); @@ -487,54 +489,61 @@ class Actor : public ActorBase } // Address: 0x02001A28 - void carryFukidashiCheck_(s32 action); + void carryFukidashiCheck_(FukidashiType action); // Address: 0x02001490 - void carryFukidashiCheck_(s32 action, const sead::Vector2f& range); + void carryFukidashiCheck_(FukidashiType action, const sead::Vector2f& range); // Address: 0x02001A64 - void carryFukidashiCancel_(s32 action, s32 player_no); + void carryFukidashiCancel_(FukidashiType action, s32 player_no); // Address: 0x02001DC4 - bool isEnablePressLR_(const ActorBgCollisionCheck& bc); + bool checkPressBgLR_(const ActorBgCollisionCheck& bc); // Address: 0x0200222C - bool isEnablePressUD_(const ActorBgCollisionCheck& bc); + bool checkPressBgUD_(const ActorBgCollisionCheck& bc); // Address: 0x02002594 - bool setPressBreakLR_(const ActorBgCollisionCheck& bc); + bool setBreakPressObjBgLR_(const ActorBgCollisionCheck& bc); // Address: 0x02002664 - bool setPressBreakUD_(const ActorBgCollisionCheck& bc); + bool setBreakPressObjBgUD_(const ActorBgCollisionCheck& bc); // Address: 0x0200272C - bool setPressIceHeadBreak_(const ActorBgCollisionCheck& bc); + bool checkInternalIceBlock_(const ActorBgCollisionCheck& bc); // Address: 0x02002390 - bool setPressBreakIce_(const BgCollision* bg_collision); + bool setEnemyIceBreakReq_(const BgCollision* bg_collision); // Address: 0x020024E0 - bool setPressBreakBlockDRC_(const BgCollision* bg_collision); + bool setDrcBlockBreakReq_(const BgCollision* bg_collision); -private: - inline Actor* searchCarryFukidashiPlayer_(s32 action); + void setPosSuddenly_(const sead::Vector3f& position) + { + mPos.set(position); + mPosPrev.set(position); + mPosPrev2.set(position); + } + +protected: + Actor* searchCarryFukidashiPlayer_(FukidashiType action) const; // Address: 0x02001AF4 - bool canPress_(const BgCollision* bg_collision); + bool isEnablePressObjBg_(const BgCollision* bg_collision) const; // Address: 0x02001C08 - bool checkPressLR_(const ActorBgCollisionCheck& bc, DirType direction); + bool checkPressBgWall_(const ActorBgCollisionCheck& bc, DirType direction) const; // Address: 0x02002098 - bool checkPressU_(const ActorBgCollisionCheck& bc); + bool checkPressBgHead_(const ActorBgCollisionCheck& bc) const; // Address: 0x02001F04 - bool checkPressD_(const ActorBgCollisionCheck& bc); + bool checkPressBgFoot_(const ActorBgCollisionCheck& bc) const; // Address: 0x02001B2C - bool canPressIfApproaching_(const BgCollision* bgcol_approaching_side, const BgCollision* bgcol_fixed_side); + bool isBreakPressObjBg_(const BgCollision* bgcol_approaching_side, const BgCollision* bgcol_fixed_side) const; // Address: 0x02000720 - u32 calcTottenToSrcDir_(const sead::BoundBox2f& src_range) const; + u32 checkAvailableCullCheckOnQuest(const sead::BoundBox2f& src_range); protected: DirType mDirection; s8 mPlayerNo; s8 mControllerLytPlayerNo; - u8 mLayer; // Inited to ActorCreateParam::layer + u8 mLayer; // Inited to ActorCreateParameter::layer sead::BitFlag8 mCollisionMask; f32 mSpeedF; // Horizontal speed f32 mMaxSpeedF; // Maximum horizontal speed @@ -549,13 +558,13 @@ class Actor : public ActorBase Angle3 mAnglePrev; sead::Vector2f mPosDelta; // At start of every frame ActorCollisionCheck mCollisionCheck; - sead::Vector2f mVisibleAreaOffset; // Inited to ActorCreateInfo::spawn_range.offset - sead::Vector2f mVisibleAreaSize; // Inited to ActorCreateInfo::spawn_range.half_size * 2 + sead::Vector2f mVisibleAreaOffset; // Inited to ActorData::spawn_range.offset + sead::Vector2f mVisibleAreaSize; // Inited to ActorData::spawn_range.half_size * 2 sead::Vector2f mSize; - ActorCullRange mCullLimit; // Inited to { 256.0 + ActorCreateInfo::cull_range.up, - // 256.0 + ActorCreateInfo::cull_range.down, - // 80.0 + ActorCreateInfo::cull_range.left, - // 80.0 + ActorCreateInfo::cull_range.right } + ActorCulling::ActorCullUsable mCullLimit; // Inited to { 256.0 + ActorData::cull_range.up, + // 256.0 + ActorData::cull_range.down, + // 80.0 + ActorData::cull_range.left, + // 80.0 + ActorData::cull_range.right } u8 mAreaNo; u8 mActorKind; // ActorKind bool mIsExecEnable; @@ -565,7 +574,7 @@ class Actor : public ActorBase u8 mCarryFlag; // CarryFlag u8 mSwitchFlag0; u8 mSwitchFlag1; - u16 mCreateFlag; // Inited to ActorCreateInfo::flag + u16 mCreateFlag; // Inited to ActorData::flag u32 mBlockHitTimer; DirType mBlockHitDirection; u8 _220; @@ -577,16 +586,11 @@ class Actor : public ActorBase sead::Vector3f mPosPrev; // At frame start sead::Vector3f mPosPrevPostExec; sead::Vector3f mPosPrev2; // At frame end - EatData* mEatDataPtr; - ChibiYoshiEatData* mChibiYoshiEatDataPtr; + EatCallback* mEatCallbackPtr; + ChibiEatCallback* mChibiEatCallbackPtr; PropelParts* mPropelParts; - u8* _270; // Inited to ActorCreateParam::_28 + u8* _270; // Inited to ActorCreateParameter::_28 f32 mAddSpeedF; ChibiYoshiAwaData* mChibiYoshiAwaDataPtr; - - // Address: 0x10000B64 - static const f32 cCullXLimit; - // Address: 0x10000B68 - static const f32 cCullYLimit; }; -static_assert(sizeof(Actor) == 0x27C); +static_assert(sizeof(Actor) == 0x27C, "Actor size mismatch"); diff --git a/actor/ActorAdditionalHeap.h b/actor/ActorAdditionalHeap.h index aea4b437..a029ecf4 100644 --- a/actor/ActorAdditionalHeap.h +++ b/actor/ActorAdditionalHeap.h @@ -13,13 +13,13 @@ class ActorAdditionalHeap : public sead::IDisposer virtual ~ActorAdditionalHeap() { - destroy(); + destroyHeap(); } // Address: 0x02002C70 - void create(); + void createHeap(); // Address: 0x02002C54 - void destroy(); + void destroyHeap(); sead::Heap* getHeap() const { @@ -29,4 +29,4 @@ class ActorAdditionalHeap : public sead::IDisposer protected: sead::Heap* mHeap; }; -static_assert(sizeof(ActorAdditionalHeap) == 0x14); +static_assert(sizeof(ActorAdditionalHeap) == 0x14, "ActorAdditionalHeap size mismatch"); diff --git a/actor/ActorBase.h b/actor/ActorBase.h index 645af7e7..7f37fd77 100644 --- a/actor/ActorBase.h +++ b/actor/ActorBase.h @@ -1,11 +1,12 @@ #pragma once -#include +#include #include #include #include #include +#include