SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
GameCameraCreator.cpp
1#include "Game/Camera/CameraDirector.hpp"
2#include "Game/Camera/CameraParamChunkHolder.hpp"
3#include "Game/Camera/GameCameraCreator.hpp"
4#include "Game/Util/AreaObjUtil.hpp"
5#include <cstring>
6#include <mem.h>
7
8GameCameraCreator::GameCameraCreator(CameraParamChunkHolder *pChunkHolder) {
9 mChunkHolder = pChunkHolder;
10 _4 = nullptr;
11 _8 = -1;
12
13 memset(&mCodes[0], 0, sizeof(mCodes));
14}
15
16void GameCameraCreator::initCameraCodeCollection(const char *a1, long a2) {
17 _4 = a1;
18 _8 = a2;
19}
20
21void GameCameraCreator::registerCameraCode(unsigned long code) {
22 if (code >= 0xFF) {
23 return;
24 }
25
26 mCodes[code] = 1;
27}
28
29void GameCameraCreator::termCameraCodeCollection() {
30 for (u32 i = 0; i < 0xFF; i++) {
31 if (mCodes[i] != 0) {
32 mCodes[i] = 0;
33
35 chunk.createGroupID(_8, _4, i, 0);
36
37 mChunkHolder->createChunk(chunk, nullptr);
38 }
39 }
40
41 _4 = nullptr;
42 _8 = -1;
43}