print git info to log as well

This commit is contained in:
georgemoralis 2024-08-01 01:11:58 +03:00
parent 62e501f31f
commit bd48e24c32
4 changed files with 16 additions and 4 deletions

View File

@ -16,6 +16,7 @@ Files: CMakeSettings.json
documents/Screenshots/We are DOOMED.png documents/Screenshots/We are DOOMED.png
externals/stb_image.h externals/stb_image.h
externals/tracy/* externals/tracy/*
externals/cmake-modules/*
scripts/ps4_names.txt scripts/ps4_names.txt
src/images/controller_icon.png src/images/controller_icon.png
src/images/exit_icon.png src/images/exit_icon.png

View File

@ -9,5 +9,6 @@
namespace Common { namespace Common {
constexpr char VERSION[] = "0.1.1 WIP"; constexpr char VERSION[] = "0.1.1 WIP";
constexpr bool isRelease = false;
} // namespace Common } // namespace Common

View File

@ -26,8 +26,8 @@
#include "core/linker.h" #include "core/linker.h"
#include "core/memory.h" #include "core/memory.h"
#include "emulator.h" #include "emulator.h"
#include "video_core/renderdoc.h"
#include "src/common/scm_rev.h" #include "src/common/scm_rev.h"
#include "video_core/renderdoc.h"
Frontend::WindowSDL* g_window = nullptr; Frontend::WindowSDL* g_window = nullptr;
@ -50,6 +50,9 @@ Emulator::Emulator() {
Common::Log::Initialize(); Common::Log::Initialize();
Common::Log::Start(); Common::Log::Start();
LOG_INFO(Loader, "Starting shadps4 emulator v{} ", Common::VERSION); 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. // Defer until after logging is initialized.
memory = Core::Memory::Instance(); memory = Core::Memory::Instance();
@ -103,7 +106,13 @@ void Emulator::Run(const std::filesystem::path& file) {
} }
std::string game_title = fmt::format("{} - {} <{}>", id, title, app_version); 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 = window =
std::make_unique<Frontend::WindowSDL>(WindowWidth, WindowHeight, controller, window_title); std::make_unique<Frontend::WindowSDL>(WindowWidth, WindowHeight, controller, window_title);

View File

@ -28,7 +28,8 @@ WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_
SDL_InitSubSystem(SDL_INIT_AUDIO); SDL_InitSubSystem(SDL_INIT_AUDIO);
SDL_PropertiesID props = SDL_CreateProperties(); 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_X_NUMBER, SDL_WINDOWPOS_CENTERED);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_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); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, width);