SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
ChangeBgmCube.cpp
1#include "Game/AreaObj/ChangeBgmCube.hpp"
2#include "Game/AudioLib/AudWrap.hpp"
3#include "Game/GameAudio/AudStageBgmTable.hpp"
4
5ChangeBgmCube::ChangeBgmCube(int a1, const char *pName) : AreaObj(a1, pName) {
6 _3C = 0;
7}
8
9ChangeBgmCube::~ChangeBgmCube() {
10
11}
12
14 AreaObj::init(rIter);
15 MR::connectToSceneAreaObj(this);
16}
17
18// this is one massive function, todo
19/*
20void ChangeBgmCube::movement() {
21 bool valid = false;
22
23 if (mValid && _15 && _16) {
24 valid = true;
25 }
26
27 if (!valid) {
28 return;
29 }
30
31 if (MR::isCubeBgmChangeInvalid()) {
32 return;
33 }
34
35 if (MR::isPowerStarGetDemoActive()) {
36 mValid = false;
37 return;
38 }
39
40 if (MR::isPlayingStageBgmID(0x2000014)) {
41 mValid = false;
42 return;
43 }
44
45 if (MR::isPlayingStageBgmID(0x200003E)) {
46 mValid = false;
47 return;
48 }
49
50 if (MR::isPlayerDead()) {
51 mValid = false;
52 }
53
54 if (MR::isStageStateScenarioOpeningCamera()) {
55 return;
56 }
57
58 if (MR::isPlayingStageBgmID(0x200000A)) {
59 return;
60 }
61
62 if (MR::isPlayingStageBgmID(0x2000039)) {
63 return;
64 }
65
66 if (MR::isPlayingStageBgmID(0x2000003)) {
67 return;
68 }
69
70 if (!isInVolume(*MR::getPlayerPos())) {
71 _3C = false;
72 return;
73 }
74
75 if (!_3C) {
76 return;
77 }
78
79 switch(mObjArg0) {
80 case 1:
81 if (mObjArg3 != 1) {
82 if (MR::isGalaxyRedCometAppearInCurrentStage()) {
83 _3C = true;
84 return;
85 }
86
87 if (MR::isGalaxyBlackCometAppearInCurrentStage()) {
88 _3C = true;
89 return;
90 }
91 }
92
93 if (mObjArg1 < 0) {
94 mObjArg1 = 0x5A;
95 }
96
97 if (mObjArg2 >= 0) {
98 u32 bgmID = AudStageBgmTable::getBgmId(MR::getCurrentStageName(), mObjArg2);
99 if (bgmID != 0xFFFF) {
100 if (AudWrap::getBgmMgr()->_10 == bgmID) {
101 if (MR::isPlayingStageBgm()) {
102 _3C = 1;
103 return;
104 }
105 }
106
107 AudWrap::setNextIdStageBgm(bgmID);
108 }
109
110 MR::stopStageBGM(mObjArg1);
111 _3C = 1;
112 return;
113 }
114 break;
115 }
116}
117*/
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.
Definition AreaObj.cpp:41
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.