diff --git a/README.md b/README.md index 1c32a7c31..926b81f09 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,6 @@ You can use `--help` to view a list of command-line options. Briefly outlined he --draw-framerate - draw the framerate. --no-exit - do not display 'exit' in the ES menu. --debug - print additional output to the console, primarily about input. ---dimtime [seconds] - delay before dimming the screen and entering sleep mode. Default is 120, use 0 for never. --windowed - run ES in a window. --scrape - run the interactive command-line metadata scraper. ``` diff --git a/src/Renderer_init_sdlgl.cpp b/src/Renderer_init_sdlgl.cpp index 812e7b8a8..aedc1a5d9 100644 --- a/src/Renderer_init_sdlgl.cpp +++ b/src/Renderer_init_sdlgl.cpp @@ -58,7 +58,7 @@ namespace Renderer sdlWindow = SDL_CreateWindow("EmulationStation", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, display_width, display_height, - SDL_WINDOW_OPENGL | (Settings::getInstance()->getBool("WINDOWED") ? 0 : SDL_WINDOW_FULLSCREEN)); + SDL_WINDOW_OPENGL | (Settings::getInstance()->getBool("Windowed") ? 0 : SDL_WINDOW_FULLSCREEN)); if(sdlWindow == NULL) { diff --git a/src/Settings.cpp b/src/Settings.cpp index d09347217..62e282a7e 100644 --- a/src/Settings.cpp +++ b/src/Settings.cpp @@ -26,24 +26,21 @@ void Settings::setDefaults() mBoolMap.clear(); mIntMap.clear(); - mBoolMap["PARSEGAMELISTONLY"] = false; - mBoolMap["IGNOREGAMELIST"] = false; - mBoolMap["DRAWFRAMERATE"] = false; - mBoolMap["DONTSHOWEXIT"] = false; - mBoolMap["DEBUG"] = false; - mBoolMap["WINDOWED"] = false; - mBoolMap["DISABLESOUNDS"] = false; - mBoolMap["DISABLEHELP"] = false; - mBoolMap["DisableGamelistWrites"] = false; + mBoolMap["ParseGamelistOnly"] = false; + mBoolMap["DrawFramerate"] = false; + mBoolMap["ShowExit"] = true; + mBoolMap["Debug"] = false; + mBoolMap["Windowed"] = false; + mBoolMap["EnableSounds"] = true; + mBoolMap["ShowHelpPrompts"] = true; mBoolMap["ScrapeRatings"] = true; - mIntMap["DIMTIME"] = 120*1000; + mIntMap["DimTime"] = 120*1000; mIntMap["ScraperResizeWidth"] = 400; mIntMap["ScraperResizeHeight"] = 0; mIntMap["GameListSortIndex"] = 0; - mScraper = std::shared_ptr(new GamesDBScraper()); } diff --git a/src/Sound.cpp b/src/Sound.cpp index cf540091f..adbfa9cf3 100644 --- a/src/Sound.cpp +++ b/src/Sound.cpp @@ -111,7 +111,7 @@ void Sound::play() if(mSampleData == NULL) return; - if(Settings::getInstance()->getBool("DISABLESOUNDS")) + if(Settings::getInstance()->getBool("EnableSounds")) return; SDL_LockAudio(); diff --git a/src/SystemData.cpp b/src/SystemData.cpp index 486c809ee..1748ce77b 100644 --- a/src/SystemData.cpp +++ b/src/SystemData.cpp @@ -38,10 +38,10 @@ SystemData::SystemData(const std::string& name, const std::string& fullName, con mRootFolder = new FileData(FOLDER, mStartPath, this); mRootFolder->metadata.set("name", mFullName); - if(!Settings::getInstance()->getBool("PARSEGAMELISTONLY")) + if(!Settings::getInstance()->getBool("ParseGamelistOnly")) populateFolder(mRootFolder); - if(!Settings::getInstance()->getBool("IGNOREGAMELIST")) + if(!Settings::getInstance()->getBool("IgnoreGamelist")) parseGamelist(this); mRootFolder->sort(FileSorts::SortTypes.at(0)); @@ -52,7 +52,7 @@ SystemData::SystemData(const std::string& name, const std::string& fullName, con SystemData::~SystemData() { //save changed game data back to xml - if(!Settings::getInstance()->getBool("IGNOREGAMELIST")) + if(!Settings::getInstance()->getBool("IgnoreGamelist")) { updateGamelist(this); } diff --git a/src/Window.cpp b/src/Window.cpp index 9051d9dd5..04ec0f2b5 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -134,7 +134,7 @@ void Window::update(int deltaTime) { mAverageDeltaTime = mFrameTimeElapsed / mFrameCountElapsed; - if(Settings::getInstance()->getBool("DRAWFRAMERATE")) + if(Settings::getInstance()->getBool("DrawFramerate")) { std::stringstream ss; ss << std::fixed << std::setprecision(1) << (1000.0f * (float)mFrameCountElapsed / (float)mFrameTimeElapsed) << "fps, "; @@ -165,7 +165,7 @@ void Window::render() mHelp->render(transform); - if(Settings::getInstance()->getBool("DRAWFRAMERATE")) + if(Settings::getInstance()->getBool("DrawFramerate")) { Renderer::setMatrix(Eigen::Affine3f::Identity()); mDefaultFonts.at(1)->drawText(mFrameDataString, Eigen::Vector2f(50, 50), 0xFF00FFFF); diff --git a/src/XMLReader.cpp b/src/XMLReader.cpp index af74a993a..1dcc9b059 100644 --- a/src/XMLReader.cpp +++ b/src/XMLReader.cpp @@ -224,7 +224,7 @@ void updateGamelist(SystemData* system) //We have the complete information for every game though, so we can simply remove a game //we already have in the system from the XML, and then add it back from its GameData information... - if(Settings::getInstance()->getBool("DisableGamelistWrites") || Settings::getInstance()->getBool("IGNOREGAMELIST")) + if(Settings::getInstance()->getBool("IgnoreGamelist")) return; std::string xmlpath = system->getGamelistPath(); diff --git a/src/components/HelpComponent.cpp b/src/components/HelpComponent.cpp index 1e275f154..63176cefd 100644 --- a/src/components/HelpComponent.cpp +++ b/src/components/HelpComponent.cpp @@ -25,7 +25,7 @@ void HelpComponent::clearPrompts() void HelpComponent::addPrompt(const char* icon, const char* text) { - if(Settings::getInstance()->getBool("DISABLEHELP")) + if(!Settings::getInstance()->getBool("ShowHelpPrompts")) return; Prompt p; diff --git a/src/guis/GuiMenu.cpp b/src/guis/GuiMenu.cpp index 0d59e1484..4a91fe767 100644 --- a/src/guis/GuiMenu.cpp +++ b/src/guis/GuiMenu.cpp @@ -42,7 +42,7 @@ GuiMenu::GuiMenu(Window* window) : GuiComponent(window), mMenu(window, "MAIN MEN } ); - if(!Settings::getInstance()->getBool("DONTSHOWEXIT")) + if(Settings::getInstance()->getBool("ShowExit")) { addEntry("EXIT EMULATIONSTATION", 0x990000FF, false, [] { diff --git a/src/guis/GuiSettingsMenu.cpp b/src/guis/GuiSettingsMenu.cpp index 4a559e2ab..71903ab0a 100644 --- a/src/guis/GuiSettingsMenu.cpp +++ b/src/guis/GuiSettingsMenu.cpp @@ -20,9 +20,9 @@ GuiSettingsMenu::GuiSettingsMenu(Window* window) : GuiComponent(window), // framerate auto framerate = std::make_shared(mWindow); - framerate->setState(s->getBool("DRAWFRAMERATE")); + framerate->setState(s->getBool("DrawFramerate")); addSetting("Draw framerate:", framerate, - [framerate] { Settings::getInstance()->setBool("DRAWFRAMERATE", framerate->getState()); }); + [framerate] { Settings::getInstance()->setBool("DrawFramerate", framerate->getState()); }); // volume auto volume = std::make_shared(mWindow, 0.f, 100.f, 1.f, "%"); @@ -32,9 +32,9 @@ GuiSettingsMenu::GuiSettingsMenu(Window* window) : GuiComponent(window), // disable sounds auto sound_disable = std::make_shared(mWindow); - sound_disable->setState(s->getBool("DISABLESOUNDS")); - addSetting("Disable sound:", sound_disable, - [sound_disable] { Settings::getInstance()->setBool("DISABLESOUNDS", sound_disable->getState()); }); + sound_disable->setState(s->getBool("EnableSounds")); + addSetting("Enable sounds:", sound_disable, + [sound_disable] { Settings::getInstance()->setBool("EnableSounds", sound_disable->getState()); }); // scraper auto scraper_list = std::make_shared< OptionListComponent< std::shared_ptr > >(mWindow, false); @@ -53,20 +53,20 @@ GuiSettingsMenu::GuiSettingsMenu(Window* window) : GuiComponent(window), // scrape ratings auto scrape_ratings = std::make_shared(mWindow); scrape_ratings->setState(s->getBool("ScrapeRatings")); - addSetting("Scrape ratings?", scrape_ratings, + addSetting("Scrape ratings:", scrape_ratings, [scrape_ratings] { Settings::getInstance()->setBool("ScrapeRatings", scrape_ratings->getState()); }); // dim time auto dim_time = std::make_shared(mWindow, 0.f, 1200.f, 30.f, "s"); - dim_time->setValue((float)(s->getInt("DIMTIME") / 1000)); + dim_time->setValue((float)(s->getInt("DimTime") / 1000)); addSetting("Dim screen after:", dim_time, - [dim_time] { Settings::getInstance()->setInt("DIMTIME", (int)(dim_time->getValue() * 1000)); }); + [dim_time] { Settings::getInstance()->setInt("DimTime", (int)(dim_time->getValue() * 1000)); }); // disable help auto disable_help = std::make_shared(mWindow); - disable_help->setState(s->getBool("DISABLEHELP")); - addSetting("Disable help:", disable_help, - [disable_help] { Settings::getInstance()->setBool("DISABLEHELP", disable_help->getState()); }); + disable_help->setState(s->getBool("ShowHelpPrompts")); + addSetting("Show help:", disable_help, + [disable_help] { Settings::getInstance()->setBool("ShowHelpPrompts", disable_help->getState()); }); // save button ComponentListRow row; diff --git a/src/main.cpp b/src/main.cpp index 3eb09ebdd..6b1df845b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -36,27 +36,23 @@ bool parseArgs(int argc, char* argv[], unsigned int* width, unsigned int* height i++; //skip the argument value }else if(strcmp(argv[i], "--gamelist-only") == 0) { - Settings::getInstance()->setBool("PARSEGAMELISTONLY", true); + Settings::getInstance()->setBool("ParseGamelistOnly", true); }else if(strcmp(argv[i], "--ignore-gamelist") == 0) { - Settings::getInstance()->setBool("IGNOREGAMELIST", true); + Settings::getInstance()->setBool("IgnoreGamelist", true); }else if(strcmp(argv[i], "--draw-framerate") == 0) { - Settings::getInstance()->setBool("DRAWFRAMERATE", true); + Settings::getInstance()->setBool("DrawFramerate", true); }else if(strcmp(argv[i], "--no-exit") == 0) { - Settings::getInstance()->setBool("DONTSHOWEXIT", true); + Settings::getInstance()->setBool("ShowExit", false); }else if(strcmp(argv[i], "--debug") == 0) { - Settings::getInstance()->setBool("DEBUG", true); + Settings::getInstance()->setBool("Debug", true); Log::setReportingLevel(LogDebug); - }else if(strcmp(argv[i], "--dimtime") == 0) - { - Settings::getInstance()->setInt("DIMTIME", atoi(argv[i + 1]) * 1000); - i++; //skip the argument value }else if(strcmp(argv[i], "--windowed") == 0) { - Settings::getInstance()->setBool("WINDOWED", true); + Settings::getInstance()->setBool("Windowed", true); }else if(strcmp(argv[i], "--scrape") == 0) { scrape_cmdline = true; @@ -71,7 +67,6 @@ bool parseArgs(int argc, char* argv[], unsigned int* width, unsigned int* height std::cout << "--draw-framerate display the framerate\n"; std::cout << "--no-exit don't show the exit option in the menu\n"; std::cout << "--debug even more logging\n"; - std::cout << "--dimtime [seconds] time to wait before dimming the screen (default 120, use 0 for never)\n"; std::cout << "--scrape scrape using command line interface\n"; std::cout << "--windowed not fullscreen, should be used in conjunction with -w and -h\n"; std::cout << "--help summon a sentient, angry tuba\n\n"; @@ -233,7 +228,7 @@ int main(int argc, char* argv[]) //sleeping entails setting a flag to start skipping frames //and initially drawing a black semi-transparent rect to dim the screen timeSinceLastEvent += deltaTime; - if(timeSinceLastEvent >= (unsigned int)Settings::getInstance()->getInt("DIMTIME") && Settings::getInstance()->getInt("DIMTIME") != 0 && window.getAllowSleep()) + if(timeSinceLastEvent >= (unsigned int)Settings::getInstance()->getInt("DimTime") && Settings::getInstance()->getInt("DimTime") != 0 && window.getAllowSleep()) { sleeping = true; timeSinceLastEvent = 0; diff --git a/src/views/gamelist/IGameListView.cpp b/src/views/gamelist/IGameListView.cpp index 4396286d5..f8aad2629 100644 --- a/src/views/gamelist/IGameListView.cpp +++ b/src/views/gamelist/IGameListView.cpp @@ -29,7 +29,7 @@ bool IGameListView::input(InputConfig* config, Input input) return true; // Ctrl-R to reload a view when debugging - }else if(Settings::getInstance()->getBool("DEBUG") && config->getDeviceId() == DEVICE_KEYBOARD && + }else if(Settings::getInstance()->getBool("Debug") && config->getDeviceId() == DEVICE_KEYBOARD && (SDL_GetModState() & (KMOD_LCTRL | KMOD_RCTRL)) && input.id == SDLK_r && input.value != 0) { LOG(LogDebug) << "reloading view";