From 3649684501f217f168ff64fafb0c7118545c4976 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 25 Sep 2021 10:47:59 +0200 Subject: [PATCH 01/42] Added support for multi-select total count and exclusive multi-select to OptionListComponent. --- es-core/src/components/MenuComponent.h | 1 + es-core/src/components/OptionListComponent.h | 112 ++++++++++++++++--- 2 files changed, 97 insertions(+), 16 deletions(-) diff --git a/es-core/src/components/MenuComponent.h b/es-core/src/components/MenuComponent.h index b0d8e927f..c9c1dc1ba 100644 --- a/es-core/src/components/MenuComponent.h +++ b/es-core/src/components/MenuComponent.h @@ -65,6 +65,7 @@ public: const std::function& callback); void setTitle(std::string title, const std::shared_ptr& font); + std::shared_ptr getList() { return mList; } void setCursorToFirstListEntry() { mList->moveCursor(-mList->getCursorId()); } void setCursorToList() { mGrid.setCursorTo(mList); } diff --git a/es-core/src/components/OptionListComponent.h b/es-core/src/components/OptionListComponent.h index 1510625a4..84fdf9236 100644 --- a/es-core/src/components/OptionListComponent.h +++ b/es-core/src/components/OptionListComponent.h @@ -27,10 +27,14 @@ public: OptionListComponent(Window* window, const HelpStyle& helpstyle, const std::string& name, - bool multiSelect = false) + bool multiSelect = false, + bool multiExclusiveSelect = false, + bool multiShowTotal = false) : GuiComponent(window) , mHelpStyle(helpstyle) , mMultiSelect(multiSelect) + , mMultiExclusiveSelect(multiExclusiveSelect) + , mMultiShowTotal(multiShowTotal) , mName(name) , mText(window) , mLeftArrow(window) @@ -212,6 +216,8 @@ public: return 0; } + void setOverrideMultiText(const std::string& text) { mOverrideMultiText = text; } + HelpStyle getHelpStyle() override { return mHelpStyle; } private: @@ -234,7 +240,15 @@ private: if (mMultiSelect) { // Display the selected entry. std::stringstream ss; - ss << getSelectedObjects().size() << " SELECTED"; + + // For special situations, allow the "selected" text to be overridden to a custom value. + if (mOverrideMultiText != "") + ss << mOverrideMultiText; + else if (mMultiShowTotal) + ss << getSelectedObjects().size() << " (OF " << mEntries.size() << ") SELECTED"; + else + ss << getSelectedObjects().size() << " SELECTED"; + mText.setText(ss.str()); mText.setSize(0, mText.getSize().y); setSize(mText.getSize().x + mRightArrow.getSize().x + @@ -271,6 +285,9 @@ private: } bool mMultiSelect; + bool mMultiExclusiveSelect; + bool mMultiShowTotal; + std::string mOverrideMultiText; std::string mName; TextComponent mText; @@ -295,14 +312,33 @@ private: auto font = Font::get(FONT_SIZE_MEDIUM); ComponentListRow row; + bool hasSelectedRow = false; + + // If the exclusive selection flag has been set, i.e. only a single row can be selected + // at a time, then make sure to gray out and disable any non-selected rows. + if (mParent->mMultiExclusiveSelect) { + for (auto entry : mParent->mEntries) { + if (entry.selected == true) { + hasSelectedRow = true; + break; + } + } + } + // For selecting all/none. - std::vector checkboxes; + std::vector checkBoxes; + std::vector textEntries; for (auto it = mParent->mEntries.begin(); it != mParent->mEntries.end(); it++) { row.elements.clear(); - row.addElement(std::make_shared( - mWindow, Utils::String::toUpper(it->name), font, 0x777777FF), - true); + auto textComponent = std::make_shared( + mWindow, Utils::String::toUpper(it->name), font, 0x777777FF); + row.addElement(textComponent, true); + + if (mParent->mMultiExclusiveSelect && hasSelectedRow && !(*it).selected) { + textComponent.get()->setOpacity(DISABLED_OPACITY); + textComponent.get()->setEnabled(false); + } OptionListData& e = *it; @@ -313,16 +349,53 @@ private: checkbox->setResize(0, font->getLetterHeight()); row.addElement(checkbox, false); + if (mParent->mMultiExclusiveSelect && hasSelectedRow && !(*it).selected) + checkbox.get()->setOpacity(DISABLED_OPACITY); + // Input handler. // Update checkbox state and selected value. row.makeAcceptInputHandler([this, &e, checkbox] { + auto list = mMenu.getList(); + int cursorId = list->getCursorId(); + bool isEnabled = list->getChild(cursorId * 2)->getEnabled(); + + if (mParent->mMultiExclusiveSelect && !isEnabled) + return; + e.selected = !e.selected; checkbox->setImage(e.selected ? CHECKED_PATH : UNCHECKED_PATH); mParent->onSelectedChanged(); + + // When selecting a row and the exclusive selection flag has been set, + // gray out and disable all other rows. + if (mParent->mMultiExclusiveSelect) { + for (unsigned int i = 0; i < mParent->mEntries.size(); i++) { + + bool isSelected = mParent->mEntries[cursorId].selected; + + for (unsigned int i = 0; i < list->getChildCount(); i += 2) { + if (i == static_cast(cursorId) * 2) + continue; + if (isSelected) { + mEnabled = false; + list->getChild(i)->setEnabled(false); + list->getChild(i)->setOpacity(DISABLED_OPACITY); + list->getChild(i + 1)->setOpacity(DISABLED_OPACITY); + } + else { + mEnabled = true; + list->getChild(i)->setEnabled(true); + list->getChild(i)->setOpacity(255); + list->getChild(i + 1)->setOpacity(255); + } + } + } + } }); // For selecting all/none. - checkboxes.push_back(checkbox.get()); + checkBoxes.push_back(checkbox.get()); + textEntries.push_back(textComponent.get()); } else { // Input handler for non-multiselect. @@ -342,18 +415,25 @@ private: mMenu.addButton("BACK", "back", [this] { delete this; }); if (mParent->mMultiSelect) { - mMenu.addButton("SELECT ALL", "select all", [this, checkboxes] { - for (unsigned int i = 0; i < mParent->mEntries.size(); i++) { - mParent->mEntries.at(i).selected = true; - checkboxes.at(i)->setImage(CHECKED_PATH); - } - mParent->onSelectedChanged(); - }); + if (!mParent->mMultiExclusiveSelect) { + mMenu.addButton("SELECT ALL", "select all", [this, checkBoxes] { + for (unsigned int i = 0; i < mParent->mEntries.size(); i++) { + mParent->mEntries.at(i).selected = true; + checkBoxes.at(i)->setImage(CHECKED_PATH); + } + mParent->onSelectedChanged(); + }); + } - mMenu.addButton("SELECT NONE", "select none", [this, checkboxes] { + mMenu.addButton("SELECT NONE", "select none", [this, checkBoxes, textEntries] { for (unsigned int i = 0; i < mParent->mEntries.size(); i++) { mParent->mEntries.at(i).selected = false; - checkboxes.at(i)->setImage(UNCHECKED_PATH); + checkBoxes.at(i)->setImage(UNCHECKED_PATH); + if (mParent->mMultiExclusiveSelect) { + checkBoxes.at(i)->setOpacity(255); + textEntries.at(i)->setOpacity(255); + textEntries.at(i)->setEnabled(true); + } } mParent->onSelectedChanged(); }); From 78db6cd18c213f9ff8c7a67abc9667461a82d847 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 25 Sep 2021 10:54:53 +0200 Subject: [PATCH 02/42] Improvements to the gamelist filter GUI. --- es-app/src/guis/GuiGamelistFilter.cpp | 47 ++++++++++++++++++++++----- es-app/src/guis/GuiGamelistFilter.h | 3 +- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/es-app/src/guis/GuiGamelistFilter.cpp b/es-app/src/guis/GuiGamelistFilter.cpp index 679e785cb..6feda35e7 100644 --- a/es-app/src/guis/GuiGamelistFilter.cpp +++ b/es-app/src/guis/GuiGamelistFilter.cpp @@ -21,7 +21,7 @@ GuiGamelistFilter::GuiGamelistFilter(Window* window, SystemData* system, std::function filterChangedCallback) : GuiComponent(window) - , mMenu(window, "FILTER GAMELIST BY") + , mMenu(window, "FILTER GAMELIST") , mSystem(system) , mFiltersChangedCallback(filterChangedCallback) , mFiltersChanged(false) @@ -92,8 +92,6 @@ void GuiGamelistFilter::resetAllFilters() mFiltersChanged = true; } -GuiGamelistFilter::~GuiGamelistFilter() { mFilterOptions.clear(); } - void GuiGamelistFilter::addFiltersToMenu() { ComponentListRow row; @@ -151,18 +149,49 @@ void GuiGamelistFilter::addFiltersToMenu() it != decls.cend(); it++) { FilterIndexType type = (*it).type; // Type of filter. - // All possible filters for this type. std::map* allKeys = (*it).allIndexKeys; + + bool exclusiveSelect = false; + + if (type == FAVORITES_FILTER || type == KIDGAME_FILTER || type == COMPLETED_FILTER || + type == BROKEN_FILTER) + exclusiveSelect = true; + + // Don't display the hidden games filter if we're actually hiding these games. + if (type == HIDDEN_FILTER) { + if (Settings::getInstance()->getBool("ShowHiddenGames")) + exclusiveSelect = true; + else + continue; + } + std::string menuLabel = (*it).menuLabel; // Text to show in menu. std::shared_ptr> optionList; - // Add genres. - optionList = std::make_shared>(mWindow, getHelpStyle(), - menuLabel, true); + // For bool values, make the selection exclusive so that both True and False can't be + // selected at the same time. This should be changed to a SwitchComponent at some point. + if (exclusiveSelect) + optionList = std::make_shared>(mWindow, getHelpStyle(), + menuLabel, true, true); + else + optionList = std::make_shared>(mWindow, getHelpStyle(), + menuLabel, true, false); + + // Still display fields that can't be filtered in the menu, but notify the user and set + // the OptionListComponent as disabled. + if (allKeys->size() == 1 || allKeys->empty()) { + optionList->setEnabled(false); + optionList->setOpacity(DISABLED_OPACITY); + optionList->setOverrideMultiText("NOTHING TO FILTER"); + } + for (auto it : *allKeys) optionList->add(it.first, it.first, mFilterIndex->isKeyBeingFilteredBy(it.first, type)); - if (allKeys->size() > 0) - mMenu.addWithLabel(menuLabel, optionList); + + if (allKeys->size() == 0) + optionList->add("", "", false); + + mMenu.addWithLabel(menuLabel, optionList); mFilterOptions[type] = optionList; } diff --git a/es-app/src/guis/GuiGamelistFilter.h b/es-app/src/guis/GuiGamelistFilter.h index 90fdc0c02..977f0cb9c 100644 --- a/es-app/src/guis/GuiGamelistFilter.h +++ b/es-app/src/guis/GuiGamelistFilter.h @@ -25,7 +25,8 @@ public: SystemData* system, std::function filtersChangedCallback); - ~GuiGamelistFilter(); + ~GuiGamelistFilter() { mFilterOptions.clear(); } + bool input(InputConfig* config, Input input) override; virtual std::vector getHelpPrompts() override; From 966d2616be5d9f757f4555101c9b873021fc888d Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 25 Sep 2021 11:02:27 +0200 Subject: [PATCH 03/42] Added support for defining custom system sorting using the tag. --- es-app/src/CollectionSystemsManager.cpp | 4 ++-- es-app/src/CollectionSystemsManager.h | 2 +- es-app/src/SystemData.cpp | 19 ++++++++++++++++--- es-app/src/SystemData.h | 3 +++ .../src/guis/GuiCollectionSystemsOptions.cpp | 4 ++-- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/es-app/src/CollectionSystemsManager.cpp b/es-app/src/CollectionSystemsManager.cpp index 282b880a2..b804698a7 100644 --- a/es-app/src/CollectionSystemsManager.cpp +++ b/es-app/src/CollectionSystemsManager.cpp @@ -925,7 +925,7 @@ SystemData* CollectionSystemsManager::addNewCustomCollection(std::string name) CollectionSystemDecl decl = mCollectionSystemDeclsIndex[myCollectionsName]; decl.themeFolder = name; decl.name = name; - decl.longName = name; + decl.fullName = name; return createNewCollectionEntry(name, decl, true, true); } @@ -1113,7 +1113,7 @@ SystemData* CollectionSystemsManager::createNewCollectionEntry(std::string name, bool index, bool custom) { - SystemData* newSys = new SystemData(name, sysDecl.longName, mCollectionEnvData, + SystemData* newSys = new SystemData(name, sysDecl.fullName, "", mCollectionEnvData, sysDecl.themeFolder, true, custom); CollectionSystemData newCollectionData; diff --git a/es-app/src/CollectionSystemsManager.h b/es-app/src/CollectionSystemsManager.h index df976ef93..ff31f88d7 100644 --- a/es-app/src/CollectionSystemsManager.h +++ b/es-app/src/CollectionSystemsManager.h @@ -43,7 +43,7 @@ enum CollectionSystemType { struct CollectionSystemDecl { CollectionSystemType type; std::string name; - std::string longName; + std::string fullName; std::string themeFolder; bool isCustom; }; diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index adaa2c9b6..1ca0cae81 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -178,12 +178,14 @@ void FindRules::loadFindRules() SystemData::SystemData(const std::string& name, const std::string& fullName, + const std::string& sortName, SystemEnvironmentData* envData, const std::string& themeFolder, bool CollectionSystem, bool CustomCollectionSystem) : mName(name) , mFullName(fullName) + , mSortName(sortName) , mEnvData(envData) , mThemeFolder(themeFolder) , mIsCollectionSystem(CollectionSystem) @@ -438,11 +440,13 @@ bool SystemData::loadConfig() system = system.next_sibling("system")) { std::string name; std::string fullname; + std::string sortName; std::string path; std::string themeFolder; name = system.child("name").text().get(); fullname = system.child("fullname").text().get(); + sortName = system.child("systemsortname").text().get(); path = system.child("path").text().get(); auto nameFindFunc = [&] { @@ -583,6 +587,15 @@ bool SystemData::loadConfig() continue; } + if (sortName == "") { + sortName = fullname; + } + else { + LOG(LogDebug) << "SystemData::loadConfig(): System \"" << name + << "\" has a tag set, sorting as \"" << sortName + << "\" instead of \"" << fullname << "\""; + } + // Convert path to generic directory seperators. path = Utils::FileSystem::getGenericPath(path); @@ -601,7 +614,7 @@ bool SystemData::loadConfig() envData->mLaunchCommands = commands; envData->mPlatformIds = platformIds; - SystemData* newSys = new SystemData(name, fullname, envData, themeFolder); + SystemData* newSys = new SystemData(name, fullname, sortName, envData, themeFolder); bool onlyHidden = false; // If the option to show hidden games has been disabled, then check whether all @@ -630,9 +643,9 @@ bool SystemData::loadConfig() } } - // Sort systems by their full names. + // Sort systems by sortName, which will normally be the same as the full name. std::sort(std::begin(sSystemVector), std::end(sSystemVector), - [](SystemData* a, SystemData* b) { return a->getFullName() < b->getFullName(); }); + [](SystemData* a, SystemData* b) { return a->getSortName() < b->getSortName(); }); // Don't load any collections if there are no systems available. if (sSystemVector.size() > 0) diff --git a/es-app/src/SystemData.h b/es-app/src/SystemData.h index 8dd7bd4fd..a89eb4586 100644 --- a/es-app/src/SystemData.h +++ b/es-app/src/SystemData.h @@ -62,6 +62,7 @@ class SystemData public: SystemData(const std::string& name, const std::string& fullName, + const std::string& sortName, SystemEnvironmentData* envData, const std::string& themeFolder, bool CollectionSystem = false, @@ -72,6 +73,7 @@ public: FileData* getRootFolder() const { return mRootFolder; } const std::string& getName() const { return mName; } const std::string& getFullName() const { return mFullName; } + const std::string& getSortName() const { return mSortName; } const std::string& getStartPath() const { return mEnvData->mStartPath; } const std::vector& getExtensions() const { return mEnvData->mSearchExtensions; } const std::string& getThemeFolder() const { return mThemeFolder; } @@ -152,6 +154,7 @@ public: private: std::string mName; std::string mFullName; + std::string mSortName; SystemEnvironmentData* mEnvData; std::string mAlternativeEmulator; std::string mThemeFolder; diff --git a/es-app/src/guis/GuiCollectionSystemsOptions.cpp b/es-app/src/guis/GuiCollectionSystemsOptions.cpp index 59cc0052e..2d1e31059 100644 --- a/es-app/src/guis/GuiCollectionSystemsOptions.cpp +++ b/es-app/src/guis/GuiCollectionSystemsOptions.cpp @@ -52,7 +52,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st for (std::map::const_iterator it = autoSystems.cbegin(); it != autoSystems.cend(); it++) - collection_systems_auto->add(it->second.decl.longName, it->second.decl.name, + collection_systems_auto->add(it->second.decl.fullName, it->second.decl.name, it->second.isEnabled); addWithLabel("AUTOMATIC GAME COLLECTIONS", collection_systems_auto); addSaveFunc([this, autoSystems] { @@ -101,7 +101,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st for (std::map::const_iterator it = customSystems.cbegin(); it != customSystems.cend(); it++) - collection_systems_custom->add(it->second.decl.longName, it->second.decl.name, + collection_systems_custom->add(it->second.decl.fullName, it->second.decl.name, it->second.isEnabled); addWithLabel("CUSTOM GAME COLLECTIONS", collection_systems_custom); From c85700571d277e2ec3cb5a080f0a39551a7b8774 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 25 Sep 2021 16:16:25 +0200 Subject: [PATCH 04/42] Added a filter for the 'Alternative emulator' field. --- es-app/src/FileFilterIndex.cpp | 66 +++++++++++++++++++++------------- es-app/src/FileFilterIndex.h | 7 +++- 2 files changed, 48 insertions(+), 25 deletions(-) diff --git a/es-app/src/FileFilterIndex.cpp b/es-app/src/FileFilterIndex.cpp index 75daf387f..72671f104 100644 --- a/es-app/src/FileFilterIndex.cpp +++ b/es-app/src/FileFilterIndex.cpp @@ -31,21 +31,23 @@ FileFilterIndex::FileFilterIndex() , mFilterByCompleted(false) , mFilterByBroken(false) , mFilterByHidden(false) + , mFilterByAltemulator(false) { clearAllFilters(); // clang-format off FilterDataDecl filterDecls[] = { - //type //allKeys //filteredBy //filteredKeys //primaryKey //hasSecondaryKey //secondaryKey //menuLabel - {FAVORITES_FILTER, &mFavoritesIndexAllKeys, &mFilterByFavorites, &mFavoritesIndexFilteredKeys, "favorite", false, "", "FAVORITES"}, - {GENRE_FILTER, &mGenreIndexAllKeys, &mFilterByGenre, &mGenreIndexFilteredKeys, "genre", true, "genre", "GENRE"}, - {PLAYER_FILTER, &mPlayersIndexAllKeys, &mFilterByPlayers, &mPlayersIndexFilteredKeys, "players", false, "", "PLAYERS"}, - {PUBDEV_FILTER, &mPubDevIndexAllKeys, &mFilterByPubDev, &mPubDevIndexFilteredKeys, "developer", true, "publisher", "PUBLISHER / DEVELOPER"}, - {RATINGS_FILTER, &mRatingsIndexAllKeys, &mFilterByRatings, &mRatingsIndexFilteredKeys, "rating", false, "", "RATING"}, - {KIDGAME_FILTER, &mKidGameIndexAllKeys, &mFilterByKidGame, &mKidGameIndexFilteredKeys, "kidgame", false, "", "KIDGAME"}, - {COMPLETED_FILTER, &mCompletedIndexAllKeys, &mFilterByCompleted, &mCompletedIndexFilteredKeys, "completed", false, "", "COMPLETED"}, - {BROKEN_FILTER, &mBrokenIndexAllKeys, &mFilterByBroken, &mBrokenIndexFilteredKeys, "broken", false, "", "BROKEN"}, - {HIDDEN_FILTER, &mHiddenIndexAllKeys, &mFilterByHidden, &mHiddenIndexFilteredKeys, "hidden", false, "", "HIDDEN"} + //type //allKeys //filteredBy //filteredKeys //primaryKey //hasSecondaryKey //secondaryKey //menuLabel + {FAVORITES_FILTER, &mFavoritesIndexAllKeys, &mFilterByFavorites, &mFavoritesIndexFilteredKeys, "favorite", false, "", "FAVORITES"}, + {GENRE_FILTER, &mGenreIndexAllKeys, &mFilterByGenre, &mGenreIndexFilteredKeys, "genre", true, "genre", "GENRE"}, + {PLAYER_FILTER, &mPlayersIndexAllKeys, &mFilterByPlayers, &mPlayersIndexFilteredKeys, "players", false, "", "PLAYERS"}, + {PUBDEV_FILTER, &mPubDevIndexAllKeys, &mFilterByPubDev, &mPubDevIndexFilteredKeys, "developer", true, "publisher", "PUBLISHER / DEVELOPER"}, + {RATINGS_FILTER, &mRatingsIndexAllKeys, &mFilterByRatings, &mRatingsIndexFilteredKeys, "rating", false, "", "RATING"}, + {KIDGAME_FILTER, &mKidGameIndexAllKeys, &mFilterByKidGame, &mKidGameIndexFilteredKeys, "kidgame", false, "", "KIDGAME"}, + {COMPLETED_FILTER, &mCompletedIndexAllKeys, &mFilterByCompleted, &mCompletedIndexFilteredKeys, "completed", false, "", "COMPLETED"}, + {BROKEN_FILTER, &mBrokenIndexAllKeys, &mFilterByBroken, &mBrokenIndexFilteredKeys, "broken", false, "", "BROKEN"}, + {HIDDEN_FILTER, &mHiddenIndexAllKeys, &mFilterByHidden, &mHiddenIndexFilteredKeys, "hidden", false, "", "HIDDEN"}, + {ALTEMULATOR_FILTER, &mAltemulatorIndexAllKeys, &mFilterByAltemulator, &mAltemulatorIndexFilteredKeys, "altemulator", false, "", "ALTERNATIVE EMULATOR"} }; // clang-format on @@ -76,6 +78,7 @@ void FileFilterIndex::importIndex(FileFilterIndex* indexToImport) {&mCompletedIndexAllKeys, &(indexToImport->mCompletedIndexAllKeys)}, {&mBrokenIndexAllKeys, &(indexToImport->mBrokenIndexAllKeys)}, {&mHiddenIndexAllKeys, &(indexToImport->mHiddenIndexAllKeys)}, + {&mAltemulatorIndexAllKeys, &(indexToImport->mAltemulatorIndexAllKeys)}, }; std::vector indexImportDecl = std::vector( @@ -111,6 +114,7 @@ void FileFilterIndex::resetIndex() clearIndex(mCompletedIndexAllKeys); clearIndex(mBrokenIndexAllKeys); clearIndex(mHiddenIndexAllKeys); + clearIndex(mAltemulatorIndexAllKeys); } std::string FileFilterIndex::getIndexableKey(FileData* game, @@ -142,14 +146,12 @@ std::string FileFilterIndex::getIndexableKey(FileData* game, case PLAYER_FILTER: { if (getSecondary) break; - key = Utils::String::toUpper(game->metadata.get("players")); break; } case PUBDEV_FILTER: { key = Utils::String::toUpper(game->metadata.get("publisher")); key = Utils::String::trim(key); - if ((getSecondary && !key.empty()) || (!getSecondary && key.empty())) key = Utils::String::toUpper(game->metadata.get("developer")); else @@ -210,6 +212,12 @@ std::string FileFilterIndex::getIndexableKey(FileData* game, key = Utils::String::toUpper(game->metadata.get("hidden")); break; } + case ALTEMULATOR_FILTER: { + if (getSecondary) + break; + key = Utils::String::toUpper(game->metadata.get("altemulator")); + break; + } default: break; } @@ -231,6 +239,7 @@ void FileFilterIndex::addToIndex(FileData* game) manageCompletedEntryInIndex(game); manageBrokenEntryInIndex(game); manageHiddenEntryInIndex(game); + manageAltemulatorEntryInIndex(game); } void FileFilterIndex::removeFromIndex(FileData* game) @@ -244,6 +253,7 @@ void FileFilterIndex::removeFromIndex(FileData* game) manageCompletedEntryInIndex(game, true); manageBrokenEntryInIndex(game, true); manageHiddenEntryInIndex(game, true); + manageAltemulatorEntryInIndex(game, true); } void FileFilterIndex::setFilter(FilterIndexType type, std::vector* values) @@ -339,6 +349,9 @@ void FileFilterIndex::debugPrintIndexes() for (auto x : mHiddenIndexAllKeys) { LOG(LogInfo) << "Hidden Index: " << x.first << ": " << x.second; } + for (auto x : mAltemulatorIndexAllKeys) { + LOG(LogInfo) << "Altemulator Index: " << x.first << ": " << x.second; + } } bool FileFilterIndex::showFile(FileData* game) @@ -415,26 +428,27 @@ bool FileFilterIndex::isFiltered() if (UIModeController::getInstance()->isUIModeKid()) { return (mFilterByText || mFilterByFavorites || mFilterByGenre || mFilterByPlayers || mFilterByPubDev || mFilterByRatings || mFilterByCompleted || mFilterByBroken || - mFilterByHidden); + mFilterByHidden || mFilterByAltemulator); } else { return (mFilterByText || mFilterByFavorites || mFilterByGenre || mFilterByPlayers || mFilterByPubDev || mFilterByRatings || mFilterByKidGame || mFilterByCompleted || - mFilterByBroken || mFilterByHidden); + mFilterByBroken || mFilterByHidden | mFilterByAltemulator); } } bool FileFilterIndex::isKeyBeingFilteredBy(std::string key, FilterIndexType type) { - const FilterIndexType filterTypes[9] = {FAVORITES_FILTER, GENRE_FILTER, PLAYER_FILTER, - PUBDEV_FILTER, RATINGS_FILTER, KIDGAME_FILTER, - COMPLETED_FILTER, BROKEN_FILTER, HIDDEN_FILTER}; - std::vector filterKeysList[9] = { - mFavoritesIndexFilteredKeys, mGenreIndexFilteredKeys, mPlayersIndexFilteredKeys, - mPubDevIndexFilteredKeys, mRatingsIndexFilteredKeys, mKidGameIndexFilteredKeys, - mCompletedIndexFilteredKeys, mBrokenIndexFilteredKeys, mHiddenIndexFilteredKeys}; + const FilterIndexType filterTypes[10] = { + FAVORITES_FILTER, GENRE_FILTER, PLAYER_FILTER, PUBDEV_FILTER, RATINGS_FILTER, + KIDGAME_FILTER, COMPLETED_FILTER, BROKEN_FILTER, HIDDEN_FILTER, ALTEMULATOR_FILTER}; + std::vector filterKeysList[10] = { + mFavoritesIndexFilteredKeys, mGenreIndexFilteredKeys, mPlayersIndexFilteredKeys, + mPubDevIndexFilteredKeys, mRatingsIndexFilteredKeys, mKidGameIndexFilteredKeys, + mCompletedIndexFilteredKeys, mBrokenIndexFilteredKeys, mHiddenIndexFilteredKeys, + mAltemulatorIndexFilteredKeys}; - for (int i = 0; i < 9; i++) { + for (int i = 0; i < 10; i++) { if (filterTypes[i] == type) { for (std::vector::const_iterator it = filterKeysList[i].cbegin(); it != filterKeysList[i].cend(); it++) { @@ -467,7 +481,6 @@ void FileFilterIndex::manageGenreEntryInIndex(FileData* game, bool remove) // Flag for including unknowns. bool includeUnknown = INCLUDE_UNKNOWN; - // Only add unknown in pubdev IF both dev and pub are empty. if (!includeUnknown && (key == UNKNOWN_LABEL || key == "BIOS")) // No valid genre info found. return; @@ -485,7 +498,6 @@ void FileFilterIndex::managePlayerEntryInIndex(FileData* game, bool remove) bool includeUnknown = INCLUDE_UNKNOWN; std::string key = getIndexableKey(game, PLAYER_FILTER, false); - // Only add unknown in pubdev IF both dev and pub are empty. if (!includeUnknown && key == UNKNOWN_LABEL) // No valid player info found. return; @@ -595,6 +607,12 @@ void FileFilterIndex::manageHiddenEntryInIndex(FileData* game, bool remove) manageIndexEntry(&mHiddenIndexAllKeys, key, remove); } +void FileFilterIndex::manageAltemulatorEntryInIndex(FileData* game, bool remove) +{ + std::string key = getIndexableKey(game, ALTEMULATOR_FILTER, false); + manageIndexEntry(&mAltemulatorIndexAllKeys, key, remove); +} + void FileFilterIndex::manageIndexEntry(std::map* index, std::string key, bool remove) diff --git a/es-app/src/FileFilterIndex.h b/es-app/src/FileFilterIndex.h index 18cbf4469..cd2576f39 100644 --- a/es-app/src/FileFilterIndex.h +++ b/es-app/src/FileFilterIndex.h @@ -29,7 +29,8 @@ enum FilterIndexType { KIDGAME_FILTER, COMPLETED_FILTER, BROKEN_FILTER, - HIDDEN_FILTER + HIDDEN_FILTER, + ALTEMULATOR_FILTER }; struct FilterDataDecl { @@ -79,6 +80,7 @@ private: void manageCompletedEntryInIndex(FileData* game, bool remove = false); void manageBrokenEntryInIndex(FileData* game, bool remove = false); void manageHiddenEntryInIndex(FileData* game, bool remove = false); + void manageAltemulatorEntryInIndex(FileData* game, bool remove = false); void manageIndexEntry(std::map* index, std::string key, bool remove); @@ -97,6 +99,7 @@ private: bool mFilterByCompleted; bool mFilterByBroken; bool mFilterByHidden; + bool mFilterByAltemulator; std::map mFavoritesIndexAllKeys; std::map mGenreIndexAllKeys; @@ -107,6 +110,7 @@ private: std::map mCompletedIndexAllKeys; std::map mBrokenIndexAllKeys; std::map mHiddenIndexAllKeys; + std::map mAltemulatorIndexAllKeys; std::vector mFavoritesIndexFilteredKeys; std::vector mGenreIndexFilteredKeys; @@ -117,6 +121,7 @@ private: std::vector mCompletedIndexFilteredKeys; std::vector mBrokenIndexFilteredKeys; std::vector mHiddenIndexFilteredKeys; + std::vector mAltemulatorIndexFilteredKeys; }; #endif // ES_APP_FILE_FILTER_INDEX_H From 53630e3a7a9f7fbfa1bb7bb0f6224e00ea454fbe Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 25 Sep 2021 16:53:30 +0200 Subject: [PATCH 05/42] Blank/unknown values can now be filtered for Genre, Player, Publisher/Developer and Alternative emulator. --- es-app/src/FileFilterIndex.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/es-app/src/FileFilterIndex.cpp b/es-app/src/FileFilterIndex.cpp index 72671f104..0089932cb 100644 --- a/es-app/src/FileFilterIndex.cpp +++ b/es-app/src/FileFilterIndex.cpp @@ -13,6 +13,7 @@ #include "Settings.h" #include "utils/StringUtil.h" #include "views/UIModeController.h" +#include "views/ViewController.h" #include @@ -222,9 +223,16 @@ std::string FileFilterIndex::getIndexableKey(FileData* game, break; } key = Utils::String::trim(key); - if (key.empty() || (type == RATINGS_FILTER && key == "0 STARS")) { + + // Add a dummy value in case there is no metadata defined so we can filter based on this. + if ((type == GENRE_FILTER || type == PLAYER_FILTER || type == PUBDEV_FILTER) && + Utils::String::toUpper(key) == UNKNOWN_LABEL) + key = ViewController::CROSSEDCIRCLE_CHAR + " UNKNOWN"; + else if (type == ALTEMULATOR_FILTER && key.empty()) + key = ViewController::CROSSEDCIRCLE_CHAR + " NONE DEFINED"; + else if (key.empty() || (type == RATINGS_FILTER && key == "0 STARS")) key = UNKNOWN_LABEL; - } + return key; } From 3233288a8c04f0d79f1d1670979d2db1705497d1 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 25 Sep 2021 18:01:41 +0200 Subject: [PATCH 06/42] Improved the string trim function and replaced some inlined occurrences. --- es-app/src/CollectionSystemsManager.cpp | 8 +------- es-app/src/guis/GuiScraperSearch.cpp | 9 +-------- es-app/src/scrapers/GamesDBJSONScraper.cpp | 10 +--------- es-app/src/scrapers/ScreenScraper.cpp | 10 +--------- es-core/src/utils/StringUtil.cpp | 17 ++++++++++++----- 5 files changed, 16 insertions(+), 38 deletions(-) diff --git a/es-app/src/CollectionSystemsManager.cpp b/es-app/src/CollectionSystemsManager.cpp index b804698a7..df2ed075e 100644 --- a/es-app/src/CollectionSystemsManager.cpp +++ b/es-app/src/CollectionSystemsManager.cpp @@ -555,13 +555,7 @@ std::string CollectionSystemsManager::getValidNewCollectionName(std::string inNa std::string name = inName; // Trim leading and trailing whitespaces. - name.erase(name.begin(), std::find_if(name.begin(), name.end(), [](char c) { - return !std::isspace(static_cast(c)); - })); - name.erase(std::find_if(name.rbegin(), name.rend(), - [](char c) { return !std::isspace(static_cast(c)); }) - .base(), - name.end()); + name = Utils::String::trim(name); if (index == 0) { size_t remove = std::string::npos; diff --git a/es-app/src/guis/GuiScraperSearch.cpp b/es-app/src/guis/GuiScraperSearch.cpp index d749c1302..cb3ed5ba7 100644 --- a/es-app/src/guis/GuiScraperSearch.cpp +++ b/es-app/src/guis/GuiScraperSearch.cpp @@ -794,14 +794,7 @@ void GuiScraperSearch::openInputScreen(ScraperSearchParams& params) { auto searchForFunc = [&](std::string name) { // Trim leading and trailing whitespaces. - name.erase(name.begin(), std::find_if(name.begin(), name.end(), [](char c) { - return !std::isspace(static_cast(c)); - })); - name.erase(std::find_if(name.rbegin(), name.rend(), - [](char c) { return !std::isspace(static_cast(c)); }) - .base(), - name.end()); - + name = Utils::String::trim(name); stop(); mRefinedSearch = true; params.nameOverride = name; diff --git a/es-app/src/scrapers/GamesDBJSONScraper.cpp b/es-app/src/scrapers/GamesDBJSONScraper.cpp index 4c015d38c..327bbef30 100644 --- a/es-app/src/scrapers/GamesDBJSONScraper.cpp +++ b/es-app/src/scrapers/GamesDBJSONScraper.cpp @@ -160,15 +160,7 @@ void thegamesdb_generate_json_scraper_requests( } // Trim leading and trailing whitespaces. - cleanName.erase(cleanName.begin(), - std::find_if(cleanName.begin(), cleanName.end(), [](char c) { - return !std::isspace(static_cast(c)); - })); - cleanName.erase( - std::find_if(cleanName.rbegin(), cleanName.rend(), - [](char c) { return !std::isspace(static_cast(c)); }) - .base(), - cleanName.end()); + cleanName = Utils::String::trim(cleanName); path += "/Games/ByGameName?" + apiKey + "&fields=players,publishers,genres,overview,last_updated,rating," diff --git a/es-app/src/scrapers/ScreenScraper.cpp b/es-app/src/scrapers/ScreenScraper.cpp index afdb9ea00..ea4cb1cab 100644 --- a/es-app/src/scrapers/ScreenScraper.cpp +++ b/es-app/src/scrapers/ScreenScraper.cpp @@ -553,15 +553,7 @@ std::string ScreenScraperRequest::ScreenScraperConfig::getGameSearchUrl( bool singleSearch = false; // Trim leading and trailing whitespaces. - searchName.erase(searchName.begin(), - std::find_if(searchName.begin(), searchName.end(), [](char c) { - return !std::isspace(static_cast(c)); - })); - searchName.erase( - std::find_if(searchName.rbegin(), searchName.rend(), - [](char c) { return !std::isspace(static_cast(c)); }) - .base(), - searchName.end()); + searchName = Utils::String::trim(searchName); // If only whitespaces were entered as the search string, then search using a random string // that will not return any results. This is a quick and dirty way to avoid french error diff --git a/es-core/src/utils/StringUtil.cpp b/es-core/src/utils/StringUtil.cpp index 2bc8798ac..2a7adb093 100644 --- a/es-core/src/utils/StringUtil.cpp +++ b/es-core/src/utils/StringUtil.cpp @@ -564,13 +564,20 @@ namespace Utils std::string trim(const std::string& stringArg) { - const size_t strBegin = stringArg.find_first_not_of(" \t"); - const size_t strEnd = stringArg.find_last_not_of(" \t"); + std::string trimString = stringArg; - if (strBegin == std::string::npos) - return ""; + // Trim leading and trailing whitespaces. + trimString.erase(trimString.begin(), + std::find_if(trimString.begin(), trimString.end(), [](char c) { + return !std::isspace(static_cast(c)); + })); + trimString.erase( + std::find_if(trimString.rbegin(), trimString.rend(), + [](char c) { return !std::isspace(static_cast(c)); }) + .base(), + trimString.end()); - return stringArg.substr(strBegin, strEnd - strBegin + 1); + return trimString; } std::string replace(const std::string& stringArg, From 3d6628f084e59f7e8947d9dcb33b28711de59bcf Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 25 Sep 2021 19:22:59 +0200 Subject: [PATCH 07/42] Massive ~2500% speed improvement for OptionListComponent. --- es-core/src/components/MenuComponent.h | 5 +++-- es-core/src/components/OptionListComponent.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/es-core/src/components/MenuComponent.h b/es-core/src/components/MenuComponent.h index c9c1dc1ba..2604ca837 100644 --- a/es-core/src/components/MenuComponent.h +++ b/es-core/src/components/MenuComponent.h @@ -39,10 +39,11 @@ public: void setNeedsSaving() { mNeedsSaving = true; } - void addRow(const ComponentListRow& row, bool setCursorHere = false) + void addRow(const ComponentListRow& row, bool setCursorHere = false, bool updateRowSize = true) { mList->addRow(row, setCursorHere); - updateSize(); + if (updateRowSize) + updateSize(); } void addWithLabel(const std::string& label, diff --git a/es-core/src/components/OptionListComponent.h b/es-core/src/components/OptionListComponent.h index 84fdf9236..25df35e61 100644 --- a/es-core/src/components/OptionListComponent.h +++ b/es-core/src/components/OptionListComponent.h @@ -409,7 +409,7 @@ private: } // Also set cursor to this row if we're not multi-select and this row is selected. - mMenu.addRow(row, (!mParent->mMultiSelect && it->selected)); + mMenu.addRow(row, (!mParent->mMultiSelect && it->selected), false); } mMenu.addButton("BACK", "back", [this] { delete this; }); From 5f3abed826d4aa80c06050b984f258669b510229 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 25 Sep 2021 19:30:44 +0200 Subject: [PATCH 08/42] Split up the Publisher/Developer filter into two separate filters. --- es-app/src/FileFilterIndex.cpp | 126 ++++++++++++++++----------------- es-app/src/FileFilterIndex.h | 15 ++-- 2 files changed, 71 insertions(+), 70 deletions(-) diff --git a/es-app/src/FileFilterIndex.cpp b/es-app/src/FileFilterIndex.cpp index 0089932cb..e3d315de9 100644 --- a/es-app/src/FileFilterIndex.cpp +++ b/es-app/src/FileFilterIndex.cpp @@ -26,7 +26,8 @@ FileFilterIndex::FileFilterIndex() , mFilterByFavorites(false) , mFilterByGenre(false) , mFilterByPlayers(false) - , mFilterByPubDev(false) + , mFilterByDeveloper(false) + , mFilterByPublisher(false) , mFilterByRatings(false) , mFilterByKidGame(false) , mFilterByCompleted(false) @@ -42,7 +43,8 @@ FileFilterIndex::FileFilterIndex() {FAVORITES_FILTER, &mFavoritesIndexAllKeys, &mFilterByFavorites, &mFavoritesIndexFilteredKeys, "favorite", false, "", "FAVORITES"}, {GENRE_FILTER, &mGenreIndexAllKeys, &mFilterByGenre, &mGenreIndexFilteredKeys, "genre", true, "genre", "GENRE"}, {PLAYER_FILTER, &mPlayersIndexAllKeys, &mFilterByPlayers, &mPlayersIndexFilteredKeys, "players", false, "", "PLAYERS"}, - {PUBDEV_FILTER, &mPubDevIndexAllKeys, &mFilterByPubDev, &mPubDevIndexFilteredKeys, "developer", true, "publisher", "PUBLISHER / DEVELOPER"}, + {DEVELOPER_FILTER, &mDeveloperIndexAllKeys, &mFilterByDeveloper, &mDeveloperIndexFilteredKeys, "developer", false, "", "DEVELOPER"}, + {PUBLISHER_FILTER, &mPublisherIndexAllKeys, &mFilterByPublisher, &mPublisherIndexFilteredKeys, "publisher", false, "", "PUBLISHER"}, {RATINGS_FILTER, &mRatingsIndexAllKeys, &mFilterByRatings, &mRatingsIndexFilteredKeys, "rating", false, "", "RATING"}, {KIDGAME_FILTER, &mKidGameIndexAllKeys, &mFilterByKidGame, &mKidGameIndexFilteredKeys, "kidgame", false, "", "KIDGAME"}, {COMPLETED_FILTER, &mCompletedIndexAllKeys, &mFilterByCompleted, &mCompletedIndexFilteredKeys, "completed", false, "", "COMPLETED"}, @@ -73,7 +75,8 @@ void FileFilterIndex::importIndex(FileFilterIndex* indexToImport) {&mFavoritesIndexAllKeys, &(indexToImport->mFavoritesIndexAllKeys)}, {&mGenreIndexAllKeys, &(indexToImport->mGenreIndexAllKeys)}, {&mPlayersIndexAllKeys, &(indexToImport->mPlayersIndexAllKeys)}, - {&mPubDevIndexAllKeys, &(indexToImport->mPubDevIndexAllKeys)}, + {&mDeveloperIndexAllKeys, &(indexToImport->mDeveloperIndexAllKeys)}, + {&mPublisherIndexAllKeys, &(indexToImport->mPublisherIndexAllKeys)}, {&mRatingsIndexAllKeys, &(indexToImport->mRatingsIndexAllKeys)}, {&mKidGameIndexAllKeys, &(indexToImport->mKidGameIndexAllKeys)}, {&mCompletedIndexAllKeys, &(indexToImport->mCompletedIndexAllKeys)}, @@ -109,7 +112,8 @@ void FileFilterIndex::resetIndex() clearIndex(mFavoritesIndexAllKeys); clearIndex(mGenreIndexAllKeys); clearIndex(mPlayersIndexAllKeys); - clearIndex(mPubDevIndexAllKeys); + clearIndex(mDeveloperIndexAllKeys); + clearIndex(mPublisherIndexAllKeys); clearIndex(mRatingsIndexAllKeys); clearIndex(mKidGameIndexAllKeys); clearIndex(mCompletedIndexAllKeys); @@ -132,7 +136,6 @@ std::string FileFilterIndex::getIndexableKey(FileData* game, } case GENRE_FILTER: { key = Utils::String::toUpper(game->metadata.get("genre")); - key = Utils::String::trim(key); if (getSecondary && !key.empty()) { std::istringstream f(key); std::string newKey; @@ -150,13 +153,12 @@ std::string FileFilterIndex::getIndexableKey(FileData* game, key = Utils::String::toUpper(game->metadata.get("players")); break; } - case PUBDEV_FILTER: { + case DEVELOPER_FILTER: { + key = Utils::String::toUpper(game->metadata.get("developer")); + break; + } + case PUBLISHER_FILTER: { key = Utils::String::toUpper(game->metadata.get("publisher")); - key = Utils::String::trim(key); - if ((getSecondary && !key.empty()) || (!getSecondary && key.empty())) - key = Utils::String::toUpper(game->metadata.get("developer")); - else - key = Utils::String::toUpper(game->metadata.get("publisher")); break; } case RATINGS_FILTER: { @@ -225,7 +227,8 @@ std::string FileFilterIndex::getIndexableKey(FileData* game, key = Utils::String::trim(key); // Add a dummy value in case there is no metadata defined so we can filter based on this. - if ((type == GENRE_FILTER || type == PLAYER_FILTER || type == PUBDEV_FILTER) && + if ((type == GENRE_FILTER || type == PLAYER_FILTER || type == DEVELOPER_FILTER || + type == PUBLISHER_FILTER) && Utils::String::toUpper(key) == UNKNOWN_LABEL) key = ViewController::CROSSEDCIRCLE_CHAR + " UNKNOWN"; else if (type == ALTEMULATOR_FILTER && key.empty()) @@ -241,7 +244,8 @@ void FileFilterIndex::addToIndex(FileData* game) manageFavoritesEntryInIndex(game); manageGenreEntryInIndex(game); managePlayerEntryInIndex(game); - managePubDevEntryInIndex(game); + manageDeveloperEntryInIndex(game); + managePublisherEntryInIndex(game); manageRatingsEntryInIndex(game); manageKidGameEntryInIndex(game); manageCompletedEntryInIndex(game); @@ -255,7 +259,8 @@ void FileFilterIndex::removeFromIndex(FileData* game) manageFavoritesEntryInIndex(game, true); manageGenreEntryInIndex(game, true); managePlayerEntryInIndex(game, true); - managePubDevEntryInIndex(game, true); + manageDeveloperEntryInIndex(game, true); + managePublisherEntryInIndex(game, true); manageRatingsEntryInIndex(game, true); manageKidGameEntryInIndex(game, true); manageCompletedEntryInIndex(game, true); @@ -339,7 +344,10 @@ void FileFilterIndex::debugPrintIndexes() for (auto x : mPlayersIndexAllKeys) { LOG(LogInfo) << "Multiplayer Index: " << x.first << ": " << x.second; } - for (auto x : mPubDevIndexAllKeys) { + for (auto x : mDeveloperIndexAllKeys) { + LOG(LogInfo) << "PubDev Index: " << x.first << ": " << x.second; + } + for (auto x : mPublisherIndexAllKeys) { LOG(LogInfo) << "PubDev Index: " << x.first << ": " << x.second; } for (auto x : mRatingsIndexAllKeys) { @@ -435,28 +443,29 @@ bool FileFilterIndex::isFiltered() { if (UIModeController::getInstance()->isUIModeKid()) { return (mFilterByText || mFilterByFavorites || mFilterByGenre || mFilterByPlayers || - mFilterByPubDev || mFilterByRatings || mFilterByCompleted || mFilterByBroken || - mFilterByHidden || mFilterByAltemulator); + mFilterByDeveloper || mFilterByPublisher || mFilterByRatings || + mFilterByCompleted || mFilterByBroken || mFilterByHidden || mFilterByAltemulator); } else { return (mFilterByText || mFilterByFavorites || mFilterByGenre || mFilterByPlayers || - mFilterByPubDev || mFilterByRatings || mFilterByKidGame || mFilterByCompleted || - mFilterByBroken || mFilterByHidden | mFilterByAltemulator); + mFilterByDeveloper || mFilterByPublisher || mFilterByRatings || mFilterByKidGame || + mFilterByCompleted || mFilterByBroken || mFilterByHidden | mFilterByAltemulator); } } bool FileFilterIndex::isKeyBeingFilteredBy(std::string key, FilterIndexType type) { - const FilterIndexType filterTypes[10] = { - FAVORITES_FILTER, GENRE_FILTER, PLAYER_FILTER, PUBDEV_FILTER, RATINGS_FILTER, - KIDGAME_FILTER, COMPLETED_FILTER, BROKEN_FILTER, HIDDEN_FILTER, ALTEMULATOR_FILTER}; - std::vector filterKeysList[10] = { - mFavoritesIndexFilteredKeys, mGenreIndexFilteredKeys, mPlayersIndexFilteredKeys, - mPubDevIndexFilteredKeys, mRatingsIndexFilteredKeys, mKidGameIndexFilteredKeys, - mCompletedIndexFilteredKeys, mBrokenIndexFilteredKeys, mHiddenIndexFilteredKeys, - mAltemulatorIndexFilteredKeys}; + const FilterIndexType filterTypes[11] = {FAVORITES_FILTER, GENRE_FILTER, PLAYER_FILTER, + DEVELOPER_FILTER, PUBLISHER_FILTER, RATINGS_FILTER, + KIDGAME_FILTER, COMPLETED_FILTER, BROKEN_FILTER, + HIDDEN_FILTER, ALTEMULATOR_FILTER}; + std::vector filterKeysList[11] = { + mFavoritesIndexFilteredKeys, mGenreIndexFilteredKeys, mPlayersIndexFilteredKeys, + mDeveloperIndexFilteredKeys, mPublisherIndexFilteredKeys, mRatingsIndexFilteredKeys, + mKidGameIndexFilteredKeys, mCompletedIndexFilteredKeys, mBrokenIndexFilteredKeys, + mHiddenIndexFilteredKeys, mAltemulatorIndexFilteredKeys}; - for (int i = 0; i < 10; i++) { + for (int i = 0; i < 11; i++) { if (filterTypes[i] == type) { for (std::vector::const_iterator it = filterKeysList[i].cbegin(); it != filterKeysList[i].cend(); it++) { @@ -471,12 +480,10 @@ bool FileFilterIndex::isKeyBeingFilteredBy(std::string key, FilterIndexType type void FileFilterIndex::manageFavoritesEntryInIndex(FileData* game, bool remove) { - // Flag for including unknowns. bool includeUnknown = INCLUDE_UNKNOWN; std::string key = getIndexableKey(game, FAVORITES_FILTER, false); if (!includeUnknown && key == UNKNOWN_LABEL) - // No valid favorites info found. return; manageIndexEntry(&mFavoritesIndexAllKeys, key, remove); @@ -484,13 +491,10 @@ void FileFilterIndex::manageFavoritesEntryInIndex(FileData* game, bool remove) void FileFilterIndex::manageGenreEntryInIndex(FileData* game, bool remove) { + bool includeUnknown = INCLUDE_UNKNOWN; std::string key = getIndexableKey(game, GENRE_FILTER, false); - // Flag for including unknowns. - bool includeUnknown = INCLUDE_UNKNOWN; - if (!includeUnknown && (key == UNKNOWN_LABEL || key == "BIOS")) - // No valid genre info found. return; manageIndexEntry(&mGenreIndexAllKeys, key, remove); @@ -502,51 +506,43 @@ void FileFilterIndex::manageGenreEntryInIndex(FileData* game, bool remove) void FileFilterIndex::managePlayerEntryInIndex(FileData* game, bool remove) { - // Flag for including unknowns. bool includeUnknown = INCLUDE_UNKNOWN; std::string key = getIndexableKey(game, PLAYER_FILTER, false); if (!includeUnknown && key == UNKNOWN_LABEL) - // No valid player info found. return; manageIndexEntry(&mPlayersIndexAllKeys, key, remove); } -void FileFilterIndex::managePubDevEntryInIndex(FileData* game, bool remove) +void FileFilterIndex::manageDeveloperEntryInIndex(FileData* game, bool remove) { - std::string pub = getIndexableKey(game, PUBDEV_FILTER, false); - std::string dev = getIndexableKey(game, PUBDEV_FILTER, true); - - // Flag for including unknowns. bool includeUnknown = INCLUDE_UNKNOWN; - bool unknownPub = false; - bool unknownDev = false; + std::string key = getIndexableKey(game, DEVELOPER_FILTER, false); - if (pub == UNKNOWN_LABEL) - unknownPub = true; - - if (dev == UNKNOWN_LABEL) - unknownDev = true; - - if (!includeUnknown && unknownDev && unknownPub) - // No valid rating info found. + if (!includeUnknown && key == UNKNOWN_LABEL) return; - if (unknownDev && unknownPub) { - // If no info at all. - manageIndexEntry(&mPubDevIndexAllKeys, pub, remove); - } - else { - if (!unknownDev) { - // If no info at all. - manageIndexEntry(&mPubDevIndexAllKeys, dev, remove); - } - if (!unknownPub) { - // If no info at all. - manageIndexEntry(&mPubDevIndexAllKeys, pub, remove); - } - } + manageIndexEntry(&mDeveloperIndexAllKeys, key, remove); + + key = getIndexableKey(game, DEVELOPER_FILTER, true); + if (!includeUnknown && key == UNKNOWN_LABEL) + manageIndexEntry(&mDeveloperIndexAllKeys, key, remove); +} + +void FileFilterIndex::managePublisherEntryInIndex(FileData* game, bool remove) +{ + bool includeUnknown = INCLUDE_UNKNOWN; + std::string key = getIndexableKey(game, PUBLISHER_FILTER, false); + + if (!includeUnknown && key == UNKNOWN_LABEL) + return; + + manageIndexEntry(&mPublisherIndexAllKeys, key, remove); + + key = getIndexableKey(game, PUBLISHER_FILTER, true); + if (!includeUnknown && key == UNKNOWN_LABEL) + manageIndexEntry(&mPublisherIndexAllKeys, key, remove); } void FileFilterIndex::manageRatingsEntryInIndex(FileData* game, bool remove) diff --git a/es-app/src/FileFilterIndex.h b/es-app/src/FileFilterIndex.h index cd2576f39..b06ca7d79 100644 --- a/es-app/src/FileFilterIndex.h +++ b/es-app/src/FileFilterIndex.h @@ -24,7 +24,8 @@ enum FilterIndexType { FAVORITES_FILTER, GENRE_FILTER, PLAYER_FILTER, - PUBDEV_FILTER, + DEVELOPER_FILTER, + PUBLISHER_FILTER, RATINGS_FILTER, KIDGAME_FILTER, COMPLETED_FILTER, @@ -74,7 +75,8 @@ private: void manageFavoritesEntryInIndex(FileData* game, bool remove = false); void manageGenreEntryInIndex(FileData* game, bool remove = false); void managePlayerEntryInIndex(FileData* game, bool remove = false); - void managePubDevEntryInIndex(FileData* game, bool remove = false); + void manageDeveloperEntryInIndex(FileData* game, bool remove = false); + void managePublisherEntryInIndex(FileData* game, bool remove = false); void manageRatingsEntryInIndex(FileData* game, bool remove = false); void manageKidGameEntryInIndex(FileData* game, bool remove = false); void manageCompletedEntryInIndex(FileData* game, bool remove = false); @@ -93,7 +95,8 @@ private: bool mFilterByFavorites; bool mFilterByGenre; bool mFilterByPlayers; - bool mFilterByPubDev; + bool mFilterByDeveloper; + bool mFilterByPublisher; bool mFilterByRatings; bool mFilterByKidGame; bool mFilterByCompleted; @@ -104,7 +107,8 @@ private: std::map mFavoritesIndexAllKeys; std::map mGenreIndexAllKeys; std::map mPlayersIndexAllKeys; - std::map mPubDevIndexAllKeys; + std::map mDeveloperIndexAllKeys; + std::map mPublisherIndexAllKeys; std::map mRatingsIndexAllKeys; std::map mKidGameIndexAllKeys; std::map mCompletedIndexAllKeys; @@ -115,7 +119,8 @@ private: std::vector mFavoritesIndexFilteredKeys; std::vector mGenreIndexFilteredKeys; std::vector mPlayersIndexFilteredKeys; - std::vector mPubDevIndexFilteredKeys; + std::vector mDeveloperIndexFilteredKeys; + std::vector mPublisherIndexFilteredKeys; std::vector mRatingsIndexFilteredKeys; std::vector mKidGameIndexFilteredKeys; std::vector mCompletedIndexFilteredKeys; From e93084864588dc1c80ae6ef943653f18c8a5940a Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 25 Sep 2021 20:15:13 +0200 Subject: [PATCH 09/42] Sorted the filters in the same order as the metadata editor fields. --- es-app/src/FileFilterIndex.cpp | 296 ++++++++++++++++----------------- es-app/src/FileFilterIndex.h | 60 +++---- 2 files changed, 178 insertions(+), 178 deletions(-) diff --git a/es-app/src/FileFilterIndex.cpp b/es-app/src/FileFilterIndex.cpp index e3d315de9..20063dea8 100644 --- a/es-app/src/FileFilterIndex.cpp +++ b/es-app/src/FileFilterIndex.cpp @@ -23,16 +23,16 @@ FileFilterIndex::FileFilterIndex() : mFilterByText(false) , mTextRemoveSystem(false) - , mFilterByFavorites(false) - , mFilterByGenre(false) - , mFilterByPlayers(false) + , mFilterByRatings(false) , mFilterByDeveloper(false) , mFilterByPublisher(false) - , mFilterByRatings(false) - , mFilterByKidGame(false) + , mFilterByGenre(false) + , mFilterByPlayers(false) + , mFilterByFavorites(false) , mFilterByCompleted(false) - , mFilterByBroken(false) + , mFilterByKidGame(false) , mFilterByHidden(false) + , mFilterByBroken(false) , mFilterByAltemulator(false) { clearAllFilters(); @@ -40,16 +40,16 @@ FileFilterIndex::FileFilterIndex() // clang-format off FilterDataDecl filterDecls[] = { //type //allKeys //filteredBy //filteredKeys //primaryKey //hasSecondaryKey //secondaryKey //menuLabel - {FAVORITES_FILTER, &mFavoritesIndexAllKeys, &mFilterByFavorites, &mFavoritesIndexFilteredKeys, "favorite", false, "", "FAVORITES"}, - {GENRE_FILTER, &mGenreIndexAllKeys, &mFilterByGenre, &mGenreIndexFilteredKeys, "genre", true, "genre", "GENRE"}, - {PLAYER_FILTER, &mPlayersIndexAllKeys, &mFilterByPlayers, &mPlayersIndexFilteredKeys, "players", false, "", "PLAYERS"}, + {RATINGS_FILTER, &mRatingsIndexAllKeys, &mFilterByRatings, &mRatingsIndexFilteredKeys, "rating", false, "", "RATING"}, {DEVELOPER_FILTER, &mDeveloperIndexAllKeys, &mFilterByDeveloper, &mDeveloperIndexFilteredKeys, "developer", false, "", "DEVELOPER"}, {PUBLISHER_FILTER, &mPublisherIndexAllKeys, &mFilterByPublisher, &mPublisherIndexFilteredKeys, "publisher", false, "", "PUBLISHER"}, - {RATINGS_FILTER, &mRatingsIndexAllKeys, &mFilterByRatings, &mRatingsIndexFilteredKeys, "rating", false, "", "RATING"}, - {KIDGAME_FILTER, &mKidGameIndexAllKeys, &mFilterByKidGame, &mKidGameIndexFilteredKeys, "kidgame", false, "", "KIDGAME"}, + {GENRE_FILTER, &mGenreIndexAllKeys, &mFilterByGenre, &mGenreIndexFilteredKeys, "genre", true, "genre", "GENRE"}, + {PLAYER_FILTER, &mPlayersIndexAllKeys, &mFilterByPlayers, &mPlayersIndexFilteredKeys, "players", false, "", "PLAYERS"}, + {FAVORITES_FILTER, &mFavoritesIndexAllKeys, &mFilterByFavorites, &mFavoritesIndexFilteredKeys, "favorite", false, "", "FAVORITE"}, {COMPLETED_FILTER, &mCompletedIndexAllKeys, &mFilterByCompleted, &mCompletedIndexFilteredKeys, "completed", false, "", "COMPLETED"}, - {BROKEN_FILTER, &mBrokenIndexAllKeys, &mFilterByBroken, &mBrokenIndexFilteredKeys, "broken", false, "", "BROKEN"}, + {KIDGAME_FILTER, &mKidGameIndexAllKeys, &mFilterByKidGame, &mKidGameIndexFilteredKeys, "kidgame", false, "", "KIDGAME"}, {HIDDEN_FILTER, &mHiddenIndexAllKeys, &mFilterByHidden, &mHiddenIndexFilteredKeys, "hidden", false, "", "HIDDEN"}, + {BROKEN_FILTER, &mBrokenIndexAllKeys, &mFilterByBroken, &mBrokenIndexFilteredKeys, "broken", false, "", "BROKEN"}, {ALTEMULATOR_FILTER, &mAltemulatorIndexAllKeys, &mFilterByAltemulator, &mAltemulatorIndexFilteredKeys, "altemulator", false, "", "ALTERNATIVE EMULATOR"} }; // clang-format on @@ -72,16 +72,16 @@ void FileFilterIndex::importIndex(FileFilterIndex* indexToImport) }; IndexImportStructure indexStructDecls[] = { - {&mFavoritesIndexAllKeys, &(indexToImport->mFavoritesIndexAllKeys)}, - {&mGenreIndexAllKeys, &(indexToImport->mGenreIndexAllKeys)}, - {&mPlayersIndexAllKeys, &(indexToImport->mPlayersIndexAllKeys)}, + {&mRatingsIndexAllKeys, &(indexToImport->mRatingsIndexAllKeys)}, {&mDeveloperIndexAllKeys, &(indexToImport->mDeveloperIndexAllKeys)}, {&mPublisherIndexAllKeys, &(indexToImport->mPublisherIndexAllKeys)}, - {&mRatingsIndexAllKeys, &(indexToImport->mRatingsIndexAllKeys)}, - {&mKidGameIndexAllKeys, &(indexToImport->mKidGameIndexAllKeys)}, + {&mGenreIndexAllKeys, &(indexToImport->mGenreIndexAllKeys)}, + {&mPlayersIndexAllKeys, &(indexToImport->mPlayersIndexAllKeys)}, + {&mFavoritesIndexAllKeys, &(indexToImport->mFavoritesIndexAllKeys)}, {&mCompletedIndexAllKeys, &(indexToImport->mCompletedIndexAllKeys)}, - {&mBrokenIndexAllKeys, &(indexToImport->mBrokenIndexAllKeys)}, + {&mKidGameIndexAllKeys, &(indexToImport->mKidGameIndexAllKeys)}, {&mHiddenIndexAllKeys, &(indexToImport->mHiddenIndexAllKeys)}, + {&mBrokenIndexAllKeys, &(indexToImport->mBrokenIndexAllKeys)}, {&mAltemulatorIndexAllKeys, &(indexToImport->mAltemulatorIndexAllKeys)}, }; @@ -109,16 +109,16 @@ void FileFilterIndex::importIndex(FileFilterIndex* indexToImport) void FileFilterIndex::resetIndex() { clearAllFilters(); - clearIndex(mFavoritesIndexAllKeys); - clearIndex(mGenreIndexAllKeys); - clearIndex(mPlayersIndexAllKeys); + clearIndex(mRatingsIndexAllKeys); clearIndex(mDeveloperIndexAllKeys); clearIndex(mPublisherIndexAllKeys); - clearIndex(mRatingsIndexAllKeys); - clearIndex(mKidGameIndexAllKeys); + clearIndex(mGenreIndexAllKeys); + clearIndex(mPlayersIndexAllKeys); + clearIndex(mFavoritesIndexAllKeys); clearIndex(mCompletedIndexAllKeys); - clearIndex(mBrokenIndexAllKeys); + clearIndex(mKidGameIndexAllKeys); clearIndex(mHiddenIndexAllKeys); + clearIndex(mBrokenIndexAllKeys); clearIndex(mAltemulatorIndexAllKeys); } @@ -128,39 +128,6 @@ std::string FileFilterIndex::getIndexableKey(FileData* game, { std::string key = ""; switch (type) { - case FAVORITES_FILTER: { - if (game->getType() != GAME) - return "FALSE"; - key = Utils::String::toUpper(game->metadata.get("favorite")); - break; - } - case GENRE_FILTER: { - key = Utils::String::toUpper(game->metadata.get("genre")); - if (getSecondary && !key.empty()) { - std::istringstream f(key); - std::string newKey; - getline(f, newKey, '/'); - if (!newKey.empty() && newKey != key) - key = newKey; - else - key = std::string(); - } - break; - } - case PLAYER_FILTER: { - if (getSecondary) - break; - key = Utils::String::toUpper(game->metadata.get("players")); - break; - } - case DEVELOPER_FILTER: { - key = Utils::String::toUpper(game->metadata.get("developer")); - break; - } - case PUBLISHER_FILTER: { - key = Utils::String::toUpper(game->metadata.get("publisher")); - break; - } case RATINGS_FILTER: { int ratingNumber = 0; if (!getSecondary) { @@ -191,10 +158,37 @@ std::string FileFilterIndex::getIndexableKey(FileData* game, } break; } - case KIDGAME_FILTER: { + case DEVELOPER_FILTER: { + key = Utils::String::toUpper(game->metadata.get("developer")); + break; + } + case PUBLISHER_FILTER: { + key = Utils::String::toUpper(game->metadata.get("publisher")); + break; + } + case GENRE_FILTER: { + key = Utils::String::toUpper(game->metadata.get("genre")); + if (getSecondary && !key.empty()) { + std::istringstream f(key); + std::string newKey; + getline(f, newKey, '/'); + if (!newKey.empty() && newKey != key) + key = newKey; + else + key = std::string(); + } + break; + } + case PLAYER_FILTER: { + if (getSecondary) + break; + key = Utils::String::toUpper(game->metadata.get("players")); + break; + } + case FAVORITES_FILTER: { if (game->getType() != GAME) return "FALSE"; - key = Utils::String::toUpper(game->metadata.get("kidgame")); + key = Utils::String::toUpper(game->metadata.get("favorite")); break; } case COMPLETED_FILTER: { @@ -203,10 +197,10 @@ std::string FileFilterIndex::getIndexableKey(FileData* game, key = Utils::String::toUpper(game->metadata.get("completed")); break; } - case BROKEN_FILTER: { + case KIDGAME_FILTER: { if (game->getType() != GAME) return "FALSE"; - key = Utils::String::toUpper(game->metadata.get("broken")); + key = Utils::String::toUpper(game->metadata.get("kidgame")); break; } case HIDDEN_FILTER: { @@ -215,6 +209,12 @@ std::string FileFilterIndex::getIndexableKey(FileData* game, key = Utils::String::toUpper(game->metadata.get("hidden")); break; } + case BROKEN_FILTER: { + if (game->getType() != GAME) + return "FALSE"; + key = Utils::String::toUpper(game->metadata.get("broken")); + break; + } case ALTEMULATOR_FILTER: { if (getSecondary) break; @@ -241,31 +241,31 @@ std::string FileFilterIndex::getIndexableKey(FileData* game, void FileFilterIndex::addToIndex(FileData* game) { - manageFavoritesEntryInIndex(game); - manageGenreEntryInIndex(game); - managePlayerEntryInIndex(game); + manageRatingsEntryInIndex(game); manageDeveloperEntryInIndex(game); managePublisherEntryInIndex(game); - manageRatingsEntryInIndex(game); - manageKidGameEntryInIndex(game); + manageGenreEntryInIndex(game); + managePlayerEntryInIndex(game); + manageFavoritesEntryInIndex(game); manageCompletedEntryInIndex(game); - manageBrokenEntryInIndex(game); + manageKidGameEntryInIndex(game); manageHiddenEntryInIndex(game); + manageBrokenEntryInIndex(game); manageAltemulatorEntryInIndex(game); } void FileFilterIndex::removeFromIndex(FileData* game) { - manageFavoritesEntryInIndex(game, true); - manageGenreEntryInIndex(game, true); - managePlayerEntryInIndex(game, true); + manageRatingsEntryInIndex(game, true); manageDeveloperEntryInIndex(game, true); managePublisherEntryInIndex(game, true); - manageRatingsEntryInIndex(game, true); - manageKidGameEntryInIndex(game, true); + manageGenreEntryInIndex(game, true); + managePlayerEntryInIndex(game, true); + manageFavoritesEntryInIndex(game, true); manageCompletedEntryInIndex(game, true); - manageBrokenEntryInIndex(game, true); + manageKidGameEntryInIndex(game, true); manageHiddenEntryInIndex(game, true); + manageBrokenEntryInIndex(game, true); manageAltemulatorEntryInIndex(game, true); } @@ -335,36 +335,36 @@ void FileFilterIndex::setKidModeFilters() void FileFilterIndex::debugPrintIndexes() { LOG(LogInfo) << "Printing Indexes..."; - for (auto x : mFavoritesIndexAllKeys) { - LOG(LogInfo) << "Favorites Index: " << x.first << ": " << x.second; + for (auto x : mRatingsIndexAllKeys) { + LOG(LogInfo) << "Ratings Index: " << x.first << ": " << x.second; + } + for (auto x : mDeveloperIndexAllKeys) { + LOG(LogInfo) << "Developer Index: " << x.first << ": " << x.second; + } + for (auto x : mPublisherIndexAllKeys) { + LOG(LogInfo) << "Publisher Index: " << x.first << ": " << x.second; } for (auto x : mGenreIndexAllKeys) { LOG(LogInfo) << "Genre Index: " << x.first << ": " << x.second; } for (auto x : mPlayersIndexAllKeys) { - LOG(LogInfo) << "Multiplayer Index: " << x.first << ": " << x.second; + LOG(LogInfo) << "Players Index: " << x.first << ": " << x.second; } - for (auto x : mDeveloperIndexAllKeys) { - LOG(LogInfo) << "PubDev Index: " << x.first << ": " << x.second; - } - for (auto x : mPublisherIndexAllKeys) { - LOG(LogInfo) << "PubDev Index: " << x.first << ": " << x.second; - } - for (auto x : mRatingsIndexAllKeys) { - LOG(LogInfo) << "Ratings Index: " << x.first << ": " << x.second; - } - for (auto x : mKidGameIndexAllKeys) { - LOG(LogInfo) << "KidGames Index: " << x.first << ": " << x.second; + for (auto x : mFavoritesIndexAllKeys) { + LOG(LogInfo) << "Favorites Index: " << x.first << ": " << x.second; } for (auto x : mCompletedIndexAllKeys) { LOG(LogInfo) << "Completed Index: " << x.first << ": " << x.second; } - for (auto x : mBrokenIndexAllKeys) { - LOG(LogInfo) << "Broken Index: " << x.first << ": " << x.second; + for (auto x : mKidGameIndexAllKeys) { + LOG(LogInfo) << "KidGames Index: " << x.first << ": " << x.second; } for (auto x : mHiddenIndexAllKeys) { LOG(LogInfo) << "Hidden Index: " << x.first << ": " << x.second; } + for (auto x : mBrokenIndexAllKeys) { + LOG(LogInfo) << "Broken Index: " << x.first << ": " << x.second; + } for (auto x : mAltemulatorIndexAllKeys) { LOG(LogInfo) << "Altemulator Index: " << x.first << ": " << x.second; } @@ -442,28 +442,28 @@ bool FileFilterIndex::showFile(FileData* game) bool FileFilterIndex::isFiltered() { if (UIModeController::getInstance()->isUIModeKid()) { - return (mFilterByText || mFilterByFavorites || mFilterByGenre || mFilterByPlayers || - mFilterByDeveloper || mFilterByPublisher || mFilterByRatings || - mFilterByCompleted || mFilterByBroken || mFilterByHidden || mFilterByAltemulator); + return (mFilterByText || mFilterByRatings || mFilterByDeveloper || mFilterByPublisher || + mFilterByGenre || mFilterByPlayers || mFilterByFavorites || mFilterByCompleted || + mFilterByHidden || mFilterByBroken || mFilterByAltemulator); } else { - return (mFilterByText || mFilterByFavorites || mFilterByGenre || mFilterByPlayers || - mFilterByDeveloper || mFilterByPublisher || mFilterByRatings || mFilterByKidGame || - mFilterByCompleted || mFilterByBroken || mFilterByHidden | mFilterByAltemulator); + return (mFilterByText || mFilterByRatings || mFilterByDeveloper || mFilterByPublisher || + mFilterByGenre || mFilterByPlayers || mFilterByFavorites || mFilterByCompleted || + mFilterByKidGame || mFilterByHidden || mFilterByBroken || mFilterByAltemulator); } } bool FileFilterIndex::isKeyBeingFilteredBy(std::string key, FilterIndexType type) { - const FilterIndexType filterTypes[11] = {FAVORITES_FILTER, GENRE_FILTER, PLAYER_FILTER, - DEVELOPER_FILTER, PUBLISHER_FILTER, RATINGS_FILTER, - KIDGAME_FILTER, COMPLETED_FILTER, BROKEN_FILTER, - HIDDEN_FILTER, ALTEMULATOR_FILTER}; + const FilterIndexType filterTypes[11] = {RATINGS_FILTER, DEVELOPER_FILTER, PUBLISHER_FILTER, + GENRE_FILTER, PLAYER_FILTER, FAVORITES_FILTER, + COMPLETED_FILTER, KIDGAME_FILTER, HIDDEN_FILTER, + BROKEN_FILTER, ALTEMULATOR_FILTER}; std::vector filterKeysList[11] = { - mFavoritesIndexFilteredKeys, mGenreIndexFilteredKeys, mPlayersIndexFilteredKeys, - mDeveloperIndexFilteredKeys, mPublisherIndexFilteredKeys, mRatingsIndexFilteredKeys, - mKidGameIndexFilteredKeys, mCompletedIndexFilteredKeys, mBrokenIndexFilteredKeys, - mHiddenIndexFilteredKeys, mAltemulatorIndexFilteredKeys}; + mRatingsIndexFilteredKeys, mDeveloperIndexFilteredKeys, mPublisherIndexFilteredKeys, + mGenreIndexFilteredKeys, mPlayersIndexFilteredKeys, mFavoritesIndexFilteredKeys, + mCompletedIndexFilteredKeys, mKidGameIndexFilteredKeys, mHiddenIndexFilteredKeys, + mBrokenIndexFilteredKeys, mAltemulatorIndexFilteredKeys}; for (int i = 0; i < 11; i++) { if (filterTypes[i] == type) { @@ -478,41 +478,18 @@ bool FileFilterIndex::isKeyBeingFilteredBy(std::string key, FilterIndexType type return false; } -void FileFilterIndex::manageFavoritesEntryInIndex(FileData* game, bool remove) +void FileFilterIndex::manageRatingsEntryInIndex(FileData* game, bool remove) { + std::string key = getIndexableKey(game, RATINGS_FILTER, false); + + // Flag for including unknowns. bool includeUnknown = INCLUDE_UNKNOWN; - std::string key = getIndexableKey(game, FAVORITES_FILTER, false); if (!includeUnknown && key == UNKNOWN_LABEL) + // No valid rating info found. return; - manageIndexEntry(&mFavoritesIndexAllKeys, key, remove); -} - -void FileFilterIndex::manageGenreEntryInIndex(FileData* game, bool remove) -{ - bool includeUnknown = INCLUDE_UNKNOWN; - std::string key = getIndexableKey(game, GENRE_FILTER, false); - - if (!includeUnknown && (key == UNKNOWN_LABEL || key == "BIOS")) - return; - - manageIndexEntry(&mGenreIndexAllKeys, key, remove); - - key = getIndexableKey(game, GENRE_FILTER, true); - if (!includeUnknown && key == UNKNOWN_LABEL) - manageIndexEntry(&mGenreIndexAllKeys, key, remove); -} - -void FileFilterIndex::managePlayerEntryInIndex(FileData* game, bool remove) -{ - bool includeUnknown = INCLUDE_UNKNOWN; - std::string key = getIndexableKey(game, PLAYER_FILTER, false); - - if (!includeUnknown && key == UNKNOWN_LABEL) - return; - - manageIndexEntry(&mPlayersIndexAllKeys, key, remove); + manageIndexEntry(&mRatingsIndexAllKeys, key, remove); } void FileFilterIndex::manageDeveloperEntryInIndex(FileData* game, bool remove) @@ -545,31 +522,41 @@ void FileFilterIndex::managePublisherEntryInIndex(FileData* game, bool remove) manageIndexEntry(&mPublisherIndexAllKeys, key, remove); } -void FileFilterIndex::manageRatingsEntryInIndex(FileData* game, bool remove) +void FileFilterIndex::manageGenreEntryInIndex(FileData* game, bool remove) { - std::string key = getIndexableKey(game, RATINGS_FILTER, false); - - // Flag for including unknowns. bool includeUnknown = INCLUDE_UNKNOWN; + std::string key = getIndexableKey(game, GENRE_FILTER, false); - if (!includeUnknown && key == UNKNOWN_LABEL) - // No valid rating info found. + if (!includeUnknown && (key == UNKNOWN_LABEL || key == "BIOS")) return; - manageIndexEntry(&mRatingsIndexAllKeys, key, remove); + manageIndexEntry(&mGenreIndexAllKeys, key, remove); + + key = getIndexableKey(game, GENRE_FILTER, true); + if (!includeUnknown && key == UNKNOWN_LABEL) + manageIndexEntry(&mGenreIndexAllKeys, key, remove); } -void FileFilterIndex::manageKidGameEntryInIndex(FileData* game, bool remove) +void FileFilterIndex::managePlayerEntryInIndex(FileData* game, bool remove) { - // Flag for including unknowns. bool includeUnknown = INCLUDE_UNKNOWN; - std::string key = getIndexableKey(game, KIDGAME_FILTER, false); + std::string key = getIndexableKey(game, PLAYER_FILTER, false); if (!includeUnknown && key == UNKNOWN_LABEL) - // No valid kidgame info found. return; - manageIndexEntry(&mKidGameIndexAllKeys, key, remove); + manageIndexEntry(&mPlayersIndexAllKeys, key, remove); +} + +void FileFilterIndex::manageFavoritesEntryInIndex(FileData* game, bool remove) +{ + bool includeUnknown = INCLUDE_UNKNOWN; + std::string key = getIndexableKey(game, FAVORITES_FILTER, false); + + if (!includeUnknown && key == UNKNOWN_LABEL) + return; + + manageIndexEntry(&mFavoritesIndexAllKeys, key, remove); } void FileFilterIndex::manageCompletedEntryInIndex(FileData* game, bool remove) @@ -585,17 +572,17 @@ void FileFilterIndex::manageCompletedEntryInIndex(FileData* game, bool remove) manageIndexEntry(&mCompletedIndexAllKeys, key, remove); } -void FileFilterIndex::manageBrokenEntryInIndex(FileData* game, bool remove) +void FileFilterIndex::manageKidGameEntryInIndex(FileData* game, bool remove) { // Flag for including unknowns. bool includeUnknown = INCLUDE_UNKNOWN; - std::string key = getIndexableKey(game, BROKEN_FILTER, false); + std::string key = getIndexableKey(game, KIDGAME_FILTER, false); if (!includeUnknown && key == UNKNOWN_LABEL) - // No valid broken info found. + // No valid kidgame info found. return; - manageIndexEntry(&mBrokenIndexAllKeys, key, remove); + manageIndexEntry(&mKidGameIndexAllKeys, key, remove); } void FileFilterIndex::manageHiddenEntryInIndex(FileData* game, bool remove) @@ -611,6 +598,19 @@ void FileFilterIndex::manageHiddenEntryInIndex(FileData* game, bool remove) manageIndexEntry(&mHiddenIndexAllKeys, key, remove); } +void FileFilterIndex::manageBrokenEntryInIndex(FileData* game, bool remove) +{ + // Flag for including unknowns. + bool includeUnknown = INCLUDE_UNKNOWN; + std::string key = getIndexableKey(game, BROKEN_FILTER, false); + + if (!includeUnknown && key == UNKNOWN_LABEL) + // No valid broken info found. + return; + + manageIndexEntry(&mBrokenIndexAllKeys, key, remove); +} + void FileFilterIndex::manageAltemulatorEntryInIndex(FileData* game, bool remove) { std::string key = getIndexableKey(game, ALTEMULATOR_FILTER, false); diff --git a/es-app/src/FileFilterIndex.h b/es-app/src/FileFilterIndex.h index b06ca7d79..d4d744a7f 100644 --- a/es-app/src/FileFilterIndex.h +++ b/es-app/src/FileFilterIndex.h @@ -21,16 +21,16 @@ class FileData; enum FilterIndexType { NONE, - FAVORITES_FILTER, - GENRE_FILTER, - PLAYER_FILTER, + RATINGS_FILTER, DEVELOPER_FILTER, PUBLISHER_FILTER, - RATINGS_FILTER, - KIDGAME_FILTER, + GENRE_FILTER, + PLAYER_FILTER, + FAVORITES_FILTER, COMPLETED_FILTER, - BROKEN_FILTER, + KIDGAME_FILTER, HIDDEN_FILTER, + BROKEN_FILTER, ALTEMULATOR_FILTER }; @@ -72,16 +72,16 @@ private: std::vector filterDataDecl; std::string getIndexableKey(FileData* game, FilterIndexType type, bool getSecondary); - void manageFavoritesEntryInIndex(FileData* game, bool remove = false); - void manageGenreEntryInIndex(FileData* game, bool remove = false); - void managePlayerEntryInIndex(FileData* game, bool remove = false); + void manageRatingsEntryInIndex(FileData* game, bool remove = false); void manageDeveloperEntryInIndex(FileData* game, bool remove = false); void managePublisherEntryInIndex(FileData* game, bool remove = false); - void manageRatingsEntryInIndex(FileData* game, bool remove = false); - void manageKidGameEntryInIndex(FileData* game, bool remove = false); + void manageGenreEntryInIndex(FileData* game, bool remove = false); + void managePlayerEntryInIndex(FileData* game, bool remove = false); + void manageFavoritesEntryInIndex(FileData* game, bool remove = false); void manageCompletedEntryInIndex(FileData* game, bool remove = false); - void manageBrokenEntryInIndex(FileData* game, bool remove = false); + void manageKidGameEntryInIndex(FileData* game, bool remove = false); void manageHiddenEntryInIndex(FileData* game, bool remove = false); + void manageBrokenEntryInIndex(FileData* game, bool remove = false); void manageAltemulatorEntryInIndex(FileData* game, bool remove = false); void manageIndexEntry(std::map* index, std::string key, bool remove); @@ -92,40 +92,40 @@ private: bool mFilterByText; bool mTextRemoveSystem; - bool mFilterByFavorites; - bool mFilterByGenre; - bool mFilterByPlayers; + bool mFilterByRatings; bool mFilterByDeveloper; bool mFilterByPublisher; - bool mFilterByRatings; - bool mFilterByKidGame; + bool mFilterByGenre; + bool mFilterByPlayers; + bool mFilterByFavorites; bool mFilterByCompleted; - bool mFilterByBroken; + bool mFilterByKidGame; bool mFilterByHidden; + bool mFilterByBroken; bool mFilterByAltemulator; - std::map mFavoritesIndexAllKeys; - std::map mGenreIndexAllKeys; - std::map mPlayersIndexAllKeys; + std::map mRatingsIndexAllKeys; std::map mDeveloperIndexAllKeys; std::map mPublisherIndexAllKeys; - std::map mRatingsIndexAllKeys; - std::map mKidGameIndexAllKeys; + std::map mGenreIndexAllKeys; + std::map mPlayersIndexAllKeys; + std::map mFavoritesIndexAllKeys; std::map mCompletedIndexAllKeys; - std::map mBrokenIndexAllKeys; + std::map mKidGameIndexAllKeys; std::map mHiddenIndexAllKeys; + std::map mBrokenIndexAllKeys; std::map mAltemulatorIndexAllKeys; - std::vector mFavoritesIndexFilteredKeys; - std::vector mGenreIndexFilteredKeys; - std::vector mPlayersIndexFilteredKeys; + std::vector mRatingsIndexFilteredKeys; std::vector mDeveloperIndexFilteredKeys; std::vector mPublisherIndexFilteredKeys; - std::vector mRatingsIndexFilteredKeys; - std::vector mKidGameIndexFilteredKeys; + std::vector mGenreIndexFilteredKeys; + std::vector mPlayersIndexFilteredKeys; + std::vector mFavoritesIndexFilteredKeys; std::vector mCompletedIndexFilteredKeys; - std::vector mBrokenIndexFilteredKeys; + std::vector mKidGameIndexFilteredKeys; std::vector mHiddenIndexFilteredKeys; + std::vector mBrokenIndexFilteredKeys; std::vector mAltemulatorIndexFilteredKeys; }; From f8b9275b4b69d7b5b0ef22fe02869d44c24bb9b1 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 26 Sep 2021 11:14:52 +0200 Subject: [PATCH 10/42] Fixed a missing filter index update when removing games from custom collections. --- es-app/src/CollectionSystemsManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/es-app/src/CollectionSystemsManager.cpp b/es-app/src/CollectionSystemsManager.cpp index df2ed075e..43999865f 100644 --- a/es-app/src/CollectionSystemsManager.cpp +++ b/es-app/src/CollectionSystemsManager.cpp @@ -692,6 +692,7 @@ bool CollectionSystemsManager::toggleGameInCollection(FileData* file) adding = false; // If we found it, we need to remove it. FileData* collectionEntry = children.at(key); + fileIndex->removeFromIndex(collectionEntry); ViewController::get() ->getGameListView(systemViewToUpdate) .get() From 7228491878292b089fc596779293784a61095a2e Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 26 Sep 2021 12:03:12 +0200 Subject: [PATCH 11/42] Added alternative emulators to the gb, gba and gc systems. --- resources/systems/macos/es_systems.xml | 25 ++++++++++++++++++------ resources/systems/unix/es_systems.xml | 25 ++++++++++++++++++------ resources/systems/windows/es_systems.xml | 25 ++++++++++++++++++------ 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/resources/systems/macos/es_systems.xml b/resources/systems/macos/es_systems.xml index 0457f49ff..bc3fa6aec 100644 --- a/resources/systems/macos/es_systems.xml +++ b/resources/systems/macos/es_systems.xml @@ -402,8 +402,13 @@ gb Nintendo Game Boy %ROMPATH%/gb - .sfc .SFC .smc .SMC .gb .GB .gbc .GBC .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.dylib %ROM% + .bs .BS .cgb .CGB .dmg .DMG .gb .GB .gbc .GBC .sgb .SGB .sfc .SFC .smc .SMC .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/sameboy_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gambatte_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gearboy_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/tgbdual_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mesen-s_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.dylib %ROM% gb gb @@ -411,8 +416,11 @@ gba Nintendo Game Boy Advance %ROMPATH%/gba - .gba .GBA .agb .AGB .bin .BIN .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_gba_libretro.dylib %ROM% + .agb .AGB .bin .BIN .cgb .CGB .dmg .DMG .gb .GB .gba .GBA .gbc .GBC .sgb .SGB .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mgba_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vbam_next_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vba_next_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gpsp_libretro.dylib %ROM% gba gba @@ -420,8 +428,13 @@ gbc Nintendo Game Boy Color %ROMPATH%/gbc - .sfc .SFC .smc .SMC .gb .GB .gbc .GBC .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.dylib %ROM% + .bs .BS .cgb .CGB .dmg .DMG .gb .GB .gbc .GBC .sgb .SGB .sfc .SFC .smc .SMC .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/sameboy_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gambatte_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gearboy_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/tgbdual_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mesen-s_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.dylib %ROM% gbc gbc diff --git a/resources/systems/unix/es_systems.xml b/resources/systems/unix/es_systems.xml index 83c0f653a..a1129e75a 100644 --- a/resources/systems/unix/es_systems.xml +++ b/resources/systems/unix/es_systems.xml @@ -403,8 +403,13 @@ gb Nintendo Game Boy %ROMPATH%/gb - .sfc .SFC .smc .SMC .gb .GB .gbc .GBC .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.so %ROM% + .bs .BS .cgb .CGB .dmg .DMG .gb .GB .gbc .GBC .sgb .SGB .sfc .SFC .smc .SMC .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/sameboy_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gambatte_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gearboy_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/tgbdual_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mesen-s_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.so %ROM% gb gb @@ -412,8 +417,11 @@ gba Nintendo Game Boy Advance %ROMPATH%/gba - .gba .GBA .agb .AGB .bin .BIN .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_gba_libretro.so %ROM% + .agb .AGB .bin .BIN .cgb .CGB .dmg .DMG .gb .GB .gba .GBA .gbc .GBC .sgb .SGB .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mgba_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vbam_next_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vba_next_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gpsp_libretro.so %ROM% gba gba @@ -421,8 +429,13 @@ gbc Nintendo Game Boy Color %ROMPATH%/gbc - .sfc .SFC .smc .SMC .gb .GB .gbc .GBC .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.so %ROM% + .bs .BS .cgb .CGB .dmg .DMG .gb .GB .gbc .GBC .sgb .SGB .sfc .SFC .smc .SMC .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/sameboy_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gambatte_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gearboy_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/tgbdual_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mesen-s_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.so %ROM% gbc gbc diff --git a/resources/systems/windows/es_systems.xml b/resources/systems/windows/es_systems.xml index 62843d550..6e4071a65 100644 --- a/resources/systems/windows/es_systems.xml +++ b/resources/systems/windows/es_systems.xml @@ -403,8 +403,13 @@ gb Nintendo Game Boy %ROMPATH%\gb - .sfc .SFC .smc .SMC .gb .GB .gbc .GBC .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bsnes_libretro.dll %ROM% + .bs .BS .cgb .CGB .dmg .DMG .gb .GB .gbc .GBC .sgb .SGB .sfc .SFC .smc .SMC .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\sameboy_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\gambatte_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\gearboy_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\tgbdual_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mesen-s_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bsnes_libretro.dll %ROM% gb gb @@ -412,8 +417,11 @@ gba Nintendo Game Boy Advance %ROMPATH%\gba - .gba .GBA .agb .AGB .bin .BIN .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_gba_libretro.dll %ROM% + .agb .AGB .bin .BIN .cgb .CGB .dmg .DMG .gb .GB .gba .GBA .gbc .GBC .sgb .SGB .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mgba_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\vbam_next_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\vba_next_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\gpsp_libretro.dll %ROM% gba gba @@ -421,8 +429,13 @@ gbc Nintendo Game Boy Color %ROMPATH%\gbc - .sfc .SFC .smc .SMC .gb .GB .gbc .GBC .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bsnes_libretro.dll %ROM% + .bs .BS .cgb .CGB .dmg .DMG .gb .GB .gbc .GBC .sgb .SGB .sfc .SFC .smc .SMC .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\sameboy_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\gambatte_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\gearboy_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\tgbdual_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mesen-s_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bsnes_libretro.dll %ROM% gbc gbc From f435cb5b746352eea97ab1c13618b8b33f57c796 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 26 Sep 2021 12:21:13 +0200 Subject: [PATCH 12/42] Added alternative emulators to the n3ds and nds systems. --- resources/systems/macos/es_systems.xml | 9 ++++++--- resources/systems/unix/es_systems.xml | 9 ++++++--- resources/systems/windows/es_systems.xml | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/resources/systems/macos/es_systems.xml b/resources/systems/macos/es_systems.xml index bc3fa6aec..23187816e 100644 --- a/resources/systems/macos/es_systems.xml +++ b/resources/systems/macos/es_systems.xml @@ -665,7 +665,8 @@ Nintendo 3DS %ROMPATH%/n3ds .3ds .3DS .3dsx .3DSX .app .APP .axf .AXF .cci .CCI .cxi .CXI .elf .ELF .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/citra_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/citra_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/citra2018_libretro.dylib %ROM% n3ds n3ds @@ -700,8 +701,10 @@ nds Nintendo DS %ROMPATH%/nds - .nds .NDS .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/melonds_libretro.dylib %ROM% + .bin .BIN .nds .NDS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/desmume_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/desmume2015_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/melonds_libretro.dylib %ROM% nds nds diff --git a/resources/systems/unix/es_systems.xml b/resources/systems/unix/es_systems.xml index a1129e75a..755e7553b 100644 --- a/resources/systems/unix/es_systems.xml +++ b/resources/systems/unix/es_systems.xml @@ -666,7 +666,8 @@ Nintendo 3DS %ROMPATH%/n3ds .3ds .3DS .3dsx .3DSX .app .APP .axf .AXF .cci .CCI .cxi .CXI .elf .ELF .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/citra_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/citra_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/citra2018_libretro.so %ROM% n3ds n3ds @@ -702,8 +703,10 @@ nds Nintendo DS %ROMPATH%/nds - .nds .NDS .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/melonds_libretro.so %ROM% + .bin .BIN .nds .NDS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/desmume_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/desmume2015_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/melonds_libretro.so %ROM% nds nds diff --git a/resources/systems/windows/es_systems.xml b/resources/systems/windows/es_systems.xml index 6e4071a65..394491c3f 100644 --- a/resources/systems/windows/es_systems.xml +++ b/resources/systems/windows/es_systems.xml @@ -666,7 +666,8 @@ Nintendo 3DS %ROMPATH%\n3ds .3ds .3DS .3dsx .3DSX .app .APP .axf .AXF .cci .CCI .cxi .CXI .elf .ELF .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\citra_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\citra_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\citra2018_libretro.dll %ROM% n3ds n3ds @@ -702,8 +703,10 @@ nds Nintendo DS %ROMPATH%\nds - .nds .NDS .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\melonds_libretro.dll %ROM% + .bin .BIN .nds .NDS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\desmume_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\desmume2015_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\melonds_libretro.dll %ROM% nds nds From 5e23cb6989fc8b947c3daf9a4c46aa11916f992b Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 26 Sep 2021 13:10:12 +0200 Subject: [PATCH 13/42] Added alternative emulators to the amstradcpc, atarilynx, ngp, ngpc, pc98, saturn and saturnjp systems. --- resources/systems/macos/es_systems.xml | 27 +++++++++++++-------- resources/systems/unix/es_systems.xml | 31 ++++++++++++++++-------- resources/systems/windows/es_systems.xml | 31 ++++++++++++++++-------- 3 files changed, 59 insertions(+), 30 deletions(-) diff --git a/resources/systems/macos/es_systems.xml b/resources/systems/macos/es_systems.xml index 23187816e..db1b290e2 100644 --- a/resources/systems/macos/es_systems.xml +++ b/resources/systems/macos/es_systems.xml @@ -68,8 +68,9 @@ amstradcpc Amstrad CPC %ROMPATH%/amstradcpc - .dsk .DSK .sna .SNA .tap .TAR .cdt .CDT .voc .VOC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/cap32_libretro.dylib %ROM% + .cdt .CDT .cpr .CPR .dsk .DSK .kcr .KCR .m3u .M3U .sna .SNA .tap .TAR .voc .VOC .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/cap32_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/crocods_libretro.dylib %ROM% amstradcpc amstradcpc @@ -174,7 +175,8 @@ Atari Lynx %ROMPATH%/atarilynx .lnx .LNX .o .O .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_lynx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/handy_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_lynx_libretro.dylib %ROM% atarilynx atarilynx @@ -752,7 +754,8 @@ SNK Neo Geo Pocket %ROMPATH%/ngp .ngp .NGP .ngc .NGC .ngpc .NGPC .npc .NPC .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_ngp_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_ngp_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/race_libretro.dylib %ROM% ngp ngp @@ -761,7 +764,8 @@ SNK Neo Geo Pocket Color %ROMPATH%/ngpc .ngp .NGP .ngc .NGC .ngpc .NGPC .npc .NPC .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_ngp_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_ngp_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/race_libretro.dylib %ROM% ngpc ngpc @@ -826,7 +830,8 @@ NEC PC-9800 series %ROMPATH%/pc98 .2hd .2HD .88d .88D .98d .98D .d88 .D88 .d98 .D98 .cmd .CMD .dup .DUP .fdd .FDD .fdi .FDI .hdd .HDD .hdi .HDI .hdm .HDM .hdn .HDN .nhd .NHD .tfd .TFD .thd .THD . xdf .XDF .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/np2kai_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/np2kai_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/nekop2_libretro.dylib %ROM% pc98 pc98 @@ -965,8 +970,9 @@ saturn Sega Saturn %ROMPATH%/saturn - .ccd .CCD .chd .CHD .cue .CUE .toc .TOC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_saturn_libretro.dylib %ROM% + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .iso .ISO .mds .MDS .toc .TOC .m3u .M3U .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_saturn_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/yabause_libretro.dylib %ROM% saturn saturn @@ -974,8 +980,9 @@ saturnjp Sega Saturn %ROMPATH%/saturnjp - .ccd .CCD .chd .CHD .cue .CUE .toc .TOC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_saturn_libretro.dylib %ROM% + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .iso .ISO .mds .MDS .toc .TOC .m3u .M3U .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_saturn_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/yabause_libretro.dylib %ROM% saturn saturnjp diff --git a/resources/systems/unix/es_systems.xml b/resources/systems/unix/es_systems.xml index 755e7553b..830068d73 100644 --- a/resources/systems/unix/es_systems.xml +++ b/resources/systems/unix/es_systems.xml @@ -69,8 +69,9 @@ amstradcpc Amstrad CPC %ROMPATH%/amstradcpc - .dsk .DSK .sna .SNA .tap .TAR .cdt .CDT .voc .VOC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/cap32_libretro.so %ROM% + .cdt .CDT .cpr .CPR .dsk .DSK .kcr .KCR .m3u .M3U .sna .SNA .tap .TAR .voc .VOC .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/cap32_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/crocods_libretro.so %ROM% amstradcpc amstradcpc @@ -175,7 +176,8 @@ Atari Lynx %ROMPATH%/atarilynx .lnx .LNX .o .O .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_lynx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/handy_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_lynx_libretro.so %ROM% atarilynx atarilynx @@ -754,7 +756,8 @@ SNK Neo Geo Pocket %ROMPATH%/ngp .ngp .NGP .ngc .NGC .ngpc .NGPC .npc .NPC .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_ngp_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_ngp_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/race_libretro.so %ROM% ngp ngp @@ -763,7 +766,8 @@ SNK Neo Geo Pocket Color %ROMPATH%/ngpc .ngp .NGP .ngc .NGC .ngpc .NGPC .npc .NPC .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_ngp_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_ngp_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/race_libretro.so %ROM% ngpc ngpc @@ -828,7 +832,8 @@ NEC PC-9800 series %ROMPATH%/pc98 .2hd .2HD .88d .88D .98d .98D .d88 .D88 .d98 .D98 .cmd .CMD .dup .DUP .fdd .FDD .fdi .FDI .hdd .HDD .hdi .HDI .hdm .HDM .hdn .HDN .nhd .NHD .tfd .TFD .thd .THD . xdf .XDF .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/np2kai_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/np2kai_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/nekop2_libretro.so %ROM% pc98 pc98 @@ -967,8 +972,11 @@ saturn Sega Saturn %ROMPATH%/saturn - .ccd .CCD .chd .CHD .cue .CUE .toc .TOC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_saturn_libretro.so %ROM% + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .iso .ISO .mds .MDS .toc .TOC .m3u .M3U .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_saturn_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/kronos_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/yabasanshiro_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/yabause_libretro.so %ROM% saturn saturn @@ -976,8 +984,11 @@ saturnjp Sega Saturn %ROMPATH%/saturnjp - .ccd .CCD .chd .CHD .cue .CUE .toc .TOC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_saturn_libretro.so %ROM% + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .iso .ISO .mds .MDS .toc .TOC .m3u .M3U .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_saturn_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/kronos_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/yabasanshiro_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/yabause_libretro.so %ROM% saturn saturnjp diff --git a/resources/systems/windows/es_systems.xml b/resources/systems/windows/es_systems.xml index 394491c3f..1c2560b7e 100644 --- a/resources/systems/windows/es_systems.xml +++ b/resources/systems/windows/es_systems.xml @@ -69,8 +69,9 @@ amstradcpc Amstrad CPC %ROMPATH%\amstradcpc - .dsk .DSK .sna .SNA .tap .TAR .cdt .CDT .voc .VOC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\cap32_libretro.dll %ROM% + .cdt .CDT .cpr .CPR .dsk .DSK .kcr .KCR .m3u .M3U .sna .SNA .tap .TAR .voc .VOC .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\cap32_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\crocods_libretro.dll %ROM% amstradcpc amstradcpc @@ -175,7 +176,8 @@ Atari Lynx %ROMPATH%\atarilynx .lnx .LNX .o .O .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_lynx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\handy_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_lynx_libretro.dll %ROM% atarilynx atarilynx @@ -754,7 +756,8 @@ SNK Neo Geo Pocket %ROMPATH%\ngp .ngp .NGP .ngc .NGC .ngpc .NGPC .npc .NPC .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_ngp_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_ngp_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\race_libretro.dll %ROM% ngp ngp @@ -763,7 +766,8 @@ SNK Neo Geo Pocket Color %ROMPATH%\ngpc .ngp .NGP .ngc .NGC .ngpc .NGPC .npc .NPC .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_ngp_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_ngp_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\race_libretro.dll %ROM% ngpc ngpc @@ -828,7 +832,8 @@ NEC PC-9800 series %ROMPATH%\pc98 .2hd .2HD .88d .88D .98d .98D .d88 .D88 .d98 .D98 .cmd .CMD .dup .DUP .fdd .FDD .fdi .FDI .hdd .HDD .hdi .HDI .hdm .HDM .hdn .HDN .nhd .NHD .tfd .TFD .thd .THD . xdf .XDF .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\np2kai_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\np2kai_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\nekop2_libretro.dll %ROM% pc98 pc98 @@ -967,8 +972,11 @@ saturn Sega Saturn %ROMPATH%\saturn - .ccd .CCD .chd .CHD .cue .CUE .toc .TOC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_saturn_libretro.dll %ROM% + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .iso .ISO .mds .MDS .toc .TOC .m3u .M3U .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_saturn_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\kronos_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\yabasanshiro_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\yabause_libretro.dll %ROM% saturn saturn @@ -976,8 +984,11 @@ saturnjp Sega Saturn %ROMPATH%\saturnjp - .ccd .CCD .chd .CHD .cue .CUE .toc .TOC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_saturn_libretro.dll %ROM% + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .iso .ISO .mds .MDS .toc .TOC .m3u .M3U .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_saturn_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\kronos_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\yabasanshiro_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\yabause_libretro.dll %ROM% saturn saturnjp From b33da81f4f956ede457d4dd9fc2b501e0800eb23 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 26 Sep 2021 13:23:10 +0200 Subject: [PATCH 14/42] Added alternative emulators to the msx, msx1 and msx2 systems. --- resources/systems/macos/es_systems.xml | 9 ++++++--- resources/systems/unix/es_systems.xml | 9 ++++++--- resources/systems/windows/es_systems.xml | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/resources/systems/macos/es_systems.xml b/resources/systems/macos/es_systems.xml index db1b290e2..85837db54 100644 --- a/resources/systems/macos/es_systems.xml +++ b/resources/systems/macos/es_systems.xml @@ -622,7 +622,8 @@ MSX %ROMPATH%/msx .rom .ROM .ri .RI .mx1 .MX1 .mx2 .MX2 .col .COL .dsk .DSK .cas .CAS .sg .SG .sc .SC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fmsx_libretro.dylib %ROM% msx msx @@ -631,7 +632,8 @@ MSX1 %ROMPATH%/msx1 .rom .ROM .ri .RI .mx1 .MX1 .mx2 .MX2 .col .COL .dsk .DSK .cas .CAS .sg .SG .sc .SC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fmsx_libretro.dylib %ROM% msx msx1 @@ -640,7 +642,8 @@ MSX2 %ROMPATH%/msx2 .rom .ROM .ri .RI .mx1 .MX1 .mx2 .MX2 .col .COL .dsk .DSK .cas .CAS .sg .SG .sc .SC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fmsx_libretro.dylib %ROM% msx2 msx2 diff --git a/resources/systems/unix/es_systems.xml b/resources/systems/unix/es_systems.xml index 830068d73..bc2859998 100644 --- a/resources/systems/unix/es_systems.xml +++ b/resources/systems/unix/es_systems.xml @@ -623,7 +623,8 @@ MSX %ROMPATH%/msx .rom .ROM .ri .RI .mx1 .MX1 .mx2 .MX2 .col .COL .dsk .DSK .cas .CAS .sg .SG .sc .SC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fmsx_libretro.so %ROM% msx msx @@ -632,7 +633,8 @@ MSX1 %ROMPATH%/msx1 .rom .ROM .ri .RI .mx1 .MX1 .mx2 .MX2 .col .COL .dsk .DSK .cas .CAS .sg .SG .sc .SC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fmsx_libretro.so %ROM% msx msx1 @@ -641,7 +643,8 @@ MSX2 %ROMPATH%/msx2 .rom .ROM .ri .RI .mx1 .MX1 .mx2 .MX2 .col .COL .dsk .DSK .cas .CAS .sg .SG .sc .SC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fmsx_libretro.so %ROM% msx2 msx2 diff --git a/resources/systems/windows/es_systems.xml b/resources/systems/windows/es_systems.xml index 1c2560b7e..e252aafc6 100644 --- a/resources/systems/windows/es_systems.xml +++ b/resources/systems/windows/es_systems.xml @@ -623,7 +623,8 @@ MSX %ROMPATH%\msx .rom .ROM .ri .RI .mx1 .MX1 .mx2 .MX2 .col .COL .dsk .DSK .cas .CAS .sg .SG .sc .SC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bluemsx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bluemsx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fmsx_libretro.dll %ROM% msx msx @@ -632,7 +633,8 @@ MSX1 %ROMPATH%\msx1 .rom .ROM .ri .RI .mx1 .MX1 .mx2 .MX2 .col .COL .dsk .DSK .cas .CAS .sg .SG .sc .SC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bluemsx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bluemsx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fmsx_libretro.dll %ROM% msx msx1 @@ -641,7 +643,8 @@ MSX2 %ROMPATH%\msx2 .rom .ROM .ri .RI .mx1 .MX1 .mx2 .MX2 .col .COL .dsk .DSK .cas .CAS .sg .SG .sc .SC .m3u .M3U .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bluemsx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bluemsx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fmsx_libretro.dll %ROM% msx2 msx2 From 3e8f7d17619b87c78807be7b7492e05ca8519d3e Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 26 Sep 2021 14:44:00 +0200 Subject: [PATCH 15/42] Added alternative emulators to the gamegear, megacd, megacdjp, segacd and sg-1000 systems. --- resources/systems/macos/es_systems.xml | 32 ++++++++++++++++-------- resources/systems/unix/es_systems.xml | 32 ++++++++++++++++-------- resources/systems/windows/es_systems.xml | 32 ++++++++++++++++-------- 3 files changed, 66 insertions(+), 30 deletions(-) diff --git a/resources/systems/macos/es_systems.xml b/resources/systems/macos/es_systems.xml index 85837db54..68ed65242 100644 --- a/resources/systems/macos/es_systems.xml +++ b/resources/systems/macos/es_systems.xml @@ -395,8 +395,11 @@ gamegear Sega Game Gear %ROMPATH%/gamegear - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .col .COL .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .rom .ROM .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gearsystem_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/smsplus_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.dylib %ROM% gamegear gamegear @@ -564,8 +567,10 @@ megacd Sega Mega-CD %ROMPATH%/megacd - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/picodrive_libretro.dylib %ROM% segacd megacd @@ -573,8 +578,10 @@ megacdjp Sega Mega-CD %ROMPATH%/megacdjp - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/picodrive_libretro.dylib %ROM% segacd megacdjp @@ -1029,8 +1036,10 @@ segacd Sega CD %ROMPATH%/segacd - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/picodrive_libretro.dylib %ROM% segacd segacd @@ -1038,8 +1047,11 @@ sg-1000 Sega SG-1000 %ROMPATH%/sg-1000 - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .ri .RI .rom .ROM .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gearsystem_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.dylib %ROM% sg-1000 sg-1000 diff --git a/resources/systems/unix/es_systems.xml b/resources/systems/unix/es_systems.xml index bc2859998..b1d0abe87 100644 --- a/resources/systems/unix/es_systems.xml +++ b/resources/systems/unix/es_systems.xml @@ -396,8 +396,11 @@ gamegear Sega Game Gear %ROMPATH%/gamegear - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .col .COL .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .rom .ROM .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gearsystem_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/smsplus_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.so %ROM% gamegear gamegear @@ -565,8 +568,10 @@ megacd Sega Mega-CD %ROMPATH%/megacd - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/picodrive_libretro.so %ROM% segacd megacd @@ -574,8 +579,10 @@ megacdjp Sega Mega-CD %ROMPATH%/megacdjp - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/picodrive_libretro.so %ROM% segacd megacdjp @@ -1035,8 +1042,10 @@ segacd Sega CD %ROMPATH%/segacd - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/picodrive_libretro.so %ROM% segacd segacd @@ -1044,8 +1053,11 @@ sg-1000 Sega SG-1000 %ROMPATH%/sg-1000 - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .ri .RI .rom .ROM .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gearsystem_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bluemsx_libretro.so %ROM% sg-1000 sg-1000 diff --git a/resources/systems/windows/es_systems.xml b/resources/systems/windows/es_systems.xml index e252aafc6..99177075e 100644 --- a/resources/systems/windows/es_systems.xml +++ b/resources/systems/windows/es_systems.xml @@ -396,8 +396,11 @@ gamegear Sega Game Gear %ROMPATH%\gamegear - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .col .COL .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .rom .ROM .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\gearsystem_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\smsplus_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_wide_libretro.dll %ROM% gamegear gamegear @@ -565,8 +568,10 @@ megacd Sega Mega-CD %ROMPATH%\megacd - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_wide_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\picodrive_libretro.dll %ROM% segacd megacd @@ -574,8 +579,10 @@ megacdjp Sega Mega-CD %ROMPATH%\megacdjp - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_wide_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\picodrive_libretro.dll %ROM% segacd megacdjp @@ -1035,8 +1042,10 @@ segacd Sega CD %ROMPATH%\segacd - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_wide_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\picodrive_libretro.dll %ROM% segacd segacd @@ -1044,8 +1053,11 @@ sg-1000 Sega SG-1000 %ROMPATH%\sg-1000 - .mdx .MDX .md .MD .smd .SMD .gen .GEN .bin .BIN .cue .CUE .iso .ISO .sms .SMS .gg .GG .sg .SG .68k .68K .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .ri .RI .rom .ROM .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\gearsystem_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_wide_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bluemsx_libretro.dll %ROM% sg-1000 sg-1000 From 1abcdcfc5dbac5060d64b8c5ed2ab3952e869066 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 26 Sep 2021 15:02:57 +0200 Subject: [PATCH 16/42] Added alternative emulators to the satellaview and sufami systems. --- resources/systems/macos/es_systems.xml | 15 +++++++++++---- resources/systems/unix/es_systems.xml | 15 +++++++++++---- resources/systems/windows/es_systems.xml | 15 +++++++++++---- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/resources/systems/macos/es_systems.xml b/resources/systems/macos/es_systems.xml index 68ed65242..f85f77f7f 100644 --- a/resources/systems/macos/es_systems.xml +++ b/resources/systems/macos/es_systems.xml @@ -971,8 +971,12 @@ satellaview Nintendo Satellaview %ROMPATH%/satellaview - .smc .SMC .sfc .SFC .swc .SWC .fig .FIG .bs .BS .bin .BIN .mgd .MGD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.dylib %ROM% + .bml .BML .bs .BS .fig .FIG .sfc .SFC .smc .SMC .swc .SWC .st .ST .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x2010_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mesen-s_libretro.dylib %ROM% satellaview satellaview @@ -1121,8 +1125,11 @@ sufami Bandai SuFami Turbo %ROMPATH%/sufami - .smc .SMC .sfc .SFC .swc .SWC .fig .FIG .bs .BS .bin .BIN .mgd .MGD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.dylib %ROM% + .bml .BML .bs .BS .fig .FIG .sfc .SFC .smc .SMC .st .ST .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x2010_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.dylib %ROM% sufami sufami diff --git a/resources/systems/unix/es_systems.xml b/resources/systems/unix/es_systems.xml index b1d0abe87..22c1d38a9 100644 --- a/resources/systems/unix/es_systems.xml +++ b/resources/systems/unix/es_systems.xml @@ -973,8 +973,12 @@ satellaview Nintendo Satellaview %ROMPATH%/satellaview - .smc .SMC .sfc .SFC .swc .SWC .fig .FIG .bs .BS .bin .BIN .mgd .MGD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.so %ROM% + .bml .BML .bs .BS .fig .FIG .sfc .SFC .smc .SMC .swc .SWC .st .ST .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x2010_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mesen-s_libretro.so %ROM% satellaview satellaview @@ -1129,8 +1133,11 @@ sufami Bandai SuFami Turbo %ROMPATH%/sufami - .smc .SMC .sfc .SFC .swc .SWC .fig .FIG .bs .BS .bin .BIN .mgd .MGD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.so %ROM% + .bml .BML .bs .BS .fig .FIG .sfc .SFC .smc .SMC .st .ST .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x2010_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.so %ROM% sufami sufami diff --git a/resources/systems/windows/es_systems.xml b/resources/systems/windows/es_systems.xml index 99177075e..ee281a624 100644 --- a/resources/systems/windows/es_systems.xml +++ b/resources/systems/windows/es_systems.xml @@ -973,8 +973,12 @@ satellaview Nintendo Satellaview %ROMPATH%\satellaview - .smc .SMC .sfc .SFC .swc .SWC .fig .FIG .bs .BS .bin .BIN .mgd .MGD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\snes9x_libretro.dll %ROM% + .bml .BML .bs .BS .fig .FIG .sfc .SFC .smc .SMC .swc .SWC .st .ST .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\snes9x_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\snes9x2010_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bsnes_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bsnes_mercury_accuracy_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mesen-s_libretro.dll %ROM% satellaview satellaview @@ -1129,8 +1133,11 @@ sufami Bandai SuFami Turbo %ROMPATH%\sufami - .smc .SMC .sfc .SFC .swc .SWC .fig .FIG .bs .BS .bin .BIN .mgd .MGD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\snes9x_libretro.dll %ROM% + .bml .BML .bs .BS .fig .FIG .sfc .SFC .smc .SMC .st .ST .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\snes9x_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\snes9x2010_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bsnes_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bsnes_mercury_accuracy_libretro.dll %ROM% sufami sufami From c010030db667f66d8866b47e0022e41e61ae70fb Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 26 Sep 2021 16:00:52 +0200 Subject: [PATCH 17/42] Shortened the full name for the videopac system. --- resources/systems/macos/es_systems.xml | 2 +- resources/systems/unix/es_systems.xml | 2 +- resources/systems/windows/es_systems.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/systems/macos/es_systems.xml b/resources/systems/macos/es_systems.xml index f85f77f7f..ffe09a5d2 100644 --- a/resources/systems/macos/es_systems.xml +++ b/resources/systems/macos/es_systems.xml @@ -1236,7 +1236,7 @@ videopac - Philips Videopac G7000 (Magnavox Odyssey2) + Philips Videopac G7000 %ROMPATH%/videopac .bin .BIN .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/o2em_libretro.dylib %ROM% diff --git a/resources/systems/unix/es_systems.xml b/resources/systems/unix/es_systems.xml index 22c1d38a9..fa1976071 100644 --- a/resources/systems/unix/es_systems.xml +++ b/resources/systems/unix/es_systems.xml @@ -1245,7 +1245,7 @@ videopac - Philips Videopac G7000 (Magnavox Odyssey2) + Philips Videopac G7000 %ROMPATH%/videopac .bin .BIN .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/o2em_libretro.so %ROM% diff --git a/resources/systems/windows/es_systems.xml b/resources/systems/windows/es_systems.xml index ee281a624..9dbbea775 100644 --- a/resources/systems/windows/es_systems.xml +++ b/resources/systems/windows/es_systems.xml @@ -1245,7 +1245,7 @@ videopac - Philips Videopac G7000 (Magnavox Odyssey2) + Philips Videopac G7000 %ROMPATH%\videopac .bin .BIN .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\o2em_libretro.dll %ROM% From 1917bfba745c75bc6f03f1938f0b6cfc98afc780 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 26 Sep 2021 16:06:08 +0200 Subject: [PATCH 18/42] Some cosmetic changes to the alternative emulators GUI. --- es-app/src/guis/GuiAlternativeEmulators.cpp | 36 +++++++++++++-------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/es-app/src/guis/GuiAlternativeEmulators.cpp b/es-app/src/guis/GuiAlternativeEmulators.cpp index ccf26c313..50420a17b 100644 --- a/es-app/src/guis/GuiAlternativeEmulators.cpp +++ b/es-app/src/guis/GuiAlternativeEmulators.cpp @@ -118,14 +118,8 @@ GuiAlternativeEmulators::GuiAlternativeEmulators(Window* window) mMenu.addRow(row); } - float width = - static_cast(std::min(static_cast(Renderer::getScreenHeight() * 1.05f), - static_cast(Renderer::getScreenWidth() * 0.90f))); - setSize(mMenu.getSize()); setPosition((Renderer::getScreenWidth() - mSize.x) / 2.0f, Renderer::getScreenHeight() * 0.13f); - - mMenu.setSize(width, Renderer::getScreenHeight() * 0.76f); } void GuiAlternativeEmulators::updateMenu(const std::string& systemName, @@ -162,7 +156,7 @@ void GuiAlternativeEmulators::selectorWindow(SystemData* system) label = entry.second; std::shared_ptr labelText = std::make_shared( - mWindow, label, Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_CENTER); + mWindow, label, Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_LEFT); if (system->getSystemEnvData()->mLaunchCommands.front().second == label) labelText->setValue(labelText->getValue().append(" [DEFAULT]")); @@ -213,21 +207,37 @@ void GuiAlternativeEmulators::selectorWindow(SystemData* system) s->addRow(row, false); } - // Adjust the width depending on the aspect ratio of the screen, to make the screen look + // Set a maximum width depending on the aspect ratio of the screen, to make the screen look // somewhat coherent regardless of screen type. The 1.778 aspect ratio value is the 16:9 // reference. float aspectValue = 1.778f / Renderer::getScreenAspectRatio(); - - float maxWidthModifier = glm::clamp(0.70f * aspectValue, 0.50f, 0.92f); + float maxWidthModifier = glm::clamp(0.72f * aspectValue, 0.50f, 0.92f); float maxWidth = static_cast(Renderer::getScreenWidth()) * maxWidthModifier; - s->setMenuSize(glm::vec2{maxWidth, s->getMenuSize().y}); + // Set the width of the selector window to the menu width, unless the system full name is + // too large to fit. If so, allow the size to be exceeded up to the maximum size calculated + // above. + float systemTextWidth = + Font::get(FONT_SIZE_LARGE)->sizeText(Utils::String::toUpper(system->getFullName())).x * + 1.05f; + + float width = 0.0f; + float menuWidth = mMenu.getSize().x; + + if (systemTextWidth <= menuWidth) + width = menuWidth; + else if (systemTextWidth > maxWidth) + width = maxWidth; + else + width = systemTextWidth; + + s->setMenuSize(glm::vec2{width, s->getMenuSize().y}); auto menuSize = s->getMenuSize(); auto menuPos = s->getMenuPosition(); - s->setMenuPosition(glm::vec3{(s->getSize().x - menuSize.x) / 2.0f, - (s->getSize().y - menuSize.y) / 3.0f, menuPos.z}); + s->setMenuPosition(glm::vec3{(s->getSize().x - menuSize.x) / 2.0f, menuPos.y, menuPos.z}); + mWindow->pushGui(s); } From ba07a0b24c1435fbb3d215117aadedd42d880417 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 26 Sep 2021 18:23:01 +0200 Subject: [PATCH 19/42] Documentation update. --- CHANGELOG.md | 12 +++++- INSTALL-DEV.md | 54 +++++++++++++++++++++---- USERGUIDE-DEV.md | 101 +++++++++++++++++++++++++++-------------------- USERGUIDE.md | 13 ++++++ 4 files changed, 127 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5557eb114..6c0757c58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,14 @@ ### Detailed list of changes * Added alternative emulators support where additional emulators can be defined in es_systems.xml and be selected system-wide or per game via the user interface +* Populated the bundled es_systems.xml files with alternative emulator entries for must RetroArch cores * Added a virtual keyboard partly based on code from batocera-emulationstation * Added the ability to make complementary game system customizations without having to replace the entire bundled es_systems.xml file +* Added support for an optional \ tag for es_systems.xml that can be used to override the default \ systems sorting +* Improved the gamelist filter screen to not allow filtering of values where there is no actual data to filter, e.g. Favorites for a system with no favorite games +* Grayed out all fields in the gamelist filter screen where there is no data to filter, previously some fields were removed entirely and some could still be used +* Added the ability to filter on blank/unknown values for Genre, Player, Developer, Publisher and Alternative emulator. +* Added a filter for "Alternative emulator" and sorted the filters in the same order as the metadata editor fields * Added a menu option to change the application exit key combination * Expanded the themeable options for "helpsystem" to support custom button graphics, dimmed text and icon colors, upper/lower/camel case and custom spacing * Added support for using the left and right trigger buttons in the help prompts @@ -24,6 +30,8 @@ * Moved the game media directory setting to the top of the Other Settings menu, following the new Alternative Emulators entry * Added a blinking cursor to TextEditComponent * Changed the filter description "Text filter (game name)" to "Game name" +* Added support for multi-select total count and exclusive multi-select to OptionListComponent +* Achieved a massive speed improvement for OptionListComponent by not resizing each added MenuComponent row (most notable in the filter GUI) * Added support for a new type of "flat style" button to ButtonComponent * Added support for correctly navigating arbitrarily sized ComponentGrid entries, i.e. those spanning multiple cells * Bundled the bold font version of Fontfabric Akrobat @@ -32,6 +40,7 @@ * Replaced some additional math functions and moved the remaining built-in functions to a math utility namespace * Added a function to generate MD5 hashes * Moved the "complex" mode functionality from GuiComplexTextEditPopup into GuiTextEditPopup and removed the source files for the former +* Replaced the String::Utils::trim function with better code and removed some inline text trimming throughout the application * Increased the warning level for Clang/LLVM and GCC by adding -Wall, -Wpedantic and some additional flags * Fixed a lot of compiler warnings introduced by the -Wall and -Wpedantic flags * Changed the language standard from C++14 to C++17 @@ -44,6 +53,7 @@ * When multi-scraping in interactive mode, the game counter was not decreased when skipping games, making it impossible to skip the final games in the queue * When multi-scraping in interactive mode, "No games found" results could be accepted using the "A" button * When scraping in interactive mode, any refining done using the "Y" button shortcut would not be shown when doing another refine using the "Refine search" button +* Removing games from custom collections did not remove their filter index entries * Input consisting of only whitespace characters would get accepted by TextEditComponent which led to various strange behaviors * Leading and trailing whitespace characters would not get trimmed from the collection name when creating a new custom collection * Leading and trailing whitespace characters would get included in scraper search refines and TheGamesDB searches @@ -334,6 +344,4 @@ Many bugs have been fixed, and numerous features that were only partially implem * There is an issue with launching games on Windows when using AMD and Intel GPUs. This causes the emulator to just output a blank screen. There is a workaround available for this which is enabled by default and that can be disabled via the menu option "AMD and Intel GPU game launch workaround". The drawback of this workaround is that a white instead of a black screen will be displayed when launching games. If using an Nvidia GPU, it should be safe to disable this option for a slightly better user experience. An alternative workaround is to enable the option "Run in background (while game is launched)". -* On macOS Big Sur (and possibly other OS versions) when connecting a DualShock 4 controller either via Bluetooth or using a USB cable, two separate controller devices are registered in parallel. This is a bug in either macOS or the DualShock driver and it makes it seem as if ES-DE is registering double button presses when actually two separate controller devices are generating identical input. A workaround if using Bluetooth mode is to plug in the USB cable just after connecting the controller, wait a second or two and then remove the cable again. This will remove the cabled device, leaving only the Bluetooth device active. Another workaround is to enable the setting "Only accept input from first controller" in the ES-DE input device settings. The reason why this bug may not be visible in some other games and applications is that ES-DE enables and auto-configures all connected controllers. - * On Windows when using high DPI displays, if not running ES-DE on the primary monitor and the display where it runs does not have the same scaling percentage as the primary monitor, then the ES-DE resolution will not be properly set. The application will still work and if running in fullscreen mode it may not even be noticeable. This issue is caused by a bug in SDL where the primary display scaling is always used for calculating the display bounds and as such it needs to be fixed in that library. If using the same scaling percentage across all monitors, or if not using high DPI monitors at all, then this issue will not occur. diff --git a/INSTALL-DEV.md b/INSTALL-DEV.md index e7db548c6..f3af62b19 100644 --- a/INSTALL-DEV.md +++ b/INSTALL-DEV.md @@ -1409,7 +1409,7 @@ This custom file functionality is designed to be complementary to the bundled es The bundled es_systems.xml file is located in the resources directory that is part of the application installation. For example this could be `/usr/share/emulationstation/resources/systems/unix/es_systems.xml` on Unix, `/Applications/EmulationStation Desktop Edition.app/Contents/Resources/resources/systems/macos/es_systems.xml` on macOS or `C:\Program Files\EmulationStation-DE\resources\systems\windows\es_systems.xml` on Windows. The actual location may differ from these examples of course, depending on where ES-DE has been installed. -It doesn't matter in which order you define the systems as they will be sorted by the full system name inside the application, but it's still probably a good idea to add them in alphabetical order to make the file easier to maintain. +It doesn't matter in which order you define the systems as they will be sorted by the `` tag or by the optional `` tag when displayed inside the application. But it's still a good idea to add the systems in alphabetical order to make the configuration file easier to maintain. Keep in mind that you have to set up your emulators separately from ES-DE as the es_systems.xml file assumes that your emulator environment is properly configured. @@ -1430,6 +1430,12 @@ Below is an overview of the file layout with various examples. For the command t Nintendo SNES (Super Nintendo) + + Super Nintendo + @@ -1444,13 +1450,15 @@ Below is an overview of the file layout with various examples. For the command t file. This is the recommended way to configure the launch command. --> %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.so %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/nestopia_libretro.so %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fceumm_libretro.so %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mesen_libretro.so %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/quicknes_libretro.so %ROM% + + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x2010_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_supafaust_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mesen-s_libretro.so %ROM% + + + nes + Nintendo Entertainment System + %ROMPATH%/nes + .nes .NES .zip .ZIP + /usr/games/fceux %ROM% + nes + nes + + + snes + Super Nintendo + Nintendo SNES (Super Nintendo) + %ROMPATH%/snes + .smc .SMC .sfc .SFC .swc .SWC .bin .BIN .mgd .MGD .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x2010_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.so %ROM% + snes + snes + + +``` + ## es_find_rules.xml This file makes it possible to define rules for where to search for the emulator binaries and emulator cores. diff --git a/USERGUIDE-DEV.md b/USERGUIDE-DEV.md index 4d75dc06b..25ffbd132 100644 --- a/USERGUIDE-DEV.md +++ b/USERGUIDE-DEV.md @@ -128,6 +128,18 @@ There will be a lot of directories created if using the es_systems.xml file bund _This is the dialog shown if no game files were found. It lets you configure the ROM directory if you don't want to use the default one, and you can also generate the game systems directory structure. Note that the directory is the physical path, and that your operating system may present this as a localized path if you are using a language other than English._ +## Specific notes for macOS + +On macOS, the first time you launch a game from within ES-DE, the operating system will present you with a security option with the following description: + +`"EmulationStation Desktop Edition" would like to access files in your Documents folder.` + +If you don't allow this, you will not be able to place system BIOS ROMs in the RetroArch default system directory `~/Documents/RetroArch/system` even if you've already given RetroArch access to this folder. This is so because RetroArch runs as a subprocess to ES-DE and therefore inherits the security settings from the parent application. Attempting to launch a game without enabling the access will simply display an error message in the emulator that the BIOS files are missing. This of course only applies to emulators that require BIOS ROMs, all other games should work fine regardless of this security setting. + +If you accidentally refused ES-DE the folder access, you can fix this by opening _System Preferences_, selecting _Security & Privacy_ and within the GUI choose _Files and Folders_. The option you need to enable is _Documents Folder_ under _EmulationStation Desktop Edition_. + +Another issue on macOS 11 Big Sur (and possibly other OS versions) is that when connecting a DualShock 4 controller either via Bluetooth or using a USB cable, two separate controller devices are registered in parallel. This is a bug in either macOS or the DualShock driver and it makes it seem as if ES-DE is registering double button presses when actually two separate controller devices are generating identical input. A workaround if using Bluetooth mode is to plug in the USB cable just after connecting the controller, wait a second or two and then remove the cable again. This will remove the cabled device, leaving only the Bluetooth device active. Another workaround is to enable the setting _Only accept input from first controller_ in the ES-DE input device settings. The reason why this bug may not be visible in some other games and applications is that ES-DE enables and auto-configures all connected controllers. + ## Game system customizations The game systems configuration file `es_systems.xml` is located in the ES-DE resources directory which is part of the application installation. As such this file is not intended to be modified directly. If system customizations are required, a separate es_systems.xml file should instead be placed in the `custom_systems` folder in the ES-DE home directory, i.e. `~/.emulationstation/custom_systems/es_systems.xml`. @@ -136,7 +148,7 @@ Although it's possible to make a copy of the bundled configuration file, to modi For example you may want to replace the emulator launch command, modify the full name or change the supported file extensions for a single system. In this case it wouldn't make sense to copy the complete bundled file and just apply these minor modifications, instead an es_systems.xml file only containing the configuration for that single system should be placed in the custom_systems directory. -The instructions for how to customize the es_systems.xml file can be found in [INSTALL-DEV.md](INSTALL-DEV.md#es_systemsxml). There you can also find an example of a custom file that you can copy into ~/.emulationstation/custom_systems/ and modify as required. +The instructions for how to customize the es_systems.xml file can be found in [INSTALL-DEV.md](INSTALL-DEV.md#es_systemsxml). There you can also find some examples of custom files that you can copy into ~/.emulationstation/custom_systems/ and modify as required. ## Migrating from other EmulationStation forks @@ -179,9 +191,9 @@ If you experience double button presses with your DualShock 4 controller on macO When starting ES-DE with the default settings, you will see the System view first. From here you can navigate your game systems and enter their respective gamelists. -Depending on the theme, the system navigation carousel can be either horizontal or vertical. The default theme rbsimple-DE provides horizontal navigation, i.e. you browse your systems by scrolling left or right. +Depending on the theme, the system navigation carousel can be horizontal, vertical or displayed as a wheel. The default theme rbsimple-DE provides horizontal navigation, i.e. you browse your systems by scrolling left or right. -The game systems are sorted by their full names, as defined in the es_systems.xml file. +The game systems are sorted by their full names by default, as defined in the es_systems.xml file. It's however possible to set a custom sortname per system, as explained in the [INSTALL-DEV.md](INSTALL-DEV.md#es_systemsxml) document. ![alt text](images/es-de_system_view.png "ES-DE System View") _The **System view** is the default starting point for the application, it's here that you browse through your game systems._ @@ -1332,25 +1344,29 @@ The following filters can be applied: **Game name** -**Favorites** +**Rating** + +**Developer** + +**Publisher** **Genre** **Players** -**Publisher / Developer** - -**Rating** - -**Kidgame** +**Favorite** **Completed** +**Kidgame** + +**Hidden** _If the "Show hidden games" option is enabled_ + **Broken** -**Hidden** +**Alternative emulator** -With the exception of the game name text filter, all available filter values are assembled from metadata from the actual gamelist, so if there for instance are no games marked as completed, the Completed filter will only have the selectable option False, i.e. True will be missing. +With the exception of the game name text filter, all available filter values are assembled from metadata from the actual gamelist, so if there is no data to filter for the specific field, the text _Nothing to filter_ will be displayed. This for example happens for the _Completed_ filter if there are no games marked as having been completed in the current gamelist. Be aware that although folders can have most of the metadata values set, the filters are only applied to files (this is also true for the game name text filter). So if you for example set a filter to only display your favorite games, any folder that contains a favorite game will be displayed, and other folders which are themselves marked as favorites but that do not contain any favorite games will be hidden. @@ -1672,13 +1688,13 @@ All emulators are RetroArch cores unless marked as **(Standalone**) | System name | Full name | Default emulator | Alternative emulators | Needs BIOS | Recommended game setup | | :-------------------- | :--------------------------------------------- | :-------------------------------- | :-------------------------------- | :----------- | :----------------------------------- | | 3do | 3DO | 4DO | | | | -| 64dd | Nintendo 64DD | Mupen64Plus-Next [UW],
ParaLLEl N64 [M] | ParaLLEl N64 [UW] | | | +| 64dd | Nintendo 64DD | Mupen64Plus-Next [UW],
ParaLLEl N64 [M] | ParaLLEl N64 [UW] | | | | ags | Adventure Game Studio game engine | | | | | | amiga | Commodore Amiga | PUAE | | Yes | WHDLoad hard disk image in .hdf or .hdz format in root folder, or diskette image in .adf format in root folder if single-disc, or in separate folder with .m3u playlist if multi-disc | | amiga600 | Commodore Amiga 600 | PUAE | | Yes | WHDLoad hard disk image in .hdf or .hdz format in root folder, or diskette image in .adf format in root folder if single-disc, or in separate folder with .m3u playlist if multi-disc | | amiga1200 | Commodore Amiga 1200 | PUAE | | Yes | WHDLoad hard disk image in .hdf or .hdz format in root folder, or diskette image in .adf format in root folder if single-disc, or in separate folder with .m3u playlist if multi-disc | | amigacd32 | Commodore Amiga CD32 | PUAE | | | | -| amstradcpc | Amstrad CPC | Caprice32 | | | | +| amstradcpc | Amstrad CPC | Caprice32 | CrocoDS | | | | apple2 | Apple II | | | | | | apple2gs | Apple IIGS | | | | | | arcade | Arcade | MAME - Current | MAME 2000,
MAME 2003-Plus,
MAME 2010,
FinalBurn Neo,
FB Alpha 2012 | Depends | Single archive file following MAME name standard in root folder | @@ -1689,12 +1705,12 @@ All emulators are RetroArch cores unless marked as **(Standalone**) | atari800 | Atari 800 | Atari800 | | | | | atarijaguar | Atari Jaguar | Virtual Jaguar | | | | | atarijaguarcd | Atari Jaguar CD | Virtual Jaguar | | | | -| atarilynx | Atari Lynx | Beetle Lynx | | | | +| atarilynx | Atari Lynx | Handy | Beetle Lynx | | | | atarist | Atari ST [also STE and Falcon] | Hatari | | | | | atarixe | Atari XE | Atari800 | | | | | atomiswave | Atomiswave | Flycast | | | | | bbcmicro | BBC Micro | | | | | -| c64 | Commodore 64 | VICE x64sc Accurate | VICE x64 Fast,
VICE x64 SuperCPU,
VICE x128,
Frodo | No | Single disk, tape r cartridge image in root folder and/or multi-disc images in separate folder | +| c64 | Commodore 64 | VICE x64sc Accurate | VICE x64 Fast,
VICE x64 SuperCPU,
VICE x128,
Frodo | No | Single disk, tape or cartridge image in root folder and/or multi-disc images in separate folder | | cavestory | Cave Story (NXEngine) | NXEngine | | | | | cdtv | Commodore CDTV | | | | | | chailove | ChaiLove game engine | ChaiLove | | | | @@ -1712,51 +1728,51 @@ All emulators are RetroArch cores unless marked as **(Standalone**) | fbneo | FinalBurn Neo | FinalBurn Neo | | Yes | Single archive file following MAME name standard in root folder | | fds | Nintendo Famicom Disk System | Nestopia UE | | Yes | Single archive or ROM file in root folder | | gameandwatch | Nintendo Game and Watch | GW | | | | -| gamegear | Sega Game Gear | Genesis Plus GX | | | | -| gb | Nintendo Game Boy | bsnes | | | | -| gba | Nintendo Game Boy Advance | Beetle GBA | | | | -| gbc | Nintendo Game Boy Color | bsnes | | | | +| gamegear | Sega Game Gear | Gearsystem | SMS Plus GX,
Genesis Plus GX,
Genesis Plus GX Wide | | | +| gb | Nintendo Game Boy | SameBoy | Gambatte,
Gearboy,
TGB Dual,
Mesen-S,
bsnes | | | +| gba | Nintendo Game Boy Advance | mGBA | VBA-M,
VBA Next,
gpSP | | | +| gbc | Nintendo Game Boy Color | SameBoy | Gambatte,
Gearboy,
TGB Dual,
Mesen-S,
bsnes | | | | gc | Nintendo GameCube | Dolphin | | | | | genesis | Sega Genesis | Genesis Plus GX | Genesis Plus GX Wide,
PicoDrive,
BlastEm | No | Single archive or ROM file in root folder | | gx4000 | Amstrad GX4000 | | | | | | intellivision | Mattel Electronics Intellivision | FreeIntv | | | | | kodi | Kodi home theatre software | N/A | | No | | -| lutris | Lutris open gaming platform | Lutris application **(Standalone)** [U] | | No | Shell script in root folder | +| lutris | Lutris open gaming platform | Lutris application **(Standalone)** [U] | | No | Shell script in root folder | | lutro | Lutro game engine | Lutro | | | | | macintosh | Apple Macintosh | | | | | | mame | Multiple Arcade Machine Emulator | MAME 2003-Plus | MAME 2000,
MAME 2010,
MAME - Current,
FinalBurn Neo,
FB Alpha 2012 | Depends | Single archive file following MAME name standard in root folder | | mame-advmame | AdvanceMAME | | | Depends | Single archive file following MAME name standard in root folder | | mame-mame4all | MAME4ALL | | | Depends | Single archive file following MAME name standard in root folder | | mastersystem | Sega Master System | Genesis Plus GX | Genesis Plus GX Wide,
SMS Plus GX,
Gearsystem,
PicoDrive | No | Single archive or ROM file in root folder | -| megacd | Sega Mega-CD | Genesis Plus GX | | | | -| megacdjp | Sega Mega-CD [Japan] | Genesis Plus GX | | | | +| megacd | Sega Mega-CD | Genesis Plus GX | Genesis Plus GX Wide,
PicoDrive | | | +| megacdjp | Sega Mega-CD [Japan] | Genesis Plus GX | Genesis Plus GX Wide,
PicoDrive | | | | megadrive | Sega Mega Drive | Genesis Plus GX | Genesis Plus GX Wide,
PicoDrive,
BlastEm | No | Single archive or ROM file in root folder | | mess | Multi Emulator Super System | MESS 2015 | | | | | moonlight | Moonlight game streaming | | | | | | moto | Thomson MO/TO series | Theodore | | | | -| msx | MSX | blueMSX | | | | -| msx1 | MSX1 | blueMSX | | | | -| msx2 | MSX2 | blueMSX | | | | +| msx | MSX | blueMSX | fMSX | | | +| msx1 | MSX1 | blueMSX | fMSX | | | +| msx2 | MSX2 | blueMSX | fMSX | | | | msxturbor | MSX Turbo R | blueMSX | | | | | multivision | Othello Multivision | Gearsystem | | | | | naomi | Sega NAOMI | Flycast | | | | | naomigd | Sega NAOMI GD-ROM | Flycast | | | | -| n3ds | Nintendo 3DS | Citra | | | | -| n64 | Nintendo 64 | Mupen64Plus-Next [UW],
ParaLLEl N64 [M] | ParaLLEl N64 [UW] | No | Single archive or ROM file in root folder | -| nds | Nintendo DS | melonDS | | | | +| n3ds | Nintendo 3DS | Citra [UW] | Citra 2018 [UW] | | | +| n64 | Nintendo 64 | Mupen64Plus-Next [UW],
ParaLLEl N64 [M] | ParaLLEl N64 [UW] | No | Single archive or ROM file in root folder | +| nds | Nintendo DS | DeSmuME | DeSmuME 2015,
melonDS | | | | neogeo | SNK Neo Geo | FinalBurn Neo | | Yes | Single archive file following MAME name standard in root folder | | neogeocd | SNK Neo Geo CD | NeoCD | | Yes | Single archive in root folder (which includes the CD image and ripped audio) | | neogeocdjp | SNK Neo Geo CD [Japan] | NeoCD | | Yes | Single archive in root folder (which includes the CD image and ripped audio) | -| nes | Nintendo Entertainment System | Nestopia UE | FCEUmm,
Mesen,
QuickNES | No | Single archive or ROM file in root folder | -| ngp | SNK Neo Geo Pocket | Beetle NeoPop | | | | -| ngpc | SNK Neo Geo Pocket Color | Beetle NeoPop | | | | +| nes | Nintendo Entertainment System | Nestopia UE | FCEUmm,
Mesen,
QuickNES | No | Single archive or ROM file in root folder | +| ngp | SNK Neo Geo Pocket | Beetle NeoPop | RACE | | | +| ngpc | SNK Neo Geo Pocket Color | Beetle NeoPop | RACE | | | | odyssey2 | Magnavox Odyssey2 | O2EM | | | | | openbor | OpenBOR game engine | | | | | | oric | Tangerine Computer Systems Oric | | | | | | palm | Palm OS | Mu | | | | -| pc | IBM PC | DOSBox-Core | DOSBox-Pure,
DOSBox-SVN | No | In separate folder (one folder per game, with complete file structure retained) | +| pc | IBM PC | DOSBox-Core | DOSBox-Pure,
DOSBox-SVN | No | In separate folder (one folder per game, with complete file structure retained) | | pc88 | NEC PC-8800 series | QUASI88 | | | | -| pc98 | NEC PC-9800 series | Neko Project II Kai | | | | +| pc98 | NEC PC-9800 series | Neko Project II Kai | Neko Project II | | | | pcengine | NEC PC Engine | Beetle PCE | Beetle PCE FAST | No | Single archive or ROM file in root folder | | pcenginecd | NEC PC Engine CD | Beetle PCE | Beetle PCE FAST | Yes | | | pcfx | NEC PC-FX | Beetle PC-FX | | | | @@ -1770,22 +1786,22 @@ All emulators are RetroArch cores unless marked as **(Standalone**) | psx | Sony PlayStation | Beetle PSX | Beetle PSX HW,
PCSX ReARMed,
DuckStation | Yes | .chd file in root folder for single-disc games, .m3u playlist in root folder for multi-disc games | | residualvm | ResidualVM game engine | | | | | | samcoupe | SAM Coupé | SimCoupe | | | | -| satellaview | Nintendo Satellaview | Snes9x - Current | | | | -| saturn | Sega Saturn | Beetle Saturn | | | | -| saturnjp | Sega Saturn [Japan] | Beetle Saturn | | | | +| satellaview | Nintendo Satellaview | Snes9x - Current | Snes9x 2010,
bsnes,
bsnes-mercury Accuracy,
Mesen-S | | | +| saturn | Sega Saturn | Beetle Saturn | Kronos [UW],
YabaSanshiro [UW],
Yabause | | | +| saturnjp | Sega Saturn [Japan] | Beetle Saturn | Kronos [UW],
YabaSanshiro [UW],
Yabause | | | | scummvm | ScummVM game engine | ScummVM | | No | In separate folder (one folder per game, with complete file structure retained) | | sega32x | Sega Mega Drive 32X | PicoDrive | | No | Single archive or ROM file in root folder | | sega32xjp | Sega Super 32X [Japan] | PicoDrive | | No | Single archive or ROM file in root folder | | sega32xna | Sega Genesis 32X [North America] | PicoDrive | | No | Single archive or ROM file in root folder | -| segacd | Sega CD | Genesis Plus GX | | | | -| sg-1000 | Sega SG-1000 | Genesis Plus GX | | | | +| segacd | Sega CD | Genesis Plus GX | Genesis Plus GX Wide,
PicoDrive | | | +| sg-1000 | Sega SG-1000 | Gearsystem | Genesis Plus GX,
Genesis Plus GX Wide,
blueMSX | | | | snes | Nintendo SNES (Super Nintendo) | Snes9x - Current | Snes9x 2010,
bsnes,
bsnes-mercury Accuracy,
Beetle Supafaust [UW],
Mesen-S | No | Single archive or ROM file in root folder | | snesna | Nintendo SNES (Super Nintendo) [North America] | Snes9x - Current | Snes9x 2010,
bsnes,
bsnes-mercury Accuracy,
Beetle Supafaust [UW],
Mesen-S | No | Single archive or ROM file in root folder | | solarus | Solarus game engine | | | | | | spectravideo | Spectravideo | blueMSX | | | | -| steam | Valve Steam | Steam application **(Standalone)** | | No | Shell script/batch file in root folder | +| steam | Valve Steam | Steam application **(Standalone)** | | No | Shell script/batch file in root folder | | stratagus | Stratagus game engine | | | | | -| sufami | Bandai SuFami Turbo | Snes9x - Current | | | | +| sufami | Bandai SuFami Turbo | Snes9x - Current | Snes9x 2010,
bsnes,
bsnes-mercury Accuracy | | | | supergrafx | NEC SuperGrafx | Beetle SuperGrafx | Beetle PCE | | | | switch | Nintendo Switch | Yuzu **(Standalone)** [UW] | | Yes | | | tanodragon | Tano Dragon | | | | | @@ -1797,7 +1813,7 @@ All emulators are RetroArch cores unless marked as **(Standalone**) | trs-80 | Tandy TRS-80 | | | | | | uzebox | Uzebox | Uzem | | | | | vectrex | Vectrex | vecx | | | | -| videopac | Philips Videopac G7000 (Magnavox Odyssey2) | O2EM | | | | +| videopac | Philips Videopac G7000 | O2EM | | | | | virtualboy | Nintendo Virtual Boy | Beetle VB | | | | | wii | Nintendo Wii | Dolphin | | | | | wiiu | Nintendo Wii U | | | | | @@ -1809,5 +1825,4 @@ All emulators are RetroArch cores unless marked as **(Standalone**) | xbox360 | Microsoft Xbox 360 | | | | | | zmachine | Infocom Z-machine | | | | | | zx81 | Sinclair ZX81 | EightyOne | | | | -| zxspectrum | Sinclair ZX Spectrum | Fuse | | | | | Amstrad GX4000 | | | | | - +| zxspectrum | Sinclair ZX Spectrum | Fuse | | | | diff --git a/USERGUIDE.md b/USERGUIDE.md index 81eada3a2..144d5ba26 100644 --- a/USERGUIDE.md +++ b/USERGUIDE.md @@ -124,6 +124,19 @@ There will be a lot of directories created if using the es_systems.xml file bund _This is the dialog shown if no game files were found. It lets you configure the ROM directory if you don't want to use the default one, and you can also generate the game systems directory structure. Note that the directory is the physical path, and that your operating system may present this as a localized path if you are using a language other than English._ +## Specific notes for macOS + +On macOS, the first time you launch a game from within ES-DE, the operating system will present you with a security option with the following description: + +`"EmulationStation Desktop Edition" would like to access files in your Documents folder.` + +If you don't allow this, you will not be able to place system BIOS ROMs in the RetroArch default system directory `~/Documents/RetroArch/system` even if you've already given RetroArch access to this folder. This is so because RetroArch runs as a subprocess to ES-DE and therefore inherits the security settings from the parent application. Attempting to launch a game without enabling the access will simply display an error message in the emulator that the BIOS files are missing. This of course only applies to emulators that require BIOS ROMs, all other games should work fine regardless of this security setting. + +If you accidentally refused ES-DE the folder access, you can fix this by opening _System Preferences_, selecting _Security & Privacy_ and within the GUI choose _Files and Folders_. The option you need to enable is _Documents Folder_ under _EmulationStation Desktop Edition_. + +Another issue on macOS 11 Big Sur (and possibly other OS versions) is that when connecting a DualShock 4 controller either via Bluetooth or using a USB cable, two separate controller devices are registered in parallel. This is a bug in either macOS or the DualShock driver and it makes it seem as if ES-DE is registering double button presses when actually two separate controller devices are generating identical input. A workaround if using Bluetooth mode is to plug in the USB cable just after connecting the controller, wait a second or two and then remove the cable again. This will remove the cabled device, leaving only the Bluetooth device active. Another workaround is to enable the setting _Only accept input from first controller_ in the ES-DE input device settings. The reason why this bug may not be visible in some other games and applications is that ES-DE enables and auto-configures all connected controllers. + + ## Customizing the systems configuration file The `es_systems.xml` file is located in the ES-DE resources directory which is part of the application installation. As such this file is not intended to be modified directly. If a customized file is needed, this should instead be placed in the `custom_systems` folder in the ES-DE home directory, i.e. `~/.emulationstation/custom_systems/es_systems.xml`. You can find information on the file structure and how to adapt the configuration in the [INSTALL.md](INSTALL.md#es_systemsxml) document. From a928142d5b6181d4e408af19815f6548f9bd8f32 Mon Sep 17 00:00:00 2001 From: Sophia Hadash Date: Mon, 27 Sep 2021 01:50:45 +0200 Subject: [PATCH 20/42] make slots configurable by theme (fix) --- es-core/src/components/BadgesComponent.cpp | 23 +++++++++++++++++----- es-core/src/components/BadgesComponent.h | 2 +- themes/rbsimple-DE/theme.xml | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/es-core/src/components/BadgesComponent.cpp b/es-core/src/components/BadgesComponent.cpp index bfa210770..5fb20c41c 100644 --- a/es-core/src/components/BadgesComponent.cpp +++ b/es-core/src/components/BadgesComponent.cpp @@ -14,8 +14,8 @@ #include "resources/TextureResource.h" // Available slot definitions. -const std::vector BadgesComponent::mSlots = {SLOT_FAVORITE, SLOT_COMPLETED, SLOT_KIDS, SLOT_BROKEN, - SLOT_ALTERNATIVE_EMULATOR}; +std::vector BadgesComponent::mSlots = {SLOT_FAVORITE, SLOT_COMPLETED, SLOT_KIDS, SLOT_BROKEN, + SLOT_ALTERNATIVE_EMULATOR}; BadgesComponent::BadgesComponent(Window *window) : FlexboxComponent(window) { @@ -63,7 +63,7 @@ void BadgesComponent::setValue(const std::string &value) { if (!(temp == SLOT_FAVORITE || temp == SLOT_COMPLETED || temp == SLOT_KIDS || temp == SLOT_BROKEN || temp == SLOT_ALTERNATIVE_EMULATOR)) LOG(LogError) << "Badge slot '" << temp << "' is invalid."; - else + else if (std::find(mSlots.begin(), mSlots.end(), temp) != mSlots.end()) mChildren.push_back(&mImageComponents.find(temp)->second); } } @@ -101,8 +101,21 @@ void BadgesComponent::applyTheme(const std::shared_ptr& theme, } } - if (elem->has("slots")) - setValue(elem->get("slots")); + if (elem->has("slots")) { + auto value = elem->get("slots"); + mSlots = {}; + if (!value.empty()) { + std::string temp; + std::istringstream ss(value); + while (std::getline(ss, temp, ' ')) { + if (!(temp == SLOT_FAVORITE || temp == SLOT_COMPLETED || temp == SLOT_KIDS || + temp == SLOT_BROKEN || temp == SLOT_ALTERNATIVE_EMULATOR)) + LOG(LogError) << "Badge slot '" << temp << "' is invalid."; + else + mSlots.push_back(temp); + } + } + } // Apply theme on the flexbox component parent. FlexboxComponent::applyTheme(theme, view, element, properties); diff --git a/es-core/src/components/BadgesComponent.h b/es-core/src/components/BadgesComponent.h index 2dbc9dc1d..ce158012b 100644 --- a/es-core/src/components/BadgesComponent.h +++ b/es-core/src/components/BadgesComponent.h @@ -42,7 +42,7 @@ public: virtual std::vector getHelpPrompts() override; private: - static const std::vector mSlots; + static std::vector mSlots; std::map mBadgeIcons; std::map mImageComponents; }; diff --git a/themes/rbsimple-DE/theme.xml b/themes/rbsimple-DE/theme.xml index 43bb3da1b..381379f96 100644 --- a/themes/rbsimple-DE/theme.xml +++ b/themes/rbsimple-DE/theme.xml @@ -248,7 +248,7 @@ based on: 'recalbox-multi' by the Recalbox community .035 - favorite completed kidgame broken + favorite completed kidgame broken altemu :/graphics/badge_favorite.svg :/graphics/badge_completed.svg :/graphics/badge_kidgame.svg From 081fbc566582c368d10565b291cd8e010faa9510 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 27 Sep 2021 20:59:33 +0200 Subject: [PATCH 21/42] Made an optimization for SVG graphics to avoid a lot of unnecessary re-rasterizations. --- es-core/src/resources/TextureData.cpp | 4 ++-- es-core/src/resources/TextureData.h | 3 +++ es-core/src/resources/TextureResource.cpp | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/es-core/src/resources/TextureData.cpp b/es-core/src/resources/TextureData.cpp index 5760111e0..924abd87f 100644 --- a/es-core/src/resources/TextureData.cpp +++ b/es-core/src/resources/TextureData.cpp @@ -72,8 +72,8 @@ bool TextureData::initSVGFromMemory(const std::string& fileData) mSourceHeight = svgImage->height; } - mWidth = static_cast(std::round(mSourceWidth * mScaleDuringLoad)); - mHeight = static_cast(std::round(mSourceHeight * mScaleDuringLoad)); + mWidth = static_cast(floorf(floorf(mSourceWidth) * mScaleDuringLoad)); + mHeight = static_cast(floorf(floorf(mSourceHeight) * mScaleDuringLoad)); if (mWidth == 0) { // Auto scale width to keep aspect ratio. diff --git a/es-core/src/resources/TextureData.h b/es-core/src/resources/TextureData.h index ebb27b3e8..c50cd19d3 100644 --- a/es-core/src/resources/TextureData.h +++ b/es-core/src/resources/TextureData.h @@ -9,6 +9,8 @@ #ifndef ES_CORE_RESOURCES_TEXTURE_DATA_H #define ES_CORE_RESOURCES_TEXTURE_DATA_H +#include "utils/MathUtil.h" + #include #include #include @@ -53,6 +55,7 @@ public: float sourceWidth(); float sourceHeight(); void setSourceSize(float width, float height); + glm::vec2 getSize() { return glm::vec2{mWidth, mHeight}; } // Define a factor for scaling the file when loading it (1.0f = no scaling). void setScaleDuringLoad(float scale) { mScaleDuringLoad = scale; } diff --git a/es-core/src/resources/TextureResource.cpp b/es-core/src/resources/TextureResource.cpp index 33fec7e8a..74e5d5bfe 100644 --- a/es-core/src/resources/TextureResource.cpp +++ b/es-core/src/resources/TextureResource.cpp @@ -194,9 +194,14 @@ std::shared_ptr TextureResource::get(const std::string& path, return tex; } -// For scalable source images in textures we want to set the resolution to rasterize at. void TextureResource::rasterizeAt(size_t width, size_t height) { + if (mTextureData != nullptr) { + glm::vec2 textureSize = mTextureData.get()->getSize(); + if (textureSize.x == width && textureSize.y == height) + return; + } + std::shared_ptr data; if (mTextureData != nullptr) data = mTextureData; From 87d6207c51eb673466e0fbd46d9b572adcd95bb5 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 27 Sep 2021 21:03:53 +0200 Subject: [PATCH 22/42] Removed lots of unnecessary help component texture resizing. --- es-core/src/components/HelpComponent.cpp | 2 +- es-core/src/components/ImageComponent.cpp | 5 +++-- es-core/src/components/ImageComponent.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/es-core/src/components/HelpComponent.cpp b/es-core/src/components/HelpComponent.cpp index 69c1ae32c..7b6c7197f 100644 --- a/es-core/src/components/HelpComponent.cpp +++ b/es-core/src/components/HelpComponent.cpp @@ -218,7 +218,7 @@ void HelpComponent::updateGrid() for (auto it = mPrompts.cbegin(); it != mPrompts.cend(); it++) { auto icon = std::make_shared(mWindow); - icon->setImage(getIconTexture(it->first.c_str())); + icon->setImage(getIconTexture(it->first.c_str()), false); icon->setColorShift(isDimmed ? mStyle.iconColorDimmed : mStyle.iconColor); icon->setResize(0, height); icons.push_back(icon); diff --git a/es-core/src/components/ImageComponent.cpp b/es-core/src/components/ImageComponent.cpp index 600af7c22..f6c2d2af2 100644 --- a/es-core/src/components/ImageComponent.cpp +++ b/es-core/src/components/ImageComponent.cpp @@ -170,10 +170,11 @@ void ImageComponent::setImage(const char* data, size_t length, bool tile) resize(); } -void ImageComponent::setImage(const std::shared_ptr& texture) +void ImageComponent::setImage(const std::shared_ptr& texture, bool resizeTexture) { mTexture = texture; - resize(); + if (resizeTexture) + resize(); } void ImageComponent::setResize(float width, float height) diff --git a/es-core/src/components/ImageComponent.h b/es-core/src/components/ImageComponent.h index ca537c62f..159d65e3b 100644 --- a/es-core/src/components/ImageComponent.h +++ b/es-core/src/components/ImageComponent.h @@ -28,7 +28,7 @@ public: // Loads an image from memory. void setImage(const char* data, size_t length, bool tile = false); // Use an already existing texture. - void setImage(const std::shared_ptr& texture); + void setImage(const std::shared_ptr& texture, bool resizeTexture = true); void onSizeChanged() override { updateVertices(); } From f6dd49071e8b9a3fe2593f62bdba2b81c6f8c43b Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 27 Sep 2021 21:06:07 +0200 Subject: [PATCH 23/42] Fixed lots of code formatting issues. --- es-app/src/CollectionSystemsManager.cpp | 41 +-- es-app/src/FileData.cpp | 26 +- es-app/src/FileFilterIndex.cpp | 24 +- es-app/src/FileFilterIndex.h | 12 +- es-app/src/FileSorts.cpp | 3 +- es-app/src/FileSorts.h | 36 +-- .../src/guis/GuiCollectionSystemsOptions.cpp | 17 +- es-app/src/guis/GuiGameScraper.cpp | 11 +- es-app/src/guis/GuiGamelistFilter.cpp | 15 +- es-app/src/guis/GuiGamelistOptions.cpp | 12 +- es-app/src/guis/GuiLaunchScreen.cpp | 12 +- es-app/src/guis/GuiLaunchScreen.h | 10 +- es-app/src/guis/GuiMenu.cpp | 25 +- es-app/src/guis/GuiMetaDataEd.cpp | 47 +-- es-app/src/guis/GuiOfflineGenerator.cpp | 8 +- es-app/src/guis/GuiScraperMulti.cpp | 12 +- es-app/src/guis/GuiScraperSearch.cpp | 43 ++- es-app/src/guis/GuiScraperSearch.h | 15 +- es-app/src/guis/GuiSettings.cpp | 31 +- es-app/src/scrapers/GamesDBJSONScraper.cpp | 13 +- .../views/gamelist/DetailedGameListView.cpp | 52 +++- .../src/views/gamelist/GridGameListView.cpp | 31 +- es-app/src/views/gamelist/GridGameListView.h | 4 +- es-app/src/views/gamelist/VideoGameListView.h | 2 +- es-core/src/GuiComponent.cpp | 21 +- es-core/src/GuiComponent.h | 10 +- es-core/src/HttpReq.h | 2 +- es-core/src/components/BadgesComponent.cpp | 21 +- es-core/src/components/BadgesComponent.h | 10 +- es-core/src/components/ButtonComponent.cpp | 64 ++-- es-core/src/components/ButtonComponent.h | 21 +- es-core/src/components/ComponentGrid.cpp | 24 +- es-core/src/components/ComponentGrid.h | 41 +-- es-core/src/components/ComponentList.cpp | 7 +- .../src/components/DateTimeEditComponent.cpp | 15 +- es-core/src/components/FlexboxComponent.cpp | 27 +- es-core/src/components/HelpComponent.cpp | 34 +- es-core/src/components/ImageComponent.cpp | 32 +- es-core/src/components/ImageComponent.h | 14 +- es-core/src/guis/GuiInputConfig.cpp | 2 +- es-core/src/guis/GuiMsgBox.cpp | 24 +- es-core/src/guis/GuiTextEditKeyboardPopup.cpp | 292 ++++++++++-------- es-core/src/guis/GuiTextEditKeyboardPopup.h | 56 ++-- es-core/src/guis/GuiTextEditPopup.cpp | 116 ++++--- es-core/src/guis/GuiTextEditPopup.h | 31 +- es-core/src/resources/Font.cpp | 12 +- es-core/src/resources/TextureResource.cpp | 2 +- es-core/src/resources/TextureResource.h | 4 +- 48 files changed, 828 insertions(+), 556 deletions(-) diff --git a/es-app/src/CollectionSystemsManager.cpp b/es-app/src/CollectionSystemsManager.cpp index f4b7823d4..282b880a2 100644 --- a/es-app/src/CollectionSystemsManager.cpp +++ b/es-app/src/CollectionSystemsManager.cpp @@ -377,21 +377,21 @@ void CollectionSystemsManager::updateCollectionSystem(FileData* file, Collection // If the countasgame flag has been set to false, then remove the game. if (curSys->isGroupedCustomCollection()) { ViewController::get() - ->getGameListView(curSys->getRootFolder()->getParent()->getSystem()) - .get() - ->remove(collectionEntry, false); - FileData *parentRootFolder = - rootFolder->getParent()->getSystem()->getRootFolder(); + ->getGameListView(curSys->getRootFolder()->getParent()->getSystem()) + .get() + ->remove(collectionEntry, false); + FileData* parentRootFolder = + rootFolder->getParent()->getSystem()->getRootFolder(); parentRootFolder->sort(parentRootFolder->getSortTypeFromString( - parentRootFolder->getSortTypeString()), + parentRootFolder->getSortTypeString()), mFavoritesSorting); - GuiInfoPopup *s = new GuiInfoPopup( - mWindow, - "DISABLED '" + + GuiInfoPopup* s = new GuiInfoPopup( + mWindow, + "DISABLED '" + Utils::String::toUpper( - Utils::String::removeParenthesis(file->getName())) + + Utils::String::removeParenthesis(file->getName())) + "' IN '" + Utils::String::toUpper(sysData.system->getName()) + "'", - 4000); + 4000); mWindow->setInfoPopup(s); } else { @@ -550,26 +550,28 @@ bool CollectionSystemsManager::isThemeCustomCollectionCompatible( return true; } -std::string CollectionSystemsManager::getValidNewCollectionName(std::string inName, int index) { +std::string CollectionSystemsManager::getValidNewCollectionName(std::string inName, int index) +{ std::string name = inName; // Trim leading and trailing whitespaces. name.erase(name.begin(), std::find_if(name.begin(), name.end(), [](char c) { - return !std::isspace(static_cast(c)); - })); + return !std::isspace(static_cast(c)); + })); name.erase(std::find_if(name.rbegin(), name.rend(), [](char c) { return !std::isspace(static_cast(c)); }) - .base(), + .base(), name.end()); if (index == 0) { size_t remove = std::string::npos; // Get valid name. while ((remove = name.find_first_not_of( - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-[]()' ")) != + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-[]()' ")) != std::string::npos) name.erase(remove, 1); - } else { + } + else { name += " (" + std::to_string(index) + ")"; } @@ -1331,7 +1333,8 @@ void CollectionSystemsManager::addEnabledCollectionsToDisplayedSystems( } } -std::vector CollectionSystemsManager::getSystemsFromConfig() { +std::vector CollectionSystemsManager::getSystemsFromConfig() +{ std::vector systems; std::vector configPaths = SystemData::getConfigPath(false); @@ -1339,7 +1342,7 @@ std::vector CollectionSystemsManager::getSystemsFromConfig() { // file under ~/.emulationstation/custom_systems as we really want to include all the themes // supported by ES-DE. Otherwise a user may accidentally create a custom collection that // corresponds to a supported theme. - for (auto path: configPaths) { + for (auto path : configPaths) { if (!Utils::FileSystem::exists(path)) return systems; diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index c3fdf9103..8b441da80 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -30,11 +30,18 @@ #include FileData::FileData(FileType type, - const std::string &path, - SystemEnvironmentData *envData, - SystemData *system) - : metadata(type == GAME ? GAME_METADATA : FOLDER_METADATA), mSourceFileData(nullptr), mParent(nullptr), - mType(type), mPath(path), mEnvData(envData), mSystem(system), mOnlyFolders(false), mDeletionFlag(false) + const std::string& path, + SystemEnvironmentData* envData, + SystemData* system) + : metadata(type == GAME ? GAME_METADATA : FOLDER_METADATA) + , mSourceFileData(nullptr) + , mParent(nullptr) + , mType(type) + , mPath(path) + , mEnvData(envData) + , mSystem(system) + , mOnlyFolders(false) + , mDeletionFlag(false) { // Metadata needs at least a name field (since that's what getName() will return). if (metadata.get("name").empty()) { @@ -735,10 +742,11 @@ FileData::SortType FileData::getSortTypeFromString(std::string desc) return FileSorts::SortTypes.at(0); } -void FileData::launchGame(Window *window) { +void FileData::launchGame(Window* window) +{ LOG(LogInfo) << "Launching game \"" << this->metadata.get("name") << "\"..."; - SystemData *gameSystem = nullptr; + SystemData* gameSystem = nullptr; std::string command = ""; std::string alternativeEmulator; @@ -1347,8 +1355,8 @@ const std::string& CollectionFileData::getName() if (mDirty) { mCollectionFileName = mSourceFileData->metadata.get("name"); mCollectionFileName.append(" [") - .append(Utils::String::toUpper(mSourceFileData->getSystem()->getName())) - .append("]"); + .append(Utils::String::toUpper(mSourceFileData->getSystem()->getName())) + .append("]"); mDirty = false; } diff --git a/es-app/src/FileFilterIndex.cpp b/es-app/src/FileFilterIndex.cpp index 4e464b020..b49be5f5d 100644 --- a/es-app/src/FileFilterIndex.cpp +++ b/es-app/src/FileFilterIndex.cpp @@ -20,9 +20,17 @@ #define INCLUDE_UNKNOWN false; FileFilterIndex::FileFilterIndex() - : mFilterByText(false), mTextRemoveSystem(false), mFilterByFavorites(false), mFilterByGenre(false), - mFilterByPlayers(false), mFilterByPubDev(false), mFilterByRatings(false), mFilterByKidGame(false), - mFilterByCompleted(false), mFilterByBroken(false), mFilterByHidden(false) + : mFilterByText(false) + , mTextRemoveSystem(false) + , mFilterByFavorites(false) + , mFilterByGenre(false) + , mFilterByPlayers(false) + , mFilterByPubDev(false) + , mFilterByRatings(false) + , mFilterByKidGame(false) + , mFilterByCompleted(false) + , mFilterByBroken(false) + , mFilterByHidden(false) { clearAllFilters(); @@ -357,10 +365,11 @@ bool FileFilterIndex::showFile(FileData* game) // in [] from the search string. if (mTextFilter != "" && mTextRemoveSystem && !(Utils::String::toUpper(game->getName().substr(0, game->getName().find_last_of("["))) - .find(mTextFilter) != std::string::npos)) { + .find(mTextFilter) != std::string::npos)) { return false; - } else if (mTextFilter != "" && - !(Utils::String::toUpper(game->getName()).find(mTextFilter) != std::string::npos)) { + } + else if (mTextFilter != "" && + !(Utils::String::toUpper(game->getName()).find(mTextFilter) != std::string::npos)) { return false; } @@ -372,7 +381,8 @@ bool FileFilterIndex::showFile(FileData* game) FilterDataDecl filterData = (*it); if (filterData.primaryKey == "kidgame" && UIModeController::getInstance()->isUIModeKid()) { return (getIndexableKey(game, filterData.type, false) != "FALSE"); - } else if (*(filterData.filteredByRef)) { + } + else if (*(filterData.filteredByRef)) { // Try to find a match. std::string key = getIndexableKey(game, filterData.type, false); keepGoing = isKeyBeingFilteredBy(key, filterData.type); diff --git a/es-app/src/FileFilterIndex.h b/es-app/src/FileFilterIndex.h index 3e2af831e..ac0c3f0e4 100644 --- a/es-app/src/FileFilterIndex.h +++ b/es-app/src/FileFilterIndex.h @@ -49,11 +49,11 @@ public: FileFilterIndex(); ~FileFilterIndex(); - void addToIndex(FileData *game); + void addToIndex(FileData* game); - void removeFromIndex(FileData *game); + void removeFromIndex(FileData* game); - void setFilter(FilterIndexType type, std::vector *values); + void setFilter(FilterIndexType type, std::vector* values); void setTextFilter(std::string textFilter); @@ -63,17 +63,17 @@ public: void debugPrintIndexes(); - bool showFile(FileData *game); + bool showFile(FileData* game); bool isFiltered(); bool isKeyBeingFilteredBy(std::string key, FilterIndexType type); - std::vector &getFilterDataDecls() { return filterDataDecl; } + std::vector& getFilterDataDecls() { return filterDataDecl; } void setTextRemoveSystem(bool status) { mTextRemoveSystem = status; } - void importIndex(FileFilterIndex *indexToImport); + void importIndex(FileFilterIndex* indexToImport); void resetIndex(); diff --git a/es-app/src/FileSorts.cpp b/es-app/src/FileSorts.cpp index 196244391..916ecd819 100644 --- a/es-app/src/FileSorts.cpp +++ b/es-app/src/FileSorts.cpp @@ -227,7 +227,8 @@ namespace FileSorts return system1.compare(system2) < 0; } - bool compareSystemDescending(const FileData *file1, const FileData *file2) { + bool compareSystemDescending(const FileData* file1, const FileData* file2) + { std::string system1 = Utils::String::toUpper(file1->getSystemName()); std::string system2 = Utils::String::toUpper(file2->getSystemName()); return system1.compare(system2) > 0; diff --git a/es-app/src/FileSorts.h b/es-app/src/FileSorts.h index 950878c27..424acf109 100644 --- a/es-app/src/FileSorts.h +++ b/es-app/src/FileSorts.h @@ -19,41 +19,41 @@ namespace FileSorts bool compareName(const FileData* file1, const FileData* file2); bool compareNameDescending(const FileData* file1, const FileData* file2); - bool compareRating(const FileData *file1, const FileData *file2); + bool compareRating(const FileData* file1, const FileData* file2); - bool compareRatingDescending(const FileData *file1, const FileData *file2); + bool compareRatingDescending(const FileData* file1, const FileData* file2); - bool compareReleaseDate(const FileData *file1, const FileData *file2); + bool compareReleaseDate(const FileData* file1, const FileData* file2); - bool compareReleaseDateDescending(const FileData *file1, const FileData *file2); + bool compareReleaseDateDescending(const FileData* file1, const FileData* file2); - bool compareDeveloper(const FileData *file1, const FileData *file2); + bool compareDeveloper(const FileData* file1, const FileData* file2); - bool compareDeveloperDescending(const FileData *file1, const FileData *file2); + bool compareDeveloperDescending(const FileData* file1, const FileData* file2); - bool comparePublisher(const FileData *file1, const FileData *file2); + bool comparePublisher(const FileData* file1, const FileData* file2); - bool comparePublisherDescending(const FileData *file1, const FileData *file2); + bool comparePublisherDescending(const FileData* file1, const FileData* file2); - bool compareGenre(const FileData *file1, const FileData *file2); + bool compareGenre(const FileData* file1, const FileData* file2); - bool compareGenreDescending(const FileData *file1, const FileData *file2); + bool compareGenreDescending(const FileData* file1, const FileData* file2); - bool compareNumPlayers(const FileData *file1, const FileData *file2); + bool compareNumPlayers(const FileData* file1, const FileData* file2); - bool compareNumPlayersDescending(const FileData *file1, const FileData *file2); + bool compareNumPlayersDescending(const FileData* file1, const FileData* file2); - bool compareLastPlayed(const FileData *file1, const FileData *file2); + bool compareLastPlayed(const FileData* file1, const FileData* file2); - bool compareLastPlayedDescending(const FileData *file1, const FileData *file2); + bool compareLastPlayedDescending(const FileData* file1, const FileData* file2); - bool compareTimesPlayed(const FileData *file1, const FileData *fil2); + bool compareTimesPlayed(const FileData* file1, const FileData* fil2); - bool compareTimesPlayedDescending(const FileData *file1, const FileData *fil2); + bool compareTimesPlayedDescending(const FileData* file1, const FileData* fil2); - bool compareSystem(const FileData *file1, const FileData *file2); + bool compareSystem(const FileData* file1, const FileData* file2); - bool compareSystemDescending(const FileData *file1, const FileData *file2); + bool compareSystemDescending(const FileData* file1, const FileData* file2); extern const std::vector SortTypes; } // namespace FileSorts diff --git a/es-app/src/guis/GuiCollectionSystemsOptions.cpp b/es-app/src/guis/GuiCollectionSystemsOptions.cpp index cf4298c2d..59cc0052e 100644 --- a/es-app/src/guis/GuiCollectionSystemsOptions.cpp +++ b/es-app/src/guis/GuiCollectionSystemsOptions.cpp @@ -200,12 +200,12 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st glm::vec2{0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()}); row.addElement(newCollection, true); row.addElement(bracketNewCollection, false); - auto createCollectionCall = [this](const std::string &newVal) { + auto createCollectionCall = [this](const std::string& newVal) { std::string name = newVal; // We need to store the first GUI and remove it, as it'll be deleted // by the actual GUI. - Window *window = mWindow; - GuiComponent *topGui = window->peekGui(); + Window* window = mWindow; + GuiComponent* topGui = window->peekGui(); window->removeGui(topGui); createCustomCollection(name); }; @@ -213,10 +213,11 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st if (Settings::getInstance()->getBool("VirtualKeyboard")) { row.makeAcceptInputHandler([this, createCollectionCall] { mWindow->pushGui(new GuiTextEditKeyboardPopup( - mWindow, getHelpStyle(), "New Collection Name", "", createCollectionCall, false, - "CREATE", "CREATE COLLECTION?")); + mWindow, getHelpStyle(), "New Collection Name", "", createCollectionCall, false, + "CREATE", "CREATE COLLECTION?")); }); - } else { + } + else { row.makeAcceptInputHandler([this, createCollectionCall] { mWindow->pushGui(new GuiTextEditPopup(mWindow, getHelpStyle(), "New Collection Name", "", createCollectionCall, false, "CREATE", @@ -228,11 +229,11 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st // Delete custom collection. row.elements.clear(); auto deleteCollection = std::make_shared( - mWindow, "DELETE CUSTOM COLLECTION", Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + mWindow, "DELETE CUSTOM COLLECTION", Font::get(FONT_SIZE_MEDIUM), 0x777777FF); auto bracketDeleteCollection = std::make_shared(mWindow); bracketDeleteCollection->setImage(":/graphics/arrow.svg"); bracketDeleteCollection->setResize( - glm::vec2{0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()}); + glm::vec2{0.0f, Font::get(FONT_SIZE_MEDIUM)->getLetterHeight()}); row.addElement(deleteCollection, true); row.addElement(bracketDeleteCollection, false); row.makeAcceptInputHandler([this, customSystems] { diff --git a/es-app/src/guis/GuiGameScraper.cpp b/es-app/src/guis/GuiGameScraper.cpp index 3f65554fa..9ddc85caa 100644 --- a/es-app/src/guis/GuiGameScraper.cpp +++ b/es-app/src/guis/GuiGameScraper.cpp @@ -18,11 +18,14 @@ #include "components/TextComponent.h" #include "views/ViewController.h" -GuiGameScraper::GuiGameScraper(Window *window, +GuiGameScraper::GuiGameScraper(Window* window, ScraperSearchParams params, - std::function doneFunc) - : GuiComponent(window), mClose(false), mGrid(window, glm::ivec2{1, 7}), mBox(window, ":/graphics/frame.svg"), - mSearchParams(params) + std::function doneFunc) + : GuiComponent(window) + , mClose(false) + , mGrid(window, glm::ivec2{1, 7}) + , mBox(window, ":/graphics/frame.svg") + , mSearchParams(params) { addChild(&mBox); addChild(&mGrid); diff --git a/es-app/src/guis/GuiGamelistFilter.cpp b/es-app/src/guis/GuiGamelistFilter.cpp index 8330b4424..679e785cb 100644 --- a/es-app/src/guis/GuiGamelistFilter.cpp +++ b/es-app/src/guis/GuiGamelistFilter.cpp @@ -29,7 +29,8 @@ GuiGamelistFilter::GuiGamelistFilter(Window* window, initializeMenu(); } -void GuiGamelistFilter::initializeMenu() { +void GuiGamelistFilter::initializeMenu() +{ addChild(&mMenu); // Get filters from system. @@ -93,12 +94,13 @@ void GuiGamelistFilter::resetAllFilters() GuiGamelistFilter::~GuiGamelistFilter() { mFilterOptions.clear(); } -void GuiGamelistFilter::addFiltersToMenu() { +void GuiGamelistFilter::addFiltersToMenu() +{ ComponentListRow row; auto lbl = std::make_shared( - mWindow, Utils::String::toUpper(ViewController::KEYBOARD_CHAR + " GAME NAME"), - Font::get(FONT_SIZE_MEDIUM), 0x777777FF); + mWindow, Utils::String::toUpper(ViewController::KEYBOARD_CHAR + " GAME NAME"), + Font::get(FONT_SIZE_MEDIUM), 0x777777FF); mTextFilterField = std::make_shared(mWindow, "", Font::get(FONT_SIZE_MEDIUM), 0x777777FF, ALIGN_RIGHT); @@ -121,7 +123,7 @@ void GuiGamelistFilter::addFiltersToMenu() { } // Callback function. - auto updateVal = [this](const std::string &newVal) { + auto updateVal = [this](const std::string& newVal) { mTextFilterField->setValue(Utils::String::toUpper(newVal)); mFilterIndex->setTextFilter(Utils::String::toUpper(newVal)); }; @@ -132,7 +134,8 @@ void GuiGamelistFilter::addFiltersToMenu() { mTextFilterField->getValue(), updateVal, false, "OK", "APPLY CHANGES?")); }); - } else { + } + else { row.makeAcceptInputHandler([this, updateVal] { mWindow->pushGui(new GuiTextEditPopup(mWindow, getHelpStyle(), "GAME NAME", mTextFilterField->getValue(), updateVal, false, diff --git a/es-app/src/guis/GuiGamelistOptions.cpp b/es-app/src/guis/GuiGamelistOptions.cpp index c63e38da0..b7cbbd1cb 100644 --- a/es-app/src/guis/GuiGamelistOptions.cpp +++ b/es-app/src/guis/GuiGamelistOptions.cpp @@ -25,9 +25,15 @@ #include "views/ViewController.h" #include "views/gamelist/IGameListView.h" -GuiGamelistOptions::GuiGamelistOptions(Window *window, SystemData *system) - : GuiComponent(window), mMenu(window, "OPTIONS"), mSystem(system), mFiltersChanged(false), mCancelled(false), - mIsCustomCollection(false), mIsCustomCollectionGroup(false), mCustomCollectionSystem(nullptr) +GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system) + : GuiComponent(window) + , mMenu(window, "OPTIONS") + , mSystem(system) + , mFiltersChanged(false) + , mCancelled(false) + , mIsCustomCollection(false) + , mIsCustomCollectionGroup(false) + , mCustomCollectionSystem(nullptr) { addChild(&mMenu); diff --git a/es-app/src/guis/GuiLaunchScreen.cpp b/es-app/src/guis/GuiLaunchScreen.cpp index ce347b85f..bffcefb71 100644 --- a/es-app/src/guis/GuiLaunchScreen.cpp +++ b/es-app/src/guis/GuiLaunchScreen.cpp @@ -14,9 +14,12 @@ #include "components/TextComponent.h" #include "utils/StringUtil.h" -GuiLaunchScreen::GuiLaunchScreen(Window *window) - : GuiComponent(window), mWindow(window), mBackground(window, ":/graphics/frame.svg"), mGrid(nullptr), - mMarquee(nullptr) +GuiLaunchScreen::GuiLaunchScreen(Window* window) + : GuiComponent(window) + , mWindow(window) + , mBackground(window, ":/graphics/frame.svg") + , mGrid(nullptr) + , mMarquee(nullptr) { addChild(&mBackground); mWindow->setLaunchScreen(this); @@ -217,7 +220,8 @@ void GuiLaunchScreen::update(int deltaTime) mScaleUp = glm::clamp(mScaleUp + 0.07f, 0.0f, 1.0f); } -void GuiLaunchScreen::render(const glm::mat4 & /*parentTrans*/) { +void GuiLaunchScreen::render(const glm::mat4& /*parentTrans*/) +{ // Scale up animation. if (mScaleUp < 1.0f) setScale(mScaleUp); diff --git a/es-app/src/guis/GuiLaunchScreen.h b/es-app/src/guis/GuiLaunchScreen.h index 352bfa711..dac32f24f 100644 --- a/es-app/src/guis/GuiLaunchScreen.h +++ b/es-app/src/guis/GuiLaunchScreen.h @@ -21,11 +21,11 @@ class FileData; class GuiLaunchScreen : public Window::GuiLaunchScreen, GuiComponent { public: - GuiLaunchScreen(Window *window); + GuiLaunchScreen(Window* window); virtual ~GuiLaunchScreen(); - virtual void displayLaunchScreen(FileData *game) override; + virtual void displayLaunchScreen(FileData* game) override; virtual void closeLaunchScreen() override; @@ -33,12 +33,12 @@ public: virtual void update(int deltaTime) override; - virtual void render(const glm::mat4 &parentTrans) override; + virtual void render(const glm::mat4& parentTrans) override; private: - Window *mWindow; + Window* mWindow; NinePatchComponent mBackground; - ComponentGrid *mGrid; + ComponentGrid* mGrid; std::shared_ptr mTitle; std::shared_ptr mGameName; diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 23b17a8eb..63090620b 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -36,8 +36,10 @@ #include #include -GuiMenu::GuiMenu(Window *window) - : GuiComponent(window), mMenu(window, "MAIN MENU"), mVersion(window) +GuiMenu::GuiMenu(Window* window) + : GuiComponent(window) + , mMenu(window, "MAIN MENU") + , mVersion(window) { bool isFullUI = UIModeController::getInstance()->isUIModeFull(); @@ -822,16 +824,17 @@ void GuiMenu::openOtherOptions() multiLineMediaDir] { if (Settings::getInstance()->getBool("VirtualKeyboard")) { mWindow->pushGui(new GuiTextEditKeyboardPopup( - mWindow, getHelpStyle(), titleMediaDir, - Settings::getInstance()->getString("MediaDirectory"), updateValMediaDir, - multiLineMediaDir, "SAVE", "SAVE CHANGES?", mediaDirectoryStaticText, - defaultDirectoryText, "load default directory")); - } else { + mWindow, getHelpStyle(), titleMediaDir, + Settings::getInstance()->getString("MediaDirectory"), updateValMediaDir, + multiLineMediaDir, "SAVE", "SAVE CHANGES?", mediaDirectoryStaticText, + defaultDirectoryText, "load default directory")); + } + else { mWindow->pushGui(new GuiTextEditPopup( - mWindow, getHelpStyle(), titleMediaDir, - Settings::getInstance()->getString("MediaDirectory"), updateValMediaDir, - multiLineMediaDir, "SAVE", "SAVE CHANGES?", mediaDirectoryStaticText, - defaultDirectoryText, "load default directory")); + mWindow, getHelpStyle(), titleMediaDir, + Settings::getInstance()->getString("MediaDirectory"), updateValMediaDir, + multiLineMediaDir, "SAVE", "SAVE CHANGES?", mediaDirectoryStaticText, + defaultDirectoryText, "load default directory")); } }); s->addRow(rowMediaDir); diff --git a/es-app/src/guis/GuiMetaDataEd.cpp b/es-app/src/guis/GuiMetaDataEd.cpp index 2aa7a5213..1c73698ab 100644 --- a/es-app/src/guis/GuiMetaDataEd.cpp +++ b/es-app/src/guis/GuiMetaDataEd.cpp @@ -31,18 +31,25 @@ #include "utils/StringUtil.h" #include "views/ViewController.h" -GuiMetaDataEd::GuiMetaDataEd(Window *window, - MetaDataList *md, - const std::vector &mdd, +GuiMetaDataEd::GuiMetaDataEd(Window* window, + MetaDataList* md, + const std::vector& mdd, ScraperSearchParams scraperParams, - const std::string & /*header*/, + const std::string& /*header*/, std::function saveCallback, std::function clearGameFunc, std::function deleteGameFunc) - : GuiComponent(window), mBackground(window, ":/graphics/frame.svg"), mGrid(window, glm::ivec2{1, 3}), - mScraperParams(scraperParams), mMetaDataDecl(mdd), mMetaData(md), mSavedCallback(saveCallback), - mClearGameFunc(clearGameFunc), mDeleteGameFunc(deleteGameFunc), mMediaFilesUpdated(false), - mInvalidEmulatorEntry(false) + : GuiComponent(window) + , mBackground(window, ":/graphics/frame.svg") + , mGrid(window, glm::ivec2{1, 3}) + , mScraperParams(scraperParams) + , mMetaDataDecl(mdd) + , mMetaData(md) + , mSavedCallback(saveCallback) + , mClearGameFunc(clearGameFunc) + , mDeleteGameFunc(deleteGameFunc) + , mMediaFilesUpdated(false) + , mInvalidEmulatorEntry(false) { addChild(&mBackground); addChild(&mGrid); @@ -211,11 +218,11 @@ GuiMetaDataEd::GuiMetaDataEd(Window *window, if (mInvalidEmulatorEntry || scraperParams.system->getSystemEnvData()->mLaunchCommands.size() > 1) { row.makeAcceptInputHandler([this, title, scraperParams, ed, updateVal, - originalValue] { - GuiSettings *s = nullptr; + originalValue] { + GuiSettings* s = nullptr; bool singleEntry = - scraperParams.system->getSystemEnvData()->mLaunchCommands.size() == 1; + scraperParams.system->getSystemEnvData()->mLaunchCommands.size() == 1; if (mInvalidEmulatorEntry && singleEntry) s = new GuiSettings(mWindow, "CLEAR INVALID ENTRY"); @@ -226,16 +233,16 @@ GuiMetaDataEd::GuiMetaDataEd(Window *window, return; std::vector> launchCommands = - scraperParams.system->getSystemEnvData()->mLaunchCommands; + scraperParams.system->getSystemEnvData()->mLaunchCommands; if (ed->getValue() != "" && mInvalidEmulatorEntry && singleEntry) launchCommands.push_back(std::make_pair( - "", ViewController::EXCLAMATION_CHAR + " " + originalValue)); + "", ViewController::EXCLAMATION_CHAR + " " + originalValue)); else if (ed->getValue() != "") launchCommands.push_back(std::make_pair( - "", ViewController::CROSSEDCIRCLE_CHAR + " CLEAR ENTRY")); + "", ViewController::CROSSEDCIRCLE_CHAR + " CLEAR ENTRY")); - for (auto entry: launchCommands) { + for (auto entry : launchCommands) { std::string selectedLabel = ed->getValue(); std::string label; ComponentListRow row; @@ -356,7 +363,8 @@ GuiMetaDataEd::GuiMetaDataEd(Window *window, ed->setColor(DEFAULT_TEXTCOLOR); else ed->setColor(TEXTCOLOR_USERMARKED); - } else { + } + else { ed->setValue(newVal); if (newVal == originalValue) ed->setColor(DEFAULT_TEXTCOLOR); @@ -368,10 +376,11 @@ GuiMetaDataEd::GuiMetaDataEd(Window *window, if (Settings::getInstance()->getBool("VirtualKeyboard")) { row.makeAcceptInputHandler([this, title, ed, updateVal, multiLine] { mWindow->pushGui(new GuiTextEditKeyboardPopup( - mWindow, getHelpStyle(), title, ed->getValue(), updateVal, multiLine, - "apply", "APPLY CHANGES?", "", "")); + mWindow, getHelpStyle(), title, ed->getValue(), updateVal, multiLine, + "apply", "APPLY CHANGES?", "", "")); }); - } else { + } + else { row.makeAcceptInputHandler([this, title, ed, updateVal, multiLine] { mWindow->pushGui(new GuiTextEditPopup(mWindow, getHelpStyle(), title, ed->getValue(), updateVal, multiLine, diff --git a/es-app/src/guis/GuiOfflineGenerator.cpp b/es-app/src/guis/GuiOfflineGenerator.cpp index 2f214f987..d88e67932 100644 --- a/es-app/src/guis/GuiOfflineGenerator.cpp +++ b/es-app/src/guis/GuiOfflineGenerator.cpp @@ -13,9 +13,11 @@ #include "components/MenuComponent.h" #include "views/ViewController.h" -GuiOfflineGenerator::GuiOfflineGenerator(Window *window, const std::queue &gameQueue) - : GuiComponent(window), mGameQueue(gameQueue), mBackground(window, ":/graphics/frame.svg"), - mGrid(window, glm::ivec2{6, 13}) +GuiOfflineGenerator::GuiOfflineGenerator(Window* window, const std::queue& gameQueue) + : GuiComponent(window) + , mGameQueue(gameQueue) + , mBackground(window, ":/graphics/frame.svg") + , mGrid(window, glm::ivec2{6, 13}) { addChild(&mBackground); addChild(&mGrid); diff --git a/es-app/src/guis/GuiScraperMulti.cpp b/es-app/src/guis/GuiScraperMulti.cpp index 6f7ec1923..067352199 100644 --- a/es-app/src/guis/GuiScraperMulti.cpp +++ b/es-app/src/guis/GuiScraperMulti.cpp @@ -86,19 +86,19 @@ GuiScraperMulti::GuiScraperMulti(Window* window, // Previously refined. if (mSearchComp->getRefinedSearch()) allowRefine = true; - // Interactive mode and "Auto-accept single game matches" not enabled. + // Interactive mode and "Auto-accept single game matches" not enabled. else if (mSearchComp->getSearchType() != GuiScraperSearch::ACCEPT_SINGLE_MATCHES) allowRefine = true; - // Interactive mode with "Auto-accept single game matches" enabled and more - // than one result. + // Interactive mode with "Auto-accept single game matches" enabled and more + // than one result. else if (mSearchComp->getSearchType() == - GuiScraperSearch::ACCEPT_SINGLE_MATCHES && + GuiScraperSearch::ACCEPT_SINGLE_MATCHES && mSearchComp->getScraperResultsSize() > 1) allowRefine = true; - // Dito but there were no games found, or the search has not been completed. + // Dito but there were no games found, or the search has not been completed. else if (mSearchComp->getSearchType() == - GuiScraperSearch::ACCEPT_SINGLE_MATCHES && + GuiScraperSearch::ACCEPT_SINGLE_MATCHES && !mSearchComp->getFoundGame()) allowRefine = true; diff --git a/es-app/src/guis/GuiScraperSearch.cpp b/es-app/src/guis/GuiScraperSearch.cpp index 1f5b9a1c9..d749c1302 100644 --- a/es-app/src/guis/GuiScraperSearch.cpp +++ b/es-app/src/guis/GuiScraperSearch.cpp @@ -37,9 +37,15 @@ #define FAILED_VERIFICATION_RETRIES 8 -GuiScraperSearch::GuiScraperSearch(Window *window, SearchType type, unsigned int scrapeCount) - : GuiComponent(window), mGrid(window, glm::ivec2{4, 3}), mSearchType(type), mScrapeCount(scrapeCount), - mRefinedSearch(false), mFoundGame(false), mScrapeRatings(false), mBusyAnim(window) +GuiScraperSearch::GuiScraperSearch(Window* window, SearchType type, unsigned int scrapeCount) + : GuiComponent(window) + , mGrid(window, glm::ivec2{4, 3}) + , mSearchType(type) + , mScrapeCount(scrapeCount) + , mRefinedSearch(false) + , mFoundGame(false) + , mScrapeRatings(false) + , mBusyAnim(window) { addChild(&mGrid); @@ -467,14 +473,14 @@ void GuiScraperSearch::updateInfoPane() i = 0; if (i != -1 && static_cast(mScraperResults.size()) > i) { - ScraperSearchResult &res = mScraperResults.at(i); + ScraperSearchResult& res = mScraperResults.at(i); mResultName->setText(Utils::String::toUpper(res.mdl.get("name"))); mResultDesc->setText(Utils::String::toUpper(res.mdl.get("desc"))); mDescContainer->reset(); mResultThumbnail->setImage(""); - const std::string &thumb = res.screenshotUrl.empty() ? res.coverUrl : res.screenshotUrl; + const std::string& thumb = res.screenshotUrl.empty() ? res.coverUrl : res.screenshotUrl; mScraperResults[i].thumbnailImageUrl = thumb; // Cache the thumbnail image in mScraperResults so that we don't need to download @@ -547,13 +553,13 @@ bool GuiScraperSearch::input(InputConfig* config, Input input) // Previously refined. if (mRefinedSearch) allowRefine = true; - // Interactive mode and "Auto-accept single game matches" not enabled. + // Interactive mode and "Auto-accept single game matches" not enabled. else if (mSearchType != ACCEPT_SINGLE_MATCHES) allowRefine = true; - // Interactive mode with "Auto-accept single game matches" enabled and more than one result. + // Interactive mode with "Auto-accept single game matches" enabled and more than one result. else if (mSearchType == ACCEPT_SINGLE_MATCHES && mScraperResults.size() > 1) allowRefine = true; - // Dito but there were no games found, or the search has not been completed. + // Dito but there were no games found, or the search has not been completed. else if (mSearchType == ACCEPT_SINGLE_MATCHES && !mFoundGame) allowRefine = true; @@ -784,15 +790,16 @@ void GuiScraperSearch::updateThumbnail() } } -void GuiScraperSearch::openInputScreen(ScraperSearchParams ¶ms) { +void GuiScraperSearch::openInputScreen(ScraperSearchParams& params) +{ auto searchForFunc = [&](std::string name) { // Trim leading and trailing whitespaces. name.erase(name.begin(), std::find_if(name.begin(), name.end(), [](char c) { - return !std::isspace(static_cast(c)); - })); + return !std::isspace(static_cast(c)); + })); name.erase(std::find_if(name.rbegin(), name.rend(), [](char c) { return !std::isspace(static_cast(c)); }) - .base(), + .base(), name.end()); stop(); @@ -810,7 +817,8 @@ void GuiScraperSearch::openInputScreen(ScraperSearchParams ¶ms) { // regardless of whether the entry is an arcade game and TheGamesDB is used. if (Settings::getInstance()->getBool("ScraperSearchMetadataName")) { searchString = Utils::String::removeParenthesis(params.game->metadata.get("name")); - } else { + } + else { // If searching based on the actual file name, then expand to the full game name // in case the scraper is set to TheGamesDB and it's an arcade game. This is // required as TheGamesDB does not support searches using the short MAME names. @@ -820,7 +828,8 @@ void GuiScraperSearch::openInputScreen(ScraperSearchParams ¶ms) { else searchString = params.game->getCleanName(); } - } else { + } + else { searchString = params.nameOverride; } @@ -828,7 +837,8 @@ void GuiScraperSearch::openInputScreen(ScraperSearchParams ¶ms) { mWindow->pushGui(new GuiTextEditKeyboardPopup(mWindow, getHelpStyle(), "REFINE SEARCH", searchString, searchForFunc, false, "SEARCH", "SEARCH USING REFINED NAME?")); - } else { + } + else { mWindow->pushGui(new GuiTextEditPopup(mWindow, getHelpStyle(), "REFINE SEARCH", searchString, searchForFunc, false, "SEARCH", "SEARCH USING REFINED NAME?")); @@ -918,7 +928,8 @@ bool GuiScraperSearch::saveMetadata(const ScraperSearchResult& result, return metadataUpdated; } -std::vector GuiScraperSearch::getHelpPrompts() { +std::vector GuiScraperSearch::getHelpPrompts() +{ std::vector prompts; prompts.push_back(HelpPrompt("y", "refine search")); diff --git a/es-app/src/guis/GuiScraperSearch.h b/es-app/src/guis/GuiScraperSearch.h index 0cf1dfd3b..fb824360e 100644 --- a/es-app/src/guis/GuiScraperSearch.h +++ b/es-app/src/guis/GuiScraperSearch.h @@ -64,19 +64,21 @@ public: mAcceptCallback = acceptCallback; } - void setSkipCallback(const std::function &skipCallback) { + void setSkipCallback(const std::function& skipCallback) + { mSkipCallback = skipCallback; } - void setCancelCallback(const std::function &cancelCallback) { + void setCancelCallback(const std::function& cancelCallback) + { mCancelCallback = cancelCallback; } - bool input(InputConfig *config, Input input) override; + bool input(InputConfig* config, Input input) override; void update(int deltaTime) override; - void render(const glm::mat4 &parentTrans) override; + void render(const glm::mat4& parentTrans) override; std::vector getHelpPrompts() override; @@ -84,7 +86,8 @@ public: void onSizeChanged() override; - void decreaseScrapeCount() { + void decreaseScrapeCount() + { if (mScrapeCount > 0) mScrapeCount--; } @@ -95,7 +98,7 @@ public: bool getFoundGame() { return mFoundGame; } - const std::string &getNameOverride() { return mLastSearch.nameOverride; } + const std::string& getNameOverride() { return mLastSearch.nameOverride; } void onFocusGained() override { mGrid.onFocusGained(); } diff --git a/es-app/src/guis/GuiSettings.cpp b/es-app/src/guis/GuiSettings.cpp index cbfbd2197..6cd181dc8 100644 --- a/es-app/src/guis/GuiSettings.cpp +++ b/es-app/src/guis/GuiSettings.cpp @@ -21,11 +21,21 @@ #include "views/ViewController.h" #include "views/gamelist/IGameListView.h" -GuiSettings::GuiSettings(Window *window, std::string title) - : GuiComponent(window), mMenu(window, title), mGoToSystem(nullptr), mNeedsSaving(false), - mNeedsReloadHelpPrompts(false), mNeedsCollectionsUpdate(false), mNeedsSorting(false), - mNeedsSortingCollections(false), mNeedsResetFilters(false), mNeedsReloading(false), mNeedsGoToStart(false), - mNeedsGoToSystem(false), mNeedsGoToGroupedCollections(false), mInvalidateCachedBackground(false) +GuiSettings::GuiSettings(Window* window, std::string title) + : GuiComponent(window) + , mMenu(window, title) + , mGoToSystem(nullptr) + , mNeedsSaving(false) + , mNeedsReloadHelpPrompts(false) + , mNeedsCollectionsUpdate(false) + , mNeedsSorting(false) + , mNeedsSortingCollections(false) + , mNeedsResetFilters(false) + , mNeedsReloading(false) + , mNeedsGoToStart(false) + , mNeedsGoToSystem(false) + , mNeedsGoToGroupedCollections(false) + , mInvalidateCachedBackground(false) { addChild(&mMenu); mMenu.addButton("BACK", "back", [this] { delete this; }); @@ -174,10 +184,12 @@ void GuiSettings::addEditableTextComponent(const std::string label, else if (isPassword && newVal == "") { ed->setValue(""); ed->setHiddenValue(""); - } else if (isPassword) { + } + else if (isPassword) { ed->setValue("********"); ed->setHiddenValue(newVal); - } else { + } + else { ed->setValue(newVal); } }; @@ -187,13 +199,14 @@ void GuiSettings::addEditableTextComponent(const std::string label, // Never display the value if it's a password, instead set it to blank. if (isPassword) mWindow->pushGui(new GuiTextEditKeyboardPopup( - mWindow, getHelpStyle(), label, "", updateVal, false, "SAVE", "SAVE CHANGES?")); + mWindow, getHelpStyle(), label, "", updateVal, false, "SAVE", "SAVE CHANGES?")); else mWindow->pushGui(new GuiTextEditKeyboardPopup(mWindow, getHelpStyle(), label, ed->getValue(), updateVal, false, "SAVE", "SAVE CHANGES?")); }); - } else { + } + else { row.makeAcceptInputHandler([this, label, ed, updateVal, isPassword] { if (isPassword) mWindow->pushGui(new GuiTextEditPopup(mWindow, getHelpStyle(), label, "", updateVal, diff --git a/es-app/src/scrapers/GamesDBJSONScraper.cpp b/es-app/src/scrapers/GamesDBJSONScraper.cpp index 87dedbac7..4c015d38c 100644 --- a/es-app/src/scrapers/GamesDBJSONScraper.cpp +++ b/es-app/src/scrapers/GamesDBJSONScraper.cpp @@ -147,7 +147,8 @@ void thegamesdb_generate_json_scraper_requests( // using this regardless of whether the entry is an arcade game. if (Settings::getInstance()->getBool("ScraperSearchMetadataName")) { cleanName = Utils::String::removeParenthesis(params.game->metadata.get("name")); - } else { + } + else { // If not searching based on the metadata name, then check whether it's an // arcade game and if so expand to the full game name. This is required as // TheGamesDB has issues with searching using the short MAME names. @@ -164,10 +165,10 @@ void thegamesdb_generate_json_scraper_requests( return !std::isspace(static_cast(c)); })); cleanName.erase( - std::find_if(cleanName.rbegin(), cleanName.rend(), - [](char c) { return !std::isspace(static_cast(c)); }) - .base(), - cleanName.end()); + std::find_if(cleanName.rbegin(), cleanName.rend(), + [](char c) { return !std::isspace(static_cast(c)); }) + .base(), + cleanName.end()); path += "/Games/ByGameName?" + apiKey + "&fields=players,publishers,genres,overview,last_updated,rating," @@ -456,7 +457,7 @@ void TheGamesDBJSONRequest::process(const std::unique_ptr& req, if (doc.HasMember("remaining_monthly_allowance") && doc.HasMember("extra_allowance")) { for (size_t i = 0; i < results.size(); i++) { results[i].scraperRequestAllowance = - doc["remaining_monthly_allowance"].GetInt() + doc["extra_allowance"].GetInt(); + doc["remaining_monthly_allowance"].GetInt() + doc["extra_allowance"].GetInt(); } LOG(LogDebug) << "TheGamesDBJSONRequest::process(): " "Remaining monthly scraping allowance: " diff --git a/es-app/src/views/gamelist/DetailedGameListView.cpp b/es-app/src/views/gamelist/DetailedGameListView.cpp index c62eef1b1..736f1ac76 100644 --- a/es-app/src/views/gamelist/DetailedGameListView.cpp +++ b/es-app/src/views/gamelist/DetailedGameListView.cpp @@ -17,12 +17,32 @@ #define FADE_IN_TIME 650 DetailedGameListView::DetailedGameListView(Window* window, FileData* root) - : BasicGameListView(window, root), mThumbnail(window), mMarquee(window), mImage(window), mLblRating(window), - mLblReleaseDate(window), mLblDeveloper(window), mLblPublisher(window), mLblGenre(window), mLblPlayers(window), - mLblLastPlayed(window), mLblPlayCount(window), mBadges(window), mRating(window), mReleaseDate(window), - mDeveloper(window), - mPublisher(window), mGenre(window), mPlayers(window), mLastPlayed(window), mPlayCount(window), mName(window), - mDescContainer(window), mDescription(window), mGamelistInfo(window), mLastUpdated(nullptr) + : BasicGameListView(window, root) + , mThumbnail(window) + , mMarquee(window) + , mImage(window) + , mLblRating(window) + , mLblReleaseDate(window) + , mLblDeveloper(window) + , mLblPublisher(window) + , mLblGenre(window) + , mLblPlayers(window) + , mLblLastPlayed(window) + , mLblPlayCount(window) + , mBadges(window) + , mRating(window) + , mReleaseDate(window) + , mDeveloper(window) + , mPublisher(window) + , mGenre(window) + , mPlayers(window) + , mLastPlayed(window) + , mPlayCount(window) + , mName(window) + , mDescContainer(window) + , mDescription(window) + , mGamelistInfo(window) + , mLastUpdated(nullptr) { const float padding = 0.01f; @@ -111,7 +131,8 @@ DetailedGameListView::DetailedGameListView(Window* window, FileData* root) initMDValues(); } -void DetailedGameListView::onThemeChanged(const std::shared_ptr& theme) { +void DetailedGameListView::onThemeChanged(const std::shared_ptr& theme) +{ BasicGameListView::onThemeChanged(theme); using namespace ThemeFlags; @@ -124,21 +145,21 @@ void DetailedGameListView::onThemeChanged(const std::shared_ptr& them mName.applyTheme(theme, getName(), "md_name", ALL); initMDLabels(); - std::vector labels = getMDLabels(); + std::vector labels = getMDLabels(); assert(labels.size() == 8); std::vector lblElements = { - "md_lbl_rating", "md_lbl_releasedate", "md_lbl_developer", "md_lbl_publisher", - "md_lbl_genre", "md_lbl_players", "md_lbl_lastplayed", "md_lbl_playcount"}; + "md_lbl_rating", "md_lbl_releasedate", "md_lbl_developer", "md_lbl_publisher", + "md_lbl_genre", "md_lbl_players", "md_lbl_lastplayed", "md_lbl_playcount"}; for (unsigned int i = 0; i < labels.size(); i++) labels[i]->applyTheme(theme, getName(), lblElements[i], ALL); initMDValues(); - std::vector values = getMDValues(); + std::vector values = getMDValues(); assert(values.size() == 9); - std::vector valElements = {"md_rating", "md_releasedate", "md_developer", - "md_publisher", "md_genre", "md_players", - "md_badges", "md_lastplayed", "md_playcount"}; + std::vector valElements = {"md_rating", "md_releasedate", "md_developer", + "md_publisher", "md_genre", "md_players", + "md_badges", "md_lastplayed", "md_playcount"}; for (unsigned int i = 0; i < values.size(); i++) values[i]->applyTheme(theme, getName(), valElements[i], ALL ^ ThemeFlags::TEXT); @@ -402,7 +423,8 @@ void DetailedGameListView::updateInfoPanel() mLastPlayed.setValue(file->metadata.get("lastplayed")); mPlayCount.setValue(file->metadata.get("playcount")); } - } else if (file->getType() == FOLDER) { + } + else if (file->getType() == FOLDER) { if (!hideMetaDataFields) { mLastPlayed.setValue(file->metadata.get("lastplayed")); mLblPlayCount.setVisible(false); diff --git a/es-app/src/views/gamelist/GridGameListView.cpp b/es-app/src/views/gamelist/GridGameListView.cpp index 319029bce..4f9491f8a 100644 --- a/es-app/src/views/gamelist/GridGameListView.cpp +++ b/es-app/src/views/gamelist/GridGameListView.cpp @@ -20,12 +20,31 @@ #define FADE_IN_TIME 650 GridGameListView::GridGameListView(Window* window, FileData* root) - : ISimpleGameListView(window, root), mGrid(window), mMarquee(window), mImage(window), mLblRating(window), - mLblReleaseDate(window), mLblDeveloper(window), mLblPublisher(window), mLblGenre(window), mLblPlayers(window), - mLblLastPlayed(window), mLblPlayCount(window), mBadges(window), mRating(window), mReleaseDate(window), - mDeveloper(window), - mPublisher(window), mGenre(window), mPlayers(window), mLastPlayed(window), mPlayCount(window), mName(window), - mDescContainer(window), mDescription(window), mGamelistInfo(window) + : ISimpleGameListView(window, root) + , mGrid(window) + , mMarquee(window) + , mImage(window) + , mLblRating(window) + , mLblReleaseDate(window) + , mLblDeveloper(window) + , mLblPublisher(window) + , mLblGenre(window) + , mLblPlayers(window) + , mLblLastPlayed(window) + , mLblPlayCount(window) + , mBadges(window) + , mRating(window) + , mReleaseDate(window) + , mDeveloper(window) + , mPublisher(window) + , mGenre(window) + , mPlayers(window) + , mLastPlayed(window) + , mPlayCount(window) + , mName(window) + , mDescContainer(window) + , mDescription(window) + , mGamelistInfo(window) { const float padding = 0.01f; diff --git a/es-app/src/views/gamelist/GridGameListView.h b/es-app/src/views/gamelist/GridGameListView.h index 7fa25bce0..b89852271 100644 --- a/es-app/src/views/gamelist/GridGameListView.h +++ b/es-app/src/views/gamelist/GridGameListView.h @@ -68,12 +68,12 @@ protected: ImageGridComponent mGrid; // Points to the first game in the list, i.e. the first entry which is of the type 'GAME'. - FileData *firstGameEntry; + FileData* firstGameEntry; private: void updateInfoPanel(); - const std::string getImagePath(FileData *file); + const std::string getImagePath(FileData* file); void initMDLabels(); diff --git a/es-app/src/views/gamelist/VideoGameListView.h b/es-app/src/views/gamelist/VideoGameListView.h index 170a0dbbd..0cd36f4e7 100644 --- a/es-app/src/views/gamelist/VideoGameListView.h +++ b/es-app/src/views/gamelist/VideoGameListView.h @@ -20,7 +20,7 @@ class VideoComponent; class VideoGameListView : public BasicGameListView { public: - VideoGameListView(Window *window, FileData *root); + VideoGameListView(Window* window, FileData* root); virtual ~VideoGameListView() noexcept; diff --git a/es-core/src/GuiComponent.cpp b/es-core/src/GuiComponent.cpp index 5790a3cb0..5075fc311 100644 --- a/es-core/src/GuiComponent.cpp +++ b/es-core/src/GuiComponent.cpp @@ -16,11 +16,22 @@ #include -GuiComponent::GuiComponent(Window *window) - : mWindow(window), mParent(nullptr), mOpacity(255), mColor(0), mSaturation(1.0f), mColorShift(0), - mColorShiftEnd(0), - mPosition({}), mOrigin({}), mRotationOrigin(0.5f, 0.5f), mSize({}), mIsProcessing(false), mVisible(true), - mEnabled(true), mTransform(Renderer::getIdentity()) +GuiComponent::GuiComponent(Window* window) + : mWindow(window) + , mParent(nullptr) + , mOpacity(255) + , mColor(0) + , mSaturation(1.0f) + , mColorShift(0) + , mColorShiftEnd(0) + , mPosition({}) + , mOrigin({}) + , mRotationOrigin(0.5f, 0.5f) + , mSize({}) + , mIsProcessing(false) + , mVisible(true) + , mEnabled(true) + , mTransform(Renderer::getIdentity()) { for (unsigned char i = 0; i < MAX_ANIMATIONS; i++) mAnimationMap[i] = nullptr; diff --git a/es-core/src/GuiComponent.h b/es-core/src/GuiComponent.h index 2e7efd9a5..7bb184c14 100644 --- a/es-core/src/GuiComponent.h +++ b/es-core/src/GuiComponent.h @@ -37,7 +37,7 @@ class Window; class GuiComponent { public: - GuiComponent(Window *window); + GuiComponent(Window* window); virtual ~GuiComponent() noexcept; @@ -231,15 +231,15 @@ public: const static unsigned char MAX_ANIMATIONS = 4; protected: - void renderChildren(const glm::mat4 &transform) const; + void renderChildren(const glm::mat4& transform) const; void updateSelf(int deltaTime); // Updates animations. void updateChildren(int deltaTime); // Updates animations. - Window *mWindow; + Window* mWindow; - GuiComponent *mParent; - std::vector mChildren; + GuiComponent* mParent; + std::vector mChildren; unsigned char mOpacity; unsigned int mColor; diff --git a/es-core/src/HttpReq.h b/es-core/src/HttpReq.h index 78feb529a..d0b9f38ee 100644 --- a/es-core/src/HttpReq.h +++ b/es-core/src/HttpReq.h @@ -80,7 +80,7 @@ private: static CURLM* s_multi_handle; Status mStatus; - CURL *mHandle; + CURL* mHandle; std::stringstream mContent; std::string mErrorMsg; diff --git a/es-core/src/components/BadgesComponent.cpp b/es-core/src/components/BadgesComponent.cpp index 5fb20c41c..e60471bb7 100644 --- a/es-core/src/components/BadgesComponent.cpp +++ b/es-core/src/components/BadgesComponent.cpp @@ -14,11 +14,12 @@ #include "resources/TextureResource.h" // Available slot definitions. -std::vector BadgesComponent::mSlots = {SLOT_FAVORITE, SLOT_COMPLETED, SLOT_KIDS, SLOT_BROKEN, - SLOT_ALTERNATIVE_EMULATOR}; +std::vector BadgesComponent::mSlots = {SLOT_FAVORITE, SLOT_COMPLETED, SLOT_KIDS, + SLOT_BROKEN, SLOT_ALTERNATIVE_EMULATOR}; -BadgesComponent::BadgesComponent(Window *window) - : FlexboxComponent(window) { +BadgesComponent::BadgesComponent(Window* window) + : FlexboxComponent(window) +{ mBadgeIcons = std::map(); mBadgeIcons[SLOT_FAVORITE] = ":/graphics/badge_favorite.svg"; @@ -45,16 +46,17 @@ BadgesComponent::BadgesComponent(Window *window) mImageComponents.insert({SLOT_ALTERNATIVE_EMULATOR, mImageAltEmu}); } -BadgesComponent::~BadgesComponent() noexcept { - for (GuiComponent *c: mChildren) +BadgesComponent::~BadgesComponent() noexcept +{ + for (GuiComponent* c : mChildren) c->clearChildren(); clearChildren(); mBadgeIcons.clear(); mImageComponents.clear(); } - -void BadgesComponent::setValue(const std::string &value) { +void BadgesComponent::setValue(const std::string& value) +{ mChildren.clear(); if (!value.empty()) { std::string temp; @@ -94,7 +96,8 @@ void BadgesComponent::applyTheme(const std::shared_ptr& theme, bool imgChanged = false; for (auto& slot : mSlots) { - if (properties & PATH && elem->has(slot) && mBadgeIcons[slot] != elem->get(slot)) { + if (properties & PATH && elem->has(slot) && + mBadgeIcons[slot] != elem->get(slot)) { mBadgeIcons[slot] = elem->get(slot); mImageComponents.find(slot)->second.setImage(mBadgeIcons[slot], false, true, true); imgChanged = true; diff --git a/es-core/src/components/BadgesComponent.h b/es-core/src/components/BadgesComponent.h index ce158012b..27a642738 100644 --- a/es-core/src/components/BadgesComponent.h +++ b/es-core/src/components/BadgesComponent.h @@ -27,16 +27,16 @@ class TextureResource; class BadgesComponent : public FlexboxComponent { public: - BadgesComponent(Window *window); + BadgesComponent(Window* window); ~BadgesComponent() noexcept; std::string getValue() const override; // Should be a list of strings. - void setValue(const std::string &value) override; + void setValue(const std::string& value) override; - virtual void applyTheme(const std::shared_ptr &theme, - const std::string &view, - const std::string &element, + virtual void applyTheme(const std::shared_ptr& theme, + const std::string& view, + const std::string& element, unsigned int properties) override; virtual std::vector getHelpPrompts() override; diff --git a/es-core/src/components/ButtonComponent.cpp b/es-core/src/components/ButtonComponent.cpp index 94734a0b7..d7ffd4d23 100644 --- a/es-core/src/components/ButtonComponent.cpp +++ b/es-core/src/components/ButtonComponent.cpp @@ -12,15 +12,24 @@ #include "resources/Font.h" #include "utils/StringUtil.h" -ButtonComponent::ButtonComponent(Window *window, - const std::string &text, - const std::string &helpText, - const std::function &func, +ButtonComponent::ButtonComponent(Window* window, + const std::string& text, + const std::string& helpText, + const std::function& func, bool upperCase, bool flatStyle) - : GuiComponent{window}, mBox{window, ":/graphics/button.svg"}, mFont{Font::get(FONT_SIZE_MEDIUM)}, mPadding{{}}, - mFocused{false}, mEnabled{true}, mFlatStyle{flatStyle}, mTextColorFocused{0xFFFFFFFF}, - mTextColorUnfocused{0x777777FF}, mFlatColorFocused{0x878787FF}, mFlatColorUnfocused{0x60606025} { + : GuiComponent{window} + , mBox{window, ":/graphics/button.svg"} + , mFont{Font::get(FONT_SIZE_MEDIUM)} + , mPadding{{}} + , mFocused{false} + , mEnabled{true} + , mFlatStyle{flatStyle} + , mTextColorFocused{0xFFFFFFFF} + , mTextColorUnfocused{0x777777FF} + , mFlatColorFocused{0x878787FF} + , mFlatColorUnfocused{0x60606025} +{ setPressedFunc(func); setText(text, helpText, upperCase); @@ -28,7 +37,8 @@ ButtonComponent::ButtonComponent(Window *window, updateImage(); } -void ButtonComponent::onSizeChanged() { +void ButtonComponent::onSizeChanged() +{ if (mFlatStyle) return; @@ -39,24 +49,27 @@ void ButtonComponent::onSizeChanged() { glm::vec2{-cornerSize.x * 2.0f, -cornerSize.y * 2.0f}); } -void ButtonComponent::onFocusGained() { +void ButtonComponent::onFocusGained() +{ mFocused = true; if (!mFlatStyle) updateImage(); } -void ButtonComponent::onFocusLost() { +void ButtonComponent::onFocusLost() +{ mFocused = false; if (!mFlatStyle) updateImage(); } -void ButtonComponent::setText(const std::string &text, const std::string &helpText, bool upperCase) { +void ButtonComponent::setText(const std::string& text, const std::string& helpText, bool upperCase) +{ mText = upperCase ? Utils::String::toUpper(text) : text; mHelpText = helpText; mTextCache = - std::unique_ptr(mFont->buildTextCache(mText, 0.0f, 0.0f, getCurTextColor())); + std::unique_ptr(mFont->buildTextCache(mText, 0.0f, 0.0f, getCurTextColor())); float minWidth = mFont->sizeText("DELETE").x + (12.0f * Renderer::getScreenWidthModifier()); setSize(std::max(mTextCache->metrics.size.x + (12.0f * Renderer::getScreenWidthModifier()), @@ -66,13 +79,15 @@ void ButtonComponent::setText(const std::string &text, const std::string &helpTe updateHelpPrompts(); } -void ButtonComponent::setEnabled(bool state) { +void ButtonComponent::setEnabled(bool state) +{ mEnabled = state; if (!mFlatStyle) updateImage(); } -void ButtonComponent::setPadding(const glm::vec4 padding) { +void ButtonComponent::setPadding(const glm::vec4 padding) +{ if (mPadding == padding) return; @@ -80,7 +95,8 @@ void ButtonComponent::setPadding(const glm::vec4 padding) { onSizeChanged(); } -bool ButtonComponent::input(InputConfig *config, Input input) { +bool ButtonComponent::input(InputConfig* config, Input input) +{ if (config->isMappedTo("a", input) && input.value != 0) { if (mPressedFunc && mEnabled) mPressedFunc(); @@ -90,7 +106,8 @@ bool ButtonComponent::input(InputConfig *config, Input input) { return GuiComponent::input(config, input); } -void ButtonComponent::render(const glm::mat4 &parentTrans) { +void ButtonComponent::render(const glm::mat4& parentTrans) +{ glm::mat4 trans{parentTrans * getTransform()}; if (mFlatStyle) { @@ -99,13 +116,15 @@ void ButtonComponent::render(const glm::mat4 &parentTrans) { Renderer::drawRect(mPadding.x, mPadding.y, mSize.x - mPadding.x - mPadding.z, mSize.y - mPadding.y - mPadding.w, mFlatColorFocused, mFlatColorFocused); - } else { + } + else { Renderer::setMatrix(trans); Renderer::drawRect(mPadding.x, mPadding.y, mSize.x - mPadding.x - mPadding.z, mSize.y - mPadding.y - mPadding.w, mFlatColorUnfocused, mFlatColorUnfocused); } - } else { + } + else { mBox.render(trans); } @@ -131,20 +150,23 @@ void ButtonComponent::render(const glm::mat4 &parentTrans) { renderChildren(trans); } -std::vector ButtonComponent::getHelpPrompts() { +std::vector ButtonComponent::getHelpPrompts() +{ std::vector prompts; prompts.push_back(HelpPrompt("a", mHelpText.empty() ? mText.c_str() : mHelpText.c_str())); return prompts; } -unsigned int ButtonComponent::getCurTextColor() const { +unsigned int ButtonComponent::getCurTextColor() const +{ if (!mFocused) return mTextColorUnfocused; else return mTextColorFocused; } -void ButtonComponent::updateImage() { +void ButtonComponent::updateImage() +{ if (!mEnabled || !mPressedFunc) { mBox.setImagePath(":/graphics/button_filled.svg"); mBox.setCenterColor(0x770000FF); diff --git a/es-core/src/components/ButtonComponent.h b/es-core/src/components/ButtonComponent.h index 7b1dad9a3..3affa67f2 100644 --- a/es-core/src/components/ButtonComponent.h +++ b/es-core/src/components/ButtonComponent.h @@ -14,12 +14,13 @@ class TextCache; -class ButtonComponent : public GuiComponent { +class ButtonComponent : public GuiComponent +{ public: - ButtonComponent(Window *window, - const std::string &text = "", - const std::string &helpText = "", - const std::function &func = nullptr, + ButtonComponent(Window* window, + const std::string& text = "", + const std::string& helpText = "", + const std::function& func = nullptr, bool upperCase = true, bool flatStyle = false); @@ -29,9 +30,9 @@ public: void onFocusLost() override; - void setText(const std::string &text, const std::string &helpText, bool upperCase = true); + void setText(const std::string& text, const std::string& helpText, bool upperCase = true); - const std::string &getText() const { return mText; } + const std::string& getText() const { return mText; } void setPressedFunc(std::function f) { mPressedFunc = f; } @@ -45,11 +46,11 @@ public: void setFlatColorUnfocused(unsigned int color) { mFlatColorUnfocused = color; } - const std::function &getPressedFunc() const { return mPressedFunc; } + const std::function& getPressedFunc() const { return mPressedFunc; } - bool input(InputConfig *config, Input input) override; + bool input(InputConfig* config, Input input) override; - void render(const glm::mat4 &parentTrans) override; + void render(const glm::mat4& parentTrans) override; virtual std::vector getHelpPrompts() override; diff --git a/es-core/src/components/ComponentGrid.cpp b/es-core/src/components/ComponentGrid.cpp index 3f73e93c0..bd6012d12 100644 --- a/es-core/src/components/ComponentGrid.cpp +++ b/es-core/src/components/ComponentGrid.cpp @@ -245,7 +245,7 @@ const ComponentGrid::GridEntry* ComponentGrid::getCellAt(int x, int y) const bool ComponentGrid::input(InputConfig* config, Input input) { - const GridEntry *cursorEntry = getCellAt(mCursor); + const GridEntry* cursorEntry = getCellAt(mCursor); if (cursorEntry && cursorEntry->component->input(config, input)) return true; @@ -287,11 +287,12 @@ void ComponentGrid::resetCursor() } } -bool ComponentGrid::moveCursor(glm::ivec2 dir) { +bool ComponentGrid::moveCursor(glm::ivec2 dir) +{ assert(dir.x || dir.y); const glm::ivec2 origCursor{mCursor}; - const GridEntry *currentCursorEntry = getCellAt(mCursor); + const GridEntry* currentCursorEntry = getCellAt(mCursor); glm::ivec2 searchAxis(dir.x == 0, dir.y == 0); // Logic to handle entries that span several cells. @@ -325,7 +326,7 @@ bool ComponentGrid::moveCursor(glm::ivec2 dir) { while (mCursor.x >= 0 && mCursor.y >= 0 && mCursor.x < mGridSize.x && mCursor.y < mGridSize.y) { mCursor = mCursor + dir; glm::ivec2 curDirPos{mCursor}; - const GridEntry *cursorEntry; + const GridEntry* cursorEntry; // Spread out on search axis+ while (mCursor.x < mGridSize.x && mCursor.y < mGridSize.y && mCursor.x >= 0 && @@ -367,7 +368,8 @@ bool ComponentGrid::moveCursor(glm::ivec2 dir) { return false; } -void ComponentGrid::moveCursorTo(int xPos, int yPos, bool selectLeftCell) { +void ComponentGrid::moveCursorTo(int xPos, int yPos, bool selectLeftCell) +{ const glm::ivec2 origCursor{mCursor}; if (xPos != -1) @@ -375,7 +377,7 @@ void ComponentGrid::moveCursorTo(int xPos, int yPos, bool selectLeftCell) { if (yPos != -1) mCursor.y = yPos; - const GridEntry *currentCursorEntry = getCellAt(mCursor); + const GridEntry* currentCursorEntry = getCellAt(mCursor); // If requested, select the leftmost cell of entries wider than 1 cell. if (selectLeftCell && mCursor.x > currentCursorEntry->pos.x) @@ -384,14 +386,16 @@ void ComponentGrid::moveCursorTo(int xPos, int yPos, bool selectLeftCell) { onCursorMoved(origCursor, mCursor); } -void ComponentGrid::onFocusLost() { - const GridEntry *cursorEntry = getCellAt(mCursor); +void ComponentGrid::onFocusLost() +{ + const GridEntry* cursorEntry = getCellAt(mCursor); if (cursorEntry) cursorEntry->component->onFocusLost(); } -void ComponentGrid::onFocusGained() { - const GridEntry *cursorEntry = getCellAt(mCursor); +void ComponentGrid::onFocusGained() +{ + const GridEntry* cursorEntry = getCellAt(mCursor); if (cursorEntry) cursorEntry->component->onFocusGained(); } diff --git a/es-core/src/components/ComponentGrid.h b/es-core/src/components/ComponentGrid.h index 59f1ca852..94300ae68 100644 --- a/es-core/src/components/ComponentGrid.h +++ b/es-core/src/components/ComponentGrid.h @@ -30,33 +30,35 @@ namespace GridFlags } // namespace GridFlags // Provides basic layout of components in an X*Y grid. -class ComponentGrid : public GuiComponent { +class ComponentGrid : public GuiComponent +{ public: - ComponentGrid(Window *window, const glm::ivec2 &gridDimensions); + ComponentGrid(Window* window, const glm::ivec2& gridDimensions); virtual ~ComponentGrid(); - bool removeEntry(const std::shared_ptr &comp); + bool removeEntry(const std::shared_ptr& comp); - void setEntry(const std::shared_ptr &comp, - const glm::ivec2 &pos, + void setEntry(const std::shared_ptr& comp, + const glm::ivec2& pos, bool canFocus, bool resize = true, - const glm::ivec2 &size = glm::ivec2{1, 1}, + const glm::ivec2& size = glm::ivec2{1, 1}, unsigned int border = GridFlags::BORDER_NONE, GridFlags::UpdateType updateType = GridFlags::UPDATE_ALWAYS); - void setPastBoundaryCallback(const std::function &func) { + void setPastBoundaryCallback(const std::function& func) + { mPastBoundaryCallback = func; } - void textInput(const std::string &text) override; + void textInput(const std::string& text) override; - bool input(InputConfig *config, Input input) override; + bool input(InputConfig* config, Input input) override; void update(int deltaTime) override; - void render(const glm::mat4 &parentTrans) override; + void render(const glm::mat4& parentTrans) override; void onSizeChanged() override; @@ -80,10 +82,11 @@ public: // Pass -1 for xPos or yPos to keep its axis cursor position. void moveCursorTo(int xPos, int yPos, bool selectLeftCell = false); - void setCursorTo(const std::shared_ptr &comp); + void setCursorTo(const std::shared_ptr& comp); - std::shared_ptr getSelectedComponent() { - const GridEntry *e = getCellAt(mCursor); + std::shared_ptr getSelectedComponent() + { + const GridEntry* e = getCellAt(mCursor); if (e) return e->component; else @@ -129,25 +132,25 @@ private: }; // Update position and size. - void updateCellComponent(const GridEntry &cell); + void updateCellComponent(const GridEntry& cell); void updateSeparators(); void onCursorMoved(glm::ivec2 from, glm::ivec2 to); - const GridEntry *getCellAt(int x, int y) const; + const GridEntry* getCellAt(int x, int y) const; - const GridEntry *getCellAt(const glm::ivec2 &pos) const { return getCellAt(pos.x, pos.y); } + const GridEntry* getCellAt(const glm::ivec2& pos) const { return getCellAt(pos.x, pos.y); } std::vector> mSeparators; glm::ivec2 mGridSize; std::vector mCells; glm::ivec2 mCursor; - std::function mPastBoundaryCallback; + std::function mPastBoundaryCallback; - float *mRowHeights; - float *mColWidths; + float* mRowHeights; + float* mColWidths; }; #endif // ES_CORE_COMPONENTS_COMPONENT_GRID_H diff --git a/es-core/src/components/ComponentList.cpp b/es-core/src/components/ComponentList.cpp index 230e66500..db6e65fff 100644 --- a/es-core/src/components/ComponentList.cpp +++ b/es-core/src/components/ComponentList.cpp @@ -71,10 +71,11 @@ bool ComponentList::input(InputConfig* config, Input input) if (mEntries.at(mCursor).data.input_handler) { if (mEntries.at(mCursor).data.input_handler(config, input)) return true; - } else { + } + else { // No input handler assigned, do the default, which is to give it // to the rightmost element in the row. - auto &row = mEntries.at(mCursor).data; + auto& row = mEntries.at(mCursor).data; if (row.elements.size()) { if (row.elements.back().component->input(config, input)) return true; @@ -196,7 +197,7 @@ void ComponentList::render(const glm::mat4& parentTrans) std::vector drawAfterCursor; bool drawAll; for (size_t i = 0; i < mEntries.size(); i++) { - auto &entry = mEntries.at(i); + auto& entry = mEntries.at(i); drawAll = !mFocused || i != static_cast(mCursor); for (auto it = entry.data.elements.cbegin(); it != entry.data.elements.cend(); it++) { if (drawAll || it->invert_when_selected) { diff --git a/es-core/src/components/DateTimeEditComponent.cpp b/es-core/src/components/DateTimeEditComponent.cpp index b1d6b3664..23b900aae 100644 --- a/es-core/src/components/DateTimeEditComponent.cpp +++ b/es-core/src/components/DateTimeEditComponent.cpp @@ -12,10 +12,17 @@ #include "resources/Font.h" #include "utils/StringUtil.h" -DateTimeEditComponent::DateTimeEditComponent(Window *window, bool alignRight, DisplayMode dispMode) - : GuiComponent(window), mEditing(false), mEditIndex(0), mDisplayMode(dispMode), mRelativeUpdateAccumulator(0), - mColor(0x777777FF), mFont(Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT)), mAlignRight(alignRight), - mUppercase(false), mAutoSize(true) +DateTimeEditComponent::DateTimeEditComponent(Window* window, bool alignRight, DisplayMode dispMode) + : GuiComponent(window) + , mEditing(false) + , mEditIndex(0) + , mDisplayMode(dispMode) + , mRelativeUpdateAccumulator(0) + , mColor(0x777777FF) + , mFont(Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT)) + , mAlignRight(alignRight) + , mUppercase(false) + , mAutoSize(true) { updateTextCache(); } diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index 6665b2883..9213ae095 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -60,9 +60,7 @@ void FlexboxComponent::setItemWidth(float value) } float FlexboxComponent::getItemWidth() { return mItemWidth; } -void FlexboxComponent::onSizeChanged() { - mLayoutValid = false; -} +void FlexboxComponent::onSizeChanged() { mLayoutValid = false; } void FlexboxComponent::computeLayout() { @@ -95,9 +93,9 @@ void FlexboxComponent::computeLayout() // Pre-compute layout parameters. int n = mChildren.size(); - int nLines = std::max(1, (int) std::ceil(n / std::max(1, (int) mItemsPerLine))); + int nLines = std::max(1, (int)std::ceil(n / std::max(1, (int)mItemsPerLine))); float lineWidth = - (mDirection == "row" ? (maxItemSize.y + mItemMargin.y) : (maxItemSize.x + mItemMargin.x)); + (mDirection == "row" ? (maxItemSize.y + mItemMargin.y) : (maxItemSize.x + mItemMargin.x)); float anchorXStart = anchorX; float anchorYStart = anchorY; @@ -106,14 +104,15 @@ void FlexboxComponent::computeLayout() if (mDirection == "row") { totalSize.x += (mItemMargin.x + mItemWidth) * mItemsPerLine; totalSize.y += (mItemMargin.y + maxItemSize.y) * nLines; - } else { + } + else { totalSize.x += (mItemMargin.x + mItemWidth) * nLines; totalSize.y += (mItemMargin.y + maxItemSize.y) * mItemsPerLine; } // Iterate through the children. for (int i = 0; i < n; i++) { - GuiComponent *child = mChildren[i]; + GuiComponent* child = mChildren[i]; auto size = child->getSize(); // Top-left anchor position. @@ -132,10 +131,12 @@ void FlexboxComponent::computeLayout() if (mAlign == ITEM_ALIGN_END) { x += directionLine.x == 0 ? (maxItemSize.x - size.x) : 0; y += directionLine.y == 0 ? (maxItemSize.y - size.y) : 0; - } else if (mAlign == ITEM_ALIGN_CENTER) { + } + else if (mAlign == ITEM_ALIGN_CENTER) { x += directionLine.x == 0 ? (maxItemSize.x - size.x) / 2 : 0; y += directionLine.y == 0 ? (maxItemSize.y - size.y) / 2 : 0; - } else if (mAlign == ITEM_ALIGN_STRETCH && mDirection == "row") { + } + else if (mAlign == ITEM_ALIGN_STRETCH && mDirection == "row") { child->setSize(child->getSize().x, maxItemSize.y); } @@ -149,7 +150,7 @@ void FlexboxComponent::computeLayout() child->setPosition(getPosition().x + x, getPosition().y + y); // Translate anchor. - if ((i + 1) % std::max(1, (int) mItemsPerLine) != 0) { + if ((i + 1) % std::max(1, (int)mItemsPerLine) != 0) { // Translate on same line. anchorX += (size.x + mItemMargin.x) * directionLine.x; anchorY += (size.y + mItemMargin.y) * directionLine.y; @@ -159,7 +160,8 @@ void FlexboxComponent::computeLayout() if (directionRow.x == 0) { anchorY += lineWidth * directionRow.y; anchorX = anchorXStart; - } else { + } + else { anchorX += lineWidth * directionRow.x; anchorY = anchorYStart; } @@ -169,7 +171,8 @@ void FlexboxComponent::computeLayout() mLayoutValid = true; } -void FlexboxComponent::render(const glm::mat4& parentTrans) { +void FlexboxComponent::render(const glm::mat4& parentTrans) +{ if (!isVisible()) return; diff --git a/es-core/src/components/HelpComponent.cpp b/es-core/src/components/HelpComponent.cpp index 3729f5a32..69c1ae32c 100644 --- a/es-core/src/components/HelpComponent.cpp +++ b/es-core/src/components/HelpComponent.cpp @@ -37,36 +37,36 @@ void HelpComponent::assignIcons() ":/help/dpad_updown.svg" : mStyle.mCustomButtons.dpad_updown; sIconPathMap["left/right"] = mStyle.mCustomButtons.dpad_leftright.empty() ? - ":/help/dpad_leftright.svg" : - mStyle.mCustomButtons.dpad_leftright; + ":/help/dpad_leftright.svg" : + mStyle.mCustomButtons.dpad_leftright; sIconPathMap["up/down/left/right"] = mStyle.mCustomButtons.dpad_all.empty() ? - ":/help/dpad_all.svg" : - mStyle.mCustomButtons.dpad_all; + ":/help/dpad_all.svg" : + mStyle.mCustomButtons.dpad_all; sIconPathMap["thumbstickclick"] = mStyle.mCustomButtons.thumbstick_click.empty() ? - ":/help/thumbstick_click.svg" : - mStyle.mCustomButtons.thumbstick_click; + ":/help/thumbstick_click.svg" : + mStyle.mCustomButtons.thumbstick_click; sIconPathMap["l"] = mStyle.mCustomButtons.button_l.empty() ? ":/help/button_l.svg" : - mStyle.mCustomButtons.button_l; + mStyle.mCustomButtons.button_l; sIconPathMap["r"] = mStyle.mCustomButtons.button_r.empty() ? ":/help/button_r.svg" : - mStyle.mCustomButtons.button_r; + mStyle.mCustomButtons.button_r; sIconPathMap["lr"] = mStyle.mCustomButtons.button_lr.empty() ? ":/help/button_lr.svg" : - mStyle.mCustomButtons.button_lr; + mStyle.mCustomButtons.button_lr; sIconPathMap["lt"] = mStyle.mCustomButtons.button_lt.empty() ? ":/help/button_lt.svg" : - mStyle.mCustomButtons.button_lt; + mStyle.mCustomButtons.button_lt; sIconPathMap["rt"] = mStyle.mCustomButtons.button_rt.empty() ? ":/help/button_rt.svg" : - mStyle.mCustomButtons.button_rt; + mStyle.mCustomButtons.button_rt; // These graphics files are custom per controller type. if (controllerType == "snes") { sIconPathMap["a"] = mStyle.mCustomButtons.button_a_SNES.empty() ? - ":/help/button_a_SNES.svg" : - mStyle.mCustomButtons.button_a_SNES; + ":/help/button_a_SNES.svg" : + mStyle.mCustomButtons.button_a_SNES; sIconPathMap["b"] = mStyle.mCustomButtons.button_b_SNES.empty() ? - ":/help/button_b_SNES.svg" : - mStyle.mCustomButtons.button_b_SNES; + ":/help/button_b_SNES.svg" : + mStyle.mCustomButtons.button_b_SNES; sIconPathMap["x"] = mStyle.mCustomButtons.button_x_SNES.empty() ? - ":/help/button_x_SNES.svg" : - mStyle.mCustomButtons.button_x_SNES; + ":/help/button_x_SNES.svg" : + mStyle.mCustomButtons.button_x_SNES; sIconPathMap["y"] = mStyle.mCustomButtons.button_y_SNES.empty() ? ":/help/button_y_SNES.svg" : mStyle.mCustomButtons.button_y_SNES; diff --git a/es-core/src/components/ImageComponent.cpp b/es-core/src/components/ImageComponent.cpp index 0787d53d5..b7c982530 100644 --- a/es-core/src/components/ImageComponent.cpp +++ b/es-core/src/components/ImageComponent.cpp @@ -27,11 +27,23 @@ glm::vec2 ImageComponent::getSize() const return GuiComponent::getSize() * (mBottomRightCrop - mTopLeftCrop); } -ImageComponent::ImageComponent(Window *window, bool forceLoad, bool dynamic) - : GuiComponent(window), mTargetSize({}), mFlipX(false), mFlipY(false), mTargetIsMax(false), mTargetIsMin(false), - mColorShift(0xFFFFFFFF), mColorShiftEnd(0xFFFFFFFF), mColorGradientHorizontal(true), mFadeOpacity(0), - mFading(false), mForceLoad(forceLoad), mDynamic(dynamic), mRotateByTargetSize(false), mTopLeftCrop({}), - mBottomRightCrop(1.0f, 1.0f) +ImageComponent::ImageComponent(Window* window, bool forceLoad, bool dynamic) + : GuiComponent(window) + , mTargetSize({}) + , mFlipX(false) + , mFlipY(false) + , mTargetIsMax(false) + , mTargetIsMin(false) + , mColorShift(0xFFFFFFFF) + , mColorShiftEnd(0xFFFFFFFF) + , mColorGradientHorizontal(true) + , mFadeOpacity(0) + , mFading(false) + , mForceLoad(forceLoad) + , mDynamic(dynamic) + , mRotateByTargetSize(false) + , mTopLeftCrop({}) + , mBottomRightCrop(1.0f, 1.0f) { updateColors(); } @@ -126,7 +138,8 @@ void ImageComponent::resize() onSizeChanged(); } -void ImageComponent::setImage(std::string path, bool tile, bool linearMagnify, bool cacheImage) { +void ImageComponent::setImage(std::string path, bool tile, bool linearMagnify, bool cacheImage) +{ // Always load bundled graphic resources statically, unless mForceLoad has been set. // This eliminates annoying texture pop-in problems that would otherwise occur. if (!mForceLoad && (path[0] == ':') && (path[1] == '/')) { @@ -137,11 +150,12 @@ void ImageComponent::setImage(std::string path, bool tile, bool linearMagnify, b if (mDefaultPath.empty() || !ResourceManager::getInstance()->fileExists(mDefaultPath)) mTexture.reset(); else - mTexture = - TextureResource::get(mDefaultPath, tile, mForceLoad, mDynamic, linearMagnify, 1.0f, cacheImage); + mTexture = TextureResource::get(mDefaultPath, tile, mForceLoad, mDynamic, linearMagnify, + 1.0f, cacheImage); } else { - mTexture = TextureResource::get(path, tile, mForceLoad, mDynamic, linearMagnify, 1.0f, cacheImage); + mTexture = + TextureResource::get(path, tile, mForceLoad, mDynamic, linearMagnify, 1.0f, cacheImage); } resize(); diff --git a/es-core/src/components/ImageComponent.h b/es-core/src/components/ImageComponent.h index c0bb05c91..474f46a1e 100644 --- a/es-core/src/components/ImageComponent.h +++ b/es-core/src/components/ImageComponent.h @@ -14,9 +14,10 @@ class TextureResource; -class ImageComponent : public GuiComponent { +class ImageComponent : public GuiComponent +{ public: - ImageComponent(Window *window, bool forceLoad = false, bool dynamic = true); + ImageComponent(Window* window, bool forceLoad = false, bool dynamic = true); virtual ~ImageComponent() noexcept {}; @@ -24,13 +25,16 @@ public: // Loads the image at the given filepath. Will tile if tile is true (retrieves texture // as tiling, creates vertices accordingly). - void setImage(std::string path, bool tile = false, bool linearMagnify = false, bool cacheSVG = false); + void setImage(std::string path, + bool tile = false, + bool linearMagnify = false, + bool cacheSVG = false); // Loads an image from memory. - void setImage(const char *data, size_t length, bool tile = false); + void setImage(const char* data, size_t length, bool tile = false); // Use an already existing texture. - void setImage(const std::shared_ptr &texture); + void setImage(const std::shared_ptr& texture); void onSizeChanged() override { updateVertices(); } diff --git a/es-core/src/guis/GuiInputConfig.cpp b/es-core/src/guis/GuiInputConfig.cpp index aa9767459..516d17c6e 100644 --- a/es-core/src/guis/GuiInputConfig.cpp +++ b/es-core/src/guis/GuiInputConfig.cpp @@ -181,7 +181,7 @@ GuiInputConfig::GuiInputConfig(Window* window, }; buttons.push_back( - std::make_shared(mWindow, "OK", "ok", [okFunction] { okFunction(); })); + std::make_shared(mWindow, "OK", "ok", [okFunction] { okFunction(); })); mButtonGrid = makeButtonGrid(mWindow, buttons); mGrid.setEntry(mButtonGrid, glm::ivec2{0, 6}, true, false); diff --git a/es-core/src/guis/GuiMsgBox.cpp b/es-core/src/guis/GuiMsgBox.cpp index 5e648eb26..0e0a7fcb2 100644 --- a/es-core/src/guis/GuiMsgBox.cpp +++ b/es-core/src/guis/GuiMsgBox.cpp @@ -15,18 +15,22 @@ #define HORIZONTAL_PADDING_PX 20.0f GuiMsgBox::GuiMsgBox(Window* window, - const HelpStyle &helpstyle, - const std::string &text, - const std::string &name1, - const std::function &func1, - const std::string &name2, - const std::function &func2, - const std::string &name3, - const std::function &func3, + const HelpStyle& helpstyle, + const std::string& text, + const std::string& name1, + const std::function& func1, + const std::string& name2, + const std::function& func2, + const std::string& name3, + const std::function& func3, bool disableBackButton, bool deleteOnButtonPress) - : GuiComponent(window), mBackground(window, ":/graphics/frame.svg"), mGrid(window, glm::ivec2{1, 2}), - mHelpStyle(helpstyle), mDisableBackButton(disableBackButton), mDeleteOnButtonPress(deleteOnButtonPress) + : GuiComponent(window) + , mBackground(window, ":/graphics/frame.svg") + , mGrid(window, glm::ivec2{1, 2}) + , mHelpStyle(helpstyle) + , mDisableBackButton(disableBackButton) + , mDeleteOnButtonPress(deleteOnButtonPress) { // Adjust the width relative to the aspect ratio of the screen to make the GUI look coherent // regardless of screen type. The 1.778 aspect ratio value is the 16:9 reference. diff --git a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp index 4edd8d95b..504fc942c 100644 --- a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp +++ b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp @@ -74,33 +74,47 @@ std::vector> kbLastRowLoad{ // clang-format on GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( - Window *window, - const HelpStyle &helpstyle, - const std::string &title, - const std::string &initValue, - const std::function &okCallback, - bool multiLine, - const std::string &acceptBtnHelpText, - const std::string &saveConfirmationText, - const std::string &infoString, - const std::string &defaultValue, - const std::string &loadBtnHelpText, - const std::string &clearBtnHelpText, - const std::string &cancelBtnHelpText) - : GuiComponent{window}, mBackground{window, ":/graphics/frame.svg"}, - mGrid{window, glm::ivec2{1, (infoString != "" && defaultValue != "" ? 8 : 6)}}, mHelpStyle{helpstyle}, - mInitValue{initValue}, mAcceptBtnHelpText{acceptBtnHelpText}, mSaveConfirmationText{saveConfirmationText}, - mLoadBtnHelpText{loadBtnHelpText}, mClearBtnHelpText{clearBtnHelpText}, mCancelBtnHelpText{cancelBtnHelpText}, - mOkCallback{okCallback}, mMultiLine{multiLine}, mComplexMode{(infoString != "" && defaultValue != "")}, - mDeleteRepeat{false}, mShift{false}, mAlt{false}, mDeleteRepeatTimer{0}, mNavigationRepeatTimer{0}, - mNavigationRepeatDirX{0}, mNavigationRepeatDirY{0} { + Window* window, + const HelpStyle& helpstyle, + const std::string& title, + const std::string& initValue, + const std::function& okCallback, + bool multiLine, + const std::string& acceptBtnHelpText, + const std::string& saveConfirmationText, + const std::string& infoString, + const std::string& defaultValue, + const std::string& loadBtnHelpText, + const std::string& clearBtnHelpText, + const std::string& cancelBtnHelpText) + : GuiComponent{window} + , mBackground{window, ":/graphics/frame.svg"} + , mGrid{window, glm::ivec2{1, (infoString != "" && defaultValue != "" ? 8 : 6)}} + , mHelpStyle{helpstyle} + , mInitValue{initValue} + , mAcceptBtnHelpText{acceptBtnHelpText} + , mSaveConfirmationText{saveConfirmationText} + , mLoadBtnHelpText{loadBtnHelpText} + , mClearBtnHelpText{clearBtnHelpText} + , mCancelBtnHelpText{cancelBtnHelpText} + , mOkCallback{okCallback} + , mMultiLine{multiLine} + , mComplexMode{(infoString != "" && defaultValue != "")} + , mDeleteRepeat{false} + , mShift{false} + , mAlt{false} + , mDeleteRepeatTimer{0} + , mNavigationRepeatTimer{0} + , mNavigationRepeatDirX{0} + , mNavigationRepeatDirY{0} +{ addChild(&mBackground); addChild(&mGrid); mTitle = std::make_shared(mWindow, Utils::String::toUpper(title), Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER); - std::vector> kbLayout; + std::vector> kbLayout; // At the moment there is only the US keyboard layout available. kbLayout.insert(kbLayout.cend(), kbBaseUS.cbegin(), kbBaseUS.cend()); @@ -114,7 +128,7 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( mHorizontalKeyCount = static_cast(kbLayout[0].size()); mKeyboardGrid = std::make_shared( - mWindow, glm::ivec2(mHorizontalKeyCount, static_cast(kbLayout.size()) / 3)); + mWindow, glm::ivec2(mHorizontalKeyCount, static_cast(kbLayout.size()) / 3)); mText = std::make_shared(mWindow); mText->setValue(initValue); @@ -129,11 +143,11 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( if (mComplexMode) { mInfoString = std::make_shared( - mWindow, infoString, Font::get(FONT_SIZE_MEDIUM), 0x555555FF, ALIGN_CENTER); + mWindow, infoString, Font::get(FONT_SIZE_MEDIUM), 0x555555FF, ALIGN_CENTER); mGrid.setEntry(mInfoString, glm::ivec2{0, yPos}, false, true); mDefaultValue = std::make_shared( - mWindow, defaultValue, Font::get(FONT_SIZE_SMALL), 0x555555FF, ALIGN_CENTER); + mWindow, defaultValue, Font::get(FONT_SIZE_SMALL), 0x555555FF, ALIGN_CENTER); mGrid.setEntry(mDefaultValue, glm::ivec2{0, yPos + 1}, false, true); yPos += 2; } @@ -164,17 +178,20 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( upper = DELETE_SYMBOL; alted = DELETE_SYMBOL; altshifted = DELETE_SYMBOL; - } else if (lower == "OK") { + } + else if (lower == "OK") { lower = OK_SYMBOL; upper = OK_SYMBOL; alted = OK_SYMBOL; altshifted = OK_SYMBOL; - } else if (lower == "SPACE") { + } + else if (lower == "SPACE") { lower = " "; upper = " "; alted = " "; altshifted = " "; - } else if (lower != "SHIFT" && lower.length() > 1) { + } + else if (lower != "SHIFT" && lower.length() > 1) { lower = (lower.c_str()); upper = (upper.c_str()); alted = (alted.c_str()); @@ -183,19 +200,21 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( if (lower == "SHIFT") { mShiftButton = std::make_shared( - mWindow, (SHIFT_SYMBOL), ("SHIFT"), [this] { shiftKeys(); }, false, true); + mWindow, (SHIFT_SYMBOL), ("SHIFT"), [this] { shiftKeys(); }, false, true); button = mShiftButton; - } else if (lower == "ALT") { + } + else if (lower == "ALT") { mAltButton = std::make_shared( - mWindow, (ALT_SYMBOL), ("ALT"), [this] { altKeys(); }, false, true); + mWindow, (ALT_SYMBOL), ("ALT"), [this] { altKeys(); }, false, true); button = mAltButton; - } else { + } + else { button = makeButton(lower, upper, alted, altshifted); } button->setPadding( - glm::vec4(BUTTON_GRID_HORIZ_PADDING / 4.0f, BUTTON_GRID_HORIZ_PADDING / 4.0f, - BUTTON_GRID_HORIZ_PADDING / 4.0f, BUTTON_GRID_HORIZ_PADDING / 4.0f)); + glm::vec4(BUTTON_GRID_HORIZ_PADDING / 4.0f, BUTTON_GRID_HORIZ_PADDING / 4.0f, + BUTTON_GRID_HORIZ_PADDING / 4.0f, BUTTON_GRID_HORIZ_PADDING / 4.0f)); buttons.push_back(button); int colSpan = 1; @@ -233,13 +252,14 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( mText->setSize(0.0f, textHeight); // If attempting to navigate beyond the edge of the keyboard grid, then wrap around. - mGrid.setPastBoundaryCallback([this, kbLayout](InputConfig *config, Input input) -> bool { + mGrid.setPastBoundaryCallback([this, kbLayout](InputConfig* config, Input input) -> bool { if (config->isMappedLike("left", input)) { if (mGrid.getSelectedComponent() == mKeyboardGrid) { mKeyboardGrid->moveCursorTo(mHorizontalKeyCount - 1, -1, true); return true; } - } else if (config->isMappedLike("right", input)) { + } + else if (config->isMappedLike("right", input)) { if (mGrid.getSelectedComponent() == mKeyboardGrid) { mKeyboardGrid->moveCursorTo(0, -1); return true; @@ -259,7 +279,8 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( setPosition((static_cast(Renderer::getScreenWidth()) - mSize.x) / 2.0f, (static_cast(Renderer::getScreenHeight()) - mSize.y) / 2.0f); - } else { + } + else { if (mComplexMode) setSize(width, KEYBOARD_HEIGHT + mDefaultValue->getSize().y * 3.0f); else @@ -270,7 +291,8 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( } } -void GuiTextEditKeyboardPopup::onSizeChanged() { +void GuiTextEditKeyboardPopup::onSizeChanged() +{ mBackground.fitTo(mSize, glm::vec3{}, glm::vec2{-32.0f, -32.0f}); mText->setSize(mSize.x - KEYBOARD_PADDINGX - KEYBOARD_PADDINGX, mText->getSize().y); @@ -281,7 +303,8 @@ void GuiTextEditKeyboardPopup::onSizeChanged() { mGrid.setRowHeightPerc(1, (mInfoString->getSize().y * 0.6f) / mSize.y); mGrid.setRowHeightPerc(2, (mDefaultValue->getSize().y * 1.6f) / mSize.y); mGrid.setRowHeightPerc(1, (mText->getSize().y * 1.0f) / mSize.y); - } else if (mMultiLine) { + } + else if (mMultiLine) { mGrid.setRowHeightPerc(1, (mText->getSize().y * 1.15f) / mSize.y); } @@ -296,7 +319,8 @@ void GuiTextEditKeyboardPopup::onSizeChanged() { mKeyboardGrid->setPosition(KEYBOARD_PADDINGX, pos.y); } -bool GuiTextEditKeyboardPopup::input(InputConfig *config, Input input) { +bool GuiTextEditKeyboardPopup::input(InputConfig* config, Input input) +{ // Enter/return key or numpad enter key accepts the changes. if (config->getDeviceId() == DEVICE_KEYBOARD && mText->isEditing() && !mMultiLine && input.value && (input.id == SDLK_RETURN || input.id == SDLK_KP_ENTER)) { @@ -304,7 +328,7 @@ bool GuiTextEditKeyboardPopup::input(InputConfig *config, Input input) { delete this; return true; } - // Dito for the A button if using a controller. + // Dito for the A button if using a controller. else if (config->getDeviceId() != DEVICE_KEYBOARD && mText->isEditing() && config->isMappedTo("a", input) && input.value) { this->mOkCallback(mText->getValue()); @@ -330,18 +354,19 @@ bool GuiTextEditKeyboardPopup::input(InputConfig *config, Input input) { if (mText->getValue() != mInitValue) { // Changes were made, ask if the user wants to save them. mWindow->pushGui(new GuiMsgBox( - mWindow, mHelpStyle, mSaveConfirmationText, "YES", - [this] { - this->mOkCallback(mText->getValue()); - delete this; - return true; - }, - "NO", - [this] { - delete this; - return true; - })); - } else { + mWindow, mHelpStyle, mSaveConfirmationText, "YES", + [this] { + this->mOkCallback(mText->getValue()); + delete this; + return true; + }, + "NO", + [this] { + delete this; + return true; + })); + } + else { delete this; return true; } @@ -374,7 +399,8 @@ bool GuiTextEditKeyboardPopup::input(InputConfig *config, Input input) { if (!editing) mText->stopEditing(); - } else { + } + else { mDeleteRepeat = false; } return true; @@ -400,7 +426,8 @@ bool GuiTextEditKeyboardPopup::input(InputConfig *config, Input input) { if (input.value) { mNavigationRepeatDirX = -1; mNavigationRepeatTimer = -(NAVIGATION_REPEAT_START_DELAY - NAVIGATION_REPEAT_SPEED); - } else { + } + else { mNavigationRepeatDirX = 0; } } @@ -409,7 +436,8 @@ bool GuiTextEditKeyboardPopup::input(InputConfig *config, Input input) { if (input.value) { mNavigationRepeatDirX = 1; mNavigationRepeatTimer = -(NAVIGATION_REPEAT_START_DELAY - NAVIGATION_REPEAT_SPEED); - } else { + } + else { mNavigationRepeatDirX = 0; } } @@ -418,7 +446,8 @@ bool GuiTextEditKeyboardPopup::input(InputConfig *config, Input input) { if (input.value) { mNavigationRepeatDirY = -1; mNavigationRepeatTimer = -(NAVIGATION_REPEAT_START_DELAY - NAVIGATION_REPEAT_SPEED); - } else { + } + else { mNavigationRepeatDirY = 0; } } @@ -427,7 +456,8 @@ bool GuiTextEditKeyboardPopup::input(InputConfig *config, Input input) { if (input.value) { mNavigationRepeatDirY = 1; mNavigationRepeatTimer = -(NAVIGATION_REPEAT_START_DELAY - NAVIGATION_REPEAT_SPEED); - } else { + } + else { mNavigationRepeatDirY = 0; } } @@ -438,19 +468,22 @@ bool GuiTextEditKeyboardPopup::input(InputConfig *config, Input input) { return false; } -void GuiTextEditKeyboardPopup::update(int deltaTime) { +void GuiTextEditKeyboardPopup::update(int deltaTime) +{ updateNavigationRepeat(deltaTime); updateDeleteRepeat(deltaTime); GuiComponent::update(deltaTime); } -std::vector GuiTextEditKeyboardPopup::getHelpPrompts() { +std::vector GuiTextEditKeyboardPopup::getHelpPrompts() +{ std::vector prompts = mGrid.getHelpPrompts(); if (!mText->isEditing()) { prompts.push_back(HelpPrompt("lt", "shift")); prompts.push_back(HelpPrompt("rt", "alt")); - } else { + } + else { prompts.push_back(HelpPrompt("a", mAcceptBtnHelpText)); } @@ -480,7 +513,8 @@ std::vector GuiTextEditKeyboardPopup::getHelpPrompts() { return prompts; } -void GuiTextEditKeyboardPopup::updateDeleteRepeat(int deltaTime) { +void GuiTextEditKeyboardPopup::updateDeleteRepeat(int deltaTime) +{ if (!mDeleteRepeat) return; @@ -500,7 +534,8 @@ void GuiTextEditKeyboardPopup::updateDeleteRepeat(int deltaTime) { } } -void GuiTextEditKeyboardPopup::updateNavigationRepeat(int deltaTime) { +void GuiTextEditKeyboardPopup::updateNavigationRepeat(int deltaTime) +{ if (mNavigationRepeatDirX == 0 && mNavigationRepeatDirY == 0) return; @@ -527,13 +562,15 @@ void GuiTextEditKeyboardPopup::updateNavigationRepeat(int deltaTime) { } } -void GuiTextEditKeyboardPopup::shiftKeys() { +void GuiTextEditKeyboardPopup::shiftKeys() +{ mShift = !mShift; if (mShift) { mShiftButton->setFlatColorFocused(0xFF2222FF); mShiftButton->setFlatColorUnfocused(0xFF2222FF); - } else { + } + else { mShiftButton->setFlatColorFocused(0x878787FF); mShiftButton->setFlatColorUnfocused(0x60606025); } @@ -547,9 +584,10 @@ void GuiTextEditKeyboardPopup::shiftKeys() { if (mAlt) { altKeys(); altKeys(); - } else { - for (auto &kb: mKeyboardButtons) { - const std::string &text = mShift ? kb.shiftedKey : kb.key; + } + else { + for (auto& kb : mKeyboardButtons) { + const std::string& text = mShift ? kb.shiftedKey : kb.key; auto sz = kb.button->getSize(); kb.button->setText(text, text, false); kb.button->setSize(sz); @@ -557,13 +595,15 @@ void GuiTextEditKeyboardPopup::shiftKeys() { } } -void GuiTextEditKeyboardPopup::altKeys() { +void GuiTextEditKeyboardPopup::altKeys() +{ mAlt = !mAlt; if (mAlt) { mAltButton->setFlatColorFocused(0xFF2222FF); mAltButton->setFlatColorUnfocused(0xFF2222FF); - } else { + } + else { mAltButton->setFlatColorFocused(0x878787FF); mAltButton->setFlatColorUnfocused(0x60606025); } @@ -577,9 +617,10 @@ void GuiTextEditKeyboardPopup::altKeys() { if (mShift) { shiftKeys(); shiftKeys(); - } else { - for (auto &kb: mKeyboardButtons) { - const std::string &text = mAlt ? kb.altedKey : kb.key; + } + else { + for (auto& kb : mKeyboardButtons) { + const std::string& text = mAlt ? kb.altedKey : kb.key; auto sz = kb.button->getSize(); kb.button->setText(text, text, false); kb.button->setSize(sz); @@ -587,9 +628,10 @@ void GuiTextEditKeyboardPopup::altKeys() { } } -void GuiTextEditKeyboardPopup::altShiftKeys() { - for (auto &kb: mKeyboardButtons) { - const std::string &text = kb.altshiftedKey; +void GuiTextEditKeyboardPopup::altShiftKeys() +{ + for (auto& kb : mKeyboardButtons) { + const std::string& text = kb.altshiftedKey; auto sz = kb.button->getSize(); kb.button->setText(text, text, false); kb.button->setSize(sz); @@ -597,56 +639,62 @@ void GuiTextEditKeyboardPopup::altShiftKeys() { } std::shared_ptr GuiTextEditKeyboardPopup::makeButton( - const std::string &key, - const std::string &shiftedKey, - const std::string &altedKey, - const std::string &altshiftedKey) { + const std::string& key, + const std::string& shiftedKey, + const std::string& altedKey, + const std::string& altshiftedKey) +{ std::shared_ptr button = std::make_shared( - mWindow, key, key, - [this, key, shiftedKey, altedKey, altshiftedKey] { - if (key == (OK_SYMBOL) || key.find("OK") != std::string::npos) { - mOkCallback(mText->getValue()); - delete this; - return; - } else if (key == (DELETE_SYMBOL) || key == "DEL") { - mText->startEditing(); - mText->textInput("\b"); - mText->stopEditing(); - return; - } else if (key == "SPACE" || key == " ") { - mText->startEditing(); - mText->textInput(" "); - mText->stopEditing(); - return; - } else if (key == "LOAD") { - mText->setValue(mDefaultValue->getValue()); - mText->setCursor(mDefaultValue->getValue().size()); - return; - } else if (key == "CLEAR") { - mText->setValue(""); - return; - } else if (key == "CANCEL") { - delete this; - return; - } - - if (mAlt && altedKey.empty()) - return; - + mWindow, key, key, + [this, key, shiftedKey, altedKey, altshiftedKey] { + if (key == (OK_SYMBOL) || key.find("OK") != std::string::npos) { + mOkCallback(mText->getValue()); + delete this; + return; + } + else if (key == (DELETE_SYMBOL) || key == "DEL") { mText->startEditing(); - - if (mShift && mAlt) - mText->textInput(altshiftedKey.c_str()); - else if (mAlt) - mText->textInput(altedKey.c_str()); - else if (mShift) - mText->textInput(shiftedKey.c_str()); - else - mText->textInput(key.c_str()); - + mText->textInput("\b"); mText->stopEditing(); - }, - false, true); + return; + } + else if (key == "SPACE" || key == " ") { + mText->startEditing(); + mText->textInput(" "); + mText->stopEditing(); + return; + } + else if (key == "LOAD") { + mText->setValue(mDefaultValue->getValue()); + mText->setCursor(mDefaultValue->getValue().size()); + return; + } + else if (key == "CLEAR") { + mText->setValue(""); + return; + } + else if (key == "CANCEL") { + delete this; + return; + } + + if (mAlt && altedKey.empty()) + return; + + mText->startEditing(); + + if (mShift && mAlt) + mText->textInput(altshiftedKey.c_str()); + else if (mAlt) + mText->textInput(altedKey.c_str()); + else if (mShift) + mText->textInput(shiftedKey.c_str()); + else + mText->textInput(key.c_str()); + + mText->stopEditing(); + }, + false, true); KeyboardButton kb(button, key, shiftedKey, altedKey, altshiftedKey); mKeyboardButtons.push_back(kb); diff --git a/es-core/src/guis/GuiTextEditKeyboardPopup.h b/es-core/src/guis/GuiTextEditKeyboardPopup.h index 4104cb6cb..6ec0ac8b4 100644 --- a/es-core/src/guis/GuiTextEditKeyboardPopup.h +++ b/es-core/src/guis/GuiTextEditKeyboardPopup.h @@ -15,25 +15,26 @@ #include "components/ComponentGrid.h" #include "components/TextEditComponent.h" -class GuiTextEditKeyboardPopup : public GuiComponent { +class GuiTextEditKeyboardPopup : public GuiComponent +{ public: - GuiTextEditKeyboardPopup(Window *window, - const HelpStyle &helpstyle, - const std::string &title, - const std::string &initValue, - const std::function &okCallback, + GuiTextEditKeyboardPopup(Window* window, + const HelpStyle& helpstyle, + const std::string& title, + const std::string& initValue, + const std::function& okCallback, bool multiLine, - const std::string &acceptBtnHelpText = "OK", - const std::string &saveConfirmationText = "SAVE CHANGES?", - const std::string &infoString = "", - const std::string &defaultValue = "", - const std::string &loadBtnHelpText = "LOAD DEFAULT", - const std::string &clearBtnHelpText = "CLEAR", - const std::string &cancelBtnHelpText = "DISCARD CHANGES"); + const std::string& acceptBtnHelpText = "OK", + const std::string& saveConfirmationText = "SAVE CHANGES?", + const std::string& infoString = "", + const std::string& defaultValue = "", + const std::string& loadBtnHelpText = "LOAD DEFAULT", + const std::string& clearBtnHelpText = "CLEAR", + const std::string& cancelBtnHelpText = "DISCARD CHANGES"); void onSizeChanged() override; - bool input(InputConfig *config, Input input) override; + bool input(InputConfig* config, Input input) override; void update(int deltaTime) override; @@ -42,7 +43,8 @@ public: HelpStyle getHelpStyle() override { return mHelpStyle; } private: - class KeyboardButton { + class KeyboardButton + { public: std::shared_ptr button; const std::string key; @@ -51,11 +53,15 @@ private: const std::string altshiftedKey; KeyboardButton(const std::shared_ptr b, - const std::string &k, - const std::string &sk, - const std::string &ak, - const std::string &ask) - : button{b}, key{k}, shiftedKey{sk}, altedKey{ak}, altshiftedKey{ask} {}; + const std::string& k, + const std::string& sk, + const std::string& ak, + const std::string& ask) + : button{b} + , key{k} + , shiftedKey{sk} + , altedKey{ak} + , altshiftedKey{ask} {}; }; void updateDeleteRepeat(int deltaTime); @@ -68,10 +74,10 @@ private: void altShiftKeys(); - std::shared_ptr makeButton(const std::string &key, - const std::string &shiftedKey, - const std::string &altedKey, - const std::string &altshiftedKey); + std::shared_ptr makeButton(const std::string& key, + const std::string& shiftedKey, + const std::string& altedKey, + const std::string& altshiftedKey); std::vector mKeyboardButtons; @@ -95,7 +101,7 @@ private: std::string mClearBtnHelpText; std::string mCancelBtnHelpText; - std::function mOkCallback; + std::function mOkCallback; bool mMultiLine; bool mComplexMode; diff --git a/es-core/src/guis/GuiTextEditPopup.cpp b/es-core/src/guis/GuiTextEditPopup.cpp index 898f4a4a6..132d81056 100644 --- a/es-core/src/guis/GuiTextEditPopup.cpp +++ b/es-core/src/guis/GuiTextEditPopup.cpp @@ -15,25 +15,35 @@ #include "components/MenuComponent.h" #include "guis/GuiMsgBox.h" -GuiTextEditPopup::GuiTextEditPopup(Window *window, - const HelpStyle &helpstyle, - const std::string &title, - const std::string &initValue, - const std::function &okCallback, +GuiTextEditPopup::GuiTextEditPopup(Window* window, + const HelpStyle& helpstyle, + const std::string& title, + const std::string& initValue, + const std::function& okCallback, bool multiLine, - const std::string &acceptBtnText, - const std::string &saveConfirmationText, - const std::string &infoString, - const std::string &defaultValue, - const std::string &loadBtnHelpText, - const std::string &clearBtnHelpText, - const std::string &cancelBtnHelpText) - : GuiComponent{window}, mBackground{window, ":/graphics/frame.svg"}, - mGrid{window, glm::ivec2{1, (infoString != "" && defaultValue != "" ? 5 : 3)}}, mHelpStyle{helpstyle}, - mInitValue{initValue}, mAcceptBtnText{acceptBtnText}, mSaveConfirmationText{saveConfirmationText}, - mLoadBtnHelpText{loadBtnHelpText}, mClearBtnHelpText{clearBtnHelpText}, mCancelBtnHelpText{cancelBtnHelpText}, - mOkCallback{okCallback}, mMultiLine{multiLine}, mComplexMode{(infoString != "" && defaultValue != "")}, - mDeleteRepeat{false}, mDeleteRepeatTimer{0} { + const std::string& acceptBtnText, + const std::string& saveConfirmationText, + const std::string& infoString, + const std::string& defaultValue, + const std::string& loadBtnHelpText, + const std::string& clearBtnHelpText, + const std::string& cancelBtnHelpText) + : GuiComponent{window} + , mBackground{window, ":/graphics/frame.svg"} + , mGrid{window, glm::ivec2{1, (infoString != "" && defaultValue != "" ? 5 : 3)}} + , mHelpStyle{helpstyle} + , mInitValue{initValue} + , mAcceptBtnText{acceptBtnText} + , mSaveConfirmationText{saveConfirmationText} + , mLoadBtnHelpText{loadBtnHelpText} + , mClearBtnHelpText{clearBtnHelpText} + , mCancelBtnHelpText{cancelBtnHelpText} + , mOkCallback{okCallback} + , mMultiLine{multiLine} + , mComplexMode{(infoString != "" && defaultValue != "")} + , mDeleteRepeat{false} + , mDeleteRepeatTimer{0} +{ addChild(&mBackground); addChild(&mGrid); @@ -42,9 +52,9 @@ GuiTextEditPopup::GuiTextEditPopup(Window *window, if (mComplexMode) { mInfoString = std::make_shared( - mWindow, infoString, Font::get(FONT_SIZE_SMALL), 0x555555FF, ALIGN_CENTER); + mWindow, infoString, Font::get(FONT_SIZE_SMALL), 0x555555FF, ALIGN_CENTER); mDefaultValue = std::make_shared( - mWindow, defaultValue, Font::get(FONT_SIZE_SMALL), 0x555555FF, ALIGN_CENTER); + mWindow, defaultValue, Font::get(FONT_SIZE_SMALL), 0x555555FF, ALIGN_CENTER); } mText = std::make_shared(mWindow); @@ -58,11 +68,11 @@ GuiTextEditPopup::GuiTextEditPopup(Window *window, })); if (mComplexMode) { buttons.push_back(std::make_shared( - mWindow, "load", loadBtnHelpText, [this, defaultValue] { - mText->setValue(defaultValue); - mText->setCursor(0); - mText->setCursor(defaultValue.size()); - })); + mWindow, "load", loadBtnHelpText, [this, defaultValue] { + mText->setValue(defaultValue); + mText->setCursor(0); + mText->setCursor(defaultValue.size()); + })); } buttons.push_back(std::make_shared(mWindow, "clear", clearBtnHelpText, @@ -99,21 +109,22 @@ GuiTextEditPopup::GuiTextEditPopup(Window *window, if (mComplexMode) { float infoWidth = - glm::clamp(0.70f * aspectValue, 0.34f, 0.85f) * Renderer::getScreenWidth(); + glm::clamp(0.70f * aspectValue, 0.34f, 0.85f) * Renderer::getScreenWidth(); float windowWidth = - glm::clamp(0.75f * aspectValue, 0.40f, 0.90f) * Renderer::getScreenWidth(); + glm::clamp(0.75f * aspectValue, 0.40f, 0.90f) * Renderer::getScreenWidth(); mDefaultValue->setSize(infoWidth, mDefaultValue->getFont()->getHeight()); setSize(windowWidth, mTitle->getFont()->getHeight() + textHeight + - mButtonGrid->getSize().y + mButtonGrid->getSize().y * 1.85f); + mButtonGrid->getSize().y + mButtonGrid->getSize().y * 1.85f); setPosition((Renderer::getScreenWidth() - mSize.x) / 2.0f, (Renderer::getScreenHeight() - mSize.y) / 2.0f); - } else { + } + else { float width = glm::clamp(0.54f * aspectValue, 0.20f, 0.70f) * Renderer::getScreenWidth(); setSize(width, mTitle->getFont()->getHeight() + textHeight + mButtonGrid->getSize().y + - mButtonGrid->getSize().y / 2.0f); + mButtonGrid->getSize().y / 2.0f); setPosition((Renderer::getScreenWidth() - mSize.x) / 2.0f, (Renderer::getScreenHeight() - mSize.y) / 2.0f); } @@ -124,7 +135,8 @@ GuiTextEditPopup::GuiTextEditPopup(Window *window, mText->startEditing(); } -void GuiTextEditPopup::onSizeChanged() { +void GuiTextEditPopup::onSizeChanged() +{ mBackground.fitTo(mSize, glm::vec3{}, glm::vec2{-32.0f, -32.0f}); mText->setSize(mSize.x - 40.0f * Renderer::getScreenHeightModifier(), mText->getSize().y); @@ -138,7 +150,8 @@ void GuiTextEditPopup::onSizeChanged() { mGrid.setSize(mSize); } -bool GuiTextEditPopup::input(InputConfig *config, Input input) { +bool GuiTextEditPopup::input(InputConfig* config, Input input) +{ // Enter key (main key or via numpad) accepts the changes. if (config->getDeviceId() == DEVICE_KEYBOARD && mText->isEditing() && !mMultiLine && input.value && (input.id == SDLK_RETURN || input.id == SDLK_KP_ENTER)) { @@ -146,7 +159,7 @@ bool GuiTextEditPopup::input(InputConfig *config, Input input) { delete this; return true; } - // Dito for the A button if using a controller. + // Dito for the A button if using a controller. else if (config->getDeviceId() != DEVICE_KEYBOARD && mText->isEditing() && config->isMappedTo("a", input) && input.value) { this->mOkCallback(mText->getValue()); @@ -166,18 +179,19 @@ bool GuiTextEditPopup::input(InputConfig *config, Input input) { if (mText->getValue() != mInitValue) { // Changes were made, ask if the user wants to save them. mWindow->pushGui(new GuiMsgBox( - mWindow, mHelpStyle, mSaveConfirmationText, "YES", - [this] { - this->mOkCallback(mText->getValue()); - delete this; - return true; - }, - "NO", - [this] { - delete this; - return true; - })); - } else { + mWindow, mHelpStyle, mSaveConfirmationText, "YES", + [this] { + this->mOkCallback(mText->getValue()); + delete this; + return true; + }, + "NO", + [this] { + delete this; + return true; + })); + } + else { delete this; return true; } @@ -202,7 +216,8 @@ bool GuiTextEditPopup::input(InputConfig *config, Input input) { if (!editing) mText->stopEditing(); - } else { + } + else { mDeleteRepeat = false; } return true; @@ -228,12 +243,14 @@ bool GuiTextEditPopup::input(InputConfig *config, Input input) { return false; } -void GuiTextEditPopup::update(int deltaTime) { +void GuiTextEditPopup::update(int deltaTime) +{ updateDeleteRepeat(deltaTime); GuiComponent::update(deltaTime); } -std::vector GuiTextEditPopup::getHelpPrompts() { +std::vector GuiTextEditPopup::getHelpPrompts() +{ std::vector prompts = mGrid.getHelpPrompts(); if (mText->isEditing()) @@ -245,7 +262,8 @@ std::vector GuiTextEditPopup::getHelpPrompts() { return prompts; } -void GuiTextEditPopup::updateDeleteRepeat(int deltaTime) { +void GuiTextEditPopup::updateDeleteRepeat(int deltaTime) +{ if (!mDeleteRepeat) return; diff --git a/es-core/src/guis/GuiTextEditPopup.h b/es-core/src/guis/GuiTextEditPopup.h index 4784cecf7..70c473f2c 100644 --- a/es-core/src/guis/GuiTextEditPopup.h +++ b/es-core/src/guis/GuiTextEditPopup.h @@ -15,25 +15,26 @@ #include "components/ComponentGrid.h" #include "components/TextEditComponent.h" -class GuiTextEditPopup : public GuiComponent { +class GuiTextEditPopup : public GuiComponent +{ public: - GuiTextEditPopup(Window *window, - const HelpStyle &helpstyle, - const std::string &title, - const std::string &initValue, - const std::function &okCallback, + GuiTextEditPopup(Window* window, + const HelpStyle& helpstyle, + const std::string& title, + const std::string& initValue, + const std::function& okCallback, bool multiLine, - const std::string &acceptBtnText = "OK", - const std::string &saveConfirmationText = "SAVE CHANGES?", - const std::string &infoString = "", - const std::string &defaultValue = "", - const std::string &loadBtnHelpText = "LOAD DEFAULT", - const std::string &clearBtnHelpText = "CLEAR", - const std::string &cancelBtnHelpText = "DISCARD CHANGES"); + const std::string& acceptBtnText = "OK", + const std::string& saveConfirmationText = "SAVE CHANGES?", + const std::string& infoString = "", + const std::string& defaultValue = "", + const std::string& loadBtnHelpText = "LOAD DEFAULT", + const std::string& clearBtnHelpText = "CLEAR", + const std::string& cancelBtnHelpText = "DISCARD CHANGES"); void onSizeChanged() override; - bool input(InputConfig *config, Input input) override; + bool input(InputConfig* config, Input input) override; void update(int deltaTime) override; @@ -61,7 +62,7 @@ private: std::string mClearBtnHelpText; std::string mCancelBtnHelpText; - std::function mOkCallback; + std::function mOkCallback; bool mMultiLine; bool mComplexMode; diff --git a/es-core/src/resources/Font.cpp b/es-core/src/resources/Font.cpp index 21c15346f..5cdb52e53 100644 --- a/es-core/src/resources/Font.cpp +++ b/es-core/src/resources/Font.cpp @@ -562,18 +562,18 @@ float Font::getNewlineStartOffset(const std::string& text, endChar = static_cast(text.find('\n', charStart)); return (xLen - sizeText(text.substr(charStart, static_cast(endChar) != std::string::npos ? - endChar - charStart : - endChar)) - .x) / + endChar - charStart : + endChar)) + .x) / 2.0f; } case ALIGN_RIGHT: { int endChar = static_cast(text.find('\n', charStart)); return xLen - (sizeText(text.substr(charStart, static_cast(endChar) != std::string::npos ? - endChar - charStart : - endChar)) - .x); + endChar - charStart : + endChar)) + .x); } default: return 0; diff --git a/es-core/src/resources/TextureResource.cpp b/es-core/src/resources/TextureResource.cpp index 317a8c99d..b1444ce21 100644 --- a/es-core/src/resources/TextureResource.cpp +++ b/es-core/src/resources/TextureResource.cpp @@ -143,7 +143,7 @@ bool TextureResource::bind() } } -std::shared_ptr TextureResource::get(const std::string &path, +std::shared_ptr TextureResource::get(const std::string& path, bool tile, bool forceLoad, bool dynamic, diff --git a/es-core/src/resources/TextureResource.h b/es-core/src/resources/TextureResource.h index 0f6c42f6f..61abe0f55 100644 --- a/es-core/src/resources/TextureResource.h +++ b/es-core/src/resources/TextureResource.h @@ -25,7 +25,7 @@ class TextureData; class TextureResource : public IReloadable { public: - static std::shared_ptr get(const std::string &path, + static std::shared_ptr get(const std::string& path, bool tile = false, bool forceLoad = false, bool dynamic = true, @@ -33,7 +33,7 @@ public: float scaleDuringLoad = 1.0f, bool cacheImage = false); - void initFromPixels(const unsigned char *dataRGBA, size_t width, size_t height); + void initFromPixels(const unsigned char* dataRGBA, size_t width, size_t height); virtual void initFromMemory(const char* data, size_t length); static void manualUnload(std::string path, bool tile); From c51ad4a4327cfc01d08beba4b00c27757890e5d8 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 27 Sep 2021 21:16:05 +0200 Subject: [PATCH 24/42] Removed some noexcept operators. --- es-app/src/views/gamelist/VideoGameListView.h | 3 +-- es-core/src/GuiComponent.h | 2 +- es-core/src/components/BadgesComponent.cpp | 2 +- es-core/src/components/BadgesComponent.h | 2 +- es-core/src/components/ImageComponent.h | 3 +-- es-core/src/resources/TextureResource.h | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/es-app/src/views/gamelist/VideoGameListView.h b/es-app/src/views/gamelist/VideoGameListView.h index 0cd36f4e7..3516d8477 100644 --- a/es-app/src/views/gamelist/VideoGameListView.h +++ b/es-app/src/views/gamelist/VideoGameListView.h @@ -21,8 +21,7 @@ class VideoGameListView : public BasicGameListView { public: VideoGameListView(Window* window, FileData* root); - - virtual ~VideoGameListView() noexcept; + virtual ~VideoGameListView(); virtual void onShow() override; virtual void onThemeChanged(const std::shared_ptr& theme) override; diff --git a/es-core/src/GuiComponent.h b/es-core/src/GuiComponent.h index 7bb184c14..eea4bad10 100644 --- a/es-core/src/GuiComponent.h +++ b/es-core/src/GuiComponent.h @@ -39,7 +39,7 @@ class GuiComponent public: GuiComponent(Window* window); - virtual ~GuiComponent() noexcept; + virtual ~GuiComponent(); virtual void textInput(const std::string& text); diff --git a/es-core/src/components/BadgesComponent.cpp b/es-core/src/components/BadgesComponent.cpp index e60471bb7..7ef09ec25 100644 --- a/es-core/src/components/BadgesComponent.cpp +++ b/es-core/src/components/BadgesComponent.cpp @@ -46,7 +46,7 @@ BadgesComponent::BadgesComponent(Window* window) mImageComponents.insert({SLOT_ALTERNATIVE_EMULATOR, mImageAltEmu}); } -BadgesComponent::~BadgesComponent() noexcept +BadgesComponent::~BadgesComponent() { for (GuiComponent* c : mChildren) c->clearChildren(); diff --git a/es-core/src/components/BadgesComponent.h b/es-core/src/components/BadgesComponent.h index 27a642738..f4584ecf4 100644 --- a/es-core/src/components/BadgesComponent.h +++ b/es-core/src/components/BadgesComponent.h @@ -28,7 +28,7 @@ class BadgesComponent : public FlexboxComponent { public: BadgesComponent(Window* window); - ~BadgesComponent() noexcept; + ~BadgesComponent(); std::string getValue() const override; // Should be a list of strings. diff --git a/es-core/src/components/ImageComponent.h b/es-core/src/components/ImageComponent.h index 474f46a1e..9e84bc84a 100644 --- a/es-core/src/components/ImageComponent.h +++ b/es-core/src/components/ImageComponent.h @@ -18,8 +18,7 @@ class ImageComponent : public GuiComponent { public: ImageComponent(Window* window, bool forceLoad = false, bool dynamic = true); - - virtual ~ImageComponent() noexcept {}; + virtual ~ImageComponent() {}; void setDefaultImage(std::string path) { mDefaultPath = path; } diff --git a/es-core/src/resources/TextureResource.h b/es-core/src/resources/TextureResource.h index 61abe0f55..39d096d6d 100644 --- a/es-core/src/resources/TextureResource.h +++ b/es-core/src/resources/TextureResource.h @@ -49,7 +49,7 @@ public: void rasterizeAt(size_t width, size_t height); glm::vec2 getSourceImageSize() const { return mSourceSize; } - virtual ~TextureResource() noexcept; + virtual ~TextureResource(); bool isInitialized() const { return true; } bool isTiled() const; From 1ed0e7e0f27b906da392c8ff7fa181bfcbb447d9 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 27 Sep 2021 21:16:56 +0200 Subject: [PATCH 25/42] Added a temporary alternative emulator badge graphics file. --- resources/graphics/badge_altemu.svg | 215 ++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 resources/graphics/badge_altemu.svg diff --git a/resources/graphics/badge_altemu.svg b/resources/graphics/badge_altemu.svg new file mode 100644 index 000000000..777ad8142 --- /dev/null +++ b/resources/graphics/badge_altemu.svg @@ -0,0 +1,215 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 50f2af007722240469614b3ae0847d7900f5d931 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 27 Sep 2021 21:27:07 +0200 Subject: [PATCH 26/42] Manual merges to align with master branch. --- CMakeLists.txt | 226 +++++------ CREDITS.md | 2 + USERGUIDE.md | 44 +-- es-app/CMakeLists.txt | 374 +++++++++--------- es-app/src/FileFilterIndex.h | 15 - es-app/src/FileSorts.h | 18 - es-app/src/guis/GuiLaunchScreen.h | 3 - es-app/src/guis/GuiScraperSearch.h | 15 - es-core/CMakeLists.txt | 274 ++++++------- es-core/src/GuiComponent.h | 2 - es-core/src/components/ButtonComponent.cpp | 1 + es-core/src/components/ButtonComponent.h | 8 - es-core/src/components/ComponentGrid.h | 14 - es-core/src/guis/GuiTextEditKeyboardPopup.cpp | 54 +-- es-core/src/guis/GuiTextEditKeyboardPopup.h | 8 - es-core/src/guis/GuiTextEditPopup.h | 3 - resources/systems/macos/es_systems.xml | 137 ++----- resources/systems/unix/es_systems.xml | 135 ++----- resources/systems/windows/es_systems.xml | 135 ++----- 19 files changed, 587 insertions(+), 881 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15beefa1f..1c8ff03b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ set(LINUX_CPACK_GENERATOR "DEB" CACHE STRING "CPack generator, DEB or RPM") # Add local find modules to the CMake path. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake/Utils - ${CMAKE_CURRENT_SOURCE_DIR}/CMake/Packages) + ${CMAKE_CURRENT_SOURCE_DIR}/CMake/Packages) # Define the options. option(GLES "Set to ON if targeting Embedded OpenGL" ${GLES}) @@ -36,11 +36,11 @@ option(CEC "Set to ON to enable CEC" ${CEC}) option(VLC_PLAYER "Set to ON to build the VLC-based video player" ${VLC_PLAYER}) option(CLANG_TIDY "Set to ON to build using the clang-tidy static analyzer" ${CLANG_TIDY}) -if (CLANG_TIDY) +if(CLANG_TIDY) find_program(CLANG_TIDY_BINARY NAMES clang-tidy) - if (CLANG_TIDY_BINARY STREQUAL "CLANG_TIDY_BINARY-NOTFOUND") + if(CLANG_TIDY_BINARY STREQUAL "CLANG_TIDY_BINARY-NOTFOUND") message("-- CLANG_TIDY was set but the clang-tidy binary was not found") - else () + else() message("-- Building with the clang-tidy static analyzer") set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=*,\ -fuchsia-*,\ @@ -76,12 +76,12 @@ set_property(CACHE GLSYSTEM PROPERTY STRINGS "Desktop OpenGL" "Embedded OpenGL") #--------------------------------------------------------------------------------------------------- # Package dependencies. -if (GLSYSTEM MATCHES "Desktop OpenGL") +if(GLSYSTEM MATCHES "Desktop OpenGL") set(OpenGL_GL_PREFERENCE "GLVND") find_package(OpenGL REQUIRED) -else () +else() find_package(OpenGLES REQUIRED) -endif () +endif() # Skip package dependency checks if we're on Windows. if(NOT WIN32) @@ -103,73 +103,73 @@ if(CEC) endif() # Add ALSA for Linux. -if (CMAKE_SYSTEM_NAME MATCHES "Linux") +if(CMAKE_SYSTEM_NAME MATCHES "Linux") find_package(ALSA REQUIRED) -endif () +endif() #--------------------------------------------------------------------------------------------------- # Compiler and linker settings. -if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") message("-- Compiler is Clang/LLVM") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0.0) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0.0) message(SEND_ERROR "You need at least Clang 5.0.0 to compile EmulationStation-DE") - endif () -elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + endif() +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") message("-- Compiler is GNU/GCC") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.1) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.1) message(SEND_ERROR "You need at least GCC 7.1 to compile EmulationStation-DE") - endif () - if (WIN32) + endif() + if(WIN32) set(CMAKE_CXX_FLAGS "-mwindows ${CMAKE_CXX_FLAGS}") - endif () -elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + endif() +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") message("-- Compiler is MSVC") # If using the MSVC compiler on Windows, disable the built-in min() and max() macros. add_definitions(-DNOMINMAX) -endif () +endif() -if (CMAKE_BUILD_TYPE) +if(CMAKE_BUILD_TYPE) message("-- Build type is ${CMAKE_BUILD_TYPE}") -endif () +endif() # Set up compiler and linker flags for debug, profiling or release builds. if(CMAKE_BUILD_TYPE MATCHES Debug) # Enable the C++17 standard and disable optimizations as it's a debug build. - if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /Od /DEBUG:FULL") - else () + else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O0 -Wall -Wpedantic -Wsign-compare -Wnarrowing -Wmissing-field-initializers -Wunused-macros") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O0") - endif () + endif() # If using Clang, then add additional debug data needed by GDB. # Comment this out if you're using LLDB for debugging as this flag makes the binary # much larger and the application much slower. On macOS this setting is never enabled # as LLDB is the default debugger on this OS. - if (NOT APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(NOT APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG") - endif () + endif() elseif(CMAKE_BUILD_TYPE MATCHES Profiling) # For the profiling build, we enable optimizations and supply the required profiler flags. - if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /O2 /DEBUG:FULL") - else () + else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2 -pg -g -Wall -Wpedantic -Wsign-compare -Wnarrowing -Wmissing-field-initializers -Wunused-macros") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O2 -pg") - endif () + endif() else() # Enable the C++17 standard and enable optimizations as it's a release build. # This will also disable all assert() macros. Strip the binary too. - if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG /std:c++17 /O2 /DEBUG:NONE") - else () + else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2 -DNDEBUG -Wall -Wpedantic -Wsign-compare -Wnarrowing -Wmissing-field-initializers -Wunused-macros") - if (APPLE) + if(APPLE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O2") - else () + else() set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O2 -s") - endif () - endif () + endif() + endif() endif() # The following removes half of the ranlib warnings on macOS regarding no symbols for files @@ -180,26 +180,26 @@ if(APPLE) endif() if(APPLE) - if (MACOS_CODESIGN_IDENTITY) + if(MACOS_CODESIGN_IDENTITY) message("-- Code signing certificate identity: " ${MACOS_CODESIGN_IDENTITY}) - endif () - if (CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.14) + endif() + if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.14) message("-- macOS version 10.13 or lower has been set, so if code signing is enabled, Hardened Runtime will not be used") - endif () + endif() endif() #--------------------------------------------------------------------------------------------------- # Preprocessor directives. -if (GLSYSTEM MATCHES "Desktop OpenGL") +if(GLSYSTEM MATCHES "Desktop OpenGL") add_definitions(-DUSE_OPENGL_21) -else () +else() add_definitions(-DUSE_OPENGLES_10) -endif () +endif() -if (VLC_PLAYER) +if(VLC_PLAYER) add_definitions(-DBUILD_VLC_PLAYER) -endif () +endif() if(DEFINED BCMHOST OR RPI) add_definitions(-D_RPI_) @@ -217,13 +217,13 @@ add_definitions(-DGLM_FORCE_XYZW_ONLY) # we use /usr on Linux, /usr/pkg on NetBSD and /usr/local on FreeBSD and OpenBSD. if(NOT WIN32 AND NOT APPLE) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - if (CMAKE_SYSTEM_NAME MATCHES "Linux") + if(CMAKE_SYSTEM_NAME MATCHES "Linux") set(CMAKE_INSTALL_PREFIX "/usr" CACHE INTERNAL "CMAKE_INSTALL_PREFIX") - elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") + elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD") set(CMAKE_INSTALL_PREFIX "/usr/pkg" CACHE INTERNAL "CMAKE_INSTALL_PREFIX") - else () + else() set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE INTERNAL "CMAKE_INSTALL_PREFIX") - endif () + endif() endif() message("-- Installation prefix is set to " ${CMAKE_INSTALL_PREFIX}) add_definitions(-DES_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") @@ -239,16 +239,16 @@ endif() # Include files. set(COMMON_INCLUDE_DIRS ${CURL_INCLUDE_DIR} - ${FFMPEG_INCLUDE_DIRS} - ${FreeImage_INCLUDE_DIRS} - ${FREETYPE_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIRS} - ${RAPIDJSON_INCLUDE_DIRS} - ${SDL2_INCLUDE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/external/CImg - ${CMAKE_CURRENT_SOURCE_DIR}/external/glm - ${CMAKE_CURRENT_SOURCE_DIR}/external/nanosvg/src - ${CMAKE_CURRENT_SOURCE_DIR}/es-core/src) + ${FFMPEG_INCLUDE_DIRS} + ${FreeImage_INCLUDE_DIRS} + ${FREETYPE_INCLUDE_DIRS} + ${PUGIXML_INCLUDE_DIRS} + ${RAPIDJSON_INCLUDE_DIRS} + ${SDL2_INCLUDE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/external/CImg + ${CMAKE_CURRENT_SOURCE_DIR}/external/glm + ${CMAKE_CURRENT_SOURCE_DIR}/external/nanosvg/src + ${CMAKE_CURRENT_SOURCE_DIR}/es-core/src) if(VLC_PLAYER) set(COMMON_INCLUDE_DIRS ${COMMON_INCLUDE_DIRS} ${VLC_INCLUDE_DIR}) endif() @@ -276,69 +276,69 @@ if(DEFINED libCEC_FOUND) endif() # For Linux, add the ALSA include directory. -if (CMAKE_SYSTEM_NAME MATCHES "Linux") +if(CMAKE_SYSTEM_NAME MATCHES "Linux") list(APPEND COMMON_INCLUDE_DIRS ${ALSA_INCLUDE_DIRS}) -endif () +endif() -if (DEFINED BCMHOST OR RPI) +if(DEFINED BCMHOST OR RPI) list(APPEND COMMON_INCLUDE_DIRS "${CMAKE_FIND_ROOT_PATH}/opt/vc/include" - "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vcos" - "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vmcs_host/linux" - "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vcos/pthreads") -endif () + "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vcos" + "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vmcs_host/linux" + "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vcos/pthreads") +endif() #--------------------------------------------------------------------------------------------------- # Dependency libraries. -if (NOT WIN32) +if(NOT WIN32) set(COMMON_LIBRARIES ${CURL_LIBRARIES} - ${FFMPEG_LIBRARIES} - ${FreeImage_LIBRARIES} - ${FREETYPE_LIBRARIES} - ${PUGIXML_LIBRARIES} - ${SDL2_LIBRARY}) - if (VLC_PLAYER) + ${FFMPEG_LIBRARIES} + ${FreeImage_LIBRARIES} + ${FREETYPE_LIBRARIES} + ${PUGIXML_LIBRARIES} + ${SDL2_LIBRARY}) + if(VLC_PLAYER) set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${VLC_LIBRARIES}) - endif () -elseif (WIN32) - if (DEFINED MSVC) + endif() +elseif(WIN32) + if(DEFINED MSVC) set(COMMON_LIBRARIES "${PROJECT_SOURCE_DIR}/avcodec.lib" - "${PROJECT_SOURCE_DIR}/avfilter.lib" - "${PROJECT_SOURCE_DIR}/avformat.lib" - "${PROJECT_SOURCE_DIR}/avutil.lib" - "${PROJECT_SOURCE_DIR}/swresample.lib" - "${PROJECT_SOURCE_DIR}/swscale.lib" - "${PROJECT_SOURCE_DIR}/FreeImage.lib" - "${PROJECT_SOURCE_DIR}/glew32.lib" - "${PROJECT_SOURCE_DIR}/libcurl-x64.lib" - "${PROJECT_SOURCE_DIR}/freetype.lib" - "${PROJECT_SOURCE_DIR}/pugixml.lib" - "${PROJECT_SOURCE_DIR}/SDL2main.lib" - "${PROJECT_SOURCE_DIR}/SDL2.lib" - "Winmm.dll") - if (VLC_PLAYER) + "${PROJECT_SOURCE_DIR}/avfilter.lib" + "${PROJECT_SOURCE_DIR}/avformat.lib" + "${PROJECT_SOURCE_DIR}/avutil.lib" + "${PROJECT_SOURCE_DIR}/swresample.lib" + "${PROJECT_SOURCE_DIR}/swscale.lib" + "${PROJECT_SOURCE_DIR}/FreeImage.lib" + "${PROJECT_SOURCE_DIR}/glew32.lib" + "${PROJECT_SOURCE_DIR}/libcurl-x64.lib" + "${PROJECT_SOURCE_DIR}/freetype.lib" + "${PROJECT_SOURCE_DIR}/pugixml.lib" + "${PROJECT_SOURCE_DIR}/SDL2main.lib" + "${PROJECT_SOURCE_DIR}/SDL2.lib" + "Winmm.dll") + if(VLC_PLAYER) set(COMMON_LIBRARIES ${COMMON_LIBRARIES} "${PROJECT_SOURCE_DIR}/libvlc.lib") - endif () - else () + endif() + else() set(COMMON_LIBRARIES "${PROJECT_SOURCE_DIR}/avcodec-58.dll" - "${PROJECT_SOURCE_DIR}/avfilter-7.dll" - "${PROJECT_SOURCE_DIR}/avformat-58.dll" - "${PROJECT_SOURCE_DIR}/avutil-56.dll" - "${PROJECT_SOURCE_DIR}/swresample-3.dll" - "${PROJECT_SOURCE_DIR}/swscale-5.dll" - "${PROJECT_SOURCE_DIR}/FreeImage.dll" - "${PROJECT_SOURCE_DIR}/glew32.dll" - "${PROJECT_SOURCE_DIR}/libcurl-x64.dll" - "${PROJECT_SOURCE_DIR}/libfreetype.dll" - "${PROJECT_SOURCE_DIR}/libpugixml.dll" - "${PROJECT_SOURCE_DIR}/libSDL2main.a" - "${PROJECT_SOURCE_DIR}/SDL2.dll" - "mingw32" - "Winmm.dll") - if (VLC_PLAYER) + "${PROJECT_SOURCE_DIR}/avfilter-7.dll" + "${PROJECT_SOURCE_DIR}/avformat-58.dll" + "${PROJECT_SOURCE_DIR}/avutil-56.dll" + "${PROJECT_SOURCE_DIR}/swresample-3.dll" + "${PROJECT_SOURCE_DIR}/swscale-5.dll" + "${PROJECT_SOURCE_DIR}/FreeImage.dll" + "${PROJECT_SOURCE_DIR}/glew32.dll" + "${PROJECT_SOURCE_DIR}/libcurl-x64.dll" + "${PROJECT_SOURCE_DIR}/libfreetype.dll" + "${PROJECT_SOURCE_DIR}/libpugixml.dll" + "${PROJECT_SOURCE_DIR}/libSDL2main.a" + "${PROJECT_SOURCE_DIR}/SDL2.dll" + "mingw32" + "Winmm.dll") + if(VLC_PLAYER) set(COMMON_LIBRARIES ${COMMON_LIBRARIES} "${PROJECT_SOURCE_DIR}/libvlc.dll") - endif () - endif () + endif() + endif() endif() if(APPLE) @@ -366,9 +366,9 @@ if(DEFINED libCEC_FOUND) endif() # Add ALSA for Linux libraries. -if (CMAKE_SYSTEM_NAME MATCHES "Linux") +if(CMAKE_SYSTEM_NAME MATCHES "Linux") list(APPEND COMMON_LIBRARIES ${ALSA_LIBRARY}) -endif () +endif() if(DEFINED BCMHOST) link_directories("${CMAKE_FIND_ROOT_PATH}/opt/vc/lib") @@ -378,11 +378,11 @@ elseif(RPI) list(APPEND COMMON_LIBRARIES ${OPENGLES_LIBRARIES}) endif() -if (GLSYSTEM MATCHES "Desktop OpenGL") +if(GLSYSTEM MATCHES "Desktop OpenGL") list(APPEND COMMON_LIBRARIES ${OPENGL_LIBRARIES}) -else () +else() list(APPEND COMMON_LIBRARIES EGL ${OPENGLES_LIBRARIES}) -endif () +endif() #--------------------------------------------------------------------------------------------------- # Build directories. diff --git a/CREDITS.md b/CREDITS.md index 770648677..60cac7b99 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -60,6 +60,7 @@ https://rapidjson.org SDL \ https://www.libsdl.org + # Code Some code (like the virtual keyboard) was borrowed from Batocera.linux \ @@ -71,6 +72,7 @@ https://www.bzflag.org A few of the GLSL shaders were borrowed from the RetroArch project \ https://www.retroarch.com + # Resources Akrobat font \ diff --git a/USERGUIDE.md b/USERGUIDE.md index 97bab78ff..144d5ba26 100644 --- a/USERGUIDE.md +++ b/USERGUIDE.md @@ -377,8 +377,7 @@ The platform name for the Commodore 64 is `c64`, so the following structure woul ~/ROMs/c64/Multidisk/Pirates/Pirates!.m3u ``` -It's highly recommended to create `.m3u` playlist files for multi-disc images as this normally automates disk swapping -in the emulator. It's then this .m3u file that should be selected for launching the game. +It's highly recommended to create `.m3u` playlist files for multi-disc images as this normally automates disk swapping in the emulator. It's then this .m3u file that should be selected for launching the game. The .m3u file simply contains a list of the game files, for example in the case of Last Ninja 2.m3u: @@ -431,13 +430,9 @@ Apart from the potential difficulty in locating the emulator binary, there are s #### Commodore Amiga -There are multiple ways to run Amiga games, but the recommended approach is to use WHDLoad. The best way is to use hard -disk images in `.hdf` or `.hdz` format, meaning there will be a single file per game. This makes it just as easy to play -Amiga games as any console with game ROMs. +There are multiple ways to run Amiga games, but the recommended approach is to use WHDLoad. The best way is to use hard disk images in `.hdf` or `.hdz` format, meaning there will be a single file per game. This makes it just as easy to play Amiga games as any console with game ROMs. -An alternative would be to use `.adf` images as not all games may be available with WHDLoad support. For this, you can -either put single-disk images in the root folder or in a dedicated adf directory, or multiple-disk games in separate -folders. It's highly recommended to create `.m3u` playlist files for multi-disc images as described earlier. +An alternative would be to use `.adf` images as not all games may be available with WHDLoad support. For this, you can either put single-disk images in the root folder or in a dedicated adf directory, or multiple-disk games in separate folders. It's highly recommended to create `.m3u` playlist files for multi-disc images as described earlier. Here's an example of what the file structure could look like: @@ -877,8 +872,7 @@ If this setting is enabled and a folder has its flag set to be excluded from the **Scrape actual folders** _(Multi-scraper only)_ -Enabling this option causes folders themselves to be included by the scraper. This is useful for DOS games or any -multi-disc games where there is a folder for each individual game. +Enabling this option causes folders themselves to be included by the scraper. This is useful for DOS games or any multi-disc games where there is a folder for each individual game. **Auto-retry on peer verification errors** _(ScreenScraper only)_ @@ -1225,11 +1219,7 @@ If this option is disabled, hidden files and folders within the ROMs directory t **Show hidden games (requires restart)** -You can mark games as hidden in the metadata editor, which is useful for instance for DOS games where you may not want -to see some batch files and executables inside ES-DE, or for multi-disc games where you may only want to show the .m3u -playlists and not the individual game files. By disabling this option these files will not be processed at all when -ES-DE starts up. If you enable the option you will see the files, but their name entries will be almost transparent in -the gamelist view to visually indicate that they are hidden. +You can mark games as hidden in the metadata editor, which is useful for instance for DOS games where you may not want to see some batch files and executables inside ES-DE, or for multi-disc games where you may only want to show the .m3u playlists and not the individual game files. By disabling this option these files will not be processed at all when ES-DE starts up. If you enable the option you will see the files, but their name entries will be almost transparent in the gamelist view to visually indicate that they are hidden. **Enable custom event scripts** @@ -1417,11 +1407,7 @@ A flag to mark whether the game is suitable for children. This will be applied a **Hidden** -A flag to indicate that the game is hidden. If the corresponding option has been set in the main menu, the game will not -be shown. Useful for example for DOS games to hide batch scripts and unnecessary binaries or to hide the actual game -files for multi-disc games. If a file or folder is flagged as hidden but the corresponding option to hide hidden games -has not been enabled, then the opacity of the text will be lowered significantly to make it clear that it's a hidden -entry. +A flag to indicate that the game is hidden. If the corresponding option has been set in the main menu, the game will not be shown. Useful for example for DOS games to hide batch scripts and unnecessary binaries or to hide the actual game files for multi-disc games. If a file or folder is flagged as hidden but the corresponding option to hide hidden games has not been enabled, then the opacity of the text will be lowered significantly to make it clear that it's a hidden entry. **Broken/not working** @@ -1429,27 +1415,15 @@ A flag to indicate whether the game is broken. Useful for MAME games for instanc **Exclude from game counter** _(files only)_ -A flag to indicate whether the game should be excluded from being counted. If this is set for a game, it will not be -included in the game counter shown per system on the system view, and it will not be included in the system information -field in the gamelist view. As well, it will be excluded from all automatic and custom collections. This option is quite -useful for multi-file games such as multi-disc Amiga or Commodore 64 games, or for DOS games where you want to exclude -setup programs and similar but still need them available in ES-DE and therefore can't hide them. Files that have this -flag set will have a lower opacity in the gamelists, making them easy to spot. +A flag to indicate whether the game should be excluded from being counted. If this is set for a game, it will not be included in the game counter shown per system on the system view, and it will not be included in the system information field in the gamelist view. As well, it will be excluded from all automatic and custom collections. This option is quite useful for multi-file games such as multi-disc Amiga or Commodore 64 games, or for DOS games where you want to exclude setup programs and similar but still need them available in ES-DE and therefore can't hide them. Files that have this flag set will have a lower opacity in the gamelists, making them easy to spot. **Exclude from multi-scraper** -Whether to exclude the file from the multi-scraper. This is quite useful in order to avoid scraping all the disks for -multi-disc games for example. There is an option in the scraper settings to ignore this flag, but by default the -multi-scraper will respect it. +Whether to exclude the file from the multi-scraper. This is quite useful in order to avoid scraping all the disks for multi-disc games for example. There is an option in the scraper settings to ignore this flag, but by default the multi-scraper will respect it. **Hide metadata fields** -This option will hide most metadata fields in the gamelist view. The intention is to be able to hide the fields for -situations such as general folders (Multi-disc, Cartridges etc.) and for setup programs and similar (e.g. SETUP.EXE or -INSTALL.BAT for DOS games). It could also be used on the game files for multi-disc games where perhaps only the .m3u -playlist should have any metadata values. The only fields shown with this option enabled are the game name and -description. Using the description it's possible to write some comments regarding the file or folder, should you want -to. It's also possible to display game images and videos with this setting enabled. +This option will hide most metadata fields in the gamelist view. The intention is to be able to hide the fields for situations such as general folders (Multi-disc, Cartridges etc.) and for setup programs and similar (e.g. SETUP.EXE or INSTALL.BAT for DOS games). It could also be used on the game files for multi-disc games where perhaps only the .m3u playlist should have any metadata values. The only fields shown with this option enabled are the game name and description. Using the description it's possible to write some comments regarding the file or folder, should you want to. It's also possible to display game images and videos with this setting enabled. **Launch command** _(files only)_ diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt index 9dbb9681e..9f4dbe7e1 100644 --- a/es-app/CMakeLists.txt +++ b/es-app/CMakeLists.txt @@ -10,106 +10,106 @@ project("emulationstation-de") set(ES_HEADERS - ${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemsManager.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/EmulationStation.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/FileData.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/FileFilterIndex.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/FileSorts.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/Gamelist.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/MediaViewer.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/MetaData.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/MiximageGenerator.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/PlatformId.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemData.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreensaver.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/VolumeControl.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemsManager.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/EmulationStation.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/FileData.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/FileFilterIndex.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/FileSorts.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/Gamelist.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/MediaViewer.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/MetaData.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/MiximageGenerator.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/PlatformId.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemData.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreensaver.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/VolumeControl.h - # GUIs - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiAlternativeEmulators.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiCollectionSystemsOptions.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistFilter.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistOptions.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGameScraper.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInfoPopup.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiLaunchScreen.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMediaViewerOptions.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMenu.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMetaDataEd.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiOfflineGenerator.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperMenu.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperMulti.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperSearch.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScreensaverOptions.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiSettings.h + # GUIs + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiAlternativeEmulators.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiCollectionSystemsOptions.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistFilter.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistOptions.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGameScraper.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInfoPopup.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiLaunchScreen.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMediaViewerOptions.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMenu.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMetaDataEd.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiOfflineGenerator.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperMenu.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperMulti.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperSearch.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScreensaverOptions.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiSettings.h - # Scrapers - ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBJSONScraper.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBJSONScraperResources.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/Scraper.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/ScreenScraper.h + # Scrapers + ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBJSONScraper.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBJSONScraperResources.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/Scraper.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/ScreenScraper.h - # Views - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/BasicGameListView.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/DetailedGameListView.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/GridGameListView.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/IGameListView.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/ISimpleGameListView.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/VideoGameListView.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/SystemView.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/UIModeController.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/ViewController.h - ) + # Views + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/BasicGameListView.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/DetailedGameListView.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/GridGameListView.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/IGameListView.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/ISimpleGameListView.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/VideoGameListView.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/SystemView.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/UIModeController.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/ViewController.h +) set(ES_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemsManager.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/FileData.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/FileFilterIndex.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/FileSorts.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/Gamelist.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/MediaViewer.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/MetaData.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/MiximageGenerator.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/PlatformId.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemData.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreensaver.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/VolumeControl.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemsManager.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/FileData.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/FileFilterIndex.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/FileSorts.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Gamelist.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/MediaViewer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/MetaData.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/MiximageGenerator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/PlatformId.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemData.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/SystemScreensaver.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/VolumeControl.cpp - # GUIs - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiAlternativeEmulators.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiCollectionSystemsOptions.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistFilter.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistOptions.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGameScraper.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInfoPopup.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiLaunchScreen.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMenu.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMediaViewerOptions.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMetaDataEd.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiOfflineGenerator.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperMenu.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperMulti.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperSearch.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScreensaverOptions.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiSettings.cpp + # GUIs + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiAlternativeEmulators.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiCollectionSystemsOptions.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistFilter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGamelistOptions.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGameScraper.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInfoPopup.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiLaunchScreen.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMenu.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMediaViewerOptions.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMetaDataEd.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiOfflineGenerator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperMenu.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperMulti.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperSearch.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScreensaverOptions.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiSettings.cpp - # Scrapers - ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBJSONScraper.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBJSONScraperResources.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/Scraper.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/ScreenScraper.cpp + # Scrapers + ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBJSONScraper.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBJSONScraperResources.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/Scraper.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/ScreenScraper.cpp - # Views - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/BasicGameListView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/DetailedGameListView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/GridGameListView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/IGameListView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/ISimpleGameListView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/VideoGameListView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/SystemView.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/UIModeController.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/views/ViewController.cpp - ) + # Views + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/BasicGameListView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/DetailedGameListView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/GridGameListView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/IGameListView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/ISimpleGameListView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/VideoGameListView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/SystemView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/UIModeController.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/views/ViewController.cpp +) if(WIN32) LIST(APPEND ES_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation.rc) @@ -134,55 +134,55 @@ endif() # Setup for installation and package generation. if(WIN32) install(TARGETS EmulationStation RUNTIME DESTINATION .) - if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") install(FILES ../avcodec-58.dll - ../avfilter-7.dll - ../avformat-58.dll - ../avutil-56.dll - ../postproc-55.dll - ../swresample-3.dll - ../swscale-5.dll - ../FreeImage.dll - ../freetype.dll - ../glew32.dll - ../libcrypto-1_1-x64.dll - ../libcurl-x64.dll - ../libssl-1_1-x64.dll - ../MSVCP140.dll - ../pugixml.dll - ../SDL2.dll - ../VCOMP140.DLL - ../VCRUNTIME140.dll - ../VCRUNTIME140_1.dll - DESTINATION .) - if (VLC_PLAYER) + ../avfilter-7.dll + ../avformat-58.dll + ../avutil-56.dll + ../postproc-55.dll + ../swresample-3.dll + ../swscale-5.dll + ../FreeImage.dll + ../freetype.dll + ../glew32.dll + ../libcrypto-1_1-x64.dll + ../libcurl-x64.dll + ../libssl-1_1-x64.dll + ../MSVCP140.dll + ../pugixml.dll + ../SDL2.dll + ../VCOMP140.DLL + ../VCRUNTIME140.dll + ../VCRUNTIME140_1.dll + DESTINATION .) + if(VLC_PLAYER) install(FILES ../libvlc.dll ../libvlccore.dll DESTINATION .) - endif () - else () + endif() + else() install(FILES ../avcodec-58.dll - ../avfilter-7.dll - ../avformat-58.dll - ../avutil-56.dll - ../postproc-55.dll - ../swresample-3.dll - ../swscale-5.dll - ../FreeImage.dll - ../glew32.dll - ../libcrypto-1_1-x64.dll - ../libcurl-x64.dll - ../libfreetype.dll - ../libpugixml.dll - ../libssl-1_1-x64.dll - ../SDL2.dll - ../vcomp140.dll - DESTINATION .) - if (VLC_PLAYER) + ../avfilter-7.dll + ../avformat-58.dll + ../avutil-56.dll + ../postproc-55.dll + ../swresample-3.dll + ../swscale-5.dll + ../FreeImage.dll + ../glew32.dll + ../libcrypto-1_1-x64.dll + ../libcurl-x64.dll + ../libfreetype.dll + ../libpugixml.dll + ../libssl-1_1-x64.dll + ../SDL2.dll + ../vcomp140.dll + DESTINATION .) + if(VLC_PLAYER) install(FILES ../libvlc.dll ../libvlccore.dll DESTINATION .) - endif () - endif () - if (VLC_PLAYER) + endif() + endif() + if(VLC_PLAYER) install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins DESTINATION .) - endif () + endif() install(FILES ../LICENSE DESTINATION .) install(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses DESTINATION .) install(DIRECTORY ${CMAKE_SOURCE_DIR}/themes DESTINATION .) @@ -206,81 +206,81 @@ elseif(APPLE) # on your system (e.g. if using libSDL2-2.1.0.dylib instead of libSDL2-2.0.0.dylib). # This problem definitely needs to be resolved properly at a later date. add_custom_command(TARGET EmulationStation POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} - -change /usr/local/lib/libavcodec.58.dylib @rpath/libavcodec.58.dylib - -change /usr/local/lib/libavfilter.7.dylib @rpath/libavfilter.7.dylib - -change /usr/local/lib/libavformat.58.dylib @rpath/libavformat.58.dylib - -change /usr/local/lib/libavutil.56.dylib @rpath/libavutil.56.dylib - -change /usr/local/lib/libswresample.3.dylib @rpath/libswresample.3.dylib - -change /usr/local/lib/libswscale.5.dylib @rpath/libswscale.5.dylib - -change /usr/local/opt/freeimage/lib/libfreeimage.dylib @rpath/libfreeimage.dylib - -change /usr/local/opt/freetype/lib/libfreetype.6.dylib @rpath/libfreetype.6.dylib - -change /usr/local/opt/libpng/lib/libpng16.16.dylib @rpath/libpng16.16.dylib - -change /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib @rpath/libSDL2-2.0.0.dylib - $) + -change /usr/local/lib/libavcodec.58.dylib @rpath/libavcodec.58.dylib + -change /usr/local/lib/libavfilter.7.dylib @rpath/libavfilter.7.dylib + -change /usr/local/lib/libavformat.58.dylib @rpath/libavformat.58.dylib + -change /usr/local/lib/libavutil.56.dylib @rpath/libavutil.56.dylib + -change /usr/local/lib/libswresample.3.dylib @rpath/libswresample.3.dylib + -change /usr/local/lib/libswscale.5.dylib @rpath/libswscale.5.dylib + -change /usr/local/opt/freeimage/lib/libfreeimage.dylib @rpath/libfreeimage.dylib + -change /usr/local/opt/freetype/lib/libfreetype.6.dylib @rpath/libfreetype.6.dylib + -change /usr/local/opt/libpng/lib/libpng16.16.dylib @rpath/libpng16.16.dylib + -change /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib @rpath/libSDL2-2.0.0.dylib + $) set(APPLE_DYLIB_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE) + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) install(FILES ${CMAKE_SOURCE_DIR}/libavcodec.58.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libavfilter.7.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libavformat.58.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libavutil.56.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libpostproc.55.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libswresample.3.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libswscale.5.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libfdk-aac.2.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libfreeimage.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libfreetype.6.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libpng16.16.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libSDL2-2.0.0.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) - if (VLC_PLAYER) + if(VLC_PLAYER) install(FILES ${CMAKE_SOURCE_DIR}/libvlc.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(FILES ${CMAKE_SOURCE_DIR}/libvlccore.dylib - PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) + PERMISSIONS ${APPLE_DYLIB_PERMISSIONS} DESTINATION ../MacOS) install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins - DESTINATION ../MacOS) - endif () + DESTINATION ../MacOS) + endif() install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ../Resources) install(DIRECTORY ${CMAKE_SOURCE_DIR}/resources DESTINATION ../Resources) install(DIRECTORY ${CMAKE_SOURCE_DIR}/themes DESTINATION ../Resources) install(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses DESTINATION ../Resources) -else () +else() install(TARGETS emulationstation RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) - if (CMAKE_SYSTEM_NAME MATCHES "Linux") + if(CMAKE_SYSTEM_NAME MATCHES "Linux") install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/emulationstation.6.gz - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man6) - else () + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man6) + else() install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/emulationstation.6.gz - DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man6) - endif () + DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man6) + endif() install(FILES ${CMAKE_SOURCE_DIR}/LICENSE - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation) + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/emulationstation.desktop - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/emulationstation.svg - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps) + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps) install(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation) + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation) install(DIRECTORY ${CMAKE_SOURCE_DIR}/themes - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation) + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation) install(DIRECTORY ${CMAKE_SOURCE_DIR}/resources - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation) + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/emulationstation) endif() include(InstallRequiredSystemLibraries) @@ -317,13 +317,13 @@ endif() # Settings per operating system and generator type. if(APPLE) set(CPACK_GENERATOR "Bundle") - if (CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.14) + if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.14) set(CPACK_PACKAGE_FILE_NAME "EmulationStation-DE-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}_legacy") set(CPACK_DMG_VOLUME_NAME "EmulationStation Desktop Edition ${CPACK_PACKAGE_VERSION}_legacy") - else () + else() set(CPACK_PACKAGE_FILE_NAME "EmulationStation-DE-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}") set(CPACK_DMG_VOLUME_NAME "EmulationStation Desktop Edition ${CPACK_PACKAGE_VERSION}") - endif () + endif() set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE.icns") set(CPACK_DMG_DS_STORE "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_DS_Store") set(CPACK_BUNDLE_NAME "EmulationStation Desktop Edition") @@ -331,9 +331,9 @@ if(APPLE) set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/assets/EmulationStation-DE_Info.plist") if(MACOS_CODESIGN_IDENTITY) set(CPACK_BUNDLE_APPLE_CERT_APP "Developer ID Application: ${MACOS_CODESIGN_IDENTITY}") - if (CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER 10.13) + if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER 10.13) set(CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER "--deep --force --options runtime") - endif () + endif() endif() elseif(WIN32) set(CPACK_GENERATOR "NSIS") @@ -354,9 +354,9 @@ elseif(WIN32) else() set(CPACK_PACKAGE_INSTALL_DIRECTORY "emulationstation_${CMAKE_PACKAGE_VERSION}") set(CPACK_PACKAGE_EXECUTABLES "emulationstation" "emulationstation") - if (LINUX_CPACK_GENERATOR STREQUAL "DEB") + if(LINUX_CPACK_GENERATOR STREQUAL "DEB") set(CPACK_GENERATOR "DEB") - endif () + endif() set(CPACK_DEBIAN_FILE_NAME "emulationstation-de-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}.deb") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Leon Styhre ") set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://es-de.org") @@ -366,9 +366,9 @@ else() set(CPACK_DEBIAN_PACKAGE_DEPENDS "vlc") endif() set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) - if (LINUX_CPACK_GENERATOR STREQUAL "RPM") + if(LINUX_CPACK_GENERATOR STREQUAL "RPM") set(CPACK_GENERATOR "RPM") - endif () + endif() set(CPACK_RPM_FILE_NAME "emulationstation-de-${CPACK_PACKAGE_VERSION}-${CPU_ARCHITECTURE}.rpm") set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) set(CPACK_RPM_PACKAGE_LICENSE "MIT") diff --git a/es-app/src/FileFilterIndex.h b/es-app/src/FileFilterIndex.h index a9a127ad1..d4d744a7f 100644 --- a/es-app/src/FileFilterIndex.h +++ b/es-app/src/FileFilterIndex.h @@ -50,37 +50,22 @@ class FileFilterIndex public: FileFilterIndex(); ~FileFilterIndex(); - void addToIndex(FileData* game); - void removeFromIndex(FileData* game); - void setFilter(FilterIndexType type, std::vector* values); - void setTextFilter(std::string textFilter); - std::string getTextFilter() { return mTextFilter; } - void clearAllFilters(); - void debugPrintIndexes(); - bool showFile(FileData* game); - bool isFiltered(); - bool isKeyBeingFilteredBy(std::string key, FilterIndexType type); - std::vector& getFilterDataDecls() { return filterDataDecl; } - void setTextRemoveSystem(bool status) { mTextRemoveSystem = status; } void importIndex(FileFilterIndex* indexToImport); - void resetIndex(); - void resetFilters(); - void setKidModeFilters(); private: diff --git a/es-app/src/FileSorts.h b/es-app/src/FileSorts.h index 424acf109..e7f84346d 100644 --- a/es-app/src/FileSorts.h +++ b/es-app/src/FileSorts.h @@ -18,41 +18,23 @@ namespace FileSorts { bool compareName(const FileData* file1, const FileData* file2); bool compareNameDescending(const FileData* file1, const FileData* file2); - bool compareRating(const FileData* file1, const FileData* file2); - bool compareRatingDescending(const FileData* file1, const FileData* file2); - bool compareReleaseDate(const FileData* file1, const FileData* file2); - bool compareReleaseDateDescending(const FileData* file1, const FileData* file2); - bool compareDeveloper(const FileData* file1, const FileData* file2); - bool compareDeveloperDescending(const FileData* file1, const FileData* file2); - bool comparePublisher(const FileData* file1, const FileData* file2); - bool comparePublisherDescending(const FileData* file1, const FileData* file2); - bool compareGenre(const FileData* file1, const FileData* file2); - bool compareGenreDescending(const FileData* file1, const FileData* file2); - bool compareNumPlayers(const FileData* file1, const FileData* file2); - bool compareNumPlayersDescending(const FileData* file1, const FileData* file2); - bool compareLastPlayed(const FileData* file1, const FileData* file2); - bool compareLastPlayedDescending(const FileData* file1, const FileData* file2); - bool compareTimesPlayed(const FileData* file1, const FileData* fil2); - bool compareTimesPlayedDescending(const FileData* file1, const FileData* fil2); - bool compareSystem(const FileData* file1, const FileData* file2); - bool compareSystemDescending(const FileData* file1, const FileData* file2); extern const std::vector SortTypes; diff --git a/es-app/src/guis/GuiLaunchScreen.h b/es-app/src/guis/GuiLaunchScreen.h index dac32f24f..c40d3c220 100644 --- a/es-app/src/guis/GuiLaunchScreen.h +++ b/es-app/src/guis/GuiLaunchScreen.h @@ -22,17 +22,14 @@ class GuiLaunchScreen : public Window::GuiLaunchScreen, GuiComponent { public: GuiLaunchScreen(Window* window); - virtual ~GuiLaunchScreen(); virtual void displayLaunchScreen(FileData* game) override; - virtual void closeLaunchScreen() override; void onSizeChanged() override; virtual void update(int deltaTime) override; - virtual void render(const glm::mat4& parentTrans) override; private: diff --git a/es-app/src/guis/GuiScraperSearch.h b/es-app/src/guis/GuiScraperSearch.h index fb824360e..449124ba0 100644 --- a/es-app/src/guis/GuiScraperSearch.h +++ b/es-app/src/guis/GuiScraperSearch.h @@ -63,27 +63,20 @@ public: { mAcceptCallback = acceptCallback; } - void setSkipCallback(const std::function& skipCallback) { mSkipCallback = skipCallback; } - void setCancelCallback(const std::function& cancelCallback) { mCancelCallback = cancelCallback; } bool input(InputConfig* config, Input input) override; - void update(int deltaTime) override; - void render(const glm::mat4& parentTrans) override; - std::vector getHelpPrompts() override; - HelpStyle getHelpStyle() override; - void onSizeChanged() override; void decreaseScrapeCount() @@ -91,26 +84,18 @@ public: if (mScrapeCount > 0) mScrapeCount--; } - void unsetRefinedSearch() { mRefinedSearch = false; } - bool getRefinedSearch() { return mRefinedSearch; } - bool getFoundGame() { return mFoundGame; } - const std::string& getNameOverride() { return mLastSearch.nameOverride; } void onFocusGained() override { mGrid.onFocusGained(); } - void onFocusLost() override { mGrid.onFocusLost(); } private: void updateViewStyle(); - void updateThumbnail(); - void updateInfoPane(); - void resizeMetadata(); void onSearchError(const std::string& error, diff --git a/es-core/CMakeLists.txt b/es-core/CMakeLists.txt index d906217a7..92a164761 100644 --- a/es-core/CMakeLists.txt +++ b/es-core/CMakeLists.txt @@ -9,157 +9,157 @@ project("core") set(CORE_HEADERS - ${CMAKE_CURRENT_SOURCE_DIR}/src/AsyncHandle.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/AudioManager.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/CECInput.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/GuiComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/HelpStyle.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/HttpReq.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/ImageIO.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/InputConfig.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/InputManager.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/Log.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/MameNames.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/Platform.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/Settings.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/Sound.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/ThemeData.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/Window.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/AsyncHandle.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/AudioManager.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/CECInput.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/GuiComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/HelpStyle.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/HttpReq.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/ImageIO.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/InputConfig.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/InputManager.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/Log.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/MameNames.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/Platform.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/Settings.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/Sound.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/ThemeData.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/Window.h - # Animations - ${CMAKE_CURRENT_SOURCE_DIR}/src/animations/Animation.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/animations/AnimationController.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/animations/LambdaAnimation.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/animations/MoveCameraAnimation.h + # Animations + ${CMAKE_CURRENT_SOURCE_DIR}/src/animations/Animation.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/animations/AnimationController.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/animations/LambdaAnimation.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/animations/MoveCameraAnimation.h - # GUI components - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/AnimatedImageComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/BadgesComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/BusyComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ButtonComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ComponentGrid.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ComponentList.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/DateTimeComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/DateTimeEditComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/FlexboxComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/GridTileComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/HelpComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/IList.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ImageComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ImageGridComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/MenuComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/NinePatchComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/OptionListComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/RatingComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ScrollableContainer.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SliderComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SwitchComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextEditComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextListComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoFFmpegComponent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoVlcComponent.h + # GUI components + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/AnimatedImageComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/BadgesComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/BusyComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ButtonComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ComponentGrid.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ComponentList.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/DateTimeComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/DateTimeEditComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/FlexboxComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/GridTileComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/HelpComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/IList.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ImageComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ImageGridComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/MenuComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/NinePatchComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/OptionListComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/RatingComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ScrollableContainer.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SliderComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SwitchComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextEditComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextListComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoFFmpegComponent.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoVlcComponent.h - # GUIs - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiDetectDevice.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInputConfig.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMsgBox.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiTextEditKeyboardPopup.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiTextEditPopup.h + # GUIs + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiDetectDevice.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInputConfig.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMsgBox.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiTextEditKeyboardPopup.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiTextEditPopup.h - # Renderers - ${CMAKE_CURRENT_SOURCE_DIR}/src/renderers/Renderer.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/renderers/Shader_GL21.h + # Renderers + ${CMAKE_CURRENT_SOURCE_DIR}/src/renderers/Renderer.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/renderers/Shader_GL21.h - # Resources - ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/Font.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/ResourceManager.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/TextureData.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/TextureDataManager.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/TextureResource.h + # Resources + ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/Font.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/ResourceManager.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/TextureData.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/TextureDataManager.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/TextureResource.h - # Utils - ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/CImgUtil.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/FileSystemUtil.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/MathUtil.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/StringUtil.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/TimeUtil.h - ) + # Utils + ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/CImgUtil.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/FileSystemUtil.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/MathUtil.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/StringUtil.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/TimeUtil.h +) set(CORE_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/src/AudioManager.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/CECInput.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/GuiComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/HelpStyle.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/HttpReq.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/ImageIO.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/InputConfig.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/InputManager.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/Log.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/MameNames.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/Platform.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/Scripting.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/Settings.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/Sound.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/ThemeData.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/Window.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/AudioManager.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/CECInput.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/GuiComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/HelpStyle.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/HttpReq.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/ImageIO.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/InputConfig.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/InputManager.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Log.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/MameNames.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Platform.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Scripting.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Settings.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Sound.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/ThemeData.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/Window.cpp - # Animations - ${CMAKE_CURRENT_SOURCE_DIR}/src/animations/AnimationController.cpp + # Animations + ${CMAKE_CURRENT_SOURCE_DIR}/src/animations/AnimationController.cpp - # GUI components - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/AnimatedImageComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/BadgesComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/BusyComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ButtonComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ComponentGrid.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ComponentList.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/DateTimeComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/DateTimeEditComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/FlexboxComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/GridTileComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/HelpComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ImageComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/MenuComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/NinePatchComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/RatingComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ScrollableContainer.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SliderComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SwitchComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextEditComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoFFmpegComponent.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoVlcComponent.cpp + # GUI components + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/AnimatedImageComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/BadgesComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/BusyComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ButtonComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ComponentGrid.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ComponentList.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/DateTimeComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/DateTimeEditComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/FlexboxComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/GridTileComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/HelpComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ImageComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/MenuComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/NinePatchComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/RatingComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/ScrollableContainer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SliderComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/SwitchComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextEditComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoFFmpegComponent.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/VideoVlcComponent.cpp - # GUIs - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiDetectDevice.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInputConfig.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMsgBox.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiTextEditKeyboardPopup.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiTextEditPopup.cpp + # GUIs + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiDetectDevice.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInputConfig.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMsgBox.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiTextEditKeyboardPopup.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiTextEditPopup.cpp - # Renderer - ${CMAKE_CURRENT_SOURCE_DIR}/src/renderers/Renderer.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/renderers/Renderer_GL21.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/renderers/Renderer_GLES10.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/renderers/Shader_GL21.cpp + # Renderer + ${CMAKE_CURRENT_SOURCE_DIR}/src/renderers/Renderer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/renderers/Renderer_GL21.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/renderers/Renderer_GLES10.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/renderers/Shader_GL21.cpp - # Resources - ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/Font.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/ResourceManager.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/TextureResource.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/TextureData.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/TextureDataManager.cpp + # Resources + ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/Font.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/ResourceManager.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/TextureResource.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/TextureData.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/resources/TextureDataManager.cpp - # Utils - ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/CImgUtil.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/FileSystemUtil.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/MathUtil.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/StringUtil.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/TimeUtil.cpp - ) + # Utils + ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/CImgUtil.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/FileSystemUtil.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/MathUtil.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/StringUtil.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/TimeUtil.cpp +) include_directories(${COMMON_INCLUDE_DIRS}) add_library(es-core STATIC ${CORE_SOURCES} ${CORE_HEADERS}) diff --git a/es-core/src/GuiComponent.h b/es-core/src/GuiComponent.h index eea4bad10..322efab40 100644 --- a/es-core/src/GuiComponent.h +++ b/es-core/src/GuiComponent.h @@ -38,7 +38,6 @@ class GuiComponent { public: GuiComponent(Window* window); - virtual ~GuiComponent(); virtual void textInput(const std::string& text); @@ -232,7 +231,6 @@ public: protected: void renderChildren(const glm::mat4& transform) const; - void updateSelf(int deltaTime); // Updates animations. void updateChildren(int deltaTime); // Updates animations. diff --git a/es-core/src/components/ButtonComponent.cpp b/es-core/src/components/ButtonComponent.cpp index d7ffd4d23..3143f52a9 100644 --- a/es-core/src/components/ButtonComponent.cpp +++ b/es-core/src/components/ButtonComponent.cpp @@ -29,6 +29,7 @@ ButtonComponent::ButtonComponent(Window* window, , mTextColorUnfocused{0x777777FF} , mFlatColorFocused{0x878787FF} , mFlatColorUnfocused{0x60606025} + { setPressedFunc(func); setText(text, helpText, upperCase); diff --git a/es-core/src/components/ButtonComponent.h b/es-core/src/components/ButtonComponent.h index 3affa67f2..55ad497db 100644 --- a/es-core/src/components/ButtonComponent.h +++ b/es-core/src/components/ButtonComponent.h @@ -25,38 +25,30 @@ public: bool flatStyle = false); void onSizeChanged() override; - void onFocusGained() override; - void onFocusLost() override; void setText(const std::string& text, const std::string& helpText, bool upperCase = true); - const std::string& getText() const { return mText; } void setPressedFunc(std::function f) { mPressedFunc = f; } - void setEnabled(bool state) override; void setPadding(const glm::vec4 padding); - glm::vec4 getPadding() { return mPadding; } void setFlatColorFocused(unsigned int color) { mFlatColorFocused = color; } - void setFlatColorUnfocused(unsigned int color) { mFlatColorUnfocused = color; } const std::function& getPressedFunc() const { return mPressedFunc; } bool input(InputConfig* config, Input input) override; - void render(const glm::mat4& parentTrans) override; virtual std::vector getHelpPrompts() override; private: unsigned int getCurTextColor() const; - void updateImage(); NinePatchComponent mBox; diff --git a/es-core/src/components/ComponentGrid.h b/es-core/src/components/ComponentGrid.h index 94300ae68..fc1145108 100644 --- a/es-core/src/components/ComponentGrid.h +++ b/es-core/src/components/ComponentGrid.h @@ -34,7 +34,6 @@ class ComponentGrid : public GuiComponent { public: ComponentGrid(Window* window, const glm::ivec2& gridDimensions); - virtual ~ComponentGrid(); bool removeEntry(const std::shared_ptr& comp); @@ -53,35 +52,26 @@ public: } void textInput(const std::string& text) override; - bool input(InputConfig* config, Input input) override; - void update(int deltaTime) override; - void render(const glm::mat4& parentTrans) override; - void onSizeChanged() override; void resetCursor(); - bool cursorValid(); float getColWidth(int col); - float getRowHeight(int row); // If update is false, will not call an onSizeChanged() which triggers // a (potentially costly) repositioning + resizing of every element. void setColWidthPerc(int col, float width, bool update = true); - // Dito. void setRowHeightPerc(int row, float height, bool update = true); bool moveCursor(glm::ivec2 dir); - // Pass -1 for xPos or yPos to keep its axis cursor position. void moveCursorTo(int xPos, int yPos, bool selectLeftCell = false); - void setCursorTo(const std::shared_ptr& comp); std::shared_ptr getSelectedComponent() @@ -94,7 +84,6 @@ public: } void onFocusLost() override; - void onFocusGained() override; virtual std::vector getHelpPrompts() override; @@ -133,13 +122,10 @@ private: // Update position and size. void updateCellComponent(const GridEntry& cell); - void updateSeparators(); void onCursorMoved(glm::ivec2 from, glm::ivec2 to); - const GridEntry* getCellAt(int x, int y) const; - const GridEntry* getCellAt(const glm::ivec2& pos) const { return getCellAt(pos.x, pos.y); } std::vector> mSeparators; diff --git a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp index 504fc942c..b3f46a3d3 100644 --- a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp +++ b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp @@ -39,38 +39,38 @@ #include "utils/StringUtil.h" // clang-format off -std::vector> kbBaseUS{ - {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "DEL"}, - {"!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "DEL"}, - {"¡", "²", "³", "¤", "€", "¼", "½", "¾", "‘", "’", "¥", "×", "DEL"}, - {"¹", "", "", "£", "", "", "", "", "", "", "", "÷", "DEL"}, +std::vector> kbBaseUS{ + {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "DEL"}, + {"!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "DEL"}, + {"¡", "²", "³", "¤", "€", "¼", "½", "¾", "‘", "’", "¥", "×", "DEL"}, + {"¹", "", "", "£", "", "", "", "", "", "", "", "÷", "DEL"}, - {"q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "OK"}, - {"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "{", "}", "OK"}, - {"ä", "å", "é", "®", "þ", "ü", "ú", "í", "ó", "ö", "«", "»", "OK"}, - {"Ä", "Å", "É", "", "Þ", "Ü", "Ú", "Í", "Ó", "Ö", "", "", "OK"}, + {"q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "OK"}, + {"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "{", "}", "OK"}, + {"ä", "å", "é", "®", "þ", "ü", "ú", "í", "ó", "ö", "«", "»", "OK"}, + {"Ä", "Å", "É", "", "Þ", "Ü", "Ú", "Í", "Ó", "Ö", "", "", "OK"}, - {"a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "\\", "-rowspan-"}, - {"A", "S", "D", "F", "G", "H", "J", "K", "L", ":", "\"", "|", "-rowspan-"}, - {"á", "ß", "ð", "", "", "", "", "", "ø", "¶", "´", "¬", "-rowspan-"}, - {"Á", "§", "Ð", "", "", "", "", "", "Ø", "°", "¨", "¦", "-rowspan-"}, + {"a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "\\", "-rowspan-"}, + {"A", "S", "D", "F", "G", "H", "J", "K", "L", ":", "\"", "|", "-rowspan-"}, + {"á", "ß", "ð", "", "", "", "", "", "ø", "¶", "´", "¬", "-rowspan-"}, + {"Á", "§", "Ð", "", "", "", "", "", "Ø", "°", "¨", "¦", "-rowspan-"}, - {"`", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "ALT", "-colspan-"}, - {"~", "Z", "X", "C", "V", "B", "N", "M", "<", ">", "?", "ALT", "-colspan-"}, - {"", "æ", "", "©", "", "", "ñ", "µ", "ç", "", "¿", "ALT", "-colspan-"}, - {"", "Æ", "", "¢", "", "", "Ñ", "Μ", "Ç", "", "", "ALT", "-colspan-"}}; + {"`", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "ALT", "-colspan-"}, + {"~", "Z", "X", "C", "V", "B", "N", "M", "<", ">", "?", "ALT", "-colspan-"}, + {"", "æ", "", "©", "", "", "ñ", "µ", "ç", "", "¿", "ALT", "-colspan-"}, + {"", "Æ", "", "¢", "", "", "Ñ", "Μ", "Ç", "", "", "ALT", "-colspan-"}}; -std::vector> kbLastRowNormal{ - {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, - {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, - {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, - {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}}; +std::vector> kbLastRowNormal{ + {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, + {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, + {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, + {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}}; -std::vector> kbLastRowLoad{ - {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, - {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, - {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, - {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}}; +std::vector> kbLastRowLoad{ + {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, + {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, + {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, + {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}}; // clang-format on GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( diff --git a/es-core/src/guis/GuiTextEditKeyboardPopup.h b/es-core/src/guis/GuiTextEditKeyboardPopup.h index 6ec0ac8b4..b8660fdf0 100644 --- a/es-core/src/guis/GuiTextEditKeyboardPopup.h +++ b/es-core/src/guis/GuiTextEditKeyboardPopup.h @@ -33,13 +33,10 @@ public: const std::string& cancelBtnHelpText = "DISCARD CHANGES"); void onSizeChanged() override; - bool input(InputConfig* config, Input input) override; - void update(int deltaTime) override; std::vector getHelpPrompts() override; - HelpStyle getHelpStyle() override { return mHelpStyle; } private: @@ -51,7 +48,6 @@ private: const std::string shiftedKey; const std::string altedKey; const std::string altshiftedKey; - KeyboardButton(const std::shared_ptr b, const std::string& k, const std::string& sk, @@ -65,20 +61,16 @@ private: }; void updateDeleteRepeat(int deltaTime); - void updateNavigationRepeat(int deltaTime); void shiftKeys(); - void altKeys(); - void altShiftKeys(); std::shared_ptr makeButton(const std::string& key, const std::string& shiftedKey, const std::string& altedKey, const std::string& altshiftedKey); - std::vector mKeyboardButtons; std::shared_ptr mShiftButton; diff --git a/es-core/src/guis/GuiTextEditPopup.h b/es-core/src/guis/GuiTextEditPopup.h index 70c473f2c..a77623704 100644 --- a/es-core/src/guis/GuiTextEditPopup.h +++ b/es-core/src/guis/GuiTextEditPopup.h @@ -33,13 +33,10 @@ public: const std::string& cancelBtnHelpText = "DISCARD CHANGES"); void onSizeChanged() override; - bool input(InputConfig* config, Input input) override; - void update(int deltaTime) override; std::vector getHelpPrompts() override; - HelpStyle getHelpStyle() override { return mHelpStyle; } private: diff --git a/resources/systems/macos/es_systems.xml b/resources/systems/macos/es_systems.xml index 85064121e..ffe09a5d2 100644 --- a/resources/systems/macos/es_systems.xml +++ b/resources/systems/macos/es_systems.xml @@ -99,12 +99,10 @@ .cmd .CMD .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2000_libretro.dylib %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2003_plus_libretro.dylib %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2003_plus_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2010_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbneo_libretro.dylib %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_libretro.dylib %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_libretro.dylib %ROM% arcade arcade
@@ -222,15 +220,10 @@ c64 Commodore 64 %ROMPATH%/c64 - .bin .BIN .cmd .CMD .crt .CRT .d2m .D2M .d4m .D4M .d64 .D64 .d6z .D6Z .d71 .D71 .d7z .D7Z .d80 .D80 - .d81 .D81 .d82 .D82 .d8z .D8Z .g41 .G41 .g4z .G4Z .g64 .G64 .g6z .G6Z .gz .GZ .lnx .LNX .m3u .M3U .nbz .NBZ - .nib .NIB .p00 .P00 .prg .PRG .t64 .T64 .tap .TAP .vfl .VFL .vsf .VSF .x64 .X64 .x6z .X6Z .7z .7Z .zip .ZIP - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vice_x64sc_libretro.dylib %ROM% - + .bin .BIN .cmd .CMD .crt .CRT .d2m .D2M .d4m .D4M .d64 .D64 .d6z .D6Z .d71 .D71 .d7z .D7Z .d80 .D80 .d81 .D81 .d82 .D82 .d8z .D8Z .g41 .G41 .g4z .G4Z .g64 .G64 .g6z .G6Z .gz .GZ .lnx .LNX .m3u .M3U .nbz .NBZ .nib .NIB .p00 .P00 .prg .PRG .t64 .T64 .tap .TAP .vfl .VFL .vsf .VSF .x64 .X64 .x6z .X6Z .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vice_x64sc_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vice_x64_libretro.dylib %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vice_xscpu64_libretro.dylib %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vice_xscpu64_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vice_x128_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/frodo_libretro.dylib %ROM% c64 @@ -363,20 +356,11 @@ FinalBurn Alpha %ROMPATH%/fba .iso .ISO .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_libretro.dylib %ROM% - - %EMULATOR_RETROARCH% -L - %CORE_RETROARCH%/fbalpha2012_neogeo_libretro.dylib %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_cps1_libretro.dylib - %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_cps2_libretro.dylib - %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_cps3_libretro.dylib - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_neogeo_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_cps1_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_cps2_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_cps3_libretro.dylib %ROM% arcade fba @@ -472,14 +456,9 @@ genesis Sega Genesis %ROMPATH%/genesis - .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx - .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% - - %EMULATOR_RETROARCH% -L - %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.dylib %ROM% - + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/picodrive_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/blastem_libretro.dylib %ROM% genesis @@ -544,14 +523,12 @@ Multiple Arcade Machine Emulator %ROMPATH%/mame .cmd .CMD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2003_plus_libretro.dylib %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2003_plus_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2000_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2010_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbneo_libretro.dylib %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_libretro.dylib %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_libretro.dylib %ROM% arcade mame @@ -577,14 +554,9 @@ mastersystem Sega Master System %ROMPATH%/mastersystem - .68k .68K .bin .BIN .bms .BMS .chd .CHD .col .COL .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md - .MD .mdx .MDX .rom .ROM .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% - - %EMULATOR_RETROARCH% -L - %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.dylib %ROM% - + .68k .68K .bin .BIN .bms .BMS .chd .CHD .col .COL .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .rom .ROM .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/smsplus_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gearsystem_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/picodrive_libretro.dylib %ROM% @@ -617,14 +589,9 @@ megadrive Sega Mega Drive %ROMPATH%/megadrive - .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx - .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% - - %EMULATOR_RETROARCH% -L - %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.dylib %ROM% - + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/picodrive_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/blastem_libretro.dylib %ROM% megadrive @@ -882,13 +849,9 @@ pcengine NEC PC Engine %ROMPATH%/pcengine - .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC - .7z .7Z .zip .ZIP - + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_libretro.dylib %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.dylib - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.dylib %ROM% pcengine pcengine @@ -896,13 +859,9 @@ pcenginecd NEC PC Engine CD %ROMPATH%/pcenginecd - .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC - .7z .7Z .zip .ZIP - + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_libretro.dylib %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.dylib - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.dylib %ROM% pcenginecd pcenginecd @@ -982,14 +941,10 @@ psx Sony PlayStation %ROMPATH%/psx - .bin .BIN .cbn .CBN .ccd .CCD .chd .CHD .cue .CUE .ecm .ECM .exe .EXE .img .IMG .iso .ISO .m3u .M3U - .mdf .MDF .mds .MDS .pbp .PBP .psexe .PSEXE .psf .PSF .toc .TOC .z .Z .znx .ZNX .7z .7Z .zip .ZIP - + .bin .BIN .cbn .CBN .ccd .CCD .chd .CHD .cue .CUE .ecm .ECM .exe .EXE .img .IMG .iso .ISO .m3u .M3U .mdf .MDF .mds .MDS .pbp .PBP .psexe .PSEXE .psf .PSF .toc .TOC .z .Z .znx .ZNX .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_psx_libretro.dylib %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_psx_hw_libretro.dylib %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/pcsx_rearmed_libretro.dylib %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_psx_hw_libretro.dylib %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/pcsx_rearmed_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/duckstation_libretro.dylib %ROM% psx psx @@ -1108,15 +1063,11 @@ snes Nintendo SNES (Super Nintendo) %ROMPATH%/snes - .bin .BIN .bml .BML .bs .BS .bsx .BSX .dx2 .DX2 .fig .FIG .gd3 .GD3 .gd7 .GD7 .mgd .MGD .sfc .SFC - .smc .SMC .st .ST .swc .SWC .7z .7Z .zip .ZIP - + .bin .BIN .bml .BML .bs .BS .bsx .BSX .dx2 .DX2 .fig .FIG .gd3 .GD3 .gd7 .GD7 .mgd .MGD .sfc .SFC .smc .SMC .st .ST .swc .SWC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x2010_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.dylib %ROM% - %EMULATOR_RETROARCH% -L - %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.dylib %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mesen-s_libretro.dylib %ROM% snes snes @@ -1125,15 +1076,11 @@ snesna Nintendo SNES (Super Nintendo) %ROMPATH%/snesna - .bin .BIN .bml .BML .bs .BS .bsx .BSX .dx2 .DX2 .fig .FIG .gd3 .GD3 .gd7 .GD7 .mgd .MGD .sfc .SFC - .smc .SMC .st .ST .swc .SWC .7z .7Z .zip .ZIP - + .bin .BIN .bml .BML .bs .BS .bsx .BSX .dx2 .DX2 .fig .FIG .gd3 .GD3 .gd7 .GD7 .mgd .MGD .sfc .SFC .smc .SMC .st .ST .swc .SWC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x2010_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.dylib %ROM% - %EMULATOR_RETROARCH% -L - %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.dylib %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mesen-s_libretro.dylib %ROM% snes snesna @@ -1191,9 +1138,7 @@ NEC SuperGrafx %ROMPATH%/supergrafx .pce .PCE .sgx .SGX .cue .CUE .ccd .CCD .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_supergrafx_libretro.dylib - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_supergrafx_libretro.dylib %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_libretro.dylib %ROM% supergrafx supergrafx @@ -1220,13 +1165,9 @@ tg16 NEC TurboGrafx-16 %ROMPATH%/tg16 - .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC - .7z .7Z .zip .ZIP - + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_libretro.dylib %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.dylib - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.dylib %ROM% pcengine tg16 @@ -1234,13 +1175,9 @@ tg-cd NEC TurboGrafx-CD %ROMPATH%/tg-cd - .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC - .7z .7Z .zip .ZIP - + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_libretro.dylib %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.dylib - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.dylib %ROM% tg-cd diff --git a/resources/systems/unix/es_systems.xml b/resources/systems/unix/es_systems.xml index 105c0669d..fa1976071 100644 --- a/resources/systems/unix/es_systems.xml +++ b/resources/systems/unix/es_systems.xml @@ -15,8 +15,7 @@ Nintendo 64DD %ROMPATH%/64dd .n64 .N64 .v64 .V64 .z64 .Z64 .bin .BIN .u1 .U1 .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mupen64plus_next_libretro.so %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mupen64plus_next_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/parallel_n64_libretro.so %ROM% n64 64dd @@ -101,8 +100,7 @@ .cmd .CMD .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2000_libretro.so %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2003_plus_libretro.so %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2003_plus_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2010_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbneo_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_libretro.so %ROM% @@ -223,15 +221,10 @@ c64 Commodore 64 %ROMPATH%/c64 - .bin .BIN .cmd .CMD .crt .CRT .d2m .D2M .d4m .D4M .d64 .D64 .d6z .D6Z .d71 .D71 .d7z .D7Z .d80 .D80 - .d81 .D81 .d82 .D82 .d8z .D8Z .g41 .G41 .g4z .G4Z .g64 .G64 .g6z .G6Z .gz .GZ .lnx .LNX .m3u .M3U .nbz .NBZ - .nib .NIB .p00 .P00 .prg .PRG .t64 .T64 .tap .TAP .vfl .VFL .vsf .VSF .x64 .X64 .x6z .X6Z .7z .7Z .zip .ZIP - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vice_x64sc_libretro.so %ROM% - + .bin .BIN .cmd .CMD .crt .CRT .d2m .D2M .d4m .D4M .d64 .D64 .d6z .D6Z .d71 .D71 .d7z .D7Z .d80 .D80 .d81 .D81 .d82 .D82 .d8z .D8Z .g41 .G41 .g4z .G4Z .g64 .G64 .g6z .G6Z .gz .GZ .lnx .LNX .m3u .M3U .nbz .NBZ .nib .NIB .p00 .P00 .prg .PRG .t64 .T64 .tap .TAP .vfl .VFL .vsf .VSF .x64 .X64 .x6z .X6Z .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vice_x64sc_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vice_x64_libretro.so %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vice_xscpu64_libretro.so %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vice_xscpu64_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/vice_x128_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/frodo_libretro.so %ROM% c64 @@ -365,18 +358,10 @@ %ROMPATH%/fba .iso .ISO .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_libretro.so %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_neogeo_libretro.so - %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_cps1_libretro.so - %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_cps2_libretro.so - %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_cps3_libretro.so - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_neogeo_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_cps1_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_cps2_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/fbalpha2012_cps3_libretro.so %ROM% arcade fba @@ -472,14 +457,9 @@ genesis Sega Genesis %ROMPATH%/genesis - .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx - .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.so - %ROM% - + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/picodrive_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/blastem_libretro.so %ROM% genesis @@ -544,8 +524,7 @@ Multiple Arcade Machine Emulator %ROMPATH%/mame .cmd .CMD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2003_plus_libretro.so %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2003_plus_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2000_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame2010_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mame_libretro.so %ROM% @@ -576,14 +555,9 @@ mastersystem Sega Master System %ROMPATH%/mastersystem - .68k .68K .bin .BIN .bms .BMS .chd .CHD .col .COL .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md - .MD .mdx .MDX .rom .ROM .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.so - %ROM% - + .68k .68K .bin .BIN .bms .BMS .chd .CHD .col .COL .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .rom .ROM .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/smsplus_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/gearsystem_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/picodrive_libretro.so %ROM% @@ -616,14 +590,9 @@ megadrive Sega Mega Drive %ROMPATH%/megadrive - .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx - .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.so - %ROM% - + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/genesis_plus_gx_wide_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/picodrive_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/blastem_libretro.so %ROM% megadrive @@ -719,8 +688,7 @@ Nintendo 64 %ROMPATH%/n64 .n64 .N64 .v64 .V64 .z64 .Z64 .bin .BIN .u1 .U1 .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mupen64plus_next_libretro.so %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mupen64plus_next_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/parallel_n64_libretro.so %ROM% n64 n64 @@ -883,12 +851,9 @@ pcengine NEC PC Engine %ROMPATH%/pcengine - .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC - .7z .7Z .zip .ZIP - + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_libretro.so %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.so %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.so %ROM% pcengine pcengine @@ -896,12 +861,9 @@ pcenginecd NEC PC Engine CD %ROMPATH%/pcenginecd - .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC - .7z .7Z .zip .ZIP - + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_libretro.so %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.so %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.so %ROM% pcenginecd pcenginecd @@ -981,12 +943,9 @@ psx Sony PlayStation %ROMPATH%/psx - .bin .BIN .cbn .CBN .ccd .CCD .chd .CHD .cue .CUE .ecm .ECM .exe .EXE .img .IMG .iso .ISO .m3u .M3U - .mdf .MDF .mds .MDS .pbp .PBP .psexe .PSEXE .psf .PSF .toc .TOC .z .Z .znx .ZNX .7z .7Z .zip .ZIP - + .bin .BIN .cbn .CBN .ccd .CCD .chd .CHD .cue .CUE .ecm .ECM .exe .EXE .img .IMG .iso .ISO .m3u .M3U .mdf .MDF .mds .MDS .pbp .PBP .psexe .PSEXE .psf .PSF .toc .TOC .z .Z .znx .ZNX .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_psx_libretro.so %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_psx_hw_libretro.so %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_psx_hw_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/pcsx_rearmed_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/duckstation_libretro.so %ROM% psx @@ -1110,18 +1069,12 @@ snes Nintendo SNES (Super Nintendo) %ROMPATH%/snes - .bin .BIN .bml .BML .bs .BS .bsx .BSX .dx2 .DX2 .fig .FIG .gd3 .GD3 .gd7 .GD7 .mgd .MGD .sfc .SFC - .smc .SMC .st .ST .swc .SWC .7z .7Z .zip .ZIP - + .bin .BIN .bml .BML .bs .BS .bsx .BSX .dx2 .DX2 .fig .FIG .gd3 .GD3 .gd7 .GD7 .mgd .MGD .sfc .SFC .smc .SMC .st .ST .swc .SWC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x2010_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.so %ROM% - %EMULATOR_RETROARCH% -L - %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.so %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_supafaust_libretro.so - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_supafaust_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mesen-s_libretro.so %ROM% snes snes @@ -1130,18 +1083,12 @@ snesna Nintendo SNES (Super Nintendo) %ROMPATH%/snesna - .bin .BIN .bml .BML .bs .BS .bsx .BSX .dx2 .DX2 .fig .FIG .gd3 .GD3 .gd7 .GD7 .mgd .MGD .sfc .SFC - .smc .SMC .st .ST .swc .SWC .7z .7Z .zip .ZIP - + .bin .BIN .bml .BML .bs .BS .bsx .BSX .dx2 .DX2 .fig .FIG .gd3 .GD3 .gd7 .GD7 .mgd .MGD .sfc .SFC .smc .SMC .st .ST .swc .SWC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/snes9x2010_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_libretro.so %ROM% - %EMULATOR_RETROARCH% -L - %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.so %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_supafaust_libretro.so - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/bsnes_mercury_accuracy_libretro.so %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_supafaust_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mesen-s_libretro.so %ROM% snes snesna @@ -1199,9 +1146,7 @@ NEC SuperGrafx %ROMPATH%/supergrafx .pce .PCE .sgx .SGX .cue .CUE .ccd .CCD .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_supergrafx_libretro.so - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_supergrafx_libretro.so %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_libretro.so %ROM% supergrafx supergrafx @@ -1228,12 +1173,9 @@ tg16 NEC TurboGrafx-16 %ROMPATH%/tg16 - .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC - .7z .7Z .zip .ZIP - + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_libretro.so %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.so %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.so %ROM% pcengine tg16 @@ -1241,12 +1183,9 @@ tg-cd NEC TurboGrafx-CD %ROMPATH%/tg-cd - .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC - .7z .7Z .zip .ZIP - + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_libretro.so %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.so %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%/mednafen_pce_fast_libretro.so %ROM% pcenginecd tg-cd diff --git a/resources/systems/windows/es_systems.xml b/resources/systems/windows/es_systems.xml index 8e0b793b8..9dbbea775 100644 --- a/resources/systems/windows/es_systems.xml +++ b/resources/systems/windows/es_systems.xml @@ -15,8 +15,7 @@ Nintendo 64DD %ROMPATH%\64dd .n64 .N64 .v64 .V64 .z64 .Z64 .bin .BIN .u1 .U1 .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mupen64plus_next_libretro.dll %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mupen64plus_next_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\parallel_n64_libretro.dll %ROM% n64 64dd @@ -101,8 +100,7 @@ .cmd .CMD .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mame_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mame2000_libretro.dll %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mame2003_plus_libretro.dll %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mame2003_plus_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mame2010_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fbneo_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fbalpha2012_libretro.dll %ROM% @@ -223,15 +221,10 @@ c64 Commodore 64 %ROMPATH%\c64 - .bin .BIN .cmd .CMD .crt .CRT .d2m .D2M .d4m .D4M .d64 .D64 .d6z .D6Z .d71 .D71 .d7z .D7Z .d80 .D80 - .d81 .D81 .d82 .D82 .d8z .D8Z .g41 .G41 .g4z .G4Z .g64 .G64 .g6z .G6Z .gz .GZ .lnx .LNX .m3u .M3U .nbz .NBZ - .nib .NIB .p00 .P00 .prg .PRG .t64 .T64 .tap .TAP .vfl .VFL .vsf .VSF .x64 .X64 .x6z .X6Z .7z .7Z .zip .ZIP - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\vice_x64sc_libretro.dll %ROM% - + .bin .BIN .cmd .CMD .crt .CRT .d2m .D2M .d4m .D4M .d64 .D64 .d6z .D6Z .d71 .D71 .d7z .D7Z .d80 .D80 .d81 .D81 .d82 .D82 .d8z .D8Z .g41 .G41 .g4z .G4Z .g64 .G64 .g6z .G6Z .gz .GZ .lnx .LNX .m3u .M3U .nbz .NBZ .nib .NIB .p00 .P00 .prg .PRG .t64 .T64 .tap .TAP .vfl .VFL .vsf .VSF .x64 .X64 .x6z .X6Z .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\vice_x64sc_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\vice_x64_libretro.dll %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\vice_xscpu64_libretro.dll %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\vice_xscpu64_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\vice_x128_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\frodo_libretro.dll %ROM% c64 @@ -365,18 +358,10 @@ %ROMPATH%\fba .iso .ISO .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fbalpha2012_libretro.dll %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fbalpha2012_neogeo_libretro.dll - %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fbalpha2012_cps1_libretro.dll - %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fbalpha2012_cps2_libretro.dll - %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fbalpha2012_cps3_libretro.dll - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fbalpha2012_neogeo_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fbalpha2012_cps1_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fbalpha2012_cps2_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\fbalpha2012_cps3_libretro.dll %ROM% arcade fba @@ -472,14 +457,9 @@ genesis Sega Genesis %ROMPATH%\genesis - .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx - .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_wide_libretro.dll - %ROM% - + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_wide_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\picodrive_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\blastem_libretro.dll %ROM% genesis @@ -544,8 +524,7 @@ Multiple Arcade Machine Emulator %ROMPATH%\mame .cmd .CMD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mame2003_plus_libretro.dll %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mame2003_plus_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mame2000_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mame2010_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mame_libretro.dll %ROM% @@ -576,14 +555,9 @@ mastersystem Sega Master System %ROMPATH%\mastersystem - .68k .68K .bin .BIN .bms .BMS .chd .CHD .col .COL .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md - .MD .mdx .MDX .rom .ROM .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_wide_libretro.dll - %ROM% - + .68k .68K .bin .BIN .bms .BMS .chd .CHD .col .COL .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .rom .ROM .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_wide_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\smsplus_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\gearsystem_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\picodrive_libretro.dll %ROM% @@ -616,14 +590,9 @@ megadrive Sega Mega Drive %ROMPATH%\megadrive - .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx - .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_wide_libretro.dll - %ROM% - + .68k .68K .bin .BIN .bms .BMS .chd .CHD .cue .CUE .gen .GEN .gg .GG .iso .ISO .m3u .M3U .md .MD .mdx .MDX .sg .SG .sgd .SGD .smd .SMD .sms .SMS .7z .7Z .zip .ZIP + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\genesis_plus_gx_wide_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\picodrive_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\blastem_libretro.dll %ROM% megadrive @@ -719,8 +688,7 @@ Nintendo 64 %ROMPATH%\n64 .n64 .N64 .v64 .V64 .z64 .Z64 .bin .BIN .u1 .U1 .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mupen64plus_next_libretro.dll %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mupen64plus_next_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\parallel_n64_libretro.dll %ROM% n64 n64 @@ -883,12 +851,9 @@ pcengine NEC PC Engine %ROMPATH%\pcengine - .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC - .7z .7Z .zip .ZIP - + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_libretro.dll %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_fast_libretro.dll %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_fast_libretro.dll %ROM% pcengine pcengine @@ -896,12 +861,9 @@ pcenginecd NEC PC Engine CD %ROMPATH%\pcenginecd - .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC - .7z .7Z .zip .ZIP - + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_libretro.dll %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_fast_libretro.dll %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_fast_libretro.dll %ROM% pcenginecd pcenginecd @@ -981,12 +943,9 @@ psx Sony PlayStation %ROMPATH%\psx - .bin .BIN .cbn .CBN .ccd .CCD .chd .CHD .cue .CUE .ecm .ECM .exe .EXE .img .IMG .iso .ISO .m3u .M3U - .mdf .MDF .mds .MDS .pbp .PBP .psexe .PSEXE .psf .PSF .toc .TOC .z .Z .znx .ZNX .7z .7Z .zip .ZIP - + .bin .BIN .cbn .CBN .ccd .CCD .chd .CHD .cue .CUE .ecm .ECM .exe .EXE .img .IMG .iso .ISO .m3u .M3U .mdf .MDF .mds .MDS .pbp .PBP .psexe .PSEXE .psf .PSF .toc .TOC .z .Z .znx .ZNX .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_psx_libretro.dll %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_psx_hw_libretro.dll %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_psx_hw_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\pcsx_rearmed_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\duckstation_libretro.dll %ROM% psx @@ -1110,18 +1069,12 @@ snes Nintendo SNES (Super Nintendo) %ROMPATH%\snes - .bin .BIN .bml .BML .bs .BS .bsx .BSX .dx2 .DX2 .fig .FIG .gd3 .GD3 .gd7 .GD7 .mgd .MGD .sfc .SFC - .smc .SMC .st .ST .swc .SWC .7z .7Z .zip .ZIP - + .bin .BIN .bml .BML .bs .BS .bsx .BSX .dx2 .DX2 .fig .FIG .gd3 .GD3 .gd7 .GD7 .mgd .MGD .sfc .SFC .smc .SMC .st .ST .swc .SWC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\snes9x_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\snes9x2010_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bsnes_libretro.dll %ROM% - %EMULATOR_RETROARCH% -L - %CORE_RETROARCH%\bsnes_mercury_accuracy_libretro.dll %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_supafaust_libretro.dll - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bsnes_mercury_accuracy_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_supafaust_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mesen-s_libretro.dll %ROM% snes snes @@ -1130,18 +1083,12 @@ snesna Nintendo SNES (Super Nintendo) %ROMPATH%\snesna - .bin .BIN .bml .BML .bs .BS .bsx .BSX .dx2 .DX2 .fig .FIG .gd3 .GD3 .gd7 .GD7 .mgd .MGD .sfc .SFC - .smc .SMC .st .ST .swc .SWC .7z .7Z .zip .ZIP - + .bin .BIN .bml .BML .bs .BS .bsx .BSX .dx2 .DX2 .fig .FIG .gd3 .GD3 .gd7 .GD7 .mgd .MGD .sfc .SFC .smc .SMC .st .ST .swc .SWC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\snes9x_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\snes9x2010_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bsnes_libretro.dll %ROM% - %EMULATOR_RETROARCH% -L - %CORE_RETROARCH%\bsnes_mercury_accuracy_libretro.dll %ROM% - - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_supafaust_libretro.dll - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\bsnes_mercury_accuracy_libretro.dll %ROM% + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_supafaust_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mesen-s_libretro.dll %ROM% snes snesna @@ -1199,9 +1146,7 @@ NEC SuperGrafx %ROMPATH%\supergrafx .pce .PCE .sgx .SGX .cue .CUE .ccd .CCD .chd .CHD .7z .7Z .zip .ZIP - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_supergrafx_libretro.dll - %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_supergrafx_libretro.dll %ROM% %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_libretro.dll %ROM% supergrafx supergrafx @@ -1228,12 +1173,9 @@ tg16 NEC TurboGrafx-16 %ROMPATH%\tg16 - .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC - .7z .7Z .zip .ZIP - + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_libretro.dll %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_fast_libretro.dll %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_fast_libretro.dll %ROM% pcengine tg16 @@ -1241,12 +1183,9 @@ tg-cd NEC TurboGrafx-CD %ROMPATH%\tg-cd - .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC - .7z .7Z .zip .ZIP - + .bin .BIN .ccd .CCD .chd .CHD .cue .CUE .img .IMG .iso .ISO .m3u .M3U .pce .PCE .sgx .SGX .toc .TOC .7z .7Z .zip .ZIP %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_libretro.dll %ROM% - %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_fast_libretro.dll %ROM% - + %EMULATOR_RETROARCH% -L %CORE_RETROARCH%\mednafen_pce_fast_libretro.dll %ROM% pcenginecd tg-cd From 7321bf8f368ae42ff04d3de760728abb75b63ec7 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 27 Sep 2021 21:41:22 +0200 Subject: [PATCH 27/42] Reverted the SVG caching logic. --- es-app/src/views/gamelist/GridGameListView.h | 2 -- es-core/src/components/BadgesComponent.cpp | 12 ++++++------ es-core/src/components/ImageComponent.cpp | 9 ++++----- es-core/src/components/ImageComponent.h | 9 ++------- es-core/src/resources/TextureResource.cpp | 5 ++--- es-core/src/resources/TextureResource.h | 4 +--- 6 files changed, 15 insertions(+), 26 deletions(-) diff --git a/es-app/src/views/gamelist/GridGameListView.h b/es-app/src/views/gamelist/GridGameListView.h index b89852271..2c2f50458 100644 --- a/es-app/src/views/gamelist/GridGameListView.h +++ b/es-app/src/views/gamelist/GridGameListView.h @@ -72,11 +72,9 @@ protected: private: void updateInfoPanel(); - const std::string getImagePath(FileData* file); void initMDLabels(); - void initMDValues(); ImageComponent mMarquee; diff --git a/es-core/src/components/BadgesComponent.cpp b/es-core/src/components/BadgesComponent.cpp index 7ef09ec25..9a28fa3c9 100644 --- a/es-core/src/components/BadgesComponent.cpp +++ b/es-core/src/components/BadgesComponent.cpp @@ -30,19 +30,19 @@ BadgesComponent::BadgesComponent(Window* window) mImageComponents = std::map(); ImageComponent mImageFavorite = ImageComponent(window); - mImageFavorite.setImage(mBadgeIcons[SLOT_FAVORITE], false, true, true); + mImageFavorite.setImage(mBadgeIcons[SLOT_FAVORITE], false, true); mImageComponents.insert({SLOT_FAVORITE, mImageFavorite}); ImageComponent mImageCompleted = ImageComponent(window); - mImageCompleted.setImage(mBadgeIcons[SLOT_COMPLETED], false, true, true); + mImageCompleted.setImage(mBadgeIcons[SLOT_COMPLETED], false, true); mImageComponents.insert({SLOT_COMPLETED, mImageCompleted}); ImageComponent mImageKids = ImageComponent(window); - mImageKids.setImage(mBadgeIcons[SLOT_KIDS], false, true, true); + mImageKids.setImage(mBadgeIcons[SLOT_KIDS], false, true); mImageComponents.insert({SLOT_KIDS, mImageKids}); ImageComponent mImageBroken = ImageComponent(window); - mImageBroken.setImage(mBadgeIcons[SLOT_BROKEN], false, true, true); + mImageBroken.setImage(mBadgeIcons[SLOT_BROKEN], false, true); mImageComponents.insert({SLOT_BROKEN, mImageBroken}); ImageComponent mImageAltEmu = ImageComponent(window); - mImageAltEmu.setImage(mBadgeIcons[SLOT_ALTERNATIVE_EMULATOR], false, true, true); + mImageAltEmu.setImage(mBadgeIcons[SLOT_ALTERNATIVE_EMULATOR], false, true); mImageComponents.insert({SLOT_ALTERNATIVE_EMULATOR, mImageAltEmu}); } @@ -99,7 +99,7 @@ void BadgesComponent::applyTheme(const std::shared_ptr& theme, if (properties & PATH && elem->has(slot) && mBadgeIcons[slot] != elem->get(slot)) { mBadgeIcons[slot] = elem->get(slot); - mImageComponents.find(slot)->second.setImage(mBadgeIcons[slot], false, true, true); + mImageComponents.find(slot)->second.setImage(mBadgeIcons[slot], false, true); imgChanged = true; } } diff --git a/es-core/src/components/ImageComponent.cpp b/es-core/src/components/ImageComponent.cpp index e3009b888..f6c2d2af2 100644 --- a/es-core/src/components/ImageComponent.cpp +++ b/es-core/src/components/ImageComponent.cpp @@ -138,7 +138,7 @@ void ImageComponent::resize() onSizeChanged(); } -void ImageComponent::setImage(std::string path, bool tile, bool linearMagnify, bool cacheImage) +void ImageComponent::setImage(std::string path, bool tile, bool linearMagnify) { // Always load bundled graphic resources statically, unless mForceLoad has been set. // This eliminates annoying texture pop-in problems that would otherwise occur. @@ -150,12 +150,11 @@ void ImageComponent::setImage(std::string path, bool tile, bool linearMagnify, b if (mDefaultPath.empty() || !ResourceManager::getInstance()->fileExists(mDefaultPath)) mTexture.reset(); else - mTexture = TextureResource::get(mDefaultPath, tile, mForceLoad, mDynamic, linearMagnify, - 1.0f, cacheImage); + mTexture = + TextureResource::get(mDefaultPath, tile, mForceLoad, mDynamic, linearMagnify); } else { - mTexture = - TextureResource::get(path, tile, mForceLoad, mDynamic, linearMagnify, 1.0f, cacheImage); + mTexture = TextureResource::get(path, tile, mForceLoad, mDynamic, linearMagnify); } resize(); diff --git a/es-core/src/components/ImageComponent.h b/es-core/src/components/ImageComponent.h index 60ba89cd9..159d65e3b 100644 --- a/es-core/src/components/ImageComponent.h +++ b/es-core/src/components/ImageComponent.h @@ -18,20 +18,15 @@ class ImageComponent : public GuiComponent { public: ImageComponent(Window* window, bool forceLoad = false, bool dynamic = true); - virtual ~ImageComponent() {}; + virtual ~ImageComponent() {} void setDefaultImage(std::string path) { mDefaultPath = path; } // Loads the image at the given filepath. Will tile if tile is true (retrieves texture // as tiling, creates vertices accordingly). - void setImage(std::string path, - bool tile = false, - bool linearMagnify = false, - bool cacheSVG = false); - + void setImage(std::string path, bool tile = false, bool linearMagnify = false); // Loads an image from memory. void setImage(const char* data, size_t length, bool tile = false); - // Use an already existing texture. void setImage(const std::shared_ptr& texture, bool resizeTexture = true); diff --git a/es-core/src/resources/TextureResource.cpp b/es-core/src/resources/TextureResource.cpp index 0b5272464..74e5d5bfe 100644 --- a/es-core/src/resources/TextureResource.cpp +++ b/es-core/src/resources/TextureResource.cpp @@ -148,8 +148,7 @@ std::shared_ptr TextureResource::get(const std::string& path, bool forceLoad, bool dynamic, bool linearMagnify, - float scaleDuringLoad, - bool cacheImage) + float scaleDuringLoad) { std::shared_ptr& rm = ResourceManager::getInstance(); @@ -177,7 +176,7 @@ std::shared_ptr TextureResource::get(const std::string& path, std::shared_ptr data = sTextureDataManager.get(tex.get()); // Is it an SVG? - if (key.first.substr(key.first.size() - 4, std::string::npos) != ".svg" || cacheImage) { + if (key.first.substr(key.first.size() - 4, std::string::npos) != ".svg") { // Probably not. Add it to our map. We don't add SVGs because 2 SVGs might be // rasterized at different sizes. sTextureMap[key] = std::weak_ptr(tex); diff --git a/es-core/src/resources/TextureResource.h b/es-core/src/resources/TextureResource.h index 39d096d6d..223d60fcc 100644 --- a/es-core/src/resources/TextureResource.h +++ b/es-core/src/resources/TextureResource.h @@ -30,9 +30,7 @@ public: bool forceLoad = false, bool dynamic = true, bool linearMagnify = false, - float scaleDuringLoad = 1.0f, - bool cacheImage = false); - + float scaleDuringLoad = 1.0f); void initFromPixels(const unsigned char* dataRGBA, size_t width, size_t height); virtual void initFromMemory(const char* data, size_t length); static void manualUnload(std::string path, bool tile); From 91f1a0a47daebaab3410f81f8ca3ccc33a3c3f36 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 27 Sep 2021 22:18:19 +0200 Subject: [PATCH 28/42] Improved the speed of the badges code. Also made some other adjustments to the badges and flexbox logic. --- .../views/gamelist/DetailedGameListView.cpp | 2 +- .../src/views/gamelist/VideoGameListView.cpp | 2 +- es-core/src/components/BadgesComponent.cpp | 34 +- es-core/src/components/BadgesComponent.h | 12 +- es-core/src/components/FlexboxComponent.cpp | 5 +- es-core/src/components/FlexboxComponent.h | 6 +- ...badge_altemu.svg => badge_altemulator.svg} | 2 +- resources/graphics/badge_broken.svg | 323 +++++++++++++---- resources/graphics/badge_completed.svg | 325 ++++++++++++++---- resources/graphics/badge_favorite.svg | 317 +++++++++++++---- resources/graphics/badge_kidgame.svg | 320 +++++++++++++---- themes/rbsimple-DE/theme.xml | 5 +- 12 files changed, 1045 insertions(+), 308 deletions(-) rename resources/graphics/{badge_altemu.svg => badge_altemulator.svg} (99%) diff --git a/es-app/src/views/gamelist/DetailedGameListView.cpp b/es-app/src/views/gamelist/DetailedGameListView.cpp index 736f1ac76..24c1450a9 100644 --- a/es-app/src/views/gamelist/DetailedGameListView.cpp +++ b/es-app/src/views/gamelist/DetailedGameListView.cpp @@ -410,7 +410,7 @@ void DetailedGameListView::updateInfoPanel() ss << (file->metadata.get("completed").compare("true") ? "" : "completed "); ss << (file->metadata.get("kidgame").compare("true") ? "" : "kidgame "); ss << (file->metadata.get("broken").compare("true") ? "" : "broken "); - ss << (file->metadata.get("altemulator").compare("") ? "altemu " : ""); + ss << (file->metadata.get("altemulator").compare("") ? "altemulator " : ""); std::string slots = ss.str(); if (!slots.empty()) slots.pop_back(); diff --git a/es-app/src/views/gamelist/VideoGameListView.cpp b/es-app/src/views/gamelist/VideoGameListView.cpp index 49b25ddd1..acff97747 100644 --- a/es-app/src/views/gamelist/VideoGameListView.cpp +++ b/es-app/src/views/gamelist/VideoGameListView.cpp @@ -451,7 +451,7 @@ void VideoGameListView::updateInfoPanel() ss << (file->metadata.get("completed").compare("true") ? "" : "completed "); ss << (file->metadata.get("kidgame").compare("true") ? "" : "kidgame "); ss << (file->metadata.get("broken").compare("true") ? "" : "broken "); - ss << (file->metadata.get("altemulator").compare("") ? "altemu " : ""); + ss << (file->metadata.get("altemulator").compare("") ? "altemulator " : ""); std::string slots = ss.str(); if (!slots.empty()) slots.pop_back(); diff --git a/es-core/src/components/BadgesComponent.cpp b/es-core/src/components/BadgesComponent.cpp index 9a28fa3c9..1d6ebfaab 100644 --- a/es-core/src/components/BadgesComponent.cpp +++ b/es-core/src/components/BadgesComponent.cpp @@ -20,30 +20,22 @@ std::vector BadgesComponent::mSlots = {SLOT_FAVORITE, SLOT_COMPLETE BadgesComponent::BadgesComponent(Window* window) : FlexboxComponent(window) { - - mBadgeIcons = std::map(); mBadgeIcons[SLOT_FAVORITE] = ":/graphics/badge_favorite.svg"; mBadgeIcons[SLOT_COMPLETED] = ":/graphics/badge_completed.svg"; mBadgeIcons[SLOT_KIDS] = ":/graphics/badge_kidgame.svg"; mBadgeIcons[SLOT_BROKEN] = ":/graphics/badge_broken.svg"; - mBadgeIcons[SLOT_ALTERNATIVE_EMULATOR] = ":/graphics/badge_altemu.svg"; + mBadgeIcons[SLOT_ALTERNATIVE_EMULATOR] = ":/graphics/badge_altemulator.svg"; - mImageComponents = std::map(); ImageComponent mImageFavorite = ImageComponent(window); - mImageFavorite.setImage(mBadgeIcons[SLOT_FAVORITE], false, true); mImageComponents.insert({SLOT_FAVORITE, mImageFavorite}); ImageComponent mImageCompleted = ImageComponent(window); - mImageCompleted.setImage(mBadgeIcons[SLOT_COMPLETED], false, true); mImageComponents.insert({SLOT_COMPLETED, mImageCompleted}); ImageComponent mImageKids = ImageComponent(window); - mImageKids.setImage(mBadgeIcons[SLOT_KIDS], false, true); mImageComponents.insert({SLOT_KIDS, mImageKids}); ImageComponent mImageBroken = ImageComponent(window); - mImageBroken.setImage(mBadgeIcons[SLOT_BROKEN], false, true); mImageComponents.insert({SLOT_BROKEN, mImageBroken}); - ImageComponent mImageAltEmu = ImageComponent(window); - mImageAltEmu.setImage(mBadgeIcons[SLOT_ALTERNATIVE_EMULATOR], false, true); - mImageComponents.insert({SLOT_ALTERNATIVE_EMULATOR, mImageAltEmu}); + ImageComponent mImageAltEmulator = ImageComponent(window); + mImageComponents.insert({SLOT_ALTERNATIVE_EMULATOR, mImageAltEmulator}); } BadgesComponent::~BadgesComponent() @@ -94,13 +86,14 @@ void BadgesComponent::applyTheme(const std::shared_ptr& theme, if (!elem) return; - bool imgChanged = false; for (auto& slot : mSlots) { - if (properties & PATH && elem->has(slot) && - mBadgeIcons[slot] != elem->get(slot)) { + if (properties & PATH && elem->has(slot)) { mBadgeIcons[slot] = elem->get(slot); - mImageComponents.find(slot)->second.setImage(mBadgeIcons[slot], false, true); - imgChanged = true; + mImageComponents.find(slot)->second.setImage(mBadgeIcons[slot]); + } + else { + mImageComponents.find(slot)->second.setImage(mBadgeIcons[slot]); + std::string teststring; } } @@ -123,12 +116,5 @@ void BadgesComponent::applyTheme(const std::shared_ptr& theme, // Apply theme on the flexbox component parent. FlexboxComponent::applyTheme(theme, view, element, properties); - if (imgChanged) - onSizeChanged(); -} - -std::vector BadgesComponent::getHelpPrompts() -{ - std::vector prompts; - return prompts; + onSizeChanged(); } diff --git a/es-core/src/components/BadgesComponent.h b/es-core/src/components/BadgesComponent.h index f4584ecf4..e7412233a 100644 --- a/es-core/src/components/BadgesComponent.h +++ b/es-core/src/components/BadgesComponent.h @@ -7,8 +7,8 @@ // Used by gamelist views. // -#ifndef ES_APP_COMPONENTS_BADGES_COMPONENT_H -#define ES_APP_COMPONENTS_BADGES_COMPONENT_H +#ifndef ES_CORE_COMPONENTS_BADGES_COMPONENT_H +#define ES_CORE_COMPONENTS_BADGES_COMPONENT_H #include "FlexboxComponent.h" #include "GuiComponent.h" @@ -20,7 +20,7 @@ #define SLOT_COMPLETED "completed" #define SLOT_KIDS "kidgame" #define SLOT_BROKEN "broken" -#define SLOT_ALTERNATIVE_EMULATOR "altemu" +#define SLOT_ALTERNATIVE_EMULATOR "altemulator" class TextureResource; @@ -30,6 +30,8 @@ public: BadgesComponent(Window* window); ~BadgesComponent(); + static std::shared_ptr& getInstance(); + std::string getValue() const override; // Should be a list of strings. void setValue(const std::string& value) override; @@ -39,12 +41,10 @@ public: const std::string& element, unsigned int properties) override; - virtual std::vector getHelpPrompts() override; - private: static std::vector mSlots; std::map mBadgeIcons; std::map mImageComponents; }; -#endif // ES_APP_COMPONENTS_BADGES_COMPONENT_H +#endif // ES_CORE_COMPONENTS_BADGES_COMPONENT_H diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index 9213ae095..ac53174df 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -71,8 +71,8 @@ void FlexboxComponent::computeLayout() float anchorOriginY = 0; // Translation directions when placing items. - glm::vec2 directionLine = {1, 0}; - glm::vec2 directionRow = {0, 1}; + glm::ivec2 directionLine = {1, 0}; + glm::ivec2 directionRow = {0, 1}; // Change direction. if (mDirection == DIRECTION_COLUMN) { @@ -89,6 +89,7 @@ void FlexboxComponent::computeLayout() glm::vec2 newSize = {mItemWidth, oldSize.y * (mItemWidth / oldSize.x)}; i->setSize(newSize); maxItemSize = {std::max(maxItemSize.x, newSize.x), std::max(maxItemSize.y, newSize.y)}; + i->setResize(maxItemSize.x, maxItemSize.y); } // Pre-compute layout parameters. diff --git a/es-core/src/components/FlexboxComponent.h b/es-core/src/components/FlexboxComponent.h index 731a00c8e..d5c1b3a15 100644 --- a/es-core/src/components/FlexboxComponent.h +++ b/es-core/src/components/FlexboxComponent.h @@ -7,8 +7,8 @@ // Used by gamelist views. // -#ifndef ES_APP_COMPONENTS_FLEXBOX_COMPONENT_H -#define ES_APP_COMPONENTS_FLEXBOX_COMPONENT_H +#ifndef ES_CORE_COMPONENTS_FLEXBOX_COMPONENT_H +#define ES_CORE_COMPONENTS_FLEXBOX_COMPONENT_H #include "GuiComponent.h" #include "renderers/Renderer.h" @@ -69,4 +69,4 @@ private: bool mLayoutValid; }; -#endif // ES_APP_COMPONENTS_FLEXBOX_COMPONENT_H +#endif // ES_CORE_COMPONENTS_FLEXBOX_COMPONENT_H diff --git a/resources/graphics/badge_altemu.svg b/resources/graphics/badge_altemulator.svg similarity index 99% rename from resources/graphics/badge_altemu.svg rename to resources/graphics/badge_altemulator.svg index 777ad8142..943ec1486 100644 --- a/resources/graphics/badge_altemu.svg +++ b/resources/graphics/badge_altemulator.svg @@ -15,7 +15,7 @@ version="1.1" id="svg4842" inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)" - sodipodi:docname="badge_altemu.svg"> + sodipodi:docname="badge_altemulator.svg"> - - - - - image/svg+xml - - - - - - - - - - + + + + + + + + + + image/svg+xml + + + + + + + + + + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + diff --git a/resources/graphics/badge_completed.svg b/resources/graphics/badge_completed.svg index fca3c4ac5..a4f0a107b 100644 --- a/resources/graphics/badge_completed.svg +++ b/resources/graphics/badge_completed.svg @@ -1,71 +1,260 @@ - - - - - - image/svg+xml - - - - - - - - - - + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/resources/graphics/badge_favorite.svg b/resources/graphics/badge_favorite.svg index 4d5abaeb8..0ccd06479 100644 --- a/resources/graphics/badge_favorite.svg +++ b/resources/graphics/badge_favorite.svg @@ -1,70 +1,253 @@ - - - - - - image/svg+xml - - - - - - - - - - + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/resources/graphics/badge_kidgame.svg b/resources/graphics/badge_kidgame.svg index 13f5a249a..f11131965 100644 --- a/resources/graphics/badge_kidgame.svg +++ b/resources/graphics/badge_kidgame.svg @@ -1,70 +1,256 @@ - - - - - - image/svg+xml - - - - - - - - - - + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/themes/rbsimple-DE/theme.xml b/themes/rbsimple-DE/theme.xml index 381379f96..613f51df6 100644 --- a/themes/rbsimple-DE/theme.xml +++ b/themes/rbsimple-DE/theme.xml @@ -243,16 +243,17 @@ based on: 'recalbox-multi' by the Recalbox community row start - 2 + 3 5 5 .035 - favorite completed kidgame broken altemu + favorite completed kidgame broken altemulator :/graphics/badge_favorite.svg :/graphics/badge_completed.svg :/graphics/badge_kidgame.svg :/graphics/badge_broken.svg + :/graphics/badge_altemulator.svg From 33f0b01c55404b55f0a924019aa6229a558df232 Mon Sep 17 00:00:00 2001 From: shadash Date: Sat, 2 Oct 2021 21:29:27 +0200 Subject: [PATCH 29/42] move to avoid unnecessary copies. --- es-core/src/components/FlexboxComponent.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index ac53174df..653fee333 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -9,6 +9,7 @@ #include "components/FlexboxComponent.h" #include +#include #include "Settings.h" #include "ThemeData.h" @@ -31,13 +32,13 @@ FlexboxComponent::FlexboxComponent(Window* window) // Getters/Setters for rendering options. void FlexboxComponent::setDirection(std::string value) { - mDirection = value; + mDirection = std::move(value); mLayoutValid = false; } std::string FlexboxComponent::getDirection() { return mDirection; } void FlexboxComponent::setAlign(std::string value) { - mAlign = value; + mAlign = std::move(value); mLayoutValid = false; } std::string FlexboxComponent::getAlign() { return mAlign; } From f37d9156538534fc3a0d47a396fc2ed89858d776 Mon Sep 17 00:00:00 2001 From: Sophia Hadash Date: Sat, 2 Oct 2021 21:30:10 +0200 Subject: [PATCH 30/42] remove old code --- es-core/src/components/FlexboxComponent.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index 653fee333..94ced8bea 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -121,14 +121,6 @@ void FlexboxComponent::computeLayout() float x = anchorX - anchorOriginX * size.x; float y = anchorY - anchorOriginY * size.y; - // Apply item margin. - /*if ((mDirection == "row" && i % std::max(1, (int) mItemsPerLine) != 0) || - (mDirection == "column" && i >= (int) mItemsPerLine)) - x += mItemMargin.x * (directionLine.x >= 0.0f ? 1.0f : -1.0f); - if ((mDirection == "column" && i % std::max(1, (int) mItemsPerLine) != 0) || - (mDirection == "row" && i >= (int) mItemsPerLine)) - y += mItemMargin.y * (directionLine.y >= 0.0f ? 1.0f : -1.0f);*/ - // Apply alignment if (mAlign == ITEM_ALIGN_END) { x += directionLine.x == 0 ? (maxItemSize.x - size.x) : 0; From 9d23d124d4bfff3e6d7e6086af06dbb3a10c723e Mon Sep 17 00:00:00 2001 From: shadash Date: Sat, 2 Oct 2021 21:34:38 +0200 Subject: [PATCH 31/42] change casts to c++ style Signed-off-by: Sophia Hadash --- es-core/src/components/FlexboxComponent.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index 94ced8bea..2827f5995 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -95,7 +95,8 @@ void FlexboxComponent::computeLayout() // Pre-compute layout parameters. int n = mChildren.size(); - int nLines = std::max(1, (int)std::ceil(n / std::max(1, (int)mItemsPerLine))); + int nLines = + std::max(1, static_cast(std::ceil(n / std::max(1, static_cast(mItemsPerLine))))); float lineWidth = (mDirection == "row" ? (maxItemSize.y + mItemMargin.y) : (maxItemSize.x + mItemMargin.x)); float anchorXStart = anchorX; @@ -144,7 +145,7 @@ void FlexboxComponent::computeLayout() child->setPosition(getPosition().x + x, getPosition().y + y); // Translate anchor. - if ((i + 1) % std::max(1, (int)mItemsPerLine) != 0) { + if ((i + 1) % std::max(1, static_cast(mItemsPerLine)) != 0) { // Translate on same line. anchorX += (size.x + mItemMargin.x) * directionLine.x; anchorY += (size.y + mItemMargin.y) * directionLine.y; From 519644f66cda31bf114609a63cfd6f289f76b3fb Mon Sep 17 00:00:00 2001 From: shadash Date: Sat, 2 Oct 2021 21:58:04 +0200 Subject: [PATCH 32/42] make direction and align an enum. more in line defaults in constructor. getter/setter in header Signed-off-by: Sophia Hadash --- es-core/src/components/FlexboxComponent.cpp | 65 ++++++--------------- es-core/src/components/FlexboxComponent.h | 63 ++++++++++++-------- 2 files changed, 55 insertions(+), 73 deletions(-) diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index 2827f5995..64433c099 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -10,7 +10,6 @@ #include "components/FlexboxComponent.h" #include #include - #include "Settings.h" #include "ThemeData.h" #include "resources/TextureResource.h" @@ -20,47 +19,12 @@ FlexboxComponent::FlexboxComponent(Window* window) , mDirection(DEFAULT_DIRECTION) , mAlign(DEFAULT_ALIGN) , mItemsPerLine(DEFAULT_ITEMS_PER_LINE) + , mItemMargin({DEFAULT_MARGIN_X, DEFAULT_MARGIN_Y}) , mItemWidth(DEFAULT_ITEM_SIZE_X) + , mLayoutValid(false) { - // Initialize item margins. - mItemMargin = glm::vec2{DEFAULT_MARGIN_X, DEFAULT_MARGIN_Y}; - - // Layout validity - mLayoutValid = false; } -// Getters/Setters for rendering options. -void FlexboxComponent::setDirection(std::string value) -{ - mDirection = std::move(value); - mLayoutValid = false; -} -std::string FlexboxComponent::getDirection() { return mDirection; } -void FlexboxComponent::setAlign(std::string value) -{ - mAlign = std::move(value); - mLayoutValid = false; -} -std::string FlexboxComponent::getAlign() { return mAlign; } -void FlexboxComponent::setItemsPerLine(unsigned int value) -{ - mItemsPerLine = value; - mLayoutValid = false; -} -unsigned int FlexboxComponent::getItemsPerLine() { return mItemsPerLine; } -void FlexboxComponent::setItemMargin(glm::vec2 value) -{ - mItemMargin = value; - mLayoutValid = false; -} -glm::vec2 FlexboxComponent::getItemMargin() { return mItemMargin; } -void FlexboxComponent::setItemWidth(float value) -{ - mItemWidth = value; - mLayoutValid = false; -} -float FlexboxComponent::getItemWidth() { return mItemWidth; } - void FlexboxComponent::onSizeChanged() { mLayoutValid = false; } void FlexboxComponent::computeLayout() @@ -76,7 +40,7 @@ void FlexboxComponent::computeLayout() glm::ivec2 directionRow = {0, 1}; // Change direction. - if (mDirection == DIRECTION_COLUMN) { + if (mDirection == Direction::row) { directionLine = {0, 1}; directionRow = {1, 0}; } @@ -97,14 +61,14 @@ void FlexboxComponent::computeLayout() int n = mChildren.size(); int nLines = std::max(1, static_cast(std::ceil(n / std::max(1, static_cast(mItemsPerLine))))); - float lineWidth = - (mDirection == "row" ? (maxItemSize.y + mItemMargin.y) : (maxItemSize.x + mItemMargin.x)); + float lineWidth = (mDirection == Direction::row ? (maxItemSize.y + mItemMargin.y) : + (maxItemSize.x + mItemMargin.x)); float anchorXStart = anchorX; float anchorYStart = anchorY; // Compute total container size. glm::vec2 totalSize = {-mItemMargin.x, -mItemMargin.y}; - if (mDirection == "row") { + if (mDirection == Direction::row) { totalSize.x += (mItemMargin.x + mItemWidth) * mItemsPerLine; totalSize.y += (mItemMargin.y + maxItemSize.y) * nLines; } @@ -123,15 +87,15 @@ void FlexboxComponent::computeLayout() float y = anchorY - anchorOriginY * size.y; // Apply alignment - if (mAlign == ITEM_ALIGN_END) { + if (mAlign == Align::end) { x += directionLine.x == 0 ? (maxItemSize.x - size.x) : 0; y += directionLine.y == 0 ? (maxItemSize.y - size.y) : 0; } - else if (mAlign == ITEM_ALIGN_CENTER) { + else if (mAlign == Align::center) { x += directionLine.x == 0 ? (maxItemSize.x - size.x) / 2 : 0; y += directionLine.y == 0 ? (maxItemSize.y - size.y) / 2 : 0; } - else if (mAlign == ITEM_ALIGN_STRETCH && mDirection == "row") { + else if (mAlign == Align::stretch && mDirection == Direction::row) { child->setSize(child->getSize().x, maxItemSize.y); } @@ -194,10 +158,15 @@ void FlexboxComponent::applyTheme(const std::shared_ptr& theme, return; if (properties & DIRECTION && elem->has("direction")) - mDirection = elem->get("direction"); + mDirection = + elem->get("direction") == "row" ? Direction::row : Direction::column; - if (elem->has("align")) - mAlign = elem->get("align"); + if (elem->has("align")) { + const auto a = elem->get("align"); + mAlign = (a == "start" ? + Align::start : + (a == "end" ? Align::end : (a == "center" ? Align::center : Align::stretch))); + } if (elem->has("itemsPerLine")) mItemsPerLine = elem->get("itemsPerLine"); diff --git a/es-core/src/components/FlexboxComponent.h b/es-core/src/components/FlexboxComponent.h index d5c1b3a15..e52b62360 100644 --- a/es-core/src/components/FlexboxComponent.h +++ b/es-core/src/components/FlexboxComponent.h @@ -13,40 +13,53 @@ #include "GuiComponent.h" #include "renderers/Renderer.h" -// Definitions for the option values. -#define DIRECTION_ROW "row" -#define DIRECTION_COLUMN "column" -#define ITEM_ALIGN_START "start" -#define ITEM_ALIGN_END "end" -#define ITEM_ALIGN_CENTER "center" -#define ITEM_ALIGN_STRETCH "stretch" - // Default values. -#define DEFAULT_DIRECTION DIRECTION_ROW -#define DEFAULT_ALIGN ITEM_ALIGN_CENTER +#define DEFAULT_DIRECTION Direction::row +#define DEFAULT_ALIGN Align::center #define DEFAULT_ITEMS_PER_LINE 4 #define DEFAULT_MARGIN_X 10.0f #define DEFAULT_MARGIN_Y 10.0f #define DEFAULT_ITEM_SIZE_X 64.0f -class TextureResource; - class FlexboxComponent : public GuiComponent { public: - FlexboxComponent(Window* window); + enum class Direction : char { row, column }; + enum class Align : char { start, end, center, stretch }; + + explicit FlexboxComponent(Window* window); // Getters/Setters for rendering options. - void setDirection(std::string value); - std::string getDirection(); - void setAlign(std::string value); - std::string getAlign(); - void setItemsPerLine(unsigned int value); - unsigned int getItemsPerLine(); - void setItemMargin(glm::vec2 value); - glm::vec2 getItemMargin(); - void setItemWidth(float value); - float getItemWidth(); + [[nodiscard]] Direction getDirection() const { return mDirection; }; + void setDirection(Direction value) + { + mDirection = value; + mLayoutValid = false; + }; + [[nodiscard]] Align getAlign() const { return mAlign; }; + void setAlign(Align value) + { + mAlign = value; + mLayoutValid = false; + }; + [[nodiscard]] unsigned int getItemsPerLine() const { return mItemsPerLine; }; + void setItemsPerLine(unsigned int value) + { + mItemsPerLine = value; + mLayoutValid = false; + }; + [[nodiscard]] glm::vec2 getItemMargin() const { return mItemMargin; }; + void setItemMargin(glm::vec2 value) + { + mItemMargin = value; + mLayoutValid = false; + }; + [[nodiscard]] float getItemWidth() const { return mItemWidth; }; + void setItemWidth(float value) + { + mItemWidth = value; + mLayoutValid = false; + }; void onSizeChanged() override; void render(const glm::mat4& parentTrans) override; @@ -61,8 +74,8 @@ private: void computeLayout(); // Rendering options. - std::string mDirection; - std::string mAlign; + Direction mDirection; + Align mAlign; unsigned int mItemsPerLine; glm::vec2 mItemMargin; float mItemWidth; From dbc9ffb99e24d563960134c8a9347513f1fc4aef Mon Sep 17 00:00:00 2001 From: shadash Date: Sat, 2 Oct 2021 22:00:05 +0200 Subject: [PATCH 33/42] remove unused imports Signed-off-by: Sophia Hadash --- es-core/src/components/FlexboxComponent.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index 64433c099..e57525e83 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -8,8 +8,6 @@ // #include "components/FlexboxComponent.h" -#include -#include #include "Settings.h" #include "ThemeData.h" #include "resources/TextureResource.h" From 20d14ca71f705db1949d1d05106aa537fc4847a3 Mon Sep 17 00:00:00 2001 From: shadash Date: Sat, 2 Oct 2021 22:00:54 +0200 Subject: [PATCH 34/42] remove redundant virtual keyword Signed-off-by: Sophia Hadash --- es-core/src/components/FlexboxComponent.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/es-core/src/components/FlexboxComponent.h b/es-core/src/components/FlexboxComponent.h index e52b62360..6f187f032 100644 --- a/es-core/src/components/FlexboxComponent.h +++ b/es-core/src/components/FlexboxComponent.h @@ -63,11 +63,11 @@ public: void onSizeChanged() override; void render(const glm::mat4& parentTrans) override; - virtual void applyTheme(const std::shared_ptr& theme, - const std::string& view, - const std::string& element, - unsigned int properties) override; - virtual std::vector getHelpPrompts() override; + void applyTheme(const std::shared_ptr& theme, + const std::string& view, + const std::string& element, + unsigned int properties) override; + std::vector getHelpPrompts() override; private: // Calculate flexbox layout. From 95b729dadfdaa9805056dd3994b1d7e522265b31 Mon Sep 17 00:00:00 2001 From: shadash Date: Sat, 2 Oct 2021 22:31:37 +0200 Subject: [PATCH 35/42] replace badges svgs minimize svgs fix bug in flexbox component adjust theme for new badges style Signed-off-by: Sophia Hadash --- es-core/src/components/FlexboxComponent.cpp | 2 +- resources/graphics/badge_altemulator.svg | 301 ++++++-------------- resources/graphics/badge_broken.svg | 274 +----------------- resources/graphics/badge_completed.svg | 292 ++++--------------- resources/graphics/badge_favorite.svg | 264 +---------------- resources/graphics/badge_kidgame.svg | 266 +---------------- themes/rbsimple-DE/theme.xml | 17 +- 7 files changed, 177 insertions(+), 1239 deletions(-) diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index e57525e83..76918b086 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -38,7 +38,7 @@ void FlexboxComponent::computeLayout() glm::ivec2 directionRow = {0, 1}; // Change direction. - if (mDirection == Direction::row) { + if (mDirection == Direction::column) { directionLine = {0, 1}; directionRow = {1, 0}; } diff --git a/resources/graphics/badge_altemulator.svg b/resources/graphics/badge_altemulator.svg index 943ec1486..b5ffc5565 100644 --- a/resources/graphics/badge_altemulator.svg +++ b/resources/graphics/badge_altemulator.svg @@ -1,215 +1,94 @@ - - - - - - - - - - image/svg+xml - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + aria-label="Alternative Emulator " + style="font-size:63.5px;line-height:1.25;font-family:'Nintendo Switch UI';-inkscape-font-specification:'Nintendo Switch UI';stroke-width:2.11667;stroke-miterlimit:4;stroke-dasharray:none"> + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/graphics/badge_broken.svg b/resources/graphics/badge_broken.svg index bfb01b538..13f416126 100644 --- a/resources/graphics/badge_broken.svg +++ b/resources/graphics/badge_broken.svg @@ -1,264 +1,12 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/resources/graphics/badge_completed.svg b/resources/graphics/badge_completed.svg index a4f0a107b..810e52f4b 100644 --- a/resources/graphics/badge_completed.svg +++ b/resources/graphics/badge_completed.svg @@ -1,260 +1,64 @@ - - - - - - - - image/svg+xml - - - - - - - - - - + + + - - + + - - + + - - - - + + aria-label="Completed" + style="font-size:63.5px;line-height:1.25;font-family:'Nintendo Switch UI';-inkscape-font-specification:'Nintendo Switch UI';stroke-width:2.11667;stroke-miterlimit:4;stroke-dasharray:none"> + d="m 293.14147,123.84266 v 5.08 q -7.62,3.73945 -16.15723,3.73945 -12.34723,0 -20.39057,-7.05556 -4.72723,-4.23334 -7.12612,-10.44223 -2.04611,-5.15056 -2.04611,-11.14779 0,-8.466669 4.02167,-15.310563 4.09222,-6.843893 11.14778,-10.371673 6.27945,-3.104447 13.97001,-3.104447 8.7489,0 16.29835,4.586114 l -1.69334,4.162781 q -2.46944,-1.693335 -4.51556,-2.610557 -4.445,-1.975557 -10.08945,-1.975557 -10.795,0 -17.85056,7.05556 -6.70279,6.773338 -6.70279,17.497792 0,11.14778 7.54945,18.20334 6.77334,6.35001 17.6389,6.35001 6.91445,0 12.34723,-2.54 1.48167,-0.77612 3.59834,-2.11667 z" + style="font-size:70.5556px;fill:#222222;fill-opacity:1;stroke:#222222;stroke-width:2.11667;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> + d="m 320.23469,89.199857 q 8.96056,0 14.67556,6.350004 5.43279,5.997229 5.43279,15.381119 0,9.3839 -5.43279,15.38112 -5.715,6.35001 -14.60501,6.35001 -9.03111,0 -14.74612,-6.35001 -5.43278,-5.99722 -5.43278,-15.66334 0,-6.35 2.82223,-11.500563 2.68111,-4.868337 7.62,-7.54945 4.37445,-2.39889 9.66612,-2.39889 z m 0,3.951113 q -7.62001,0 -12.13557,5.78556 -3.59833,4.58611 -3.59833,12.20612 0,7.83167 4.23334,12.5589 4.51555,5.00944 11.50056,5.00944 7.62,0 12.13556,-5.78556 3.59834,-4.58611 3.59834,-11.99445 0,-8.04334 -4.23334,-12.770562 -4.51556,-5.009448 -11.50056,-5.009448 z" + style="font-size:70.5556px;fill:#222222;fill-opacity:1;stroke:#222222;stroke-width:2.11667;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> + d="m 379.07805,131.53322 h -4.37445 v -23.70668 q 0,-6.06779 -0.77611,-8.537232 -1.76389,-6.138338 -8.32556,-6.138338 -5.22112,0 -8.60779,4.02167 -2.96333,3.52778 -2.96333,10.23056 v 24.13002 h -4.37445 V 90.328746 h 4.37445 v 5.997226 q 4.09222,-7.126115 12.13556,-7.126115 8.39612,0 11.9239,7.620005 4.79778,-7.620005 13.12334,-7.620005 6.20889,0 9.73667,3.810002 2.89278,3.104447 3.31612,8.607781 0.14111,1.76389 0.14111,5.50334 v 24.41224 h -4.37445 v -23.63613 q 0,-5.99722 -0.70555,-8.537227 -0.84667,-3.245557 -3.6689,-5.009447 -1.97555,-1.199446 -4.79778,-1.199446 -5.29167,0 -8.60778,3.739447 -3.175,3.527783 -3.175,11.077233 z" + style="font-size:70.5556px;fill:#222222;fill-opacity:1;stroke:#222222;stroke-width:2.11667;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> + d="m 416.33129,90.328746 h 4.37444 v 6.985005 q 5.29167,-8.113894 14.67557,-8.113894 7.97278,0 13.05279,5.573892 5.43278,5.926671 5.43278,16.157231 0,10.16001 -5.43278,16.08668 -5.08001,5.64445 -13.05279,5.64445 -9.45445,0 -14.67557,-8.1139 v 25.7528 h -4.37444 z m 18.55612,2.822224 q -8.25501,0 -11.99445,7.05556 -2.32834,4.30389 -2.32834,10.93612 0,6.20889 2.32834,10.51278 3.73944,7.05556 11.99445,7.05556 6.84389,0 10.86556,-5.00944 3.73945,-4.72723 3.73945,-12.77057 0,-8.04334 -3.73945,-12.770562 -4.02167,-5.009448 -10.86556,-5.009448 z" + style="font-size:70.5556px;fill:#222222;fill-opacity:1;stroke:#222222;stroke-width:2.11667;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> + d="m 475.38632,127.5821 v 3.95112 h -2.96334 q -4.445,0 -6.35,-1.97556 -1.76389,-1.76389 -1.76389,-6.63223 V 73.677624 h 4.445 v 49.036146 q 0,2.82222 0.635,3.66889 0.84667,1.19944 3.175,1.19944 z" + style="font-size:70.5556px;fill:#222222;fill-opacity:1;stroke:#222222;stroke-width:2.11667;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> + d="m 513.27462,130.26322 q -5.715,2.39889 -12.41778,2.39889 -9.10168,0 -14.32279,-4.93889 -6.35001,-5.99723 -6.35001,-16.58057 0,-8.89001 4.65667,-15.169456 5.08001,-6.773337 13.8289,-6.773337 6.77334,0 11.50057,4.233336 6.49111,5.785559 6.56167,18.908897 h -32.24391 q 0.35277,7.19668 3.52778,11.07723 4.445,5.29167 13.05278,5.29167 6.27945,0 12.20612,-2.96333 z m -28.71613,-21.80168 h 27.72835 q -0.42333,-4.79778 -2.32833,-8.39612 -3.66889,-6.91445 -11.2889,-6.91445 -8.53723,0 -12.41778,8.25501 -1.41112,3.10444 -1.69334,7.05556 z" + style="font-size:70.5556px;fill:#222222;fill-opacity:1;stroke:#222222;stroke-width:2.11667;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> + d="M 527.66791,90.328746 V 78.545961 h 4.37444 v 11.782785 h 13.12335 v 3.951114 h -13.12335 v 26.10557 q 0,4.58612 1.05834,6.06778 1.55222,2.25778 6.27945,2.25778 2.46944,0 5.00944,-0.28222 v 3.88056 q -2.89278,0.35278 -5.29167,0.35278 -5.99722,0 -8.53722,-2.32834 -2.11667,-1.905 -2.68112,-5.50333 -0.21166,-1.48167 -0.21166,-4.58612 V 94.27986 h -5.36223 v -3.951114 z" + style="font-size:70.5556px;fill:#222222;fill-opacity:1;stroke:#222222;stroke-width:2.11667;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> + d="m 583.8301,130.26322 q -5.715,2.39889 -12.41778,2.39889 -9.10168,0 -14.32279,-4.93889 -6.35,-5.99723 -6.35,-16.58057 0,-8.89001 4.65667,-15.169456 5.08,-6.773337 13.82889,-6.773337 6.77334,0 11.50057,4.233336 6.49111,5.785559 6.56167,18.908897 h -32.24391 q 0.35278,7.19668 3.52778,11.07723 4.445,5.29167 13.05278,5.29167 6.27945,0 12.20612,-2.96333 z m -28.71613,-21.80168 h 27.72835 q -0.42333,-4.79778 -2.32833,-8.39612 -3.66889,-6.91445 -11.2889,-6.91445 -8.53722,0 -12.41778,8.25501 -1.41111,3.10444 -1.69334,7.05556 z" + style="font-size:70.5556px;fill:#222222;fill-opacity:1;stroke:#222222;stroke-width:2.11667;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> - - - - - - - - - - - - - - - - + d="m 627.50393,124.54821 q -5.22111,8.1139 -14.67556,8.1139 -7.97279,0 -13.05279,-5.64445 -5.43278,-5.92667 -5.43278,-16.08668 0,-10.16 5.43278,-16.086675 5.08,-5.644448 13.05279,-5.644448 9.38389,0 14.67556,8.113894 V 73.677624 h 4.37445 v 57.855596 h -4.37445 z M 613.32226,93.15097 q -6.77334,0 -10.86557,5.009448 -3.73944,4.656672 -3.73944,12.770562 0,8.04334 3.73944,12.77057 3.95112,5.00944 10.86557,5.00944 8.255,0 11.99445,-7.05556 2.32833,-4.30389 2.32833,-10.93611 0,-6.27945 -2.32833,-10.51279 -3.88056,-7.05556 -11.99445,-7.05556 z" + style="font-size:70.5556px;fill:#222222;fill-opacity:1;stroke:#222222;stroke-width:2.11667;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/> + + - - - - - - - - diff --git a/resources/graphics/badge_favorite.svg b/resources/graphics/badge_favorite.svg index 0ccd06479..7bc680e93 100644 --- a/resources/graphics/badge_favorite.svg +++ b/resources/graphics/badge_favorite.svg @@ -1,253 +1,13 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/resources/graphics/badge_kidgame.svg b/resources/graphics/badge_kidgame.svg index f11131965..eee4a1266 100644 --- a/resources/graphics/badge_kidgame.svg +++ b/resources/graphics/badge_kidgame.svg @@ -1,256 +1,12 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/themes/rbsimple-DE/theme.xml b/themes/rbsimple-DE/theme.xml index 613f51df6..45c6ae52b 100644 --- a/themes/rbsimple-DE/theme.xml +++ b/themes/rbsimple-DE/theme.xml @@ -239,21 +239,12 @@ based on: 'recalbox-multi' by the Recalbox community 0.8125 0.65 0 0 - - - row + column start - 3 - 5 5 - .035 - - + 4 + 25 5 + .059 favorite completed kidgame broken altemulator - :/graphics/badge_favorite.svg - :/graphics/badge_completed.svg - :/graphics/badge_kidgame.svg - :/graphics/badge_broken.svg - :/graphics/badge_altemulator.svg From 714be4b52aa5cb2a03889675450762ec8c07e0dc Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 5 Oct 2021 17:57:33 +0200 Subject: [PATCH 36/42] Replaced default badges with colorized rectangular design. --- resources/graphics/badge_altemulator.svg | 524 +++++++++++++++++++---- resources/graphics/badge_broken.svg | 256 ++++++++++- resources/graphics/badge_completed.svg | 309 ++++++++++--- resources/graphics/badge_favorite.svg | 260 ++++++++++- resources/graphics/badge_kidgame.svg | 262 +++++++++++- 5 files changed, 1426 insertions(+), 185 deletions(-) diff --git a/resources/graphics/badge_altemulator.svg b/resources/graphics/badge_altemulator.svg index b5ffc5565..bf04c7319 100644 --- a/resources/graphics/badge_altemulator.svg +++ b/resources/graphics/badge_altemulator.svg @@ -1,94 +1,438 @@ - - - - - - - - - - - + + + + + + + + + + image/svg+xml + + + + + + + - - - - - - - - - - - - - - - - - - - + id="g16" + transform="matrix(0.10079384,0,0,0.10062218,-2.2563844e-4,266.11692)" + style="fill:#d7d7d7;fill-opacity:1"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - diff --git a/resources/graphics/badge_broken.svg b/resources/graphics/badge_broken.svg index 13f416126..a1d7dbc3c 100644 --- a/resources/graphics/badge_broken.svg +++ b/resources/graphics/badge_broken.svg @@ -1,12 +1,246 @@ - - - - - + + + + + + + + + + image/svg+xml + + + + + + + + + - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/graphics/badge_completed.svg b/resources/graphics/badge_completed.svg index 810e52f4b..a09e55f4c 100644 --- a/resources/graphics/badge_completed.svg +++ b/resources/graphics/badge_completed.svg @@ -1,64 +1,255 @@ - - - + + + + + + + + image/svg+xml + + + + + + + + - - + + - - - - - - - - - - - - - - - - + + + inkscape:connector-curvature="0" + id="path28-8" + d="m 17.401,237.59 c 0,6.2332 2.6179,7.5296 6.8066,7.5296 1.0222,0 1.845,-0.0748 2.8672,-0.27426 l -0.52358,-3.9394 -2.2938,0.17453 c -1.0222,0.0499 -1.6705,-0.52358 -1.6705,-3.4906 0,-2.96702 0.74798,-3.5155 1.6705,-3.4656 l 2.2938,0.14959 0.54852,-3.9144 c -1.0222,-0.22439 -1.8201,-0.42385 -2.8423,-0.42385 -4.2136,0 -6.8565,1.7952 -6.8565,7.6543 z" + style="fill:#f0f0f0;fill-opacity:1" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/graphics/badge_favorite.svg b/resources/graphics/badge_favorite.svg index 7bc680e93..4b8236cae 100644 --- a/resources/graphics/badge_favorite.svg +++ b/resources/graphics/badge_favorite.svg @@ -1,13 +1,247 @@ - - - - - - - - - - \ No newline at end of file + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/graphics/badge_kidgame.svg b/resources/graphics/badge_kidgame.svg index eee4a1266..565806a74 100644 --- a/resources/graphics/badge_kidgame.svg +++ b/resources/graphics/badge_kidgame.svg @@ -1,12 +1,250 @@ - - - - - - - - - - \ No newline at end of file + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 3ff5f90f364d0b3d0385f30f905378bd57ca1990 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 5 Oct 2021 17:59:44 +0200 Subject: [PATCH 37/42] Fixed a sizing issue in FlexboxComponent. --- es-core/src/components/FlexboxComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index 76918b086..2e1262a07 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -173,7 +173,7 @@ void FlexboxComponent::applyTheme(const std::shared_ptr& theme, mItemMargin = elem->get("itemMargin"); if (elem->has("itemWidth")) - mItemWidth = elem->get("itemWidth") * scale.x; + mItemWidth = floorf(elem->get("itemWidth") * scale.x); GuiComponent::applyTheme(theme, view, element, properties); From fb2f254d7e5c49e8deda4abbfa86c2ec30f9b573 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 5 Oct 2021 18:12:24 +0200 Subject: [PATCH 38/42] (rbsimple-DE) Some adjustments to the badges placement and sizing. --- themes/rbsimple-DE/theme.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/themes/rbsimple-DE/theme.xml b/themes/rbsimple-DE/theme.xml index 45c6ae52b..fef0db606 100644 --- a/themes/rbsimple-DE/theme.xml +++ b/themes/rbsimple-DE/theme.xml @@ -237,13 +237,13 @@ based on: 'recalbox-multi' by the Recalbox community right - 0.8125 0.65 + 0.8125 0.675 0 0 - column + row start - 4 - 25 5 - .059 + 3 + 20 20 + .038 favorite completed kidgame broken altemulator From 272584ac3934b11e967bd98adc593f8782572042 Mon Sep 17 00:00:00 2001 From: shadash Date: Fri, 8 Oct 2021 20:37:24 +0200 Subject: [PATCH 39/42] change font in alt emu badge Signed-off-by: Sophia Hadash --- resources/graphics/badge_altemulator.svg | 413 +++++++++++------------ 1 file changed, 203 insertions(+), 210 deletions(-) diff --git a/resources/graphics/badge_altemulator.svg b/resources/graphics/badge_altemulator.svg index bf04c7319..0a54263ac 100644 --- a/resources/graphics/badge_altemulator.svg +++ b/resources/graphics/badge_altemulator.svg @@ -1,49 +1,48 @@ - - + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="80" + height="112" + viewBox="0 0 21.166666 29.633334" + version="1.1" + id="svg4842" + inkscape:version="1.0.2 (e86c870879, 2021-01-15)" + sodipodi:docname="badge_altemulator.svg"> + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="7.0546875" + inkscape:cx="29.041584" + inkscape:cy="62.825107" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="3440" + inkscape:window-height="1355" + inkscape:window-x="2560" + inkscape:window-y="0" + inkscape:window-maximized="1" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + units="px" + inkscape:snap-nodes="false" + inkscape:snap-others="false" + inkscape:snap-global="true" + inkscape:document-rotation="0"/> @@ -62,47 +61,47 @@ id="layer1" transform="translate(-1.9829021e-4,-266.11715)"> + style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.56896;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:0;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + id="rect5286" + width="21.166666" + height="29.633333" + x="0.0001982902" + y="266.11713" /> + x="3.0257001" + y="2.9029" + width="204.36" + height="288.81" + id="rect14" + style="fill:#d7d7d7;fill-opacity:1;stroke-width:0.26458"/> + x="7.7007999" + y="7.7174001" + width="194.89999" + height="279.22" + id="rect18" + style="stroke-width:0.26458"/> + style="fill:#e6e6e6;fill-opacity:1;stroke-width:0.0266453" + id="rect22" + height="17.395565" + width="17.540144" + y="271.47574" + x="1.8325089" /> + style="fill:#f0f0f0;fill-opacity:1;stroke-width:0.25971" + id="g56-4" + aria-label="CONTENT RATED BY" + transform="matrix(0.09632353,0,0,0.10097609,0.27971034,266.32293)"> + d="m 2.2271284,292.95117 c 0,0.40604 0.015331,0.79582 0.030663,1.17749 0,0.0243 0.030663,0.0406 0.076656,0.0406 0.2529687,0.008 1.364477,0.0203 1.625048,0.0203 0.2529687,0 1.073192,-0.004 1.3184891,-0.0122 v -0.29642 -0.35327 c -0.00767,-0.0203 -0.038327,-0.0406 -0.076656,-0.0406 -0.2606263,-0.004 -1.096179,-0.008 -1.3568192,-0.008 h -0.099653 v -0.21114 h 0.9965315 v -0.268 -0.30859 c -0.00767,-0.0203 -0.038327,-0.0406 -0.076656,-0.0406 -0.1993091,0 -0.6132565,-0.004 -0.919871,-0.004 v -0.21521 h 0.2989565 c 0.2529687,0 0.9735306,0 1.2188276,-0.008 v -0.29642 -0.35326 c -0.00767,-0.0203 -0.038327,-0.0406 -0.076656,-0.0406 -0.2606264,-0.004 -1.0808497,-0.008 -1.3414899,-0.008 -0.2529687,0 -1.3491477,0.004 -1.5867594,0.008 -0.022997,0.40604 -0.030663,0.81206 -0.030663,1.21812 z" + id="path78-4" + inkscape:connector-curvature="0" + style="fill:#f0f0f0;fill-opacity:1;stroke-width:0.036704"/> + d="m 5.6153964,294.14527 c 0.5289244,0.0325 1.0961791,0.0446 1.6174179,0.0446 1.0348618,0 1.8780861,-0.15023 1.8780861,-0.79582 0,-0.5644 -0.9505434,-0.71463 -1.5867594,-0.81618 -0.3142859,-0.0487 -0.5519252,-0.0853 -0.5519252,-0.15834 0,-0.0731 0.1533072,-0.1137 0.3909464,-0.1137 0.4752649,0 1.0195325,0.0812 1.3798065,0.16647 l 0.1763081,-0.67809 c -0.5135951,-0.0527 -1.0348617,-0.0894 -1.4795233,-0.0894 -1.0501911,0 -1.8167688,0.0487 -1.8167688,0.70652 0,0.62531 0.8508821,0.75525 1.4258361,0.84049 0.2989567,0.0446 0.5212666,0.0772 0.5212666,0.15836 0,0.065 -0.1226499,0.14617 -0.4139474,0.14617 -0.3449586,0 -0.8202234,-0.0528 -1.3568193,-0.14212 z" + id="path80-9" + inkscape:connector-curvature="0" + style="fill:#f0f0f0;fill-opacity:1;stroke-width:0.036704"/> + d="m 9.4307297,292.9475 c 0,0.10149 0.00613,0.19489 0.01226,0.29641 0,0.0243 0.024523,0.0406 0.061303,0.0406 0.2023048,0.008 0.9931183,0.0203 1.2015133,0.0203 0.202306,0 0.919554,-0.004 1.054426,-0.0122 0,-0.0853 0.0061,-0.17459 0.0061,-0.2558 0,-0.20302 -0.0061,-0.24769 -0.0061,-0.34514 -0.0061,-0.0203 -0.03065,-0.0406 -0.06131,-0.0406 -0.208428,-0.004 -0.692729,-0.008 -0.901169,-0.008 -0.202303,0 -1.1647903,0.004 -1.354836,0.008 -0.00613,0.13399 -0.01226,0.21926 -0.01226,0.29642 z" + id="path82-1" + inkscape:connector-curvature="0" + style="fill:#f0f0f0;fill-opacity:1;stroke-width:0.0328234"/> + d="m 13.651876,292.95117 c 0,-0.19489 0,-0.36544 0.0077,-0.53598 h 0.130314 c 0.206967,0 0.360288,0.0528 0.360288,0.53598 0,0.48319 -0.153307,0.54004 -0.360288,0.54004 h -0.130314 c -0.0077,-0.17054 -0.0077,-0.34108 -0.0077,-0.54004 z m -1.517812,0 c 0,0.40604 0.01533,0.75525 0.01533,1.13692 0,0.0243 0.03066,0.0406 0.07666,0.0406 0.528925,0.0284 1.011861,0.0487 1.433466,0.0487 1.28783,0 2.092697,-0.21115 2.092697,-1.22628 0,-0.95418 -0.812553,-1.24657 -2.108095,-1.24657 -0.429277,0 -0.98886,0.0284 -1.494784,0.0691 0,0.40604 -0.01533,0.7715 -0.01533,1.17749 z" + id="path84-7" + inkscape:connector-curvature="0" + style="fill:#f0f0f0;fill-opacity:1;stroke-width:0.036704"/> + d="m 15.999759,292.92458 c 0,0.3953 0.01492,0.77476 0.02985,1.14634 0,0.0237 0.02985,0.0395 0.07463,0.0395 0.246278,0.008 1.328384,0.0198 1.582062,0.0198 0.246277,0 1.044804,-0.004 1.283611,-0.0118 v -0.28858 -0.34391 c -0.0075,-0.0198 -0.03731,-0.0395 -0.07463,-0.0395 -0.253731,-0.004 -1.067182,-0.008 -1.320928,-0.008 h -0.09702 v -0.20557 h 0.970171 v -0.2609 -0.30043 c -0.0075,-0.0198 -0.03731,-0.0395 -0.07463,-0.0395 -0.194037,0 -0.597034,-0.004 -0.895539,-0.004 v -0.20951 h 0.291049 c 0.246277,0 0.947778,0 1.186587,-0.008 v -0.28857 -0.34391 c -0.0075,-0.0198 -0.03731,-0.0395 -0.07463,-0.0395 -0.253731,-0.004 -1.052258,-0.008 -1.306003,-0.008 -0.246277,0 -1.313459,0.004 -1.544785,0.008 -0.02239,0.39529 -0.02985,0.79057 -0.02985,1.18589 z" + id="path86-0" + inkscape:connector-curvature="0" + style="fill:#f0f0f0;fill-opacity:1;stroke-width:0.0357331"/> + id="g54" + aria-label="CONTENT RATED BY" + transform="matrix(0.09871346,0,0,0.10292059,-29.557342,270.26518)" + style="fill:#ffffff;stroke-width:0.25912"> + id="path26" + d="m 17.44,237.05 c 0,6.2189 2.6119,7.5125 6.7911,7.5125 1.0199,0 1.8408,-0.0746 2.8607,-0.27364 l -0.52239,-3.9304 -2.2886,0.17413 c -1.0199,0.0497 -1.6667,-0.52239 -1.6667,-3.4826 0,-2.9602 0.74627,-3.5075 1.6667,-3.4577 l 2.2886,0.14926 0.54726,-3.9055 c -1.0199,-0.22388 -1.8159,-0.42289 -2.8358,-0.42289 -4.204,0 -6.8408,1.791 -6.8408,7.6368 z" + inkscape:connector-curvature="0"/> + id="path28" + d="m 27.505,237.05 c 0,5.7712 2.1642,7.612 6.9154,7.612 3.5075,-0.17413 5.7214,-2.7114 5.7214,-7.612 0,-5.7463 -2.2388,-7.6368 -6.9652,-7.6368 -3.5075,0.17413 -5.6717,2.7612 -5.6717,7.6368 z m 5.1741,0 c 0,-2.9602 0.42289,-3.2836 1.0945,-3.2836 0.67161,0 1.1692,0.32339 1.1692,3.2836 0,2.9602 -0.42289,3.2836 -1.0945,3.2836 -0.67161,0 -1.1692,-0.32339 -1.1692,-3.2836 z" + inkscape:connector-curvature="0"/> - - - - - - - - + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.5833px;line-height:1.25;font-family:Dyuthi;-inkscape-font-specification:Dyuthi;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583" + x="19.372959" + y="271.49698" + id="text5145"/> + style="opacity:1;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + d="m 11.142864,276.8821 c 0,-0.13102 -0.08756,-0.2366 -0.19606,-0.2366 h -0.245083 v -0.8903 h -0.444919 v 0.8903 h -0.245074 c -0.1085141,0 -0.1960697,0.10558 -0.1960697,0.2366 v 0.80877 c 0,0.13102 0.087556,0.23659 0.1960697,0.23659 h 0.935076 c 0.108505,0 0.19606,-0.10557 0.19606,-0.23659 z m -0.437842,0.17863 v 0.45151 h -0.451513 v -0.45151 z" + id="rect5069-0-5-6-6" + inkscape:connector-curvature="0" /> + style="opacity:1;vector-effect:none;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" + d="m 5.8349883,276.8821 c 0,-0.13102 -0.087556,-0.2366 -0.1960607,-0.2366 H 5.3938449 v -0.8903 H 4.9489256 v 0.8903 H 4.703852 c -0.1085142,0 -0.1960698,0.10558 -0.1960698,0.2366 v 0.80877 c 0,0.13102 0.087556,0.23659 0.1960698,0.23659 h 0.9350756 c 0.1085051,0 0.1960607,-0.10557 0.1960607,-0.23659 z m -0.4378418,0.17863 v 0.45151 H 4.9456332 v -0.45151 z" + id="rect5069-0-5-1-0-8-8" + inkscape:connector-curvature="0" /> + style="opacity:1;vector-effect:none;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" + d="m 7.605691,276.8821 c 0,-0.13102 -0.087556,-0.2366 -0.1960607,-0.2366 H 7.1645475 v -0.8903 H 6.7196374 v 0.8903 H 6.4745547 c -0.1085143,0 -0.1960608,0.10558 -0.1960608,0.2366 v 0.80877 c 0,0.13102 0.087556,0.23659 0.1960608,0.23659 h 0.9350756 c 0.1085051,0 0.1960607,-0.10557 0.1960607,-0.23659 z m -0.4378419,0.17863 v 0.45151 H 6.7163358 v -0.45151 z" + id="rect5069-0-5-1-0-4" + inkscape:connector-curvature="0" /> + style="opacity:1;vector-effect:none;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" + d="m 9.3740406,276.8821 c 0,-0.13102 -0.087556,-0.2366 -0.1960607,-0.2366 H 8.9328972 v -0.8903 H 8.487987 v 0.8903 H 8.2429043 c -0.1085143,0 -0.1960607,0.10558 -0.1960607,0.2366 v 0.80877 c 0,0.13102 0.087556,0.23659 0.1960607,0.23659 h 0.9350756 c 0.1085051,0 0.1960607,-0.10557 0.1960607,-0.23659 z m -0.4378419,0.17863 v 0.45151 H 8.4846854 v -0.45151 z" + id="rect5069-0-5-1-7" + inkscape:connector-curvature="0" /> + style="opacity:1;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + d="m 12.916869,276.8821 c 0,-0.13102 -0.08756,-0.2366 -0.196061,-0.2366 h -0.245083 v -0.8903 h -0.444919 v 0.8903 h -0.245074 c -0.108514,0 -0.19607,0.10558 -0.19607,0.2366 v 0.80877 c 0,0.13102 0.08756,0.23659 0.19607,0.23659 h 0.935076 c 0.108505,0 0.196061,-0.10557 0.196061,-0.23659 z m -0.437842,0.17863 v 0.45151 h -0.451514 v -0.45151 z" + id="rect5069-0-5-2" + inkscape:connector-curvature="0" /> + style="opacity:1;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + d="m 14.686158,276.8821 c 0,-0.13102 -0.08756,-0.2366 -0.196061,-0.2366 h -0.245083 v -0.8903 h -0.44491 v 0.8903 h -0.245083 c -0.108514,0 -0.196061,0.10558 -0.196061,0.2366 v 0.80877 c 0,0.13102 0.08756,0.23659 0.196061,0.23659 h 0.935076 c 0.108505,0 0.196061,-0.10557 0.196061,-0.23659 z m -0.437842,0.17863 v 0.45151 h -0.451514 v -0.45151 z" + id="rect5069-0-4" + inkscape:connector-curvature="0" /> + style="opacity:1;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + d="m 11.142864,282.65618 c 0,-0.13102 -0.08756,-0.2366 -0.19606,-0.2366 h -0.935076 c -0.1084776,0 -0.1960697,0.10558 -0.1960697,0.2366 v 0.80876 c 0,0.13102 0.087556,0.2366 0.1960697,0.2366 h 0.245074 v 0.8903 h 0.444919 v -0.8903 h 0.245083 c 0.108477,0 0.19606,-0.10558 0.19606,-0.2366 z m -0.437842,0.17862 v 0.45152 h -0.451513 v -0.45152 z" + id="rect5069-0-5-6" + inkscape:connector-curvature="0" /> + style="opacity:1;vector-effect:none;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" + d="m 16.452628,282.65618 c 0,-0.13102 -0.08755,-0.2366 -0.19607,-0.2366 h -0.935075 c -0.108478,0 -0.196061,0.10558 -0.196061,0.2366 v 0.80876 c 0,0.13102 0.08756,0.2366 0.196061,0.2366 h 0.245083 v 0.8903 h 0.444919 v -0.8903 h 0.245073 c 0.108478,0 0.19607,-0.10558 0.19607,-0.2366 z m -0.437851,0.17862 v 0.45152 h -0.451513 v -0.45152 z" + id="rect5195" + inkscape:connector-curvature="0" /> + style="opacity:1;vector-effect:none;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" + d="m 5.8349883,282.65618 c 0,-0.13102 -0.087556,-0.2366 -0.1960607,-0.2366 H 4.703852 c -0.1084777,0 -0.1960698,0.10558 -0.1960698,0.2366 v 0.80876 c 0,0.13102 0.087556,0.2366 0.1960698,0.2366 h 0.2450736 v 0.8903 h 0.4449193 v -0.8903 h 0.2450827 c 0.1084778,0 0.1960607,-0.10558 0.1960607,-0.2366 z m -0.4378418,0.17862 v 0.45152 H 4.9456332 v -0.45152 z" + id="rect5069-0-5-1-0-8" + inkscape:connector-curvature="0" /> + style="opacity:1;vector-effect:none;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" + d="m 7.605691,282.65618 c 0,-0.13102 -0.087556,-0.2366 -0.1960607,-0.2366 H 6.4745547 c -0.1084778,0 -0.1960608,0.10558 -0.1960608,0.2366 v 0.80876 c 0,0.13102 0.087556,0.2366 0.1960608,0.2366 h 0.2450827 v 0.8903 h 0.4449101 v -0.8903 h 0.2450828 c 0.1084777,0 0.1960607,-0.10558 0.1960607,-0.2366 z m -0.4378419,0.17862 v 0.45152 H 6.7163358 v -0.45152 z" + id="rect5069-0-5-1-0" + inkscape:connector-curvature="0" /> + style="opacity:1;vector-effect:none;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" + d="m 9.3740406,282.65618 c 0,-0.13102 -0.087556,-0.2366 -0.1960607,-0.2366 H 8.2429043 c -0.1084778,0 -0.1960607,0.10558 -0.1960607,0.2366 v 0.80876 c 0,0.13102 0.087556,0.2366 0.1960607,0.2366 H 8.487987 v 0.8903 h 0.4449102 v -0.8903 h 0.2450827 c 0.1084777,0 0.1960607,-0.10558 0.1960607,-0.2366 z m -0.4378419,0.17862 v 0.45152 H 8.4846854 v -0.45152 z" + id="rect5069-0-5-1" + inkscape:connector-curvature="0" /> + style="opacity:1;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + d="m 12.916869,282.65618 c 0,-0.13102 -0.08756,-0.2366 -0.196061,-0.2366 h -0.935076 c -0.108478,0 -0.19607,0.10558 -0.19607,0.2366 v 0.80876 c 0,0.13102 0.08756,0.2366 0.19607,0.2366 h 0.245074 v 0.8903 h 0.444919 v -0.8903 h 0.245083 c 0.108478,0 0.196061,-0.10558 0.196061,-0.2366 z m -0.437842,0.17862 v 0.45152 h -0.451514 v -0.45152 z" + id="rect5069-0-5" + inkscape:connector-curvature="0" /> + style="opacity:1;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.221985;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + d="m 14.686158,282.65618 c 0,-0.13102 -0.08756,-0.2366 -0.196061,-0.2366 h -0.935076 c -0.108478,0 -0.196061,0.10558 -0.196061,0.2366 v 0.80876 c 0,0.13102 0.08756,0.2366 0.196061,0.2366 h 0.245083 v 0.8903 h 0.44491 v -0.8903 h 0.245083 c 0.108478,0 0.196061,-0.10558 0.196061,-0.2366 z m -0.437842,0.17862 v 0.45152 h -0.451514 v -0.45152 z" + id="rect5069-0" + inkscape:connector-curvature="0" /> + id="rect5061" + d="m 4.7486749,277.07833 c -0.3682172,0 -0.664559,0.25094 -0.664559,0.56276 v 5.0648 c 0,0.31182 0.2963418,0.56276 0.664559,0.56276 H 16.456487 c 0.368217,0 0.664559,-0.25094 0.664559,-0.56276 v -1.64279 a 0.91714642,0.91714642 0 0 1 -0.698149,-0.88987 0.91714642,0.91714642 0 0 1 0.698149,-0.88935 v -1.64279 c 0,-0.31182 -0.296342,-0.56276 -0.664559,-0.56276 z" + style="opacity:1;fill:#fcfcfd;fill-opacity:1;stroke:#282828;stroke-width:0.274902;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" + inkscape:connector-curvature="0"/> + rx="0.42198506" + ry="0.42198506" + y="277.72012" + x="7.7069221" + height="4.9067254" + width="5.7913175" + id="rect5019" + style="opacity:1;vector-effect:none;fill:#ffd700;fill-opacity:1;stroke:#282828;stroke-width:0.213968;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers"/> + + + + + + + + + + From 123e50cf17cc8c3658ad6fa5260757aa7d9fd47e Mon Sep 17 00:00:00 2001 From: shadash Date: Sat, 9 Oct 2021 17:04:04 +0200 Subject: [PATCH 40/42] change dimension constraints to use container size. make margins proportional to screen size. Signed-off-by: Sophia Hadash --- es-core/src/ThemeData.cpp | 3 +- es-core/src/components/FlexboxComponent.cpp | 53 ++++++++++----------- es-core/src/components/FlexboxComponent.h | 22 ++++----- themes/rbsimple-DE/theme.xml | 5 +- 4 files changed, 38 insertions(+), 45 deletions(-) diff --git a/es-core/src/ThemeData.cpp b/es-core/src/ThemeData.cpp index 8dd5ae90c..0b35a30e3 100644 --- a/es-core/src/ThemeData.cpp +++ b/es-core/src/ThemeData.cpp @@ -148,12 +148,13 @@ std::map> The {"zIndex", FLOAT}}}, {"badges", {{"pos", NORMALIZED_PAIR}, + {"size", NORMALIZED_PAIR}, {"origin", NORMALIZED_PAIR}, {"direction", STRING}, {"align", STRING}, {"itemsPerLine", FLOAT}, + {"lines", FLOAT}, {"itemMargin", NORMALIZED_PAIR}, - {"itemWidth", FLOAT}, {"slots", STRING}, {"customBadgeIcon", PATH}, {"visible", BOOLEAN}, diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index 2e1262a07..57d8d649c 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -17,8 +17,8 @@ FlexboxComponent::FlexboxComponent(Window* window) , mDirection(DEFAULT_DIRECTION) , mAlign(DEFAULT_ALIGN) , mItemsPerLine(DEFAULT_ITEMS_PER_LINE) + , mLines(DEFAULT_LINES) , mItemMargin({DEFAULT_MARGIN_X, DEFAULT_MARGIN_Y}) - , mItemWidth(DEFAULT_ITEM_SIZE_X) , mLayoutValid(false) { } @@ -43,40 +43,37 @@ void FlexboxComponent::computeLayout() directionRow = {1, 0}; } - // Set children sizes. - glm::vec2 maxItemSize = {0.0f, 0.0f}; + // Compute children maximal dimensions. + // direction == row + // maxItemSize = { ((mMaxSize.x - mItemMargin.x) / mItemsPerLine) - mItemMargin.x, ((mMaxSize.y + // - mItemMargin.y) / mLines) - mItemMargin.y}; + glm::vec2 grid; + if (mDirection == Direction::row) + grid = {mItemsPerLine, mLines}; + else + grid = {mLines, mItemsPerLine}; + glm::vec2 maxItemSize = ((mSize - mItemMargin) / grid) - mItemMargin; + + // Set final children dimensions. for (auto i : mChildren) { auto oldSize = i->getSize(); if (oldSize.x == 0) - oldSize.x = DEFAULT_ITEM_SIZE_X; - glm::vec2 newSize = {mItemWidth, oldSize.y * (mItemWidth / oldSize.x)}; + oldSize.x = maxItemSize.x; + glm::vec2 sizeMaxX = {maxItemSize.x, oldSize.y * (maxItemSize.x / oldSize.x)}; + glm::vec2 sizeMaxY = {oldSize.x * (maxItemSize.y / oldSize.y), maxItemSize.y}; + glm::vec2 newSize = + sizeMaxX.x * sizeMaxX.y >= sizeMaxY.x * sizeMaxY.y ? sizeMaxX : sizeMaxY; i->setSize(newSize); - maxItemSize = {std::max(maxItemSize.x, newSize.x), std::max(maxItemSize.y, newSize.y)}; - i->setResize(maxItemSize.x, maxItemSize.y); } // Pre-compute layout parameters. - int n = mChildren.size(); - int nLines = - std::max(1, static_cast(std::ceil(n / std::max(1, static_cast(mItemsPerLine))))); float lineWidth = (mDirection == Direction::row ? (maxItemSize.y + mItemMargin.y) : (maxItemSize.x + mItemMargin.x)); float anchorXStart = anchorX; float anchorYStart = anchorY; - // Compute total container size. - glm::vec2 totalSize = {-mItemMargin.x, -mItemMargin.y}; - if (mDirection == Direction::row) { - totalSize.x += (mItemMargin.x + mItemWidth) * mItemsPerLine; - totalSize.y += (mItemMargin.y + maxItemSize.y) * nLines; - } - else { - totalSize.x += (mItemMargin.x + mItemWidth) * nLines; - totalSize.y += (mItemMargin.y + maxItemSize.y) * mItemsPerLine; - } - // Iterate through the children. - for (int i = 0; i < n; i++) { + for (int i = 0; i < static_cast(mChildren.size()); i++) { GuiComponent* child = mChildren[i]; auto size = child->getSize(); @@ -99,9 +96,9 @@ void FlexboxComponent::computeLayout() // Apply origin. if (mOrigin.x > 0 && mOrigin.x <= 1) - x -= mOrigin.x * totalSize.x; + x -= mOrigin.x * mSize.x; if (mOrigin.y > 0 && mOrigin.y <= 1) - y -= mOrigin.y * totalSize.y; + y -= mOrigin.y * mSize.y; // Store final item position. child->setPosition(getPosition().x + x, getPosition().y + y); @@ -169,11 +166,11 @@ void FlexboxComponent::applyTheme(const std::shared_ptr& theme, if (elem->has("itemsPerLine")) mItemsPerLine = elem->get("itemsPerLine"); - if (elem->has("itemMargin")) - mItemMargin = elem->get("itemMargin"); + if (elem->has("lines")) + mLines = elem->get("lines"); - if (elem->has("itemWidth")) - mItemWidth = floorf(elem->get("itemWidth") * scale.x); + if (elem->has("itemMargin")) + mItemMargin = elem->get("itemMargin") * scale; GuiComponent::applyTheme(theme, view, element, properties); diff --git a/es-core/src/components/FlexboxComponent.h b/es-core/src/components/FlexboxComponent.h index 6f187f032..ad7ee90db 100644 --- a/es-core/src/components/FlexboxComponent.h +++ b/es-core/src/components/FlexboxComponent.h @@ -17,9 +17,9 @@ #define DEFAULT_DIRECTION Direction::row #define DEFAULT_ALIGN Align::center #define DEFAULT_ITEMS_PER_LINE 4 +#define DEFAULT_LINES 1 #define DEFAULT_MARGIN_X 10.0f #define DEFAULT_MARGIN_Y 10.0f -#define DEFAULT_ITEM_SIZE_X 64.0f class FlexboxComponent : public GuiComponent { @@ -30,12 +30,6 @@ public: explicit FlexboxComponent(Window* window); // Getters/Setters for rendering options. - [[nodiscard]] Direction getDirection() const { return mDirection; }; - void setDirection(Direction value) - { - mDirection = value; - mLayoutValid = false; - }; [[nodiscard]] Align getAlign() const { return mAlign; }; void setAlign(Align value) { @@ -48,18 +42,18 @@ public: mItemsPerLine = value; mLayoutValid = false; }; + [[nodiscard]] unsigned int getLines() const { return mLines; }; + void setLines(unsigned int value) + { + mLines = value; + mLayoutValid = false; + }; [[nodiscard]] glm::vec2 getItemMargin() const { return mItemMargin; }; void setItemMargin(glm::vec2 value) { mItemMargin = value; mLayoutValid = false; }; - [[nodiscard]] float getItemWidth() const { return mItemWidth; }; - void setItemWidth(float value) - { - mItemWidth = value; - mLayoutValid = false; - }; void onSizeChanged() override; void render(const glm::mat4& parentTrans) override; @@ -77,8 +71,8 @@ private: Direction mDirection; Align mAlign; unsigned int mItemsPerLine; + unsigned int mLines; glm::vec2 mItemMargin; - float mItemWidth; bool mLayoutValid; }; diff --git a/themes/rbsimple-DE/theme.xml b/themes/rbsimple-DE/theme.xml index fef0db606..ecf21ecde 100644 --- a/themes/rbsimple-DE/theme.xml +++ b/themes/rbsimple-DE/theme.xml @@ -238,12 +238,13 @@ based on: 'recalbox-multi' by the Recalbox community 0.8125 0.675 + 0.1 0.2 0 0 row start 3 - 20 20 - .038 + 2 + 0.005 0.005 favorite completed kidgame broken altemulator From a93b975ca01374e0c8beda9ba228d56c9f5721b9 Mon Sep 17 00:00:00 2001 From: shadash Date: Sun, 10 Oct 2021 13:29:26 +0200 Subject: [PATCH 41/42] bug fixes, adjust theme badge proportions Signed-off-by: Sophia Hadash --- es-core/src/components/FlexboxComponent.cpp | 22 +++++++++++---------- themes/rbsimple-DE/theme.xml | 4 ++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index 57d8d649c..df65694da 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -44,15 +44,12 @@ void FlexboxComponent::computeLayout() } // Compute children maximal dimensions. - // direction == row - // maxItemSize = { ((mMaxSize.x - mItemMargin.x) / mItemsPerLine) - mItemMargin.x, ((mMaxSize.y - // - mItemMargin.y) / mLines) - mItemMargin.y}; glm::vec2 grid; if (mDirection == Direction::row) grid = {mItemsPerLine, mLines}; else grid = {mLines, mItemsPerLine}; - glm::vec2 maxItemSize = ((mSize - mItemMargin) / grid) - mItemMargin; + glm::vec2 maxItemSize = (mSize + mItemMargin - grid * mItemMargin) / grid; // Set final children dimensions. for (auto i : mChildren) { @@ -61,8 +58,13 @@ void FlexboxComponent::computeLayout() oldSize.x = maxItemSize.x; glm::vec2 sizeMaxX = {maxItemSize.x, oldSize.y * (maxItemSize.x / oldSize.x)}; glm::vec2 sizeMaxY = {oldSize.x * (maxItemSize.y / oldSize.y), maxItemSize.y}; - glm::vec2 newSize = - sizeMaxX.x * sizeMaxX.y >= sizeMaxY.x * sizeMaxY.y ? sizeMaxX : sizeMaxY; + glm::vec2 newSize; + if (sizeMaxX.y > maxItemSize.y) + newSize = sizeMaxY; + else if (sizeMaxY.x > maxItemSize.x) + newSize = sizeMaxX; + else + newSize = sizeMaxX.x * sizeMaxX.y >= sizeMaxY.x * sizeMaxY.y ? sizeMaxX : sizeMaxY; i->setSize(newSize); } @@ -106,17 +108,17 @@ void FlexboxComponent::computeLayout() // Translate anchor. if ((i + 1) % std::max(1, static_cast(mItemsPerLine)) != 0) { // Translate on same line. - anchorX += (size.x + mItemMargin.x) * directionLine.x; - anchorY += (size.y + mItemMargin.y) * directionLine.y; + anchorX += (size.x + mItemMargin.x) * static_cast(directionLine.x); + anchorY += (size.y + mItemMargin.y) * static_cast(directionLine.y); } else { // Translate to first position of next line. if (directionRow.x == 0) { - anchorY += lineWidth * directionRow.y; + anchorY += lineWidth * static_cast(directionRow.y); anchorX = anchorXStart; } else { - anchorX += lineWidth * directionRow.x; + anchorX += lineWidth * static_cast(directionRow.x); anchorY = anchorYStart; } } diff --git a/themes/rbsimple-DE/theme.xml b/themes/rbsimple-DE/theme.xml index ecf21ecde..bda55e899 100644 --- a/themes/rbsimple-DE/theme.xml +++ b/themes/rbsimple-DE/theme.xml @@ -238,13 +238,13 @@ based on: 'recalbox-multi' by the Recalbox community 0.8125 0.675 - 0.1 0.2 + 0.15 0.21 0 0 row start 3 2 - 0.005 0.005 + 0.0028125 0.005 favorite completed kidgame broken altemulator From 24a480cf73415fd4bcd8040fdf67bc15df42f216 Mon Sep 17 00:00:00 2001 From: Sophia Hadash Date: Mon, 11 Oct 2021 11:42:21 +0200 Subject: [PATCH 42/42] documentation for the badges --- THEMES-DEV.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/THEMES-DEV.md b/THEMES-DEV.md index 7359ef622..fc6c82f57 100644 --- a/THEMES-DEV.md +++ b/THEMES-DEV.md @@ -466,6 +466,8 @@ or to specify only a portion of the value of a theme property: - The "genre" metadata. * `text name="md_players"` - ALL - The "players" metadata (number of players the game supports). + * `badges name="md_badges"` - ALL + - The "badges" metadata. Displayed as a group of badges that indicate boolean metadata such as favorite, broken. * `datetime name="md_lastplayed"` - ALL - The "lastplayed" metadata. Displayed as a string representing the time relative to "now" (e.g. "3 hours ago"). * `text name="md_playcount"` - ALL @@ -521,6 +523,8 @@ or to specify only a portion of the value of a theme property: - The "genre" metadata. * `text name="md_players"` - ALL - The "players" metadata (number of players the game supports). + * `badges name="md_badges"` - ALL + - The "badges" metadata. Displayed as a group of badges that indicate boolean metadata such as favorite, broken. * `datetime name="md_lastplayed"` - ALL - The "lastplayed" metadata. Displayed as a string representing the time relative to "now" (e.g. "3 hours ago"). * `text name="md_playcount"` - ALL @@ -576,6 +580,8 @@ or to specify only a portion of the value of a theme property: - The "genre" metadata. * `text name="md_players"` - ALL - The "players" metadata (number of players the game supports). + * `badges name="md_badges"` - ALL + - The "badges" metadata. Displayed as a group of badges that indicate boolean metadata such as favorite, broken. * `datetime name="md_lastplayed"` - ALL - The "lastplayed" metadata. Displayed as a string representing the time relative to "now" (e.g. "3 hours ago"). * `text name="md_playcount"` - ALL @@ -909,6 +915,45 @@ EmulationStation borrows the concept of "nine patches" from Android (or "9-Slice `button_back_XBOX360`, `button_start_XBOX360`. +#### badges + +* `pos` - type: NORMALIZED_PAIR. +* `size` - type: NORMALIZED_PAIR. + - Possible combinations: + - `w h` - Dimensions of the badges container. The badges will be scaled to fit within these dimensions. +* `origin` - type: NORMALIZED_PAIR. + - Where on the component `pos` refers to. For example, an origin of `0.5 0.5` and a `pos` of `0.5 0.5` would place the component exactly in the middle of the screen. If the "POSITION" and "SIZE" attributes are themeable, "ORIGIN" is implied. +* `direction` - type: STRING. + - Valid values are "row" or "column". Controls the primary layout direction (line axis) for the badges. Lines will fill up in the specified direction. +* `align` - type: STRING. + - Valid values are "start", "center", "end", or "stretch". Controls orthogonal alignment to the line axis. "stretch" will stretch the badges to fill-up the line width. +* `itemsPerLine` - type: FLOAT. + - Number of badges that fit on a line. When more badges are available a new line will be started. +* `lines` - type: FLOAT. + - The number of lines available. +* `itemMargin` - type: NORMALIZED_PAIR. + - The margins between badges. Possible combinations: + - `x y` - horizontal and vertical margins. +* `slots` - type: STRING. + - The badge types that should be displayed. Should be specified as a dist of strings separated by spaces. The order will be followed when placing badges on the screen. + - Available badges are: + - "favorite": Will be shown when the game is marked as favorite. + - "completed": Will be shown when the game is marked as completed. + - "kidgame": Will be shown when the game is marked as a kids game. + - "broken": Will be shown when the game is marked as broken. + - "altemulator": Will be shown when an alternative emulator is setup for the game. +* `customBadgeIcon` - type: PATH. + - A badge icon override. Specify the badge type in the attribute `badge`. The available badges are: + `favorite`, + `completed`, + `kidgame`, + `broken`, + `altemulator` +* `visible` - type: BOOLEAN. + - If true, component will be rendered, otherwise rendering will be skipped. Can be used to hide elements from a particular view. +* `zIndex` - type: FLOAT. + - z-index value for component. Components will be rendered in order of z-index value from low to high. + #### carousel * `type` - type: STRING.