2023-12-13 00:40:16 -05:00
|
|
|
#include "Game/LiveActor/ViewGroupCtrl.hpp"
|
|
|
|
|
#include "Game/Util/Array.hpp"
|
2022-11-05 18:43:24 -04:00
|
|
|
|
|
|
|
|
ViewGroupCtrl::ViewGroupCtrl() {
|
2023-02-13 03:33:10 -05:00
|
|
|
mViewCubeMgr = nullptr;
|
2022-11-05 18:43:24 -04:00
|
|
|
mMaxViewGroupId = 0;
|
2023-02-13 03:33:10 -05:00
|
|
|
mViewGroupData = nullptr;
|
2022-11-05 18:43:24 -04:00
|
|
|
mViewCtrlCount = 0;
|
2023-02-13 03:33:10 -05:00
|
|
|
mLodCtrls = nullptr;
|
2022-11-05 18:43:24 -04:00
|
|
|
mLodCtrls = new LodCtrl*[0x100];
|
|
|
|
|
|
|
|
|
|
for (u32 i = 0; i < 0x100; i++) {
|
2023-02-13 03:33:10 -05:00
|
|
|
mLodCtrls[i] = nullptr;
|
2022-11-05 18:43:24 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ViewGroupCtrl::initActorInfo(ClippingActorInfo *pInfo, s32 groupID) {
|
|
|
|
|
pInfo->_12 = groupID;
|
|
|
|
|
|
|
|
|
|
if (groupID >= mMaxViewGroupId) {
|
|
|
|
|
mMaxViewGroupId = groupID + 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ViewGroupCtrl::initViewGroup(ClippingActorInfoList *pList) {
|
|
|
|
|
for (s32 i = 0; i < pList->_4; i++) {
|
|
|
|
|
s32 id = pList->mClippingActorList[i]->_12;
|
|
|
|
|
|
|
|
|
|
if (id < 0) {
|
|
|
|
|
id = mMaxViewGroupId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pList->mClippingActorList[i]->_14 = &mViewGroupData[id];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ViewGroupCtrl::endInitViewGroupTable() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ViewGroupCtrl::entryLodCtrl(LodCtrl *pCtrl, const JMapInfoIter &rIter) {
|
|
|
|
|
s32 groupID = -1;
|
|
|
|
|
if (MR::getJMapInfoViewGroupID(rIter, &groupID)) {
|
|
|
|
|
pCtrl->mViewGroupID = groupID;
|
|
|
|
|
mLodCtrls[mViewCtrlCount] = pCtrl;
|
|
|
|
|
mViewCtrlCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|