SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
NameObjAdaptor.cpp
1#include "Game/NameObj/NameObjAdaptor.hpp"
2
3NameObjAdaptor::NameObjAdaptor(const char *pName) : NameObj(pName) {
4 mMovementFunc = 0;
5 mCalcAnimFunc = 0;
6 mCalcViewFunc = 0;
7 mDrawAnimFunc = 0;
8}
9
10NameObjAdaptor::~NameObjAdaptor() {
11 delete mMovementFunc;
12 delete mCalcAnimFunc;
13 delete mCalcViewFunc;
14 delete mDrawAnimFunc;
15}
16
17void NameObjAdaptor::movement() {
18 if (mMovementFunc) {
19 (*mMovementFunc)();
20 }
21}
22
23void NameObjAdaptor::calcAnim() {
24 if (mCalcAnimFunc) {
25 (*mCalcAnimFunc)();
26 }
27}
28
29void NameObjAdaptor::calcViewAndEntry() {
30 if (mCalcViewFunc) {
31 (*mCalcViewFunc)();
32 }
33}
34
36 if (mDrawAnimFunc) {
37 (*mDrawAnimFunc)();
38 }
39}
40
41void NameObjAdaptor::connectToMovement(const MR::FunctorBase &rFunctor) {
42 mMovementFunc = rFunctor.clone(0);
43}
44
45void NameObjAdaptor::connectToCalcAnim(const MR::FunctorBase &rFunctor) {
46 mCalcAnimFunc = rFunctor.clone(0);
47}
48
49void NameObjAdaptor::connectToDraw(const MR::FunctorBase &rFunctor) {
50 mDrawAnimFunc = rFunctor.clone(0);
51}
virtual void draw() const
Draws the object. Does nothing until overridden.
The most basic form of an object.
Definition NameObj.hpp:11