Add conditional showing of Clear Debug Draw buttons only if there is anything to clear
#2989
This commit is contained in:
@@ -347,6 +347,11 @@ struct DebugDrawContext
|
||||
DebugDrawData DebugDrawDepthTest;
|
||||
Float3 LastViewPos = Float3::Zero;
|
||||
Matrix LastViewProj = Matrix::Identity;
|
||||
|
||||
inline int32 Count() const
|
||||
{
|
||||
return DebugDrawDefault.Count() + DebugDrawDepthTest.Count();
|
||||
}
|
||||
};
|
||||
|
||||
namespace
|
||||
@@ -739,6 +744,13 @@ void DebugDraw::SetContext(void* context)
|
||||
Context = context ? (DebugDrawContext*)context : &GlobalContext;
|
||||
}
|
||||
|
||||
bool DebugDraw::CanClear(void* context)
|
||||
{
|
||||
if (!context)
|
||||
context = &GlobalContext;
|
||||
return ((DebugDrawContext*)context)->Count() != 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Vector3 DebugDraw::GetViewPos()
|
||||
|
||||
Reference in New Issue
Block a user