SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
CameraCover.cpp
1#include "Game/Camera/CameraCover.hpp"
2#include "Game/Screen/ImageEffectLocalUtil.hpp"
3#include "Game/Scene/SceneFunction.hpp"
4#include "Game/Util.hpp"
5
6namespace {
7 const f32 sAngleThreshold = (JGeometry::TUtil<f32>::PI() * 60.0f) / 180.0f;
8};
9
10CameraCover::CameraCover(const char *pName) : NameObj(pName) {
11 _3C = 0;
12 _40 = 0;
13 _41 = false;
14 _44 = 1;
15 mActor = new CaptureScreenActor(46, "Camera");
16 MR::connectToScene(this, 26, -1, -1, 81);
17 MR::joinToNameObjGroup(this, "IgnorePauseNameObj");
18 _C.identity();
19 mActor->initWithoutIter();
20}
21
22void CameraCover::movement() {
23 if (isCameraHopping()) {
24 if (!_3C) {
25 MR::startToCaptureScreen("Camera");
26 CategoryList::execute((MR::DrawType)0x2E);
27 _3C = _44 + 1;
28 }
29 }
30
31 if (_3C && !--_3C) {
32 MR::endToCaptureScreen("Camera");
33 }
34
35 copyCamera();
36 _40 = 0;
37 _41 = false;
38}
39
40void CameraCover::draw() const {
41 if (_3C) {
42 ResTIMG* timg = MR::getScreenResTIMG();
43 JUTTexture texture;
44 texture._28 = 0;
45 texture.storeTIMG(timg, (u8)0);
46 texture._3B &= 2;
47 ImageEffectLocalUtil::setupDrawTexture();
48 ImageEffectLocalUtil::drawTexture(&texture, 1, 0, 255, (ImageEffectLocalUtil::ETexDrawType)0);
49 }
50}
51
52void CameraCover::cover(u32 a1) {
53 _44 = a1;
54 _41 = true;
55}
56
57bool CameraCover::isCameraHopping() const {
58 if (_40) {
59 return false;
60 }
61
62 return _41;
63}
64
65void CameraCover::copyCamera() {
66 _C.setInline(*MR::getCameraInvViewMtx());
67}
68
69CameraCover::~CameraCover() {
70
71}
virtual void draw() const
Draws the object. Does nothing until overridden.
The most basic form of an object.
Definition NameObj.hpp:11