SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
BigBubbleGoalArea.cpp
1#include "Game/AreaObj/BigBubbleGoalArea.hpp"
2#include "Game/Util/CameraUtil.hpp"
3#include "Game/Util/JMapUtil.hpp"
4#include "Game/Util/DirectDraw.hpp"
5
6BigBubbleGoalArea::BigBubbleGoalArea(int type, const char *pName) : AreaObj(type, pName) {
7 mTranslation.x = 0.0f;
8 mTranslation.y = 0.0f;
9 mTranslation.z = 0.0f;
10 _48 = 1.0f;
11 _4C = 0.0f;
12 _50 = 0.0f;
13}
14
15BigBubbleGoalArea::~BigBubbleGoalArea() {
16
17}
18
20 AreaObj::init(rIter);
21 _48 = mObjArg0 <= 0 ? 1.0f : (f32)mObjArg0;
22
23 MR::getJMapInfoTrans(rIter, &mTranslation);
24 MR::connectToScene(this, 34, -1, -1, 16);
25}
26
27void BigBubbleGoalArea::movement() {
28 if (!isValidSwitchA() || isOnSwitchA()) {
29 return;
30 }
31
32 if (!(_4C < _50)) {
33 return;
34 }
35
36 _4C += 0.05f;
37
38 if (_4C >= _48) {
39 _4C = _48;
40 onSwitchA();
41 mValid = false;
42 }
43 else if (_50 < _4C) {
44 _4C = _50;
45 }
46}
47
49 if (!isValidSwitchA() || isOnSwitchA()) {
50 return;
51 }
52
53 TDDraw::setup(0, 1, 0);
54 GXSetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
55 GXSetCullMode(GX_CULL_BACK);
56
57 f32 dVar3 = _4C / _48;
58 f32 dVar4 = 6.2831855f * dVar3;
59
60 TDDraw::drawFillFan(mTranslation, MR::getCamZDir(), MR::getCamYDir() * 150.0f, 0xFFFF00FF, 0.0f, dVar4, 16);
61 TDDraw::drawFillFan(mTranslation, MR::getCamZDir(), MR::getCamYDir() * 150.0f, 0x80FF, dVar4, 150.0f, 16);
62}
63
64const char *BigBubbleGoalArea::getManagerName() const {
65 return "BigBubbleGoalArea";
66}
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.
Definition AreaObj.cpp:41
virtual void draw() const
Draws the object. Does nothing until overridden.
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.