From 37f42a52fb9cc97488927bf1f75c9a05ea5c69ee Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 4 Aug 2018 21:46:26 +0200 Subject: [PATCH] Proper frame names on frames graph. --- server/TracyView.cpp | 53 ++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 09c55683..22079831 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -675,32 +675,43 @@ void View::DrawFrames() } else { - const auto offset = m_worker.GetFrameOffset(); - if( sel == 0 ) + if( m_frames->name == 0 ) { - ImGui::Text( "Tracy initialization" ); - ImGui::Separator(); - TextFocused( "Time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) ); - } - else if( offset == 0 ) - { - ImGui::TextDisabled( "Frame:" ); - ImGui::SameLine(); - ImGui::Text( "%s", RealToString( sel, true ) ); - ImGui::Separator(); - TextFocused( "Frame time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) ); - } - else if( sel == 1 ) - { - ImGui::Text( "Missed frames" ); - ImGui::Separator(); - TextFocused( "Time:", TimeToString( m_worker.GetFrameTime( *m_frames, 1 ) ) ); + const auto offset = m_worker.GetFrameOffset(); + if( sel == 0 ) + { + ImGui::Text( "Tracy initialization" ); + ImGui::Separator(); + TextFocused( "Time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) ); + } + else if( offset == 0 ) + { + ImGui::TextDisabled( "Frame:" ); + ImGui::SameLine(); + ImGui::Text( "%s", RealToString( sel, true ) ); + ImGui::Separator(); + TextFocused( "Frame time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) ); + } + else if( sel == 1 ) + { + ImGui::Text( "Missed frames" ); + ImGui::Separator(); + TextFocused( "Time:", TimeToString( m_worker.GetFrameTime( *m_frames, 1 ) ) ); + } + else + { + ImGui::TextDisabled( "Frame:" ); + ImGui::SameLine(); + ImGui::Text( "%s", RealToString( sel + offset - 1, true ) ); + ImGui::Separator(); + TextFocused( "Frame time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) ); + } } else { - ImGui::TextDisabled( "Frame:" ); + ImGui::TextDisabled( "%s:", m_worker.GetString( m_frames->name ) ); ImGui::SameLine(); - ImGui::Text( "%s", RealToString( sel + offset - 1, true ) ); + ImGui::Text( "%s", RealToString( sel, true ) ); ImGui::Separator(); TextFocused( "Frame time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) ); }