Serialize CVarManager on shutdown; add build type to About

This commit is contained in:
Luke Street 2021-05-27 08:51:07 -04:00
parent 996eadfb4f
commit 3bb81f7fed
3 changed files with 32 additions and 9 deletions

View File

@ -302,6 +302,7 @@ public:
if (m_window) {
m_window->getCommandQueue()->stopRenderer();
}
m_cvarManager.serialize();
m_voiceEngine.reset();
m_amuseAllocWrapper.reset();
CDvdFile::Shutdown();

View File

@ -330,7 +330,13 @@ void ImGuiConsole::ShowAboutWindow() {
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
if (ImGui::Begin("About", &m_showAboutWindow, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse)) {
ImVec4& windowBg = ImGui::GetStyle().Colors[ImGuiCol_WindowBg];
ImGui::PushStyleColor(ImGuiCol_TitleBg, windowBg);
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, windowBg);
if (ImGui::Begin("About", &m_showAboutWindow,
ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav |
ImGuiWindowFlags_NoSavedSettings)) {
float iconSize = 256.f;
ImGui::SameLine(ImGui::GetWindowSize().x / 2 - iconSize + (iconSize / 2));
ImGui::Image(ImGuiUserTextureID_MetaforceIcon, ImVec2{iconSize, iconSize});
@ -350,36 +356,51 @@ void ImGuiConsole::ShowAboutWindow() {
if (ImGui::BeginTable("Version Info", 2, ImGuiTableFlags_BordersInnerV)) {
ImGui::TableNextRow();
if (ImGui::TableNextColumn()) {
ImGui::TextUnformatted("Branch");
ImGuiStringViewText("Branch");
}
if (ImGui::TableNextColumn()) {
ImGui::TextUnformatted(METAFORCE_WC_BRANCH);
ImGuiStringViewText(METAFORCE_WC_BRANCH);
}
ImGui::TableNextRow();
if (ImGui::TableNextColumn()) {
ImGui::TextUnformatted("Revision");
ImGuiStringViewText("Revision");
}
if (ImGui::TableNextColumn()) {
ImGui::TextUnformatted(METAFORCE_WC_REVISION);
ImGuiStringViewText(METAFORCE_WC_REVISION);
}
ImGui::TableNextRow();
if (ImGui::TableNextColumn()) {
ImGui::TextUnformatted("Date");
ImGuiStringViewText("Build");
}
if (ImGui::TableNextColumn()) {
ImGui::TextUnformatted(METAFORCE_WC_DATE);
ImGuiStringViewText(METAFORCE_DLPACKAGE);
}
ImGui::TableNextRow();
if (ImGui::TableNextColumn()) {
ImGui::TextUnformatted("Build name");
ImGuiStringViewText("Date");
}
if (ImGui::TableNextColumn()) {
ImGui::TextUnformatted(METAFORCE_DLPACKAGE);
ImGuiStringViewText(METAFORCE_WC_DATE);
}
ImGui::TableNextRow();
if (ImGui::TableNextColumn()) {
ImGuiStringViewText("Type");
}
if (ImGui::TableNextColumn()) {
ImGuiStringViewText(METAFORCE_BUILD_TYPE);
}
ImGui::TableNextRow();
if (ImGui::TableNextColumn()) {
ImGuiStringViewText("Game");
}
if (ImGui::TableNextColumn()) {
ImGuiStringViewText(g_Main->GetVersionString());
}
ImGui::EndTable();
}
}
ImGui::End();
ImGui::PopStyleColor(2);
}
void ImGuiConsole::ShowDebugOverlay() {

View File

@ -16,6 +16,7 @@
#define METAFORCE_WC_BRANCH "@METAFORCE_WC_BRANCH@"
#define METAFORCE_WC_REVISION "@METAFORCE_WC_REVISION@"
#define METAFORCE_WC_DATE "@METAFORCE_WC_DATE@"
#define METAFORCE_BUILD_TYPE "@CMAKE_BUILD_TYPE@"
#if defined(__x86_64__) || defined(_M_AMD64)
#define METAFORCE_DLPACKAGE "metaforce-@METAFORCE_WC_DESCRIBE@-@PLATFORM_NAME@-x86_64-@METAFORCE_VECTOR_ISA@"