From c20f78822cc50df0aaa009b3a8fba95e94691e87 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 30 Oct 2024 22:47:03 +0900 Subject: [PATCH] Simplified definitions --- CMakeLists.txt | 1 - es-app/src/guis/GuiMenu.cpp | 21 +++++++-------------- es-app/src/guis/GuiMenu.h | 2 +- es-app/src/guis/GuiThemeDownloader.cpp | 2 +- es-app/src/main.cpp | 14 ++++++++------ es-app/src/views/ViewController.cpp | 4 ++-- es-core/src/Window.cpp | 2 +- 7 files changed, 20 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bb37e9a7..7151a1bde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -348,7 +348,6 @@ endif() if(RETRODECK) add_compile_definitions(RETRODECK) - add_compile_definitions(__RETRODECK__) message("-- Building for RetroDECK") endif() diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index e72a91cda..4cab447c6 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -58,7 +58,7 @@ GuiMenu::GuiMenu() if (isFullUI) addEntry(_("SCRAPER"), mMenuColorPrimary, true, [this] { openScraperOptions(); }); -#if defined(__RETRODECK__) +#if defined(RETRODECK) if (isFullUI) addEntry(_("RETRODECK CLASSIC CONFIGURATOR"), mMenuColorPrimary, false, [this] { openRetroDeckClassicConfigurator(); }); @@ -97,7 +97,7 @@ GuiMenu::GuiMenu() #elif defined(__ANDROID__) if (!AndroidVariables::sIsHomeApp) addEntry(_("QUIT ES-DE"), mMenuColorPrimary, false, [this] { openQuitMenu(); }); -#elif defined(__RETRODECK__) +#elif defined(RETRODECK) addEntry(_("QUIT RETRODECK"), mMenuColorPrimary, false, [this] { openQuitMenu(); }); #else if (Settings::getInstance()->getBool("ShowQuitMenu")) @@ -2202,7 +2202,7 @@ void GuiMenu::openUtilities() mWindow->pushGui(s); } -#if defined(__RETRODECK__) +#if defined(RETRODECK) void GuiMenu::openESDEConfiguration() { // RetroDECK: Create a new GuiSettings instance for the ES-DE Configurations menu @@ -2355,14 +2355,7 @@ void GuiMenu::addVersionInfo() mVersion.setAutoCalcExtent(glm::ivec2 {0, 0}); mVersion.setColor(mMenuColorTertiary); - const std::string applicationName = - #if defined(__RETRODECK__) - "RetroDECK"; - #else - "ES-DE"; - #endif - -#if defined(__RETRODECK__) +#if defined(RETRODECK) // Only execute this block if RETRODECK is defined LOG(LogInfo) << "Reading /app/retrodeck/version..."; std::ifstream versionFile("/app/retrodeck/version"); @@ -2371,12 +2364,12 @@ void GuiMenu::addVersionInfo() // Attempt to open the version file and read a line into retroDeckVersion; // also check that the line is not empty to ensure valid version information if (versionFile && std::getline(versionFile, retroDeckVersion) && !retroDeckVersion.empty()) { - mVersion.setText(applicationName + " " + retroDeckVersion); + mVersion.setText("RetroDECK" + " " + retroDeckVersion); LOG(LogInfo) << "RetroDECK version read OK."; } else { LOG(LogInfo) << "Error: Cannot read version from file or file is empty!"; retroDeckVersion = "UNKNOWN"; - mVersion.setText(applicationName + " " + retroDeckVersion); + mVersion.setText("RetroDECK" + " " + retroDeckVersion); } #else // If RETRODECK is NOT defined, execute this block @@ -2500,7 +2493,7 @@ std::vector GuiMenu::getHelpPrompts() return prompts; } -#if defined(__RETRODECK__) +#if defined(RETRODECK) void GuiMenu::openRetroDeckClassicConfigurator() { diff --git a/es-app/src/guis/GuiMenu.h b/es-app/src/guis/GuiMenu.h index 7e7669e54..37fa0ab64 100644 --- a/es-app/src/guis/GuiMenu.h +++ b/es-app/src/guis/GuiMenu.h @@ -47,7 +47,7 @@ private: void openUtilities(); void openQuitMenu(); - #if defined(__RETRODECK__) + #if defined(RETRODECK) void openRetroDeckClassicConfigurator(); void openRetroDeckGodotConfigurator(); void openESDEConfiguration(); diff --git a/es-app/src/guis/GuiThemeDownloader.cpp b/es-app/src/guis/GuiThemeDownloader.cpp index 6732230a2..7aaab3424 100644 --- a/es-app/src/guis/GuiThemeDownloader.cpp +++ b/es-app/src/guis/GuiThemeDownloader.cpp @@ -636,7 +636,7 @@ void GuiThemeDownloader::parseThemesList() LOG(LogWarning) << "Not running the most current application release, theme " "downloading is not recommended"; - #if defined(__RETRODECK__) + #if defined(RETRODECK) mWindow->pushGui(new GuiMsgBox( getHelpStyle(), _("ES-DE THEME ENGINE WAS UPDATED UPSTREAM. THESE THEMES MAY NOT BE COMPATIBLE WITH THE CURRENT RETRODECK VERSION." diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 2a137dc9d..d333ff7ad 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -695,12 +695,14 @@ int main(int argc, char* argv[]) Log::open(); { -const std::string applicationName = -#if defined(__RETRODECK__) - "RetroDECK"; -#else - "ES-DE"; -#endif +// const std::string applicationName = +// #if defined(RETRODECK) +// "RetroDECK"; +// #else +// "ES-DE"; +// #endif + +const std::string applicationName = "ES-DE"; #if defined(__ANDROID__) LOG(LogInfo) << applicationName << " " << PROGRAM_VERSION_STRING << "-" diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index 182646c59..ed5a01a72 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -262,7 +262,7 @@ void ViewController::invalidSystemsFileDialog() void ViewController::noGamesDialog() { -#if defined(__RETRODECK__) +#if defined(RETRODECK) mNoGamesErrorMessage = _("NO GAME WERE FOUND. PLEASE PLACE YOUR GAMES IN " "THE RETRODECK ROM DIRECTORY LOCATED IN:\n"); #elif defined(__ANDROID__) @@ -288,7 +288,7 @@ void ViewController::noGamesDialog() mRomDirectory = FileData::getROMDirectory(); #endif -#if defined(__RETRODECK__) +#if defined(RETRODECK) // Show a simple message with a "QUIT" option if RETRODECK is defined mNoGamesMessageBox = new GuiMsgBox( HelpStyle(), diff --git a/es-core/src/Window.cpp b/es-core/src/Window.cpp index 9f14b1409..ad785b29b 100644 --- a/es-core/src/Window.cpp +++ b/es-core/src/Window.cpp @@ -171,7 +171,7 @@ bool Window::init() progressBarRect.barHeight -= borderThickness * 2.0f; progressBarRect.barPosX += borderThickness; progressBarRect.barPosY += borderThickness; - #if defined(__RETRODECK__) + #if defined(RETRODECK) progressBarRect.color = 0xC858E6FF; #else progressBarRect.color = 0x79010FFF;