mirror of https://github.com/AxioDL/metaforce.git
Decomp fix for CStateManager::BuildDynamicLightListForWorld
This commit is contained in:
parent
058194429e
commit
9b407bd131
|
@ -534,6 +534,8 @@ void CStateManager::BuildDynamicLightListForWorld() {
|
||||||
}
|
}
|
||||||
|
|
||||||
x8e0_dynamicLights.clear();
|
x8e0_dynamicLights.clear();
|
||||||
|
x8e0_dynamicLights.reserve(GetLightObjectList().size());
|
||||||
|
|
||||||
for (const CEntity* ent : GetLightObjectList()) {
|
for (const CEntity* ent : GetLightObjectList()) {
|
||||||
const auto& light = static_cast<const CGameLight&>(*ent);
|
const auto& light = static_cast<const CGameLight&>(*ent);
|
||||||
if (light.GetActive()) {
|
if (light.GetActive()) {
|
||||||
|
@ -543,7 +545,18 @@ void CStateManager::BuildDynamicLightListForWorld() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::sort(x8e0_dynamicLights.begin(), x8e0_dynamicLights.end(), [](const CLight& a, const CLight& b) {
|
||||||
|
if (b.GetPriority() > a.GetPriority()) {
|
||||||
|
return true;
|
||||||
|
} else if (b.GetPriority() == a.GetPriority()) {
|
||||||
|
return a.GetIntensity() > b.GetIntensity();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStateManager::DrawDebugStuff() const {
|
void CStateManager::DrawDebugStuff() const {
|
||||||
if (com_developer != nullptr && !com_developer->toBoolean()) {
|
if (com_developer != nullptr && !com_developer->toBoolean()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -90,6 +90,7 @@ public:
|
||||||
|
|
||||||
ELightType GetType() const { return x1c_type; }
|
ELightType GetType() const { return x1c_type; }
|
||||||
u32 GetId() const { return x40_lightId; }
|
u32 GetId() const { return x40_lightId; }
|
||||||
|
u32 GetPriority() const { return x3c_priority; }
|
||||||
float GetIntensity() const;
|
float GetIntensity() const;
|
||||||
float GetRadius() const;
|
float GetRadius() const;
|
||||||
const zeus::CColor& GetColor() const { return x18_color; }
|
const zeus::CColor& GetColor() const { return x18_color; }
|
||||||
|
|
Loading…
Reference in New Issue