mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 09:14:36 +00:00
51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#include <assert.h>
|
|
|
|
#include "TracyBadVersion.hpp"
|
|
#include "TracyImGui.hpp"
|
|
|
|
namespace tracy
|
|
{
|
|
|
|
namespace detail
|
|
{
|
|
|
|
void BadVersionImpl( int& badVer )
|
|
{
|
|
assert( badVer != 0 );
|
|
|
|
if( badVer > 0 )
|
|
{
|
|
ImGui::OpenPopup( "Unsupported file version" );
|
|
}
|
|
else
|
|
{
|
|
ImGui::OpenPopup( "Bad file" );
|
|
}
|
|
if( ImGui::BeginPopupModal( "Unsupported file version", nullptr, ImGuiWindowFlags_AlwaysAutoResize ) )
|
|
{
|
|
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 >> 16, ( badVer >> 8 ) & 0xFF, badVer & 0xFF );
|
|
ImGui::Separator();
|
|
if( ImGui::Button( "I understand" ) )
|
|
{
|
|
ImGui::CloseCurrentPopup();
|
|
badVer = 0;
|
|
}
|
|
ImGui::EndPopup();
|
|
}
|
|
if( ImGui::BeginPopupModal( "Bad file", nullptr, ImGuiWindowFlags_AlwaysAutoResize ) )
|
|
{
|
|
ImGui::Text( "The file you are trying to open is not a tracy dump." );
|
|
ImGui::Separator();
|
|
if( ImGui::Button( "Oops" ) )
|
|
{
|
|
ImGui::CloseCurrentPopup();
|
|
badVer = 0;
|
|
}
|
|
ImGui::EndPopup();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|