SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
LayoutActor.cpp
1#include "Game/Screen/LayoutActor.hpp"
2#include "Game/Screen/PaneEffectKeeper.hpp"
3#include "Game/Util/LayoutUtil.hpp"
4
5LayoutActor::LayoutActor(const char *pName, bool) : NameObj(pName),
6 mManager(nullptr), mSpine(nullptr), mPaneEffectKeeper(nullptr), mStarPointerTargetKeeper(nullptr) {
7}
8
9void LayoutActor::movement() {
10 if (!MR::isDead(this)) {
11 updateSpine();
12
13 if (!MR::isDead(this)) {
14 control();
15 if (mManager && !MR::isStoppedAnimFrame(this)) {
16 mManager->movement();
17 }
18 }
19 }
20}
21
22void LayoutActor::calcAnim() {
23 if (MR::isExecuteCalcAnimLayout(this)) {
24 mManager->calcAnim();
25 }
26}
27
28void LayoutActor::draw() const {
29 if (MR::isExecuteDrawLayout(this)) {
30 mManager->draw();
31 }
32}
33
34void LayoutActor::appear() {
35 mFlags.mIsDead = false;
36 calcAnim();
37}
38
39void LayoutActor::kill() {
40 if (mPaneEffectKeeper) {
41 mPaneEffectKeeper->clear();
42 }
43
44 mFlags.mIsDead = true;
45}
46
47void LayoutActor::setNerve(const Nerve *pNerve) const {
48 mSpine->setNerve(pNerve);
49}
50
51bool LayoutActor::isNerve(const Nerve *pNerve) const {
52 return !(mSpine->getCurrentNerve() != pNerve);
53}
54
55s32 LayoutActor::getNerveStep() const {
56 return mSpine->mStep;
57}
58
59/*
60const TVec2f LayoutActor::getTrans() const {
61 TVec2f trans;
62 MR::copyPaneTrans(&trans, this, nullptr);
63 MR::convertLayoutPosToScreenPos(&trans, trans);
64 return trans;
65}*/
66
67// LayoutActor::setTrans
68
69LayoutManager* LayoutActor::getLayoutManager() const {
70 return mManager;
71}
72
73// LayoutActor::createPaneMtxRef
74// LayoutActor::getPaneMtxRef
75
76void LayoutActor::initLayoutManager(const char *pName, u32 a2) {
77 mManager = new LayoutManager(pName, true, a2, 0x100);
78}
79
80void LayoutActor::initLayoutManagerNoConvertFilename(const char *pName, u32 a2) {
81 mManager = new LayoutManager(pName, false, a2, 0x100);
82}
83
84void LayoutActor::initLayoutManagerWithTextBoxBufferLength(const char *pName, u32 textBoxBufLen, u32 a3) {
85 mManager = new LayoutManager(pName, false, a3, textBoxBufLen);
86}
87
88void LayoutActor::initNerve(const Nerve *pNerve) {
89 mSpine = new Spine(this, pNerve);
90}
91
92// LayoutActor::initEffectKeeper
93// LayoutActor::initPointingTarget
94
95void LayoutActor::updateSpine() {
96 if (mSpine) {
97 mSpine->update();
98 }
99}
virtual void draw() const
Draws the object. Does nothing until overridden.
The most basic form of an object.
Definition NameObj.hpp:11
Used for executing states of a LiveActor.
Definition Nerve.hpp:6
Definition Spine.hpp:9