OpenGL memory leak fix

This commit is contained in:
Jack Andersen 2019-03-04 22:34:43 -10:00
parent ed4ebf0af1
commit 4b042f6f9a
3 changed files with 9 additions and 6 deletions

View File

@ -18,12 +18,14 @@ CTransitionDatabaseGame::CTransitionDatabaseGame(const std::vector<CTransition>&
}
const std::shared_ptr<IMetaTrans>& CTransitionDatabaseGame::GetMetaTrans(u32 a, u32 b) const {
auto it = std::find_if(x14_transitions.cbegin(), x14_transitions.cend(),
[&](const std::pair<std::pair<u32, u32>, std::shared_ptr<IMetaTrans>>& elem) -> bool {
return elem.first.first == a && elem.first.second == b;
});
auto it = rstl::binary_find(x14_transitions.cbegin(), x14_transitions.cend(), std::make_pair(a, b),
[](const std::pair<std::pair<u32, u32>, std::shared_ptr<IMetaTrans>>& p) { return p.first; });
if (it != x14_transitions.cend())
return it->second;
auto it2 = rstl::binary_find(x24_halfTransitions.cbegin(), x24_halfTransitions.cend(), b,
[](const std::pair<u32, std::shared_ptr<IMetaTrans>>& p) { return p.first; });
if (it2 != x24_halfTransitions.cend())
return it2->second;
return x10_defaultTrans;
}

View File

@ -255,7 +255,8 @@ void CScriptPlatform::Think(float dt, CStateManager& mgr) {
if (!x356_25_notAnimating)
UpdateAnimation(dt, mgr, true);
if (x356_28_rainSplashes && mgr.GetWorld()->GetNeededEnvFx() == EEnvFxType::Rain) {
if (HasModelData() && !GetModelData()->IsNull() && mgr.GetEnvFxManager()->GetRainMagnitude() != 0.f)
if (HasModelData() && !GetModelData()->IsNull() && mgr.GetEnvFxManager()->IsSplashActive() &&
mgr.GetEnvFxManager()->GetRainMagnitude() != 0.f)
mgr.GetActorModelParticles()->AddRainSplashGenerator(*this, mgr, x34c_maxRainSplashes, x350_rainGenRate, 0.f);
}
}

2
hecl

@ -1 +1 @@
Subproject commit ad075d532e478c0f90b86200828ef7585050c817
Subproject commit 8393970b82fabcf604be5935368a77b949416ebb