SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
CameraTargetArg.cpp
1#include "Game/Camera/CameraDirector.hpp"
2#include "Game/Camera/CameraTargetArg.hpp"
3#include "Game/Camera/CameraTargetObj.hpp"
4#include "Game/Camera/CameraTargetMtx.hpp"
5#include "Game/LiveActor/LiveActor.hpp"
6
7CameraTargetArg::CameraTargetArg(const LiveActor *pLiveActor) {
8 mLiveActor = pLiveActor;
9 mTargetObj = nullptr;
10 mTargetMtx = nullptr;
11 mMarioActor = nullptr;
12}
13
14void CameraTargetArg::setTarget() const {
15 CameraTargetObj* obj = mTargetObj;
16
17 if (obj != nullptr) {
18 CameraDirector *director = MR::getCameraDirector();
19 director->setTarget(obj);
20 return;
21 }
22
23 CameraTargetMtx *mtx = mTargetMtx;
24
25 if (mtx != nullptr) {
26 mtx->invalidateLastMove();
27
28 CameraDirector *director = MR::getCameraDirector();
29 director->setTarget(mTargetMtx);
30 return;
31 }
32
33 const LiveActor *liveActor = mLiveActor;
34
35 if (liveActor != nullptr) {
36 CameraDirector *director = MR::getCameraDirector();
37 director->setTargetActor(liveActor);
38 return;
39 }
40
41 MarioActor *marioActor = mMarioActor;
42
43 if (marioActor != nullptr) {
44 CameraDirector *director = MR::getCameraDirector();
45 director->setTargetPlayer(marioActor);
46 }
47}
The basis of a drawable actor that can contain states (see: Nerve)
Definition LiveActor.hpp:24