diff --git a/games/game.cpp b/games/game.cpp index 54e7f10..3701f4c 100644 --- a/games/game.cpp +++ b/games/game.cpp @@ -5,6 +5,10 @@ games::Game::Game(std::string name) { this->name = name; } +const char *games::Game::title() { + return this->name.c_str(); +} + void games::Game::attach() { log_info("game", "attach: {}", name); } diff --git a/games/game.h b/games/game.h index 775434d..a0dee5f 100644 --- a/games/game.h +++ b/games/game.h @@ -15,6 +15,7 @@ namespace games { // where the main magic will happen virtual void attach(); + virtual const char *title(); // optional virtual void pre_attach(); diff --git a/launcher/launcher.cpp b/launcher/launcher.cpp index fc8a259..796fe1c 100644 --- a/launcher/launcher.cpp +++ b/launcher/launcher.cpp @@ -121,6 +121,7 @@ std::string LOG_FILE_PATH = ""; int LAUNCHER_ARGC = 0; char **LAUNCHER_ARGV = nullptr; std::unique_ptr> LAUNCHER_OPTIONS; +games::Game *GAME_INSTANCE = nullptr; std::string CARD_OVERRIDES[2]; // sub-systems @@ -1616,6 +1617,7 @@ int main_implementation(int argc, char *argv[]) { avs::core::set_default_heap_size("kamunity.dll"); games.push_back(new games::qks::QKSGame()); } + GAME_INSTANCE = games.back(); // apply user heap size, if defined if (user_heap_size > 0) { diff --git a/launcher/launcher.h b/launcher/launcher.h index 8d1ac12..3b51236 100644 --- a/launcher/launcher.h +++ b/launcher/launcher.h @@ -7,6 +7,7 @@ #include #include "cfg/option.h" +#include "games/game.h" namespace rawinput { class RawInputManager; @@ -21,6 +22,7 @@ extern std::string LOG_FILE_PATH; extern int LAUNCHER_ARGC; extern char **LAUNCHER_ARGV; extern std::unique_ptr> LAUNCHER_OPTIONS; +extern games::Game *GAME_INSTANCE; extern std::unique_ptr API_CONTROLLER; extern std::unique_ptr RI_MGR;