Files
bigmak94andClaude Opus 5.5 4b395efe5c Add the Petari decompilation (SMGCommunity/Petari@0a5c660)
The sources of Petari (https://github.com/SMGCommunity/Petari), the
Super Mario Galaxy decompilation by the SMGCommunity, at commit
0a5c6608dc3b4c44a9aa68c2535d1793dc565f02, unchanged but for LF line
endings: LICENSE (as LICENSE-Petari.txt; CC0 1.0), include/, libs/ and
src/.  Left out: the game data Petari keeps from the original
executable, the error message archive (include/Game/System/
ErrorArchive.hpp) and two tables (src/Game/System/GalaxyID.bcsv and
StoryEvent.bcsv); GalaxyQuest's converter takes them from the player's
own disc.  The port's changes follow in the next commit, so
`git diff petari-base -- decomp` shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 01:59:38 +02:00

81 lines
2.4 KiB
C++

#pragma once
#include "Game/LiveActor/LiveActor.hpp"
#include "Game/Util/Color.hpp"
#include <JSystem/JGeometry/TMatrix.hpp>
class ActorCameraInfo;
class CameraTargetMtx;
class JUTTexture;
class PartsModel;
class PlantPoint;
class SpaceCocoon : public LiveActor {
public:
SpaceCocoon(const char*);
virtual void init(const JMapInfoIter&);
virtual void draw() const;
virtual void calcAnim();
virtual void attackSensor(HitSensor* pSender, HitSensor* pReceiver);
virtual bool receiveMsgPlayerAttack(u32 msg, HitSensor* pSender, HitSensor* pReceiver);
virtual bool receiveMsgEnemyAttack(u32 msg, HitSensor* pSender, HitSensor* pReceiver);
virtual bool receiveOtherMsg(u32 msg, HitSensor* pSender, HitSensor* pReceiver);
void exeStop();
void exeFree();
void exeFreeInvalid();
void exeBindLand();
void exeBindWait();
void exeWaitKinopioAimDemo();
void exeBindAim();
void exeBindAttack();
void exeBindAttackSuccess();
bool updateBindWait();
bool updateSpringPoint();
void updateHang();
void updateBindAttack();
void updateActorMtx();
void updateDrawPoints();
bool tryTouch();
bool tryRelease();
bool tryAttackMap();
bool isKinopioAttached() const;
void endBind(const TVec3f&, bool);
void endCommandStream();
void drawPlane(f32, f32, f32, f32, Color8, Color8, f32, f32) const;
void initDraw() const;
/// @note if the next use of the SpaceCocoon should signal the associated camera area to stop focusing on this SpaceCocoon (for use when Kinipio
/// is not yet launched from SpaceCocoon)
/* 0x8C */ bool mIsKinopioCameraFocused;
/* 0x90 */ TVec3f mNeutralPos;
/* 0x9C */ TVec3f mBasePos;
/* 0xA8 */ TVec3f mSide;
/* 0xB4 */ TVec3f mUp;
/* 0xC0 */ TVec3f mFront;
/* 0xCC */ f32 mHeight;
/* 0xD0 */ TVec3f mPointerPos;
/* 0xDC */ s32 mPadChannel;
/* 0xE0 */ TVec3f mCocoonPos;
/* 0xEC */ TVec3f mSpringVel;
/// @note objArg0: number of frames in "attack mode" in the air before regaining control
/* 0xF8 */ s32 mAttackTime;
/* 0xFC */ s32 mTouchTime;
/* 0x100 */ LiveActor* mRider;
/* 0x104 */ TPos3f mBaseMtx;
/* 0x134 */ s32 mNumPoints;
/* 0x138 */ PlantPoint** mPlantPoints;
/* 0x13C */ CameraTargetMtx* mCameraTargetMtx;
/* 0x140 */ ActorCameraInfo* mCameraInfo;
/* 0x144 */ PartsModel* mCocoonModel;
/* 0x148 */ TPos3f mTopMtx;
/* 0x178 */ JUTTexture* mTexture;
};