From bd48e24c321637b083c43929225fe1f135b9cd40 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 1 Aug 2024 01:11:58 +0300 Subject: [PATCH] print git info to log as well --- .reuse/dep5 | 1 + src/common/version.h | 1 + src/emulator.cpp | 15 ++++++++++++--- src/sdl_window.cpp | 3 ++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.reuse/dep5 b/.reuse/dep5 index c467a164..5f081569 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -16,6 +16,7 @@ Files: CMakeSettings.json documents/Screenshots/We are DOOMED.png externals/stb_image.h externals/tracy/* + externals/cmake-modules/* scripts/ps4_names.txt src/images/controller_icon.png src/images/exit_icon.png diff --git a/src/common/version.h b/src/common/version.h index 8492c7d9..92fd18fb 100644 --- a/src/common/version.h +++ b/src/common/version.h @@ -9,5 +9,6 @@ namespace Common { constexpr char VERSION[] = "0.1.1 WIP"; +constexpr bool isRelease = false; } // namespace Common diff --git a/src/emulator.cpp b/src/emulator.cpp index 41b3b576..a34ee359 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -26,8 +26,8 @@ #include "core/linker.h" #include "core/memory.h" #include "emulator.h" -#include "video_core/renderdoc.h" #include "src/common/scm_rev.h" +#include "video_core/renderdoc.h" Frontend::WindowSDL* g_window = nullptr; @@ -50,6 +50,9 @@ Emulator::Emulator() { Common::Log::Initialize(); Common::Log::Start(); LOG_INFO(Loader, "Starting shadps4 emulator v{} ", Common::VERSION); + LOG_INFO(Loader, "Revision {}", Common::g_scm_rev); + LOG_INFO(Loader, "Branch {}", Common::g_scm_branch); + LOG_INFO(Loader, "Description {}", Common::g_scm_desc); // Defer until after logging is initialized. memory = Core::Memory::Instance(); @@ -101,9 +104,15 @@ void Emulator::Run(const std::filesystem::path& file) { } } } - + std::string game_title = fmt::format("{} - {} <{}>", id, title, app_version); - const std::string window_title = fmt::format("shadPS4 v{} {}| {}", Common::VERSION, Common::g_scm_desc,game_title); + std::string window_title = ""; + if (Common::isRelease) { + window_title = fmt::format("shadPS4 v{} | {}", Common::VERSION, game_title); + } else { + window_title = + fmt::format("shadPS4 v{} {} | {}", Common::VERSION, Common::g_scm_desc, game_title); + } window = std::make_unique(WindowWidth, WindowHeight, controller, window_title); diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index 98c883ee..0d25cd3f 100644 --- a/src/sdl_window.cpp +++ b/src/sdl_window.cpp @@ -28,7 +28,8 @@ WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_ SDL_InitSubSystem(SDL_INIT_AUDIO); SDL_PropertiesID props = SDL_CreateProperties(); - SDL_SetStringProperty(props, SDL_PROP_WINDOW_CREATE_TITLE_STRING, std::string(window_title).c_str()); + SDL_SetStringProperty(props, SDL_PROP_WINDOW_CREATE_TITLE_STRING, + std::string(window_title).c_str()); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_X_NUMBER, SDL_WINDOWPOS_CENTERED); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, SDL_WINDOWPOS_CENTERED); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, width);