diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index 48ee83ee..ad34f3f5 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -787,7 +787,7 @@ static void DrawContents() if( badVer.state != tracy::BadVersionState::Ok ) { if( loadThread.joinable() ) { loadThread.join(); } - tracy::BadVersion( badVer ); + tracy::BadVersion( badVer, bigFont ); } #endif diff --git a/server/TracyBadVersion.cpp b/server/TracyBadVersion.cpp index 87d59ebe..47d3ffa8 100644 --- a/server/TracyBadVersion.cpp +++ b/server/TracyBadVersion.cpp @@ -11,7 +11,7 @@ namespace tracy namespace detail { -void BadVersionImpl( BadVersionState& badVer ) +void BadVersionImpl( BadVersionState& badVer, ImFont* big ) { assert( badVer.state != BadVersionState::Ok ); @@ -35,7 +35,9 @@ void BadVersionImpl( BadVersionState& badVer ) } if( ImGui::BeginPopupModal( "Bad file", nullptr, ImGuiWindowFlags_AlwaysAutoResize ) ) { + if( big ) ImGui::PushFont( big ); TextCentered( ICON_FA_EXCLAMATION_TRIANGLE ); + if( big ) ImGui::PopFont(); ImGui::Text( "The file you are trying to open is not a Tracy dump." ); ImGui::Separator(); if( ImGui::Button( "Oops" ) ) @@ -47,7 +49,9 @@ void BadVersionImpl( BadVersionState& badVer ) } if( ImGui::BeginPopupModal( "File read error", nullptr, ImGuiWindowFlags_AlwaysAutoResize ) ) { + if( big ) ImGui::PushFont( big ); TextCentered( ICON_FA_EXCLAMATION_TRIANGLE ); + if( big ) ImGui::PopFont(); ImGui::Text( "The file you are trying to open cannot be mapped to memory." ); ImGui::Separator(); if( ImGui::Button( "OK" ) ) @@ -59,7 +63,9 @@ void BadVersionImpl( BadVersionState& badVer ) } if( ImGui::BeginPopupModal( "Unsupported file version", nullptr, ImGuiWindowFlags_AlwaysAutoResize ) ) { + if( big ) ImGui::PushFont( big ); TextCentered( ICON_FA_CLOUD_DOWNLOAD_ALT ); + if( big ) ImGui::PopFont(); ImGui::Text( "The file you are trying to open is unsupported.\nYou should update to Tracy %i.%i.%i or newer and try again.", badVer.version >> 16, ( badVer.version >> 8 ) & 0xFF, badVer.version & 0xFF ); ImGui::Separator(); if( ImGui::Button( ICON_FA_DOWNLOAD " Download update" ) ) @@ -78,7 +84,9 @@ void BadVersionImpl( BadVersionState& badVer ) } if( ImGui::BeginPopupModal( "Legacy file version", nullptr, ImGuiWindowFlags_AlwaysAutoResize ) ) { + if( big ) ImGui::PushFont( big ); TextCentered( ICON_FA_GHOST ); + if( big ) ImGui::PopFont(); ImGui::Text( "You are trying to open a file which was created by legacy version %i.%i.%i.\nUse the update utility from an older version of the profiler to convert the file to a supported version.", badVer.version >> 16, ( badVer.version >> 8 ) & 0xFF, badVer.version & 0xFF ); ImGui::Separator(); if( ImGui::Button( "Maybe I don't need it" ) ) diff --git a/server/TracyBadVersion.hpp b/server/TracyBadVersion.hpp index 5cc3023a..ba166509 100644 --- a/server/TracyBadVersion.hpp +++ b/server/TracyBadVersion.hpp @@ -1,6 +1,7 @@ #ifndef __TRACYBADVERSION_HPP__ #define __TRACYBADVERSION_HPP__ +#include #include "../common/TracyForceInline.hpp" namespace tracy @@ -23,10 +24,10 @@ struct BadVersionState namespace detail { -void BadVersionImpl( BadVersionState& badVer ); +void BadVersionImpl( BadVersionState& badVer, ImFont* big ); } -tracy_force_inline void BadVersion( BadVersionState& badVer ) { if( badVer.state != BadVersionState::Ok ) detail::BadVersionImpl( badVer ); } +tracy_force_inline void BadVersion( BadVersionState& badVer, ImFont* big ) { if( badVer.state != BadVersionState::Ok ) detail::BadVersionImpl( badVer, big ); } } diff --git a/server/TracyView.cpp b/server/TracyView.cpp index f223aa28..80501ceb 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -11744,7 +11744,7 @@ void View::DrawCompare() } } } - tracy::BadVersion( m_compare.badVer ); + tracy::BadVersion( m_compare.badVer, m_bigFont ); ImGui::End(); return; }