SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
StageSwitch.hpp
1#pragma once
2
3#include <revolution.h>
4
5#include "Game/NameObj/NameObj.hpp"
6#include "Game/Util/JMapIdInfo.hpp"
7
8class BitFlag128 {
9public:
10 inline BitFlag128() {
11 mFlags[0] = 0;
12 mFlags[1] = 0;
13 mFlags[2] = 0;
14 mFlags[3] = 0;
15 }
16
17 bool get(int) const;
18 void set(int, bool);
19
20 u32 mFlags[0x4]; // _0
21};
22
23class ZoneSwitch : public BitFlag128 {
24public:
25 ZoneSwitch();
26};
27
29public:
30 SwitchIdInfo(s32, const JMapInfoIter &);
31
32 s32 getSwitchNo() const;
33
34 JMapIdInfo* mIDInfo; // _0
35 bool mIsGlobal; // _4
36};
37
39public:
41 s32 mData; // _0
42 ZoneSwitch* mSwitch; // _4
43 };
44
46
47 virtual ~StageSwitchContainer();
48
49 void createAndAddZone(const SwitchIdInfo &);
50 ZoneSwitch* getZoneSwitch(const SwitchIdInfo &);
51 ZoneSwitch* findZoneSwitchFromTable(const SwitchIdInfo &);
52
53 ContainerSwitch mSwitches[20]; // _C
54 s32 mCount; // _AC
55 ZoneSwitch* mGlobalSwitches; // _B0
56};
57
59public:
60 static SwitchIdInfo* createSwitchIdInfo(const char *, const JMapInfoIter &, bool);
61 static void onSwitchBySwitchIdInfo(const SwitchIdInfo &);
62 static void offSwitchBySwitchIdInfo(const SwitchIdInfo &);
63 static bool isOnSwitchBySwitchIdInfo(const SwitchIdInfo &);
64};
65
67public:
69
70 void onSwitchA();
71 void offSwitchA();
72 bool isOnSwitchA() const;
73 bool isValidSwitchA() const;
74 void onSwitchB();
75 void offSwitchB();
76 bool isOnSwitchB() const;
77 bool isValidSwitchB() const;
78 bool isOnSwitchAppear() const;
79 bool isValidSwitchAppear() const;
80 void onSwitchDead();
81 void offSwitchDead();
82 bool isValidSwitchDead() const;
83 bool isOnAllSwitchAfterB(int) const;
84 bool isOnAnyOneSwitchAfterB(int) const;
85
86 SwitchIdInfo* mSW_A; // _0
87 SwitchIdInfo* mSW_B; // _4
88 SwitchIdInfo* mSW_Appear; // _8
89 SwitchIdInfo* mSW_Dead; // _C
90};
91
92namespace MR {
93 StageSwitchCtrl* createStageSwitchCtrl(NameObj *, const JMapInfoIter &);
94};
The most basic form of an object.
Definition NameObj.hpp:11