mirror of https://github.com/AxioDL/metaforce.git
Only instantiate m_actorDebugRender when used
This commit is contained in:
parent
1b4e0dc754
commit
d8e5f03886
|
@ -202,8 +202,11 @@ void CActor::DrawTouchBounds() {
|
||||||
if (m_debugHovered || m_debugSelected) {
|
if (m_debugHovered || m_debugSelected) {
|
||||||
auto aabox = GetTouchBounds();
|
auto aabox = GetTouchBounds();
|
||||||
if (aabox) {
|
if (aabox) {
|
||||||
m_actorDebugRender.setAABB(*aabox);
|
if (!m_actorDebugRender) {
|
||||||
m_actorDebugRender.draw(m_debugAddColor);
|
m_actorDebugRender = CAABoxShader();
|
||||||
|
}
|
||||||
|
m_actorDebugRender->setAABB(*aabox);
|
||||||
|
m_actorDebugRender->draw(m_debugAddColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ protected:
|
||||||
void RenderInternal(const CStateManager& mgr) const;
|
void RenderInternal(const CStateManager& mgr) const;
|
||||||
bool IsModelOpaque(const CStateManager& mgr) const;
|
bool IsModelOpaque(const CStateManager& mgr) const;
|
||||||
|
|
||||||
CAABoxShader m_actorDebugRender;
|
std::optional<CAABoxShader> m_actorDebugRender;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum class EFluidState { EnteredFluid, InFluid, LeftFluid };
|
enum class EFluidState { EnteredFluid, InFluid, LeftFluid };
|
||||||
|
|
Loading…
Reference in New Issue