diff --git a/src/olympic/applib/applib.cpp b/src/olympic/applib/applib.cpp index 24551daa..e5938986 100644 --- a/src/olympic/applib/applib.cpp +++ b/src/olympic/applib/applib.cpp @@ -9,6 +9,10 @@ #define OLYMPIC_PROJECT_NAME "OlympicProject" #endif +#ifndef OLYMPIC_APP_NAME +#define OLYMPIC_APP_NAME "App" +#endif + #ifndef OLYMPIC_PROJECT_NAMESPACE #define OLYMPIC_PROJECT_NAMESPACE project #endif @@ -27,10 +31,8 @@ namespace olympic { -[[nodiscard]] -ox::StringView appName() noexcept; - ox::Error run( + ox::StringView project, ox::StringView appName, ox::StringView projectDataDir, int argc, @@ -50,14 +52,14 @@ int WinMain() { #else int main(int argc, const char **argv) { #endif - OX_INIT_DEBUG_LOGGER(loggerConn, olympic::appName()) + OX_INIT_DEBUG_LOGGER(loggerConn, OLYMPIC_PROJECT_NAME " " OLYMPIC_APP_NAME) #if OLYMPIC_LOAD_KEEL_MODULES OLYMPIC_PROJECT_NAMESPACE::registerKeelModules(); #endif #if OLYMPIC_LOAD_STUDIO_MODULES OLYMPIC_PROJECT_NAMESPACE::registerStudioModules(); #endif - auto const err = olympic::run(olympic::appName(), OLYMPIC_PROJECT_DATADIR, argc, argv); + auto const err = olympic::run(OLYMPIC_PROJECT_NAME, OLYMPIC_APP_NAME, OLYMPIC_PROJECT_DATADIR, argc, argv); oxAssert(err, "Something went wrong..."); if (err) { oxErrf("Failure: {}\n", toStr(err)); diff --git a/src/studio/applib/include/studioapp/studioapp.hpp b/src/studio/applib/include/studioapp/studioapp.hpp index b514e77a..7a6d86d4 100644 --- a/src/studio/applib/include/studioapp/studioapp.hpp +++ b/src/studio/applib/include/studioapp/studioapp.hpp @@ -12,17 +12,4 @@ namespace studio { void registerModule(const studio::Module*) noexcept; -struct StudioOptions { - ox::String appName; - ox::String projectDataDir; -}; - -ox::Error run(StudioOptions&&); - -ox::Error run( - ox::CRStringView appName, - ox::CRStringView projectDataDir, - int argc, - const char **argv); - } diff --git a/src/studio/applib/src/CMakeLists.txt b/src/studio/applib/src/CMakeLists.txt index b9c1d765..fc402178 100644 --- a/src/studio/applib/src/CMakeLists.txt +++ b/src/studio/applib/src/CMakeLists.txt @@ -12,6 +12,7 @@ add_library( target_compile_definitions( StudioAppLib PUBLIC OLYMPIC_LOAD_STUDIO_MODULES=1 + OLYMPIC_APP_NAME="Studio" ) target_link_libraries( StudioAppLib PUBLIC diff --git a/src/studio/applib/src/main.cpp b/src/studio/applib/src/main.cpp index 6ed4faae..8694d607 100644 --- a/src/studio/applib/src/main.cpp +++ b/src/studio/applib/src/main.cpp @@ -80,6 +80,11 @@ ox::Error run( return err; } +struct StudioOptions { + ox::String appName; + ox::String projectDataDir; +}; + ox::Error run(StudioOptions &&opts, int argc = 0, const char **argv = nullptr) { return run(opts.appName, opts.projectDataDir, argc, argv); } @@ -88,17 +93,13 @@ ox::Error run(StudioOptions &&opts, int argc = 0, const char **argv = nullptr) { namespace olympic { -[[nodiscard]] -ox::StringView appName() noexcept { - return "Nostalgia Studio"; -} - ox::Error run( + ox::StringView project, ox::StringView appName, ox::StringView projectDataDir, int argc, const char **argv) noexcept { - return studio::run(appName, projectDataDir, argc, argv); + return studio::run(ox::sfmt("{} {}", project, appName), projectDataDir, argc, argv); } }