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) {
|
||||
auto aabox = GetTouchBounds();
|
||||
if (aabox) {
|
||||
m_actorDebugRender.setAABB(*aabox);
|
||||
m_actorDebugRender.draw(m_debugAddColor);
|
||||
if (!m_actorDebugRender) {
|
||||
m_actorDebugRender = CAABoxShader();
|
||||
}
|
||||
m_actorDebugRender->setAABB(*aabox);
|
||||
m_actorDebugRender->draw(m_debugAddColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ protected:
|
|||
void RenderInternal(const CStateManager& mgr) const;
|
||||
bool IsModelOpaque(const CStateManager& mgr) const;
|
||||
|
||||
CAABoxShader m_actorDebugRender;
|
||||
std::optional<CAABoxShader> m_actorDebugRender;
|
||||
|
||||
public:
|
||||
enum class EFluidState { EnteredFluid, InFluid, LeftFluid };
|
||||
|
|
Loading…
Reference in New Issue