From afa967afb0d5a145857301472fa5524a2db60ee1 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 12 Jun 2019 15:30:08 +0200 Subject: [PATCH] Flip frame image if need be. --- server/TracyView.cpp | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 6f01795d..62ecf52e 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1277,7 +1277,14 @@ void View::DrawFrames() m_frameTexturePtr = fi; } ImGui::Separator(); - ImGui::Image( m_frameTexture, ImVec2( fi->w, fi->h ), ImVec2( 0, 1 ), ImVec2( 1, 0 ) ); + if( fi->flip ) + { + ImGui::Image( m_frameTexture, ImVec2( fi->w, fi->h ), ImVec2( 0, 1 ), ImVec2( 1, 0 ) ); + } + else + { + ImGui::Image( m_frameTexture, ImVec2( fi->w, fi->h ) ); + } } ImGui::EndTooltip(); @@ -1665,7 +1672,14 @@ bool View::DrawZoneFrames( const FrameData& frames ) m_frameTexturePtr = fi; } ImGui::Separator(); - ImGui::Image( m_frameTexture, ImVec2( fi->w, fi->h ), ImVec2( 0, 1 ), ImVec2( 1, 0 ) ); + if( fi->flip ) + { + ImGui::Image( m_frameTexture, ImVec2( fi->w, fi->h ), ImVec2( 0, 1 ), ImVec2( 1, 0 ) ); + } + else + { + ImGui::Image( m_frameTexture, ImVec2( fi->w, fi->h ) ); + } } ImGui::EndTooltip(); @@ -9072,7 +9086,14 @@ void View::DrawPlayback() } ImGui::Begin( "Playback", &m_showPlayback, ImGuiWindowFlags_AlwaysAutoResize ); - ImGui::Image( m_playback.texture, ImVec2( fi->w, fi->h ), ImVec2( 0, 1 ), ImVec2( 1, 0 ) ); + if( fi->flip ) + { + ImGui::Image( m_playback.texture, ImVec2( fi->w, fi->h ), ImVec2( 0, 1 ), ImVec2( 1, 0 ) ); + } + else + { + ImGui::Image( m_playback.texture, ImVec2( fi->w, fi->h ) ); + } int tmp = m_playback.frame + 1; if( ImGui::SliderInt( "Frame image", &tmp, 1, ficnt, "%d" ) ) {