SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
ViewGroupCtrl.cpp
1#include "Game/LiveActor/ViewGroupCtrl.hpp"
2#include "Game/Util/Array.hpp"
3
4ViewGroupCtrl::ViewGroupCtrl() {
5 mViewCubeMgr = nullptr;
6 mMaxViewGroupId = 0;
7 mViewGroupData = nullptr;
8 mViewCtrlCount = 0;
9 mLodCtrls = nullptr;
10 mLodCtrls = new LodCtrl*[0x100];
11
12 for (u32 i = 0; i < 0x100; i++) {
13 mLodCtrls[i] = nullptr;
14 }
15}
16
17void ViewGroupCtrl::initActorInfo(ClippingActorInfo *pInfo, s32 groupID) {
18 pInfo->_12 = groupID;
19
20 if (groupID >= mMaxViewGroupId) {
21 mMaxViewGroupId = groupID + 1;
22 }
23}
24
25void ViewGroupCtrl::initViewGroup(ClippingActorInfoList *pList) {
26 for (s32 i = 0; i < pList->_4; i++) {
27 s32 id = pList->mClippingActorList[i]->_12;
28
29 if (id < 0) {
30 id = mMaxViewGroupId;
31 }
32
33 pList->mClippingActorList[i]->_14 = &mViewGroupData[id];
34 }
35}
36
37void ViewGroupCtrl::endInitViewGroupTable() {
38
39}
40
41void ViewGroupCtrl::entryLodCtrl(LodCtrl *pCtrl, const JMapInfoIter &rIter) {
42 s32 groupID = -1;
43 if (MR::getJMapInfoViewGroupID(rIter, &groupID)) {
44 pCtrl->mViewGroupID = groupID;
45 mLodCtrls[mViewCtrlCount] = pCtrl;
46 mViewCtrlCount++;
47 }
48}