mirror of
https://github.com/PodeCaradox/GalaxyQuest-SteamFrame.git
synced 2026-10-18 18:02:04 +02:00
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>
106 lines
3.5 KiB
C++
106 lines
3.5 KiB
C++
#pragma once
|
|
|
|
#include "Game/LiveActor/LiveActor.hpp"
|
|
#include "Game/Util/ActorSensorUtil.hpp"
|
|
#include "Game/Util/DemoUtil.hpp"
|
|
#include "Game/Util/GamePadUtil.hpp"
|
|
#include <JSystem/JGeometry/TMatrix.hpp>
|
|
|
|
class LiveActorGroup;
|
|
class SphereSelectorHandle;
|
|
|
|
enum HandlePointingPriority { Unknown_0, Unknown_1, Unknown_2 };
|
|
|
|
class SphereSelector : public LiveActor {
|
|
public:
|
|
SphereSelector();
|
|
|
|
virtual ~SphereSelector();
|
|
virtual void init(const JMapInfoIter&);
|
|
virtual void appear();
|
|
virtual void kill();
|
|
|
|
void registerPointingTarget(LiveActor*, HandlePointingPriority);
|
|
void validatePointing();
|
|
void invalidatePointing();
|
|
void sendMsgToAllActor(u32);
|
|
bool isMoveClickedPos() const;
|
|
void playSelectedME();
|
|
void playCanceledME();
|
|
void exeSelectStart();
|
|
void exeSelectWait();
|
|
void exeSelectCancel();
|
|
void exeConfirmStart();
|
|
void exeConfirmWait();
|
|
void exeConfirmCancel();
|
|
void exeConfirm();
|
|
|
|
bool isDecideTrigger() {
|
|
return MR::testDPDMenuPadDecideTrigger() && !MR::isDemoActive();
|
|
}
|
|
|
|
bool isButtonAPressed() {
|
|
return MR::testCorePadButtonA(WPAD_CHAN0) && !MR::isDemoActive();
|
|
}
|
|
|
|
void sendSelectedMsgAndSetTarget(LiveActor* pTarget) {
|
|
if (MR::sendSimpleMsgToActor(ACTMES_SPHERE_SELECTOR_TARGET_SELECTED, pTarget)) {
|
|
mSelectedTarget = pTarget;
|
|
}
|
|
}
|
|
|
|
/* 0x8C */ LiveActorGroup* mSphereGroup;
|
|
/* 0x90 */ SphereSelectorHandle* mHandle;
|
|
/* 0x94 */ LiveActor* mSelectedTarget;
|
|
/* 0x98 */ LiveActor* _98;
|
|
/* 0x9C */ u32 _9C;
|
|
/* 0xA0 */ LiveActor* mPointingTarget;
|
|
/* 0xA4 */ s32 _A4;
|
|
/* 0xA8 */ TVec2f _A8;
|
|
/* 0xB0 */ bool mIsPointingInvalid;
|
|
/* 0xB1 */ bool _B1; // Something for playing sounds the first time you click on a galaxy or cancel the selection
|
|
};
|
|
|
|
class SphereSelectorFunction {
|
|
public:
|
|
static void registerTarget(LiveActor*);
|
|
static bool isPadButton();
|
|
static s32 getSelectStartFrame();
|
|
static s32 getConfirmStartCancelFrame();
|
|
static void selectStart();
|
|
static void selectCancel(bool);
|
|
static void selectEnd();
|
|
static void confirmStart();
|
|
static void confirmCancel(bool);
|
|
static void confirmed();
|
|
static bool isSelectWait();
|
|
static bool isConfirmWait();
|
|
|
|
static bool isMsgSelectStart(u32);
|
|
static bool isMsgSelectEnd(u32);
|
|
static bool isMsgConfirmStart(u32);
|
|
static bool isMsgConfirmCancel(u32);
|
|
|
|
static bool isMsgConfirmed(u32);
|
|
static bool isMsgTargetSelected(u32);
|
|
static bool trySyncAppearMsgSelectStart(LiveActor*, u32);
|
|
static bool trySyncKillMsgSelectStart(LiveActor*, u32);
|
|
static void validatePointing();
|
|
static void invalidatePointing();
|
|
static bool isValidPointing();
|
|
static void setHandle(SphereSelectorHandle*);
|
|
static void calcHandledTrans(const TVec3f&, TVec3f*);
|
|
static void calcHandledRotateMtx(const TVec3f&, TPos3f*);
|
|
static TVec3f& getHandleTrans();
|
|
static f32 getHandleRotateSpeed();
|
|
static bool isHandleHolding() NO_INLINE;
|
|
static void registerPointingTarget(LiveActor*, HandlePointingPriority);
|
|
static bool tryRegisterPointingTarget(LiveActor*, HandlePointingPriority);
|
|
static bool isPointingTarget();
|
|
static bool isPointingTarget(const LiveActor*);
|
|
static LiveActor* getPointingTarget();
|
|
static LiveActor* getSelectedTarget() NO_INLINE;
|
|
static TVec3f& getSelectedActorTrans();
|
|
static void calcOffsetPos(TVec3f*, const TVec3f&, const TVec3f&, const TVec3f&, const TVec3f&);
|
|
};
|