SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
AirBubbleHolder.cpp
1#include "Game/MapObj/AirBubbleHolder.hpp"
2#include "Game/MapObj/AirBubble.hpp"
3#include "Game/Scene/SceneObjHolder.hpp"
4
5AirBubbleHolder::AirBubbleHolder(const char *pName) : LiveActorGroup(pName, 64) { }
6
7#ifdef NON_MATCHING // AirBubble isn't finished so the size is wrong
8void AirBubbleHolder::init(const JMapInfoIter &rIter) {
9 for (s32 i = 0; i < 32; i++) {
10 AirBubble* bubble = new AirBubble("空気アワ(共用)");
11 bubble->initWithoutIter();
12 bubble->makeActorAppeared();
13 registerActor(bubble);
14 }
15}
16#endif
17
18void AirBubbleHolder::appearAirBubble(const TVec3f &a1, s32 a2) {
19 AirBubble* bubble;
20 if (getDeadActor()) {
21 bubble = reinterpret_cast<AirBubble*>(getDeadActor());
22 }
23 else {
24 bubble = nullptr;
25 }
26
27 if (bubble) {
28 bubble->appearMove(a1, a2);
29 }
30}
31
32namespace MR {
33 AirBubbleHolder* createAirBubbleHolder() {
34 return reinterpret_cast<AirBubbleHolder*>(MR::createSceneObj(SceneObj_AirBubbleHolder));
35 }
36
37 void appearAirBubble(const TVec3f &a1, s32 a2) {
38 reinterpret_cast<AirBubbleHolder*>(MR::getSceneObjHolder()->getObj(SceneObj_AirBubbleHolder))->appearAirBubble(a1, a2);
39 }
40};
virtual void init(const JMapInfoIter &)
Intializes the NameObj and can set various settings and construct necessary classes.
void initWithoutIter()
Initializes a NameObj without a JMapInfoIter instance.
Definition NameObj.cpp:41