SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
MarioSwim.hpp
1#pragma once
2
3#include "Game/Map/WaterInfo.hpp"
4#include "Game/Player/Mario.hpp"
5#include "Game/Player/MarioConst.hpp"
6#include "Game/Player/MarioState.hpp"
7
8class MarioActor;
9class MarineSnow;
10
11class MarioSwim : public MarioState {
12public:
14
15 virtual void init();
16 virtual bool proc(u32);
17 virtual bool start();
18 virtual bool close();
19 virtual bool update();
20 virtual bool notice();
21 virtual bool keep();
22 virtual bool postureCtrl(MtxPtr);
23 virtual void hitWall(const TVec3f &, HitSensor *);
24 virtual void hitPoly(u8, const TVec3f &, HitSensor *);
25 virtual bool passRing(const HitSensor *);
26 virtual f32 getBlurOffset() const;
27 virtual void draw3D() const;
28
29 bool checkWaterCube(bool);
30 void onSurface();
31 void doJetJump(u8);
32 void updateLifeByTime();
33 void surfacePaddle();
34 void flowOnWave(f32);
35 void checkWaterBottom();
36 void spin();
37 void decideVelocity();
38 void procBuoyancy();
39 void decideAnimation();
40 void decideEffect(bool);
41 void updateTilt();
42 void jet();
43 void pushedByWaterWall();
44 void setDamage(const TVec3f &, u16);
45 void updateUnderwater();
46 void startJet(u32);
47
48 f32 getSurface() const;
49
50 virtual TVec3f &getGravityVec() const;
51
52 static inline f32 getWorthlessNumber() { return 0.523598790169f; }
53
54 /* The worthlesser variable, as its name suggests, has no purpose.
55 It achieves nothing in life. Its existence is completely devoid of value.
56 Nevertheless, the compiler left evidence of this forgettable variable behind.
57 As a result, we know that it existed, but we do not know how precisely it achieved nothing.
58
59 Summary:
60 worthlesser does not impact the behavior of this function.
61
62 */
63
64 inline void funReferenceTime(bool &worthlesser)
65 {
66 if (_5C > 1.57079637051f) {
67 worthlesser = true;
68 }
69 else {
70 if (_3C > 0x1E) {
71 _1E = 1;
72 }
73 worthlesser = false;
74 if (getStickY() > 0.0f) {
75 f32 stickY = getStickY();
76 // Note: The binary does not tell us whether this comparison is > or <.
77 // It is not == because that generates an fcmpu instruction, not fcmpo.
78 // It is not <= or >= because those generate cror instructions.
79 if (getWorthlessNumber() + getWorthlessNumber() * stickY < _5C
80
81 // This comparison needs to be present for the compiler to optimize the condition
82 // accurately.
83 && worthlesser) {
84 return;
85 }
86 }
87 }
88 worthlesser = true;
89 }
90
91 inline TVec3f getPlayer380() const { return getPlayer()->_380; }
92
93 inline bool check7Aand7C() const { return _7A || _7C; }
94
95 MarineSnow *_14;
96 u8 _18;
97 u8 _19;
98 u8 _1A;
99 u8 _1B;
100 u8 _1C;
101 u8 _1D;
102 u8 _1E;
103 u8 _1F;
104 u8 _20;
105 u8 _21;
106 u8 _22;
107 u32 _24;
108 u32 _28;
109 u16 _2C;
110 u16 _2E;
111 u16 _30;
112 u16 _32;
113 u16 _34;
114 u16 _36;
115 u16 _38;
116 u16 _3A;
117 u16 _3C;
118 u16 _3E;
119 u16 _40;
120 u16 _42;
121 u16 _44;
122 f32 _48;
123 f32 _4C;
124 f32 _50;
125 f32 _54;
126 f32 _58;
127 f32 _5C;
128 TVec3f _60;
129 TVec3f _6C;
130 u8 _78;
131 u16 _7A;
132 u16 _7C;
133 f32 _80;
134 f32 _84;
135 u8 _88;
136 u16 _8A;
137 u16 _8C;
138 u16 _8E;
139 u16 _90;
140 f32 _94;
141 f32 _98;
142 u8 _9C;
143 u8 _9D;
144 u8 _9E;
145 u8 _9F;
146 TVec3f _A0;
147 u8 _AC;
148 u8 _AD;
149 u16 _AE;
150 TMtx34f _B0;
151 f32 _E0;
152 f32 _E4;
153 u16 _E8;
154 u16 _EA;
155 u16 _EC;
156 u16 _EE;
157 u16 _F0;
158 WaterInfo _F4;
159 s32 _144;
160 TVec3f _148;
161 TVec3f _154;
162 TVec3f _160;
163 TVec3f _16C;
164 TVec3f _178;
165 TVec3f _184;
166 TVec3f _190;
167 f32 _19C;
168 f32 _1A0;
169 f32 _1A4;
170 f32 _1A8;
171 f32 _1AC;
172 u16 _1B0;
173 u8 _1B2;
174 f32 _1B4;
175 f32 _1B8;
176};