Display locks source locations in options locks list.

This commit is contained in:
Bartosz Taudul 2018-09-18 16:14:32 +02:00
parent 42360f50b0
commit 06eec51ed9
2 changed files with 27 additions and 2 deletions

View File

@ -723,6 +723,7 @@ bool View::DrawImpl()
m_callstackTreeBuzzAnim.Update( io.DeltaTime ); m_callstackTreeBuzzAnim.Update( io.DeltaTime );
m_zoneinfoBuzzAnim.Update( io.DeltaTime ); m_zoneinfoBuzzAnim.Update( io.DeltaTime );
m_findZoneBuzzAnim.Update( io.DeltaTime ); m_findZoneBuzzAnim.Update( io.DeltaTime );
m_optionsLockBuzzAnim.Update( io.DeltaTime );
return keepOpen; return keepOpen;
} }
@ -4260,11 +4261,34 @@ void View::DrawOptions()
{ {
if( l.second.valid ) if( l.second.valid )
{ {
auto& sl = m_worker.GetSourceLocation( l.second.srcloc );
auto fileName = m_worker.GetString( sl.file );
char buf[1024]; char buf[1024];
sprintf( buf, "%" PRIu32 ": %s", l.first, m_worker.GetString( m_worker.GetSourceLocation( l.second.srcloc ).function ) ); sprintf( buf, "%" PRIu32 ": %s", l.first, m_worker.GetString( m_worker.GetSourceLocation( l.second.srcloc ).function ) );
ImGui::Checkbox( buf, &Visible( &l.second ) ); ImGui::Checkbox( buf, &Visible( &l.second ) );
if( m_optionsLockBuzzAnim.Match( l.second.srcloc ) )
{
const auto time = m_optionsLockBuzzAnim.Time();
const auto indentVal = sin( time * 60.f ) * 10.f * time;
ImGui::SameLine( 0, ImGui::GetStyle().ItemSpacing.x + indentVal );
}
else
{
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextDisabled( "%s events", RealToString( l.second.timeline.size(), true ) ); }
ImGui::TextDisabled( "(%s) %s:%i", RealToString( l.second.timeline.size(), true ), fileName, sl.line );
if( ImGui::IsItemClicked( 1 ) )
{
if( FileExists( fileName ) )
{
SetTextEditorFile( fileName, sl.line );
}
else
{
m_optionsLockBuzzAnim.Enable( l.second.srcloc, 0.5f );
}
}
} }
} }
ImGui::TreePop(); ImGui::TreePop();

View File

@ -253,6 +253,7 @@ private:
BuzzAnim<int> m_callstackTreeBuzzAnim; BuzzAnim<int> m_callstackTreeBuzzAnim;
BuzzAnim<const void*> m_zoneinfoBuzzAnim; BuzzAnim<const void*> m_zoneinfoBuzzAnim;
BuzzAnim<int> m_findZoneBuzzAnim; BuzzAnim<int> m_findZoneBuzzAnim;
BuzzAnim<uint32_t> m_optionsLockBuzzAnim;
Vector<const ZoneEvent*> m_zoneInfoStack; Vector<const ZoneEvent*> m_zoneInfoStack;
Vector<const GpuEvent*> m_gpuInfoStack; Vector<const GpuEvent*> m_gpuInfoStack;