SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
LightAreaHolder.cpp
1#include "Game/AreaObj/LightAreaHolder.hpp"
2#include "Game/Map/LightZoneDataHolder.hpp"
3#include "Game/Map/LightFunction.hpp"
4
5LightAreaHolder::LightAreaHolder(s32 type, const char *pName) : AreaObjMgr(type, pName) {
6 LightFunction::registerLightAreaHolder(this);
7}
8
9#ifdef NON_MATCHING
10// for some reason the register movement for isTargetArea are wrong
11bool LightAreaHolder::tryFindLightID(const TVec3f &rArea, ZoneLightID *pLightID) const {
12 const LightArea* lightArea = reinterpret_cast<LightArea*>(find_in(rArea));
13
14 if (!lightArea) {
15 if (pLightID->isOutOfArea()) {
16 pLightID->clear();
17 return false;
18 }
19 else {
20 pLightID->clear();
21 return true;
22 }
23 }
24 else {
25 if (pLightID->isTargetArea(lightArea)) {
26 return false;
27 }
28 else {
29 pLightID->_0 = lightArea->mPlacedZoneID;
30 pLightID->mLightID = lightArea->mObjArg0;
31 return true;
32 }
33 }
34}
35#endif
36
37void LightAreaHolder::initAfterPlacement() {
38 sort();
39}
40
41LightAreaHolder::~LightAreaHolder() {
42
43}