From 0776dddc35c7199764e96762ab10d9e4e4c4f6e5 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 14 Mar 2020 13:10:15 +0100 Subject: [PATCH] Display image compression ratio in bits per pixel. --- server/TracyView.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 4d26753b..7915e111 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -13045,9 +13045,17 @@ void View::DrawPlayback() ImGui::Spacing(); ImGui::SameLine(); char buf[64]; - auto ptr = PrintFloat( buf, buf+62, 100.f * fi->csz / ( size_t( fi->w ) * size_t( fi->h ) / 2 ), 2 ); - memcpy( ptr, "%", 2 ); + auto ptr = PrintFloat( buf, buf+62, 4.f * fi->csz / ( size_t( fi->w ) * size_t( fi->h ) / 2 ), 2 ); + memcpy( ptr, " bpp", 5 ); TextFocused( "Ratio:", buf ); + if( ImGui::IsItemHovered() ) + { + ImGui::BeginTooltip(); + ptr = PrintFloat( buf, buf+62, 100.f * fi->csz / ( size_t( fi->w ) * size_t( fi->h ) / 2 ), 2 ); + memcpy( ptr, "%", 2 ); + ImGui::TextUnformatted( buf ); + ImGui::EndTooltip(); + } ImGui::End(); }