Changed most increment and decrement operators from postfix to prefix for es-app.

This commit is contained in:
Leon Styhre 2021-11-17 17:35:34 +01:00
parent 9c1008bdd2
commit dd0f36f82b
37 changed files with 249 additions and 250 deletions

View file

@ -65,7 +65,7 @@ CollectionSystemsManager::CollectionSystemsManager(Window* window)
systemDecls, systemDecls + sizeof(systemDecls) / sizeof(systemDecls[0])); systemDecls, systemDecls + sizeof(systemDecls) / sizeof(systemDecls[0]));
for (std::vector<CollectionSystemDecl>::const_iterator it = tempSystemDecl.cbegin(); for (std::vector<CollectionSystemDecl>::const_iterator it = tempSystemDecl.cbegin();
it != tempSystemDecl.cend(); it++) it != tempSystemDecl.cend(); ++it)
mCollectionSystemDeclsIndex[(*it).name] = (*it); mCollectionSystemDeclsIndex[(*it).name] = (*it);
// Setup the standard environment. // Setup the standard environment.
@ -101,7 +101,7 @@ CollectionSystemsManager::~CollectionSystemsManager()
// Delete all custom collections. // Delete all custom collections.
for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it = for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it =
mCustomCollectionSystemsData.cbegin(); mCustomCollectionSystemsData.cbegin();
it != mCustomCollectionSystemsData.cend(); it++) it != mCustomCollectionSystemsData.cend(); ++it)
delete it->second.system; delete it->second.system;
// Delete the custom collections bundle. // Delete the custom collections bundle.
@ -110,7 +110,7 @@ CollectionSystemsManager::~CollectionSystemsManager()
// Delete the auto collections systems. // Delete the auto collections systems.
for (auto it = mAutoCollectionSystemsData.cbegin(); // Line break. for (auto it = mAutoCollectionSystemsData.cbegin(); // Line break.
it != mAutoCollectionSystemsData.cend(); it++) it != mAutoCollectionSystemsData.cend(); ++it)
delete (*it).second.system; delete (*it).second.system;
delete mCollectionEnvData; delete mCollectionEnvData;
@ -176,7 +176,7 @@ void CollectionSystemsManager::saveCustomCollection(SystemData* sys)
configFileIn.close(); configFileIn.close();
for (std::unordered_map<std::string, FileData*>::const_iterator it = games.cbegin(); for (std::unordered_map<std::string, FileData*>::const_iterator it = games.cbegin();
it != games.cend(); it++) { it != games.cend(); ++it) {
std::string path = it->first; std::string path = it->first;
// If the ROM path of the game begins with the path from the setting // If the ROM path of the game begins with the path from the setting
// ROMDirectory (or the default ROM directory), then replace it with %ROMPATH%. // ROMDirectory (or the default ROM directory), then replace it with %ROMPATH%.
@ -199,7 +199,7 @@ void CollectionSystemsManager::saveCustomCollection(SystemData* sys)
configFileOut.open(getCustomCollectionConfigPath(name)); configFileOut.open(getCustomCollectionConfigPath(name));
#endif #endif
for (auto it = fileGameEntries.cbegin(); it != fileGameEntries.cend(); it++) for (auto it = fileGameEntries.cbegin(); it != fileGameEntries.cend(); ++it)
configFileOut << (*it) << std::endl; configFileOut << (*it) << std::endl;
configFileOut.close(); configFileOut.close();
@ -236,7 +236,7 @@ void CollectionSystemsManager::loadEnabledListFromSettings()
// Iterate the map. // Iterate the map.
for (std::map<std::string, CollectionSystemData, stringComparator>::iterator it = for (std::map<std::string, CollectionSystemData, stringComparator>::iterator it =
mAutoCollectionSystemsData.begin(); mAutoCollectionSystemsData.begin();
it != mAutoCollectionSystemsData.end(); it++) { it != mAutoCollectionSystemsData.end(); ++it) {
it->second.isEnabled = (std::find(autoSelected.cbegin(), autoSelected.cend(), it->first) != it->second.isEnabled = (std::find(autoSelected.cbegin(), autoSelected.cend(), it->first) !=
autoSelected.cend()); autoSelected.cend());
} }
@ -250,7 +250,7 @@ void CollectionSystemsManager::loadEnabledListFromSettings()
// Iterate the map. // Iterate the map.
for (std::map<std::string, CollectionSystemData, stringComparator>::iterator it = for (std::map<std::string, CollectionSystemData, stringComparator>::iterator it =
mCustomCollectionSystemsData.begin(); mCustomCollectionSystemsData.begin();
it != mCustomCollectionSystemsData.end(); it++) { it != mCustomCollectionSystemsData.end(); ++it) {
it->second.isEnabled = (std::find(customSelected.cbegin(), customSelected.cend(), it->second.isEnabled = (std::find(customSelected.cbegin(), customSelected.cend(),
it->first) != customSelected.cend()); it->first) != customSelected.cend());
if (it->second.isEnabled) if (it->second.isEnabled)
@ -281,7 +281,7 @@ void CollectionSystemsManager::updateSystemsList()
// Create views for collections, before reload. // Create views for collections, before reload.
for (auto sysIt = SystemData::sSystemVector.cbegin(); // Line break. for (auto sysIt = SystemData::sSystemVector.cbegin(); // Line break.
sysIt != SystemData::sSystemVector.cend(); sysIt++) { sysIt != SystemData::sSystemVector.cend(); ++sysIt) {
if ((*sysIt)->isCollection()) if ((*sysIt)->isCollection())
ViewController::get()->getGameListView((*sysIt)); ViewController::get()->getGameListView((*sysIt));
} }
@ -317,7 +317,7 @@ void CollectionSystemsManager::refreshCollectionSystems(FileData* file,
mCustomCollectionSystemsData.cend()); mCustomCollectionSystemsData.cend());
for (auto sysDataIt = allCollections.cbegin(); // Line break. for (auto sysDataIt = allCollections.cbegin(); // Line break.
sysDataIt != allCollections.cend(); sysDataIt++) { sysDataIt != allCollections.cend(); ++sysDataIt) {
if (sysDataIt->second.isEnabled || (refreshDisabledAutoCollections && if (sysDataIt->second.isEnabled || (refreshDisabledAutoCollections &&
!sysDataIt->second.system->isGroupedCustomCollection())) !sysDataIt->second.system->isGroupedCustomCollection()))
updateCollectionSystem(file, sysDataIt->second); updateCollectionSystem(file, sysDataIt->second);
@ -496,7 +496,7 @@ void CollectionSystemsManager::deleteCollectionFiles(FileData* file)
allCollections.insert(mCustomCollectionSystemsData.cbegin(), allCollections.insert(mCustomCollectionSystemsData.cbegin(),
mCustomCollectionSystemsData.cend()); mCustomCollectionSystemsData.cend());
for (auto sysDataIt = allCollections.begin(); sysDataIt != allCollections.end(); sysDataIt++) { for (auto sysDataIt = allCollections.begin(); sysDataIt != allCollections.end(); ++sysDataIt) {
if (sysDataIt->second.isPopulated) { if (sysDataIt->second.isPopulated) {
const std::unordered_map<std::string, FileData*>& children = const std::unordered_map<std::string, FileData*>& children =
(sysDataIt->second.system)->getRootFolder()->getChildrenByFilename(); (sysDataIt->second.system)->getRootFolder()->getChildrenByFilename();
@ -520,7 +520,7 @@ const bool CollectionSystemsManager::isThemeGenericCollectionCompatible(
bool genericCustomCollections) bool genericCustomCollections)
{ {
std::vector<std::string> cfgSys = getCollectionThemeFolders(genericCustomCollections); std::vector<std::string> cfgSys = getCollectionThemeFolders(genericCustomCollections);
for (auto sysIt = cfgSys.cbegin(); sysIt != cfgSys.cend(); sysIt++) { for (auto sysIt = cfgSys.cbegin(); sysIt != cfgSys.cend(); ++sysIt) {
if (!themeFolderExists(*sysIt)) if (!themeFolderExists(*sysIt))
return false; return false;
} }
@ -542,7 +542,7 @@ const bool CollectionSystemsManager::isThemeCustomCollectionCompatible(
return true; return true;
} }
for (auto sysIt = stringVector.cbegin(); sysIt != stringVector.cend(); sysIt++) { for (auto sysIt = stringVector.cbegin(); sysIt != stringVector.cend(); ++sysIt) {
if (!themeFolderExists(*sysIt)) if (!themeFolderExists(*sysIt))
return false; return false;
} }
@ -591,7 +591,7 @@ std::string CollectionSystemsManager::getValidNewCollectionName(const std::strin
systemsInUse.insert(systemsInUse.cend(), customSys.cbegin(), customSys.cend()); systemsInUse.insert(systemsInUse.cend(), customSys.cbegin(), customSys.cend());
systemsInUse.insert(systemsInUse.cend(), userSys.cbegin(), userSys.cend()); systemsInUse.insert(systemsInUse.cend(), userSys.cbegin(), userSys.cend());
for (auto sysIt = systemsInUse.cbegin(); sysIt != systemsInUse.cend(); sysIt++) { for (auto sysIt = systemsInUse.cbegin(); sysIt != systemsInUse.cend(); ++sysIt) {
if (*sysIt == name) { if (*sysIt == name) {
if (index > 0) if (index > 0)
name = name.substr(0, name.size() - 4); name = name.substr(0, name.size() - 4);
@ -639,7 +639,7 @@ void CollectionSystemsManager::exitEditMode(bool showPopup)
mEditingCollection = "Favorites"; mEditingCollection = "Favorites";
// Remove all tick marks from the games that are part of the collection. // Remove all tick marks from the games that are part of the collection.
for (auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); it++) { for (auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); ++it) {
ViewController::get()->getGameListView((*it))->onFileChanged( ViewController::get()->getGameListView((*it))->onFileChanged(
ViewController::get()->getGameListView((*it))->getCursor(), false); ViewController::get()->getGameListView((*it))->getCursor(), false);
} }
@ -796,7 +796,7 @@ FileData* CollectionSystemsManager::updateCollectionFolderMetadata(SystemData* s
std::mt19937 engine{randDev()}; std::mt19937 engine{randDev()};
unsigned int target; unsigned int target;
for (unsigned int i = 0; i < 3; i++) { for (unsigned int i = 0; i < 3; ++i) {
std::uniform_int_distribution<int> uniform_dist(0, gameCount - 1 - i); std::uniform_int_distribution<int> uniform_dist(0, gameCount - 1 - i);
target = uniform_dist(engine); target = uniform_dist(engine);
gamesListRandom.push_back(gamesList[target]); gamesListRandom.push_back(gamesList[target]);
@ -900,7 +900,7 @@ std::vector<std::string> CollectionSystemsManager::getUnusedSystemsFromTheme()
if (std::find(systemsInUse.cbegin(), systemsInUse.cend(), *sysIt) != systemsInUse.cend()) if (std::find(systemsInUse.cbegin(), systemsInUse.cend(), *sysIt) != systemsInUse.cend())
sysIt = themeSys.erase(sysIt); sysIt = themeSys.erase(sysIt);
else else
sysIt++; ++sysIt;
} }
return themeSys; return themeSys;
} }
@ -963,7 +963,7 @@ void CollectionSystemsManager::reactivateCustomCollectionEntry(FileData* game)
// game would be missing if the collection was enabled during the program session. // game would be missing if the collection was enabled during the program session.
for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it = for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it =
mCustomCollectionSystemsData.cbegin(); mCustomCollectionSystemsData.cbegin();
it != mCustomCollectionSystemsData.cend(); it++) { it != mCustomCollectionSystemsData.cend(); ++it) {
std::string path = getCustomCollectionConfigPath(it->first); std::string path = getCustomCollectionConfigPath(it->first);
if (Utils::FileSystem::exists(path)) { if (Utils::FileSystem::exists(path)) {
#if defined(_WIN64) #if defined(_WIN64)
@ -987,7 +987,7 @@ void CollectionSystemsManager::reactivateCustomCollectionEntry(FileData* game)
void CollectionSystemsManager::repopulateCollection(SystemData* sysData) void CollectionSystemsManager::repopulateCollection(SystemData* sysData)
{ {
for (auto it = mAutoCollectionSystemsData.cbegin(); // Line break. for (auto it = mAutoCollectionSystemsData.cbegin(); // Line break.
it != mAutoCollectionSystemsData.cend(); it++) { it != mAutoCollectionSystemsData.cend(); ++it) {
if ((*it).second.system == sysData) { if ((*it).second.system == sysData) {
LOG(LogDebug) << "CollectionSystemsManager::repopulateCollection(): " LOG(LogDebug) << "CollectionSystemsManager::repopulateCollection(): "
"Repopulating auto collection \"" "Repopulating auto collection \""
@ -1034,7 +1034,7 @@ void CollectionSystemsManager::repopulateCollection(SystemData* sysData)
} }
for (auto it = mCustomCollectionSystemsData.cbegin(); // Line break. for (auto it = mCustomCollectionSystemsData.cbegin(); // Line break.
it != mCustomCollectionSystemsData.cend(); it++) { it != mCustomCollectionSystemsData.cend(); ++it) {
if ((*it).second.system == sysData) { if ((*it).second.system == sysData) {
LOG(LogDebug) << "CollectionSystemsManager::repopulateCollection(): " LOG(LogDebug) << "CollectionSystemsManager::repopulateCollection(): "
"Repopulating custom collection '" "Repopulating custom collection '"
@ -1068,7 +1068,7 @@ void CollectionSystemsManager::initAutoCollectionSystems()
{ {
for (std::map<std::string, CollectionSystemDecl, stringComparator>::const_iterator it = for (std::map<std::string, CollectionSystemDecl, stringComparator>::const_iterator it =
mCollectionSystemDeclsIndex.cbegin(); mCollectionSystemDeclsIndex.cbegin();
it != mCollectionSystemDeclsIndex.cend(); it++) { it != mCollectionSystemDeclsIndex.cend(); ++it) {
CollectionSystemDecl sysDecl = it->second; CollectionSystemDecl sysDecl = it->second;
if (!sysDecl.isCustom) if (!sysDecl.isCustom)
@ -1079,7 +1079,7 @@ void CollectionSystemsManager::initAutoCollectionSystems()
void CollectionSystemsManager::initCustomCollectionSystems() void CollectionSystemsManager::initCustomCollectionSystems()
{ {
std::vector<std::string> systems = getCollectionsFromConfigFolder(); std::vector<std::string> systems = getCollectionsFromConfigFolder();
for (auto nameIt = systems.cbegin(); nameIt != systems.cend(); nameIt++) { for (auto nameIt = systems.cbegin(); nameIt != systems.cend(); ++nameIt) {
addNewCustomCollection(*nameIt); addNewCustomCollection(*nameIt);
} }
} }
@ -1124,11 +1124,11 @@ void CollectionSystemsManager::populateAutoCollection(CollectionSystemData* sysD
FileData* rootFolder = newSys->getRootFolder(); FileData* rootFolder = newSys->getRootFolder();
FileFilterIndex* index = newSys->getIndex(); FileFilterIndex* index = newSys->getIndex();
for (auto sysIt = SystemData::sSystemVector.cbegin(); // Line break. for (auto sysIt = SystemData::sSystemVector.cbegin(); // Line break.
sysIt != SystemData::sSystemVector.cend(); sysIt++) { sysIt != SystemData::sSystemVector.cend(); ++sysIt) {
// We won't iterate all collections. // We won't iterate all collections.
if ((*sysIt)->isGameSystem() && !(*sysIt)->isCollection()) { if ((*sysIt)->isGameSystem() && !(*sysIt)->isCollection()) {
std::vector<FileData*> files = (*sysIt)->getRootFolder()->getFilesRecursive(GAME); std::vector<FileData*> files = (*sysIt)->getRootFolder()->getFilesRecursive(GAME);
for (auto gameIt = files.cbegin(); gameIt != files.cend(); gameIt++) { for (auto gameIt = files.cbegin(); gameIt != files.cend(); ++gameIt) {
bool include = includeFileInAutoCollections((*gameIt)); bool include = includeFileInAutoCollections((*gameIt));
switch (sysDecl.type) { switch (sysDecl.type) {
@ -1256,14 +1256,14 @@ void CollectionSystemsManager::removeCollectionsFromDisplayedSystems()
if ((*sysIt)->isCollection()) if ((*sysIt)->isCollection())
sysIt = SystemData::sSystemVector.erase(sysIt); sysIt = SystemData::sSystemVector.erase(sysIt);
else else
sysIt++; ++sysIt;
} }
// Remove all custom collections in bundle. // Remove all custom collections in bundle.
// This should not delete the objects from memory! // This should not delete the objects from memory!
FileData* customRoot = mCustomCollectionsBundle->getRootFolder(); FileData* customRoot = mCustomCollectionsBundle->getRootFolder();
std::vector<FileData*> mChildren = customRoot->getChildren(); std::vector<FileData*> mChildren = customRoot->getChildren();
for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) { for (auto it = mChildren.cbegin(); it != mChildren.cend(); ++it) {
customRoot->removeChild(*it); customRoot->removeChild(*it);
} }
// Clear index. // Clear index.
@ -1278,7 +1278,7 @@ void CollectionSystemsManager::addEnabledCollectionsToDisplayedSystems(
// Add auto enabled collections. // Add auto enabled collections.
for (std::map<std::string, CollectionSystemData, stringComparator>::iterator it = for (std::map<std::string, CollectionSystemData, stringComparator>::iterator it =
colSystemData->begin(); colSystemData->begin();
it != colSystemData->end(); it++) { it != colSystemData->end(); ++it) {
if (it->second.isEnabled) { if (it->second.isEnabled) {
// Check if populated, otherwise populate. // Check if populated, otherwise populate.
if (!it->second.isPopulated) { if (!it->second.isPopulated) {
@ -1383,7 +1383,7 @@ std::vector<std::string> CollectionSystemsManager::getSystemsFromTheme()
Utils::FileSystem::stringList dirContent = Utils::FileSystem::getDirContent(themePath); Utils::FileSystem::stringList dirContent = Utils::FileSystem::getDirContent(themePath);
for (Utils::FileSystem::stringList::const_iterator it = dirContent.cbegin(); for (Utils::FileSystem::stringList::const_iterator it = dirContent.cbegin();
it != dirContent.cend(); it++) { it != dirContent.cend(); ++it) {
if (Utils::FileSystem::isDirectory(*it)) { if (Utils::FileSystem::isDirectory(*it)) {
// ... here you have a directory. // ... here you have a directory.
std::string folder = *it; std::string folder = *it;
@ -1406,7 +1406,7 @@ std::vector<std::string> CollectionSystemsManager::getCollectionsFromConfigFolde
if (Utils::FileSystem::exists(configPath)) { if (Utils::FileSystem::exists(configPath)) {
Utils::FileSystem::stringList dirContent = Utils::FileSystem::getDirContent(configPath); Utils::FileSystem::stringList dirContent = Utils::FileSystem::getDirContent(configPath);
for (Utils::FileSystem::stringList::const_iterator it = dirContent.cbegin(); for (Utils::FileSystem::stringList::const_iterator it = dirContent.cbegin();
it != dirContent.cend(); it++) { it != dirContent.cend(); ++it) {
if (Utils::FileSystem::isRegularFile(*it)) { if (Utils::FileSystem::isRegularFile(*it)) {
// It's a file. // It's a file.
std::string filename = Utils::FileSystem::getFileName(*it); std::string filename = Utils::FileSystem::getFileName(*it);
@ -1431,7 +1431,7 @@ std::vector<std::string> CollectionSystemsManager::getCollectionThemeFolders(boo
std::vector<std::string> systems; std::vector<std::string> systems;
for (std::map<std::string, CollectionSystemDecl, stringComparator>::const_iterator it = for (std::map<std::string, CollectionSystemDecl, stringComparator>::const_iterator it =
mCollectionSystemDeclsIndex.cbegin(); mCollectionSystemDeclsIndex.cbegin();
it != mCollectionSystemDeclsIndex.cend(); it++) { it != mCollectionSystemDeclsIndex.cend(); ++it) {
CollectionSystemDecl sysDecl = it->second; CollectionSystemDecl sysDecl = it->second;
if (sysDecl.isCustom == custom) if (sysDecl.isCustom == custom)
systems.push_back(sysDecl.themeFolder); systems.push_back(sysDecl.themeFolder);
@ -1444,7 +1444,7 @@ std::vector<std::string> CollectionSystemsManager::getUserCollectionThemeFolders
std::vector<std::string> systems; std::vector<std::string> systems;
for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it = for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it =
mCustomCollectionSystemsData.cbegin(); mCustomCollectionSystemsData.cbegin();
it != mCustomCollectionSystemsData.cend(); it++) it != mCustomCollectionSystemsData.cend(); ++it)
systems.push_back(it->second.decl.themeFolder); systems.push_back(it->second.decl.themeFolder);
return systems; return systems;
} }

View file

@ -140,7 +140,7 @@ const std::vector<FileData*> FileData::getChildrenRecursive() const
{ {
std::vector<FileData*> childrenRecursive; std::vector<FileData*> childrenRecursive;
for (auto it = mChildrenByFilename.cbegin(); it != mChildrenByFilename.cend(); it++) { for (auto it = mChildrenByFilename.cbegin(); it != mChildrenByFilename.cend(); ++it) {
childrenRecursive.emplace_back((*it).second); childrenRecursive.emplace_back((*it).second);
// Recurse through any subdirectories. // Recurse through any subdirectories.
if ((*it).second->getType() == FOLDER) { if ((*it).second->getType() == FOLDER) {
@ -221,7 +221,7 @@ const std::string FileData::getMediafilePath(const std::string& subdirectory) co
subFolders + "/" + getDisplayName(); subFolders + "/" + getDisplayName();
// Look for an image file in the media directory. // Look for an image file in the media directory.
for (size_t i = 0; i < extList.size(); i++) { for (size_t i = 0; i < extList.size(); ++i) {
std::string mediaPath = tempPath + extList[i]; std::string mediaPath = tempPath + extList[i];
if (Utils::FileSystem::exists(mediaPath)) if (Utils::FileSystem::exists(mediaPath))
return mediaPath; return mediaPath;
@ -319,7 +319,7 @@ const std::string FileData::getVideoPath() const
getMediaDirectory() + mSystemName + "/videos" + subFolders + "/" + getDisplayName(); getMediaDirectory() + mSystemName + "/videos" + subFolders + "/" + getDisplayName();
// Look for media in the media directory. // Look for media in the media directory.
for (size_t i = 0; i < extList.size(); i++) { for (size_t i = 0; i < extList.size(); ++i) {
std::string mediaPath = tempPath + extList[i]; std::string mediaPath = tempPath + extList[i];
if (Utils::FileSystem::exists(mediaPath)) if (Utils::FileSystem::exists(mediaPath))
return mediaPath; return mediaPath;
@ -333,7 +333,7 @@ const std::vector<FileData*>& FileData::getChildrenListToDisplay()
FileFilterIndex* idx = mSystem->getIndex(); FileFilterIndex* idx = mSystem->getIndex();
if (idx->isFiltered() || UIModeController::getInstance()->isUIModeKid()) { if (idx->isFiltered() || UIModeController::getInstance()->isUIModeKid()) {
mFilteredChildren.clear(); mFilteredChildren.clear();
for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) { for (auto it = mChildren.cbegin(); it != mChildren.cend(); ++it) {
if (idx->showFile((*it))) { if (idx->showFile((*it))) {
mFilteredChildren.emplace_back(*it); mFilteredChildren.emplace_back(*it);
} }
@ -352,7 +352,7 @@ std::vector<FileData*> FileData::getFilesRecursive(unsigned int typeMask,
std::vector<FileData*> out; std::vector<FileData*> out;
FileFilterIndex* idx = mSystem->getIndex(); FileFilterIndex* idx = mSystem->getIndex();
for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) { for (auto it = mChildren.cbegin(); it != mChildren.cend(); ++it) {
if ((*it)->getType() & typeMask) { if ((*it)->getType() & typeMask) {
if (!displayedOnly || !idx->isFiltered() || idx->showFile(*it)) { if (!displayedOnly || !idx->isFiltered() || idx->showFile(*it)) {
if (countAllGames) if (countAllGames)
@ -367,7 +367,7 @@ std::vector<FileData*> FileData::getFilesRecursive(unsigned int typeMask,
out.insert(out.cend(), subChildren.cbegin(), subChildren.cend()); out.insert(out.cend(), subChildren.cbegin(), subChildren.cend());
} }
else { else {
for (auto it2 = subChildren.cbegin(); it2 != subChildren.cend(); it2++) { for (auto it2 = subChildren.cbegin(); it2 != subChildren.cend(); ++it2) {
if ((*it2)->getCountAsGame()) if ((*it2)->getCountAsGame())
out.emplace_back(*it2); out.emplace_back(*it2);
} }
@ -384,7 +384,7 @@ std::vector<FileData*> FileData::getScrapeFilesRecursive(bool includeFolders,
{ {
std::vector<FileData*> out; std::vector<FileData*> out;
for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) { for (auto it = mChildren.cbegin(); it != mChildren.cend(); ++it) {
if (includeFolders && (*it)->getType() == FOLDER) { if (includeFolders && (*it)->getType() == FOLDER) {
if (!(respectExclusions && (*it)->getExcludeFromScraper())) if (!(respectExclusions && (*it)->getExcludeFromScraper()))
out.emplace_back(*it); out.emplace_back(*it);
@ -443,7 +443,7 @@ void FileData::removeChild(FileData* file)
assert(mType == FOLDER); assert(mType == FOLDER);
assert(file->getParent() == this); assert(file->getParent() == this);
mChildrenByFilename.erase(file->getKey()); mChildrenByFilename.erase(file->getKey());
for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) { for (auto it = mChildren.cbegin(); it != mChildren.cend(); ++it) {
if (*it == file) { if (*it == file) {
file->mParent = nullptr; file->mParent = nullptr;
mChildren.erase(it); mChildren.erase(it);
@ -484,7 +484,7 @@ void FileData::sort(ComparisonFunction& comparator,
!(*it)->getSystem()->isGroupedCustomCollection()) !(*it)->getSystem()->isGroupedCustomCollection())
it = mChildren.erase(it); it = mChildren.erase(it);
else else
it++; ++it;
} }
} }
@ -492,7 +492,7 @@ void FileData::sort(ComparisonFunction& comparator,
// The individual collections are however sorted as any normal systems/folders. // The individual collections are however sorted as any normal systems/folders.
if (mSystem->isCollection() && mSystem->getFullName() == "collections") { if (mSystem->isCollection() && mSystem->getFullName() == "collections") {
std::pair<unsigned int, unsigned int> tempGameCount = {}; std::pair<unsigned int, unsigned int> tempGameCount = {};
for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) { for (auto it = mChildren.cbegin(); it != mChildren.cend(); ++it) {
if ((*it)->getChildren().size() > 0) if ((*it)->getChildren().size() > 0)
(*it)->sort(comparator, gameCount); (*it)->sort(comparator, gameCount);
tempGameCount.first += gameCount.first; tempGameCount.first += gameCount.first;
@ -504,7 +504,7 @@ void FileData::sort(ComparisonFunction& comparator,
} }
if (foldersOnTop) { if (foldersOnTop) {
for (unsigned int i = 0; i < mChildren.size(); i++) { for (unsigned int i = 0; i < mChildren.size(); ++i) {
if (mChildren[i]->getType() == FOLDER) { if (mChildren[i]->getType() == FOLDER) {
mChildrenFolders.emplace_back(mChildren[i]); mChildrenFolders.emplace_back(mChildren[i]);
} }
@ -545,13 +545,13 @@ void FileData::sort(ComparisonFunction& comparator,
std::stable_sort(mChildren.begin(), mChildren.end(), comparator); std::stable_sort(mChildren.begin(), mChildren.end(), comparator);
} }
for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) { for (auto it = mChildren.cbegin(); it != mChildren.cend(); ++it) {
// Game count, which will be displayed in the system view. // Game count, which will be displayed in the system view.
if ((*it)->getType() == GAME && (*it)->getCountAsGame()) { if ((*it)->getType() == GAME && (*it)->getCountAsGame()) {
if (!isKidMode || (isKidMode && (*it)->getKidgame())) { if (!isKidMode || (isKidMode && (*it)->getKidgame())) {
gameCount.first++; ++gameCount.first;
if ((*it)->getFavorite()) if ((*it)->getFavorite())
gameCount.second++; ++gameCount.second;
} }
} }
@ -589,7 +589,7 @@ void FileData::sortFavoritesOnTop(ComparisonFunction& comparator,
// The individual collections are however sorted as any normal systems/folders. // The individual collections are however sorted as any normal systems/folders.
if (mSystem->isCollection() && mSystem->getFullName() == "collections") { if (mSystem->isCollection() && mSystem->getFullName() == "collections") {
std::pair<unsigned int, unsigned int> tempGameCount = {}; std::pair<unsigned int, unsigned int> tempGameCount = {};
for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) { for (auto it = mChildren.cbegin(); it != mChildren.cend(); ++it) {
if ((*it)->getChildren().size() > 0) if ((*it)->getChildren().size() > 0)
(*it)->sortFavoritesOnTop(comparator, gameCount); (*it)->sortFavoritesOnTop(comparator, gameCount);
tempGameCount.first += gameCount.first; tempGameCount.first += gameCount.first;
@ -600,7 +600,7 @@ void FileData::sortFavoritesOnTop(ComparisonFunction& comparator,
return; return;
} }
for (unsigned int i = 0; i < mChildren.size(); i++) { for (unsigned int i = 0; i < mChildren.size(); ++i) {
// If the option to hide hidden games has been set and the game is hidden, // If the option to hide hidden games has been set and the game is hidden,
// then skip it. Normally games are hidden during loading of the gamelists in // then skip it. Normally games are hidden during loading of the gamelists in
// Gamelist::parseGamelist() and this code should only run when a user has marked // Gamelist::parseGamelist() and this code should only run when a user has marked
@ -615,9 +615,9 @@ void FileData::sortFavoritesOnTop(ComparisonFunction& comparator,
// Game count, which will be displayed in the system view. // Game count, which will be displayed in the system view.
if (mChildren[i]->getType() == GAME && mChildren[i]->getCountAsGame()) { if (mChildren[i]->getType() == GAME && mChildren[i]->getCountAsGame()) {
if (!isKidMode || (isKidMode && mChildren[i]->getKidgame())) { if (!isKidMode || (isKidMode && mChildren[i]->getKidgame())) {
gameCount.first++; ++gameCount.first;
if (mChildren[i]->getFavorite()) if (mChildren[i]->getFavorite())
gameCount.second++; ++gameCount.second;
} }
} }
@ -681,13 +681,13 @@ void FileData::sortFavoritesOnTop(ComparisonFunction& comparator,
// Iterate through any child favorite folders. // Iterate through any child favorite folders.
for (auto it = mChildrenFavoritesFolders.cbegin(); // Line break. for (auto it = mChildrenFavoritesFolders.cbegin(); // Line break.
it != mChildrenFavoritesFolders.cend(); it++) { it != mChildrenFavoritesFolders.cend(); ++it) {
if ((*it)->getChildren().size() > 0) if ((*it)->getChildren().size() > 0)
(*it)->sortFavoritesOnTop(comparator, gameCount); (*it)->sortFavoritesOnTop(comparator, gameCount);
} }
// Iterate through any child folders. // Iterate through any child folders.
for (auto it = mChildrenFolders.cbegin(); it != mChildrenFolders.cend(); it++) { for (auto it = mChildrenFolders.cbegin(); it != mChildrenFolders.cend(); ++it) {
if ((*it)->getChildren().size() > 0) if ((*it)->getChildren().size() > 0)
(*it)->sortFavoritesOnTop(comparator, gameCount); (*it)->sortFavoritesOnTop(comparator, gameCount);
} }
@ -696,7 +696,7 @@ void FileData::sortFavoritesOnTop(ComparisonFunction& comparator,
// could be empty. So due to this, step through all mChildren and see if there are // could be empty. So due to this, step through all mChildren and see if there are
// any folders that we need to iterate. // any folders that we need to iterate.
if (mChildrenFavoritesFolders.size() == 0 && mChildrenFolders.size() == 0) { if (mChildrenFavoritesFolders.size() == 0 && mChildrenFolders.size() == 0) {
for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) { for (auto it = mChildren.cbegin(); it != mChildren.cend(); ++it) {
if ((*it)->getChildren().size() > 0) if ((*it)->getChildren().size() > 0)
(*it)->sortFavoritesOnTop(comparator, gameCount); (*it)->sortFavoritesOnTop(comparator, gameCount);
} }
@ -731,12 +731,12 @@ void FileData::countGames(std::pair<unsigned int, unsigned int>& gameCount)
(Settings::getInstance()->getString("UIMode") == "kid" || (Settings::getInstance()->getString("UIMode") == "kid" ||
Settings::getInstance()->getBool("ForceKid")); Settings::getInstance()->getBool("ForceKid"));
for (unsigned int i = 0; i < mChildren.size(); i++) { for (unsigned int i = 0; i < mChildren.size(); ++i) {
if (mChildren[i]->getType() == GAME && mChildren[i]->getCountAsGame()) { if (mChildren[i]->getType() == GAME && mChildren[i]->getCountAsGame()) {
if (!isKidMode || (isKidMode && mChildren[i]->getKidgame())) { if (!isKidMode || (isKidMode && mChildren[i]->getKidgame())) {
gameCount.first++; ++gameCount.first;
if (mChildren[i]->getFavorite()) if (mChildren[i]->getFavorite())
gameCount.second++; ++gameCount.second;
} }
} }
// Iterate through any folders. // Iterate through any folders.
@ -750,7 +750,7 @@ const FileData::SortType& FileData::getSortTypeFromString(const std::string& des
{ {
std::vector<FileData::SortType> SortTypes = FileSorts::SortTypes; std::vector<FileData::SortType> SortTypes = FileSorts::SortTypes;
for (unsigned int i = 0; i < FileSorts::SortTypes.size(); i++) { for (unsigned int i = 0; i < FileSorts::SortTypes.size(); ++i) {
const FileData::SortType& sort = FileSorts::SortTypes.at(i); const FileData::SortType& sort = FileSorts::SortTypes.at(i);
if (sort.description == desc) if (sort.description == desc)
return sort; return sort;
@ -936,7 +936,7 @@ void FileData::launchGame(Window* window)
else { else {
if (hasQuotationMark) { if (hasQuotationMark) {
command = command.replace(emuPathPos + quotationMarkPos, 1, ""); command = command.replace(emuPathPos + quotationMarkPos, 1, "");
emuPathPos--; --emuPathPos;
command = command.replace(emuPathPos, 1, ""); command = command.replace(emuPathPos, 1, "");
} }
coreFile = Utils::FileSystem::getEscapedPath(coreFile); coreFile = Utils::FileSystem::getEscapedPath(coreFile);

View file

@ -93,10 +93,10 @@ void FileFilterIndex::importIndex(FileFilterIndex* indexToImport)
indexStructDecls + sizeof(indexStructDecls) / sizeof(indexStructDecls[0])); indexStructDecls + sizeof(indexStructDecls) / sizeof(indexStructDecls[0]));
for (std::vector<IndexImportStructure>::const_iterator indexesIt = indexImportDecl.cbegin(); for (std::vector<IndexImportStructure>::const_iterator indexesIt = indexImportDecl.cbegin();
indexesIt != indexImportDecl.cend(); indexesIt++) { indexesIt != indexImportDecl.cend(); ++indexesIt) {
for (std::map<std::string, int>::const_iterator sourceIt = for (std::map<std::string, int>::const_iterator sourceIt =
(*indexesIt).sourceIndex->cbegin(); (*indexesIt).sourceIndex->cbegin();
sourceIt != (*indexesIt).sourceIndex->cend(); sourceIt++) { sourceIt != (*indexesIt).sourceIndex->cend(); ++sourceIt) {
if ((*indexesIt).destinationIndex->find((*sourceIt).first) == if ((*indexesIt).destinationIndex->find((*sourceIt).first) ==
(*indexesIt).destinationIndex->cend()) { (*indexesIt).destinationIndex->cend()) {
// Entry doesn't exist. // Entry doesn't exist.
@ -289,13 +289,13 @@ void FileFilterIndex::setFilter(FilterIndexType type, std::vector<std::string>*
} }
else { else {
for (std::vector<FilterDataDecl>::const_iterator it = filterDataDecl.cbegin(); for (std::vector<FilterDataDecl>::const_iterator it = filterDataDecl.cbegin();
it != filterDataDecl.cend(); it++) { it != filterDataDecl.cend(); ++it) {
if ((*it).type == type) { if ((*it).type == type) {
FilterDataDecl filterData = (*it); FilterDataDecl filterData = (*it);
*(filterData.filteredByRef) = values->size() > 0; *(filterData.filteredByRef) = values->size() > 0;
filterData.currentFilteredKeys->clear(); filterData.currentFilteredKeys->clear();
for (std::vector<std::string>::const_iterator vit = values->cbegin(); for (std::vector<std::string>::const_iterator vit = values->cbegin();
vit != values->cend(); vit++) { vit != values->cend(); ++vit) {
// Check if it exists. // Check if it exists.
if (filterData.allIndexKeys->find(*vit) != filterData.allIndexKeys->cend()) { if (filterData.allIndexKeys->find(*vit) != filterData.allIndexKeys->cend()) {
filterData.currentFilteredKeys->push_back(std::string(*vit)); filterData.currentFilteredKeys->push_back(std::string(*vit));
@ -320,7 +320,7 @@ void FileFilterIndex::setTextFilter(std::string textFilter)
void FileFilterIndex::clearAllFilters() void FileFilterIndex::clearAllFilters()
{ {
for (std::vector<FilterDataDecl>::const_iterator it = filterDataDecl.cbegin(); for (std::vector<FilterDataDecl>::const_iterator it = filterDataDecl.cbegin();
it != filterDataDecl.cend(); it++) { it != filterDataDecl.cend(); ++it) {
FilterDataDecl filterData = (*it); FilterDataDecl filterData = (*it);
*(filterData.filteredByRef) = false; *(filterData.filteredByRef) = false;
filterData.currentFilteredKeys->clear(); filterData.currentFilteredKeys->clear();
@ -393,7 +393,7 @@ bool FileFilterIndex::showFile(FileData* game)
std::vector<FileData*> children = game->getChildren(); std::vector<FileData*> children = game->getChildren();
// Iterate through all of the children, until there's a match. // Iterate through all of the children, until there's a match.
for (std::vector<FileData*>::const_iterator it = children.cbegin(); it != children.cend(); for (std::vector<FileData*>::const_iterator it = children.cbegin(); it != children.cend();
it++) { ++it) {
if (showFile(*it)) if (showFile(*it))
return true; return true;
} }
@ -422,7 +422,7 @@ bool FileFilterIndex::showFile(FileData* game)
nameMatch = true; nameMatch = true;
for (std::vector<FilterDataDecl>::const_iterator it = filterDataDecl.cbegin(); for (std::vector<FilterDataDecl>::const_iterator it = filterDataDecl.cbegin();
it != filterDataDecl.cend(); it++) { it != filterDataDecl.cend(); ++it) {
FilterDataDecl filterData = (*it); FilterDataDecl filterData = (*it);
if (filterData.primaryKey == "kidgame" && UIModeController::getInstance()->isUIModeKid()) { if (filterData.primaryKey == "kidgame" && UIModeController::getInstance()->isUIModeKid()) {
return (getIndexableKey(game, filterData.type, false) != "FALSE"); return (getIndexableKey(game, filterData.type, false) != "FALSE");
@ -482,10 +482,10 @@ bool FileFilterIndex::isKeyBeingFilteredBy(std::string key, FilterIndexType type
mCompletedIndexFilteredKeys, mKidGameIndexFilteredKeys, mHiddenIndexFilteredKeys, mCompletedIndexFilteredKeys, mKidGameIndexFilteredKeys, mHiddenIndexFilteredKeys,
mBrokenIndexFilteredKeys, mControllerIndexFilteredKeys, mAltemulatorIndexFilteredKeys}; mBrokenIndexFilteredKeys, mControllerIndexFilteredKeys, mAltemulatorIndexFilteredKeys};
for (int i = 0; i < 12; i++) { for (int i = 0; i < 12; ++i) {
if (filterTypes[i] == type) { if (filterTypes[i] == type) {
for (std::vector<std::string>::const_iterator it = filterKeysList[i].cbegin(); for (std::vector<std::string>::const_iterator it = filterKeysList[i].cbegin();
it != filterKeysList[i].cend(); it++) { it != filterKeysList[i].cend(); ++it) {
if (key == (*it)) if (key == (*it))
return true; return true;
} }

View file

@ -78,7 +78,7 @@ FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType
treeNode = folder; treeNode = folder;
} }
path_it++; ++path_it;
} }
return nullptr; return nullptr;
@ -146,7 +146,7 @@ void parseGamelist(SystemData* system)
std::vector<std::string> tagList = {"game", "folder"}; std::vector<std::string> tagList = {"game", "folder"};
FileType typeList[2] = {GAME, FOLDER}; FileType typeList[2] = {GAME, FOLDER};
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; ++i) {
std::string tag = tagList[i]; std::string tag = tagList[i];
FileType type = typeList[i]; FileType type = typeList[i];
for (pugi::xml_node fileNode = root.child(tag.c_str()); fileNode; for (pugi::xml_node fileNode = root.child(tag.c_str()); fileNode;
@ -331,7 +331,7 @@ void updateGamelist(SystemData* system, bool updateAlternativeEmulator)
std::vector<FileData*> files = rootFolder->getFilesRecursive(GAME | FOLDER); std::vector<FileData*> files = rootFolder->getFilesRecursive(GAME | FOLDER);
// Iterate through all files, checking if they're already in the XML file. // Iterate through all files, checking if they're already in the XML file.
for (std::vector<FileData*>::const_iterator fit = files.cbegin(); // Line break. for (std::vector<FileData*>::const_iterator fit = files.cbegin(); // Line break.
fit != files.cend(); fit++) { fit != files.cend(); ++fit) {
const std::string tag = ((*fit)->getType() == GAME) ? "game" : "folder"; const std::string tag = ((*fit)->getType() == GAME) ? "game" : "folder";
// Do not touch if it wasn't changed and is not flagged for deletion. // Do not touch if it wasn't changed and is not flagged for deletion.
@ -357,7 +357,7 @@ void updateGamelist(SystemData* system, bool updateAlternativeEmulator)
// Found it // Found it
root.remove_child(fileNode); root.remove_child(fileNode);
if ((*fit)->getDeletionFlag()) if ((*fit)->getDeletionFlag())
numUpdated++; ++numUpdated;
break; break;
} }
} }
@ -366,7 +366,7 @@ void updateGamelist(SystemData* system, bool updateAlternativeEmulator)
if (!(*fit)->getDeletionFlag()) { if (!(*fit)->getDeletionFlag()) {
addFileDataNode(root, *fit, tag, system); addFileDataNode(root, *fit, tag, system);
(*fit)->metadata.resetChangedFlag(); (*fit)->metadata.resetChangedFlag();
numUpdated++; ++numUpdated;
} }
} }

View file

@ -217,7 +217,7 @@ void MediaViewer::showNext()
if ((mVideo || showedVideo) && !mDisplayingImage) if ((mVideo || showedVideo) && !mDisplayingImage)
mCurrentImageIndex = 0; mCurrentImageIndex = 0;
else if (static_cast<int>(mImageFiles.size()) > mCurrentImageIndex + 1) else if (static_cast<int>(mImageFiles.size()) > mCurrentImageIndex + 1)
mCurrentImageIndex++; ++mCurrentImageIndex;
if (mVideo) if (mVideo)
mDisplayingImage = true; mDisplayingImage = true;
@ -248,7 +248,7 @@ void MediaViewer::showPrevious()
mImage = nullptr; mImage = nullptr;
} }
mCurrentImageIndex--; --mCurrentImageIndex;
showImage(mCurrentImageIndex); showImage(mCurrentImageIndex);
} }

View file

@ -91,8 +91,8 @@ MetaDataList::MetaDataList(MetaDataListType type)
, mWasChanged(false) , mWasChanged(false)
{ {
const std::vector<MetaDataDecl>& mdd = getMDD(); const std::vector<MetaDataDecl>& mdd = getMDD();
for (auto iter = mdd.cbegin(); iter != mdd.cend(); iter++) for (auto it = mdd.cbegin(); it != mdd.cend(); ++it)
set(iter->key, iter->defaultValue); set(it->key, it->defaultValue);
} }
MetaDataList MetaDataList::createFromXML(MetaDataListType type, MetaDataList MetaDataList::createFromXML(MetaDataListType type,
@ -103,17 +103,17 @@ MetaDataList MetaDataList::createFromXML(MetaDataListType type,
const std::vector<MetaDataDecl>& mdd = mdl.getMDD(); const std::vector<MetaDataDecl>& mdd = mdl.getMDD();
for (auto iter = mdd.cbegin(); iter != mdd.cend(); iter++) { for (auto it = mdd.cbegin(); it != mdd.cend(); ++it) {
pugi::xml_node md = node.child(iter->key.c_str()); pugi::xml_node md = node.child(it->key.c_str());
if (md && !md.text().empty()) { if (md && !md.text().empty()) {
// If it's a path, resolve relative paths. // If it's a path, resolve relative paths.
std::string value = md.text().get(); std::string value = md.text().get();
if (iter->type == MD_PATH) if (it->type == MD_PATH)
value = Utils::FileSystem::resolveRelativePath(value, relativeTo, true); value = Utils::FileSystem::resolveRelativePath(value, relativeTo, true);
mdl.set(iter->key, value); mdl.set(it->key, value);
} }
else { else {
mdl.set(iter->key, iter->defaultValue); mdl.set(it->key, it->defaultValue);
} }
} }
return mdl; return mdl;
@ -125,17 +125,17 @@ void MetaDataList::appendToXML(pugi::xml_node& parent,
{ {
const std::vector<MetaDataDecl>& mdd = getMDD(); const std::vector<MetaDataDecl>& mdd = getMDD();
for (auto mddIter = mdd.cbegin(); mddIter != mdd.cend(); mddIter++) { for (auto it = mdd.cbegin(); it != mdd.cend(); ++it) {
auto mapIter = mMap.find(mddIter->key); auto mapIter = mMap.find(it->key);
if (mapIter != mMap.cend()) { if (mapIter != mMap.cend()) {
// We have this value! // We have this value!
// If it's just the default (and we ignore defaults), don't write it. // If it's just the default (and we ignore defaults), don't write it.
if (ignoreDefaults && mapIter->second == mddIter->defaultValue) if (ignoreDefaults && mapIter->second == it->defaultValue)
continue; continue;
// Try and make paths relative if we can. // Try and make paths relative if we can.
std::string value = mapIter->second; std::string value = mapIter->second;
if (mddIter->type == MD_PATH) if (it->type == MD_PATH)
value = Utils::FileSystem::createRelativePath(value, relativeTo, true); value = Utils::FileSystem::createRelativePath(value, relativeTo, true);
parent.append_child(mapIter->first.c_str()).text().set(value.c_str()); parent.append_child(mapIter->first.c_str()).text().set(value.c_str());

View file

@ -762,7 +762,7 @@ void MiximageGenerator::sampleFrameColor(CImg<unsigned char>& screenshotImage,
red += screenshotImage(c, r, 0, 0); red += screenshotImage(c, r, 0, 0);
green += screenshotImage(c, r, 0, 1); green += screenshotImage(c, r, 0, 1);
blue += screenshotImage(c, r, 0, 2); blue += screenshotImage(c, r, 0, 2);
counter++; ++counter;
} }
if (counter > 0) { if (counter > 0) {

View file

@ -143,7 +143,7 @@ namespace PlatformIds
if (str == "") if (str == "")
return PLATFORM_UNKNOWN; return PLATFORM_UNKNOWN;
for (unsigned int i = 1; i < PLATFORM_COUNT; i++) { for (unsigned int i = 1; i < PLATFORM_COUNT; ++i) {
if (platformNames[i] == str) if (platformNames[i] == str)
return (PlatformId)i; return (PlatformId)i;
} }

View file

@ -270,7 +270,7 @@ bool SystemData::populateFolder(FileData* folder)
return false; return false;
for (Utils::FileSystem::stringList::const_iterator it = dirContent.cbegin(); for (Utils::FileSystem::stringList::const_iterator it = dirContent.cbegin();
it != dirContent.cend(); it++) { it != dirContent.cend(); ++it) {
filePath = *it; filePath = *it;
// Skip any recursive symlinks as those would hang the application at various places. // Skip any recursive symlinks as those would hang the application at various places.
@ -350,7 +350,7 @@ void SystemData::indexAllGameFilters(const FileData* folder)
const std::vector<FileData*>& children = folder->getChildren(); const std::vector<FileData*>& children = folder->getChildren();
for (std::vector<FileData*>::const_iterator it = children.cbegin(); // Line break. for (std::vector<FileData*>::const_iterator it = children.cbegin(); // Line break.
it != children.cend(); it++) { it != children.cend(); ++it) {
switch ((*it)->getType()) { switch ((*it)->getType()) {
case GAME: case GAME:
mFilterIndex->addToIndex(*it); mFilterIndex->addToIndex(*it);
@ -550,7 +550,7 @@ bool SystemData::loadConfig()
std::vector<std::string> platformStrs = readList(platformList); std::vector<std::string> platformStrs = readList(platformList);
std::vector<PlatformIds::PlatformId> platformIds; std::vector<PlatformIds::PlatformId> platformIds;
for (auto it = platformStrs.cbegin(); it != platformStrs.cend(); it++) { for (auto it = platformStrs.cbegin(); it != platformStrs.cend(); ++it) {
std::string str = *it; std::string str = *it;
PlatformIds::PlatformId platformId = PlatformIds::getPlatformId(str); PlatformIds::PlatformId platformId = PlatformIds::getPlatformId(str);
@ -623,7 +623,7 @@ bool SystemData::loadConfig()
std::vector<FileData*> recursiveGames = std::vector<FileData*> recursiveGames =
newSys->getRootFolder()->getChildrenRecursive(); newSys->getRootFolder()->getChildrenRecursive();
onlyHidden = true; onlyHidden = true;
for (auto it = recursiveGames.cbegin(); it != recursiveGames.cend(); it++) { for (auto it = recursiveGames.cbegin(); it != recursiveGames.cend(); ++it) {
if ((*it)->getType() != FOLDER) { if ((*it)->getType() != FOLDER) {
onlyHidden = (*it)->getHidden(); onlyHidden = (*it)->getHidden();
if (!onlyHidden) if (!onlyHidden)
@ -668,7 +668,7 @@ std::string SystemData::getLaunchCommandFromLabel(const std::string& label)
void SystemData::deleteSystems() void SystemData::deleteSystems()
{ {
for (unsigned int i = 0; i < sSystemVector.size(); i++) for (unsigned int i = 0; i < sSystemVector.size(); ++i)
delete sSystemVector.at(i); delete sSystemVector.at(i);
sSystemVector.clear(); sSystemVector.clear();
@ -896,7 +896,7 @@ bool SystemData::createSystemDirectories()
systemInfoFile << (commands.size() == 2 ? "Alternative launch command:" : systemInfoFile << (commands.size() == 2 ? "Alternative launch command:" :
"Alternative launch commands:") "Alternative launch commands:")
<< std::endl; << std::endl;
for (auto it = commands.cbegin() + 1; it != commands.cend(); it++) for (auto it = commands.cbegin() + 1; it != commands.cend(); ++it)
systemInfoFile << (*it) << std::endl; systemInfoFile << (*it) << std::endl;
systemInfoFile << std::endl; systemInfoFile << std::endl;
} }
@ -999,7 +999,7 @@ SystemData* SystemData::getNext() const
// As we are starting in a valid gamelistview, this will // As we are starting in a valid gamelistview, this will
// always succeed, even if we have to come full circle. // always succeed, even if we have to come full circle.
do { do {
it++; ++it;
if (it == sSystemVector.cend()) if (it == sSystemVector.cend())
it = sSystemVector.cbegin(); it = sSystemVector.cbegin();
} while (!(*it)->isVisible()); } while (!(*it)->isVisible());
@ -1014,7 +1014,7 @@ SystemData* SystemData::getPrev() const
// As we are starting in a valid gamelistview, this will // As we are starting in a valid gamelistview, this will
// always succeed, even if we have to come full circle. // always succeed, even if we have to come full circle.
do { do {
it++; ++it;
if (it == sSystemVector.crend()) if (it == sSystemVector.crend())
it = sSystemVector.crbegin(); it = sSystemVector.crbegin();
} while (!(*it)->isVisible()); } while (!(*it)->isVisible());
@ -1071,9 +1071,9 @@ std::string SystemData::getThemePath() const
SystemData* SystemData::getRandomSystem(const SystemData* currentSystem) SystemData* SystemData::getRandomSystem(const SystemData* currentSystem)
{ {
unsigned int total = 0; unsigned int total = 0;
for (auto it = sSystemVector.cbegin(); it != sSystemVector.cend(); it++) { for (auto it = sSystemVector.cbegin(); it != sSystemVector.cend(); ++it) {
if ((*it)->isGameSystem()) if ((*it)->isGameSystem())
total++; ++total;
} }
if (total < 2) if (total < 2)
@ -1089,10 +1089,10 @@ SystemData* SystemData::getRandomSystem(const SystemData* currentSystem)
std::uniform_int_distribution<int> uniform_dist(0, total - 1); std::uniform_int_distribution<int> uniform_dist(0, total - 1);
int target = uniform_dist(engine); int target = uniform_dist(engine);
for (auto it = sSystemVector.cbegin(); it != sSystemVector.cend(); it++) { for (auto it = sSystemVector.cbegin(); it != sSystemVector.cend(); ++it) {
if ((*it)->isGameSystem()) { if ((*it)->isGameSystem()) {
if (target > 0) { if (target > 0) {
target--; --target;
} }
else { else {
randomSystem = (*it); randomSystem = (*it);
@ -1140,7 +1140,7 @@ FileData* SystemData::getRandomGame(const FileData* currentGame)
if (gameList[i]->getType() == FOLDER) if (gameList[i]->getType() == FOLDER)
gameList.erase(gameList.begin() + i); gameList.erase(gameList.begin() + i);
else else
i++; ++i;
} while (i < gameList.size()); } while (i < gameList.size());
} }
@ -1191,7 +1191,7 @@ void SystemData::sortSystem(bool reloadGamelist, bool jumpToFirstRow)
// Assign the sort type to all grouped custom collections. // Assign the sort type to all grouped custom collections.
if (mIsCollectionSystem && mFullName == "collections") { if (mIsCollectionSystem && mFullName == "collections") {
for (auto it = rootFolder->getChildren().begin(); // Line break. for (auto it = rootFolder->getChildren().begin(); // Line break.
it != rootFolder->getChildren().end(); it++) { it != rootFolder->getChildren().end(); ++it) {
setupSystemSortType((*it)->getSystem()->getRootFolder()); setupSystemSortType((*it)->getSystem()->getRootFolder());
} }
} }
@ -1262,7 +1262,7 @@ void SystemData::setupSystemSortType(FileData* rootFolder)
{ {
// If DefaultSortOrder is set to something, check that it is actually a valid value. // If DefaultSortOrder is set to something, check that it is actually a valid value.
if (Settings::getInstance()->getString("DefaultSortOrder") != "") { if (Settings::getInstance()->getString("DefaultSortOrder") != "") {
for (unsigned int i = 0; i < FileSorts::SortTypes.size(); i++) { for (unsigned int i = 0; i < FileSorts::SortTypes.size(); ++i) {
if (FileSorts::SortTypes.at(i).description == if (FileSorts::SortTypes.at(i).description ==
Settings::getInstance()->getString("DefaultSortOrder")) { Settings::getInstance()->getString("DefaultSortOrder")) {
rootFolder->setSortTypeString( rootFolder->setSortTypeString(

View file

@ -433,13 +433,13 @@ void SystemScreensaver::update(int deltaTime)
void SystemScreensaver::generateImageList() void SystemScreensaver::generateImageList()
{ {
for (auto it = SystemData::sSystemVector.cbegin(); // Line break. for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) { it != SystemData::sSystemVector.cend(); ++it) {
// We only want nodes from game systems that are not collections. // We only want nodes from game systems that are not collections.
if (!(*it)->isGameSystem() || (*it)->isCollection()) if (!(*it)->isGameSystem() || (*it)->isCollection())
continue; continue;
std::vector<FileData*> allFiles = (*it)->getRootFolder()->getFilesRecursive(GAME, true); std::vector<FileData*> allFiles = (*it)->getRootFolder()->getFilesRecursive(GAME, true);
for (auto it2 = allFiles.begin(); it2 != allFiles.end(); it2++) { for (auto it2 = allFiles.cbegin(); it2 != allFiles.cend(); ++it2) {
std::string imagePath = (*it2)->getImagePath(); std::string imagePath = (*it2)->getImagePath();
if (imagePath != "") if (imagePath != "")
mImageFiles.push_back((*it2)); mImageFiles.push_back((*it2));
@ -450,13 +450,13 @@ void SystemScreensaver::generateImageList()
void SystemScreensaver::generateVideoList() void SystemScreensaver::generateVideoList()
{ {
for (auto it = SystemData::sSystemVector.cbegin(); // Line break. for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) { it != SystemData::sSystemVector.cend(); ++it) {
// We only want nodes from game systems that are not collections. // We only want nodes from game systems that are not collections.
if (!(*it)->isGameSystem() || (*it)->isCollection()) if (!(*it)->isGameSystem() || (*it)->isCollection())
continue; continue;
std::vector<FileData*> allFiles = (*it)->getRootFolder()->getFilesRecursive(GAME, true); std::vector<FileData*> allFiles = (*it)->getRootFolder()->getFilesRecursive(GAME, true);
for (auto it2 = allFiles.begin(); it2 != allFiles.end(); it2++) { for (auto it2 = allFiles.cbegin(); it2 != allFiles.cend(); ++it2) {
std::string videoPath = (*it2)->getVideoPath(); std::string videoPath = (*it2)->getVideoPath();
if (videoPath != "") if (videoPath != "")
mVideoFiles.push_back((*it2)); mVideoFiles.push_back((*it2));
@ -479,7 +479,7 @@ void SystemScreensaver::generateCustomImageList()
Utils::FileSystem::stringList dirContent = Utils::FileSystem::getDirContent( Utils::FileSystem::stringList dirContent = Utils::FileSystem::getDirContent(
imageDir, Settings::getInstance()->getBool("ScreensaverSlideshowRecurse")); imageDir, Settings::getInstance()->getBool("ScreensaverSlideshowRecurse"));
for (auto it = dirContent.begin(); it != dirContent.end(); it++) { for (auto it = dirContent.begin(); it != dirContent.end(); ++it) {
if (Utils::FileSystem::isRegularFile(*it)) { if (Utils::FileSystem::isRegularFile(*it)) {
if (imageFilter.find(Utils::FileSystem::getExtension(*it)) != std::string::npos) if (imageFilter.find(Utils::FileSystem::getExtension(*it)) != std::string::npos)
mImageCustomFiles.push_back(*it); mImageCustomFiles.push_back(*it);

View file

@ -29,7 +29,7 @@ GuiAlternativeEmulators::GuiAlternativeEmulators(Window* window)
labelSizeX += 8.0f * Renderer::getScreenHeightModifier(); labelSizeX += 8.0f * Renderer::getScreenHeightModifier();
for (auto it = SystemData::sSystemVector.cbegin(); // Line break. for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) { it != SystemData::sSystemVector.cend(); ++it) {
// Only include systems that have at least two command entries, unless the system // Only include systems that have at least two command entries, unless the system
// has an invalid entry. // has an invalid entry.

View file

@ -51,7 +51,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st
// Add automatic systems. // Add automatic systems.
for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it = for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it =
autoSystems.cbegin(); autoSystems.cbegin();
it != autoSystems.cend(); it++) it != autoSystems.cend(); ++it)
collection_systems_auto->add(it->second.decl.fullName, it->second.decl.name, collection_systems_auto->add(it->second.decl.fullName, it->second.decl.name,
it->second.isEnabled); it->second.isEnabled);
addWithLabel("AUTOMATIC GAME COLLECTIONS", collection_systems_auto); addWithLabel("AUTOMATIC GAME COLLECTIONS", collection_systems_auto);
@ -100,7 +100,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st
// Add custom systems. // Add custom systems.
for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it = for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it =
customSystems.cbegin(); customSystems.cbegin();
it != customSystems.cend(); it++) it != customSystems.cend(); ++it)
collection_systems_custom->add(it->second.decl.fullName, it->second.decl.name, collection_systems_custom->add(it->second.decl.fullName, it->second.decl.name,
it->second.isEnabled); it->second.isEnabled);
@ -168,7 +168,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st
std::make_shared<OptionListComponent<std::string>>(mWindow, getHelpStyle(), std::make_shared<OptionListComponent<std::string>>(mWindow, getHelpStyle(),
"SELECT THEME FOLDER", true); "SELECT THEME FOLDER", true);
// Add custom systems. // Add custom systems.
for (auto it = unusedFolders.cbegin(); it != unusedFolders.cend(); it++) { for (auto it = unusedFolders.cbegin(); it != unusedFolders.cend(); ++it) {
ComponentListRow row; ComponentListRow row;
std::string name = *it; std::string name = *it;
std::function<void()> createCollectionCall = [this, name] { std::function<void()> createCollectionCall = [this, name] {
@ -238,7 +238,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st
std::make_shared<OptionListComponent<std::string>>(mWindow, getHelpStyle(), "", true); std::make_shared<OptionListComponent<std::string>>(mWindow, getHelpStyle(), "", true);
for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it = for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it =
customSystems.cbegin(); customSystems.cbegin();
it != customSystems.cend(); it++) { it != customSystems.cend(); ++it) {
ComponentListRow row; ComponentListRow row;
std::string name = (*it).first; std::string name = (*it).first;
std::function<void()> deleteCollectionCall = [this, name] { std::function<void()> deleteCollectionCall = [this, name] {
@ -259,7 +259,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st
// Create the configuration file entry. If the collection to be // Create the configuration file entry. If the collection to be
// deleted was activated, then exclude it. // deleted was activated, then exclude it.
for (auto it = selectedCustomCollections.begin(); for (auto it = selectedCustomCollections.begin();
it != selectedCustomCollections.end(); it++) { it != selectedCustomCollections.end(); ++it) {
if ((*it) != name) { if ((*it) != name) {
if ((*it) != selectedCustomCollections.front() && if ((*it) != selectedCustomCollections.front() &&
collectionsConfigEntry != "") collectionsConfigEntry != "")

View file

@ -71,7 +71,7 @@ void GuiGamelistFilter::initializeMenu()
for (std::map<FilterIndexType, for (std::map<FilterIndexType,
std::shared_ptr<OptionListComponent<std::string>>>::const_iterator it = std::shared_ptr<OptionListComponent<std::string>>>::const_iterator it =
mFilterOptions.cbegin(); mFilterOptions.cbegin();
it != mFilterOptions.cend(); it++) { it != mFilterOptions.cend(); ++it) {
std::shared_ptr<OptionListComponent<std::string>> optionList = it->second; std::shared_ptr<OptionListComponent<std::string>> optionList = it->second;
std::vector<std::string> filters = optionList->getSelectedObjects(); std::vector<std::string> filters = optionList->getSelectedObjects();
mInitialFilters.push_back(filters); mInitialFilters.push_back(filters);
@ -84,7 +84,7 @@ void GuiGamelistFilter::resetAllFilters()
for (std::map<FilterIndexType, for (std::map<FilterIndexType,
std::shared_ptr<OptionListComponent<std::string>>>::const_iterator it = std::shared_ptr<OptionListComponent<std::string>>>::const_iterator it =
mFilterOptions.cbegin(); mFilterOptions.cbegin();
it != mFilterOptions.cend(); it++) { it != mFilterOptions.cend(); ++it) {
std::shared_ptr<OptionListComponent<std::string>> optionList = it->second; std::shared_ptr<OptionListComponent<std::string>> optionList = it->second;
optionList->selectNone(); optionList->selectNone();
} }
@ -148,7 +148,7 @@ void GuiGamelistFilter::addFiltersToMenu()
std::vector<FilterDataDecl> decls = mFilterIndex->getFilterDataDecls(); std::vector<FilterDataDecl> decls = mFilterIndex->getFilterDataDecls();
for (std::vector<FilterDataDecl>::const_iterator it = decls.cbegin(); // Line break. for (std::vector<FilterDataDecl>::const_iterator it = decls.cbegin(); // Line break.
it != decls.cend(); it++) { it != decls.cend(); ++it) {
FilterIndexType type = (*it).type; // Type of filter. FilterIndexType type = (*it).type; // Type of filter.
// Don't include the alternative emulators if the corresponding setting has been disabled. // Don't include the alternative emulators if the corresponding setting has been disabled.
@ -226,7 +226,7 @@ void GuiGamelistFilter::applyFilters()
for (std::map<FilterIndexType, for (std::map<FilterIndexType,
std::shared_ptr<OptionListComponent<std::string>>>::const_iterator it = std::shared_ptr<OptionListComponent<std::string>>>::const_iterator it =
mFilterOptions.cbegin(); mFilterOptions.cbegin();
it != mFilterOptions.cend(); it++) { it != mFilterOptions.cend(); ++it) {
std::shared_ptr<OptionListComponent<std::string>> optionList = it->second; std::shared_ptr<OptionListComponent<std::string>> optionList = it->second;
std::vector<std::string> filters = optionList->getSelectedObjects(); std::vector<std::string> filters = optionList->getSelectedObjects();
auto iteratorDistance = std::distance(mFilterOptions.cbegin(), it); auto iteratorDistance = std::distance(mFilterOptions.cbegin(), it);

View file

@ -104,7 +104,7 @@ GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system)
mJumpToLetterList->setKeyRepeat(true, 650, 200); mJumpToLetterList->setKeyRepeat(true, 650, 200);
// Populate the quick selector. // Populate the quick selector.
for (unsigned int i = 0; i < mFirstLetterIndex.size(); i++) { for (unsigned int i = 0; i < mFirstLetterIndex.size(); ++i) {
mJumpToLetterList->add(mFirstLetterIndex[i], mFirstLetterIndex[i], 0); mJumpToLetterList->add(mFirstLetterIndex[i], mFirstLetterIndex[i], 0);
if (mFirstLetterIndex[i] == mCurrentFirstCharacter) if (mFirstLetterIndex[i] == mCurrentFirstCharacter)
mJumpToLetterList->selectEntry(i); mJumpToLetterList->selectEntry(i);
@ -129,7 +129,7 @@ GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system)
if (!root->getSystem()->isCollection()) if (!root->getSystem()->isCollection())
numSortTypes -= 2; numSortTypes -= 2;
for (unsigned int i = 0; i < numSortTypes; i++) { for (unsigned int i = 0; i < numSortTypes; ++i) {
const FileData::SortType& sort = FileSorts::SortTypes.at(i); const FileData::SortType& sort = FileSorts::SortTypes.at(i);
if (sort.description == sortType) if (sort.description == sortType)
mListSort->add(sort.description, &sort, true); mListSort->add(sort.description, &sort, true);
@ -350,7 +350,7 @@ void GuiGamelistOptions::startEditMode()
// Display the indication icons which show what games are part of the custom collection // Display the indication icons which show what games are part of the custom collection
// currently being edited. This is done cheaply using onFileChanged() which will trigger // currently being edited. This is done cheaply using onFileChanged() which will trigger
// populateList(). // populateList().
for (auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); it++) { for (auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); ++it) {
ViewController::get()->getGameListView((*it))->onFileChanged( ViewController::get()->getGameListView((*it))->onFileChanged(
ViewController::get()->getGameListView((*it))->getCursor(), false); ViewController::get()->getGameListView((*it))->getCursor(), false);
} }
@ -393,7 +393,7 @@ void GuiGamelistOptions::openMetaDataEd()
// Manually reset all the metadata values, set the name to the actual file/folder name. // Manually reset all the metadata values, set the name to the actual file/folder name.
const std::vector<MetaDataDecl>& mdd = file->metadata.getMDD(); const std::vector<MetaDataDecl>& mdd = file->metadata.getMDD();
for (auto it = mdd.cbegin(); it != mdd.cend(); it++) { for (auto it = mdd.cbegin(); it != mdd.cend(); ++it) {
if (it->key == "name") { if (it->key == "name") {
if (file->isArcadeGame()) { if (file->isArcadeGame()) {
// If it's a MAME or Neo Geo game, expand the game name accordingly. // If it's a MAME or Neo Geo game, expand the game name accordingly.
@ -465,7 +465,7 @@ void GuiGamelistOptions::jumpToLetter()
const std::vector<FileData*>& files = const std::vector<FileData*>& files =
getGamelist()->getCursor()->getParent()->getChildrenListToDisplay(); getGamelist()->getCursor()->getParent()->getChildrenListToDisplay();
for (unsigned int i = 0; i < files.size(); i++) { for (unsigned int i = 0; i < files.size(); ++i) {
if (mFavoritesSorting && (mFirstLetterIndex.front() == ViewController::FAVORITE_CHAR || if (mFavoritesSorting && (mFirstLetterIndex.front() == ViewController::FAVORITE_CHAR ||
mFirstLetterIndex.front() == ViewController::FOLDER_CHAR)) { mFirstLetterIndex.front() == ViewController::FOLDER_CHAR)) {
if (static_cast<char>(toupper(files.at(i)->getSortName().front())) == letter && if (static_cast<char>(toupper(files.at(i)->getSortName().front())) == letter &&
@ -501,7 +501,7 @@ void GuiGamelistOptions::jumpToFirstRow()
getGamelist()->getCursor()->getParent()->getChildrenListToDisplay(); getGamelist()->getCursor()->getParent()->getChildrenListToDisplay();
// Select the first game that is not a folder, unless it's a folder-only list in // Select the first game that is not a folder, unless it's a folder-only list in
// which case the first line overall is selected. // which case the first line overall is selected.
for (auto it = files.cbegin(); it != files.cend(); it++) { for (auto it = files.cbegin(); it != files.cend(); ++it) {
if (!mOnlyHasFolders && mFoldersOnTop && (*it)->getType() == FOLDER) { if (!mOnlyHasFolders && mFoldersOnTop && (*it)->getType() == FOLDER) {
continue; continue;
} }

View file

@ -149,7 +149,7 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game)
float totalRowHeight = 0.0f; float totalRowHeight = 0.0f;
// Hack to adjust the window height to the row boundary. // Hack to adjust the window height to the row boundary.
for (int i = 0; i < 7; i++) for (int i = 0; i < 7; ++i)
totalRowHeight += mGrid->getRowHeight(i); totalRowHeight += mGrid->getRowHeight(i);
setSize(mSize.x, totalRowHeight); setSize(mSize.x, totalRowHeight);

View file

@ -103,7 +103,7 @@ void GuiMenu::openUIOptions()
mWindow, getHelpStyle(), "GAMELIST ON STARTUP", false); mWindow, getHelpStyle(), "GAMELIST ON STARTUP", false);
startup_system->add("NONE", "", Settings::getInstance()->getString("StartupSystem") == ""); startup_system->add("NONE", "", Settings::getInstance()->getString("StartupSystem") == "");
for (auto it = SystemData::sSystemVector.cbegin(); // Line break. for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) { it != SystemData::sSystemVector.cend(); ++it) {
if ((*it)->getName() != "retropie") { if ((*it)->getName() != "retropie") {
// If required, abbreviate the system name so it doesn't overlap the setting name. // If required, abbreviate the system name so it doesn't overlap the setting name.
float maxNameLength = mSize.x * 0.48f; float maxNameLength = mSize.x * 0.48f;
@ -153,7 +153,7 @@ void GuiMenu::openUIOptions()
transitions.push_back("slide"); transitions.push_back("slide");
transitions.push_back("fade"); transitions.push_back("fade");
transitions.push_back("instant"); transitions.push_back("instant");
for (auto it = transitions.cbegin(); it != transitions.cend(); it++) for (auto it = transitions.cbegin(); it != transitions.cend(); ++it)
transition_style->add(*it, *it, transition_style->add(*it, *it,
Settings::getInstance()->getString("TransitionStyle") == *it); Settings::getInstance()->getString("TransitionStyle") == *it);
s->addWithLabel("TRANSITION STYLE", transition_style); s->addWithLabel("TRANSITION STYLE", transition_style);
@ -174,7 +174,7 @@ void GuiMenu::openUIOptions()
selectedSet = themeSets.cbegin(); selectedSet = themeSets.cbegin();
auto theme_set = std::make_shared<OptionListComponent<std::string>>(mWindow, getHelpStyle(), auto theme_set = std::make_shared<OptionListComponent<std::string>>(mWindow, getHelpStyle(),
"THEME SET", false); "THEME SET", false);
for (auto it = themeSets.cbegin(); it != themeSets.cend(); it++) { for (auto it = themeSets.cbegin(); it != themeSets.cend(); ++it) {
// If required, abbreviate the theme set name so it doesn't overlap the setting name. // If required, abbreviate the theme set name so it doesn't overlap the setting name.
float maxNameLength = mSize.x * 0.62f; float maxNameLength = mSize.x * 0.62f;
theme_set->add(it->first, it->first, it == selectedSet, maxNameLength); theme_set->add(it->first, it->first, it == selectedSet, maxNameLength);
@ -215,7 +215,7 @@ void GuiMenu::openUIOptions()
setMode = "kid"; setMode = "kid";
else else
setMode = Settings::getInstance()->getString("UIMode"); setMode = Settings::getInstance()->getString("UIMode");
for (auto it = uiModes.cbegin(); it != uiModes.cend(); it++) for (auto it = uiModes.cbegin(); it != uiModes.cend(); ++it)
ui_mode->add(*it, *it, setMode == *it); ui_mode->add(*it, *it, setMode == *it);
s->addWithLabel("UI MODE", ui_mode); s->addWithLabel("UI MODE", ui_mode);
s->addSaveFunc([ui_mode, this, s] { s->addSaveFunc([ui_mode, this, s] {
@ -253,7 +253,7 @@ void GuiMenu::openUIOptions()
Settings::getInstance()->saveFile(); Settings::getInstance()->saveFile();
UIModeController::getInstance()->setCurrentUIMode(selectedMode); UIModeController::getInstance()->setCurrentUIMode(selectedMode);
for (auto it = SystemData::sSystemVector.cbegin(); for (auto it = SystemData::sSystemVector.cbegin();
it != SystemData::sSystemVector.cend(); it++) { it != SystemData::sSystemVector.cend(); ++it) {
if ((*it)->getThemeFolder() == "custom-collections") { if ((*it)->getThemeFolder() == "custom-collections") {
for (FileData* customSystem : for (FileData* customSystem :
(*it)->getRootFolder()->getChildrenListToDisplay()) (*it)->getRootFolder()->getChildrenListToDisplay())
@ -293,7 +293,7 @@ void GuiMenu::openUIOptions()
std::make_shared<SortList>(mWindow, getHelpStyle(), "DEFAULT SORT ORDER", false); std::make_shared<SortList>(mWindow, getHelpStyle(), "DEFAULT SORT ORDER", false);
// Exclude the System sort options. // Exclude the System sort options.
unsigned int numSortTypes = static_cast<unsigned int>(FileSorts::SortTypes.size() - 2); unsigned int numSortTypes = static_cast<unsigned int>(FileSorts::SortTypes.size() - 2);
for (unsigned int i = 0; i < numSortTypes; i++) { for (unsigned int i = 0; i < numSortTypes; ++i) {
if (FileSorts::SortTypes[i].description == if (FileSorts::SortTypes[i].description ==
Settings::getInstance()->getString("DefaultSortOrder")) { Settings::getInstance()->getString("DefaultSortOrder")) {
sortOrder = FileSorts::SortTypes[i].description; sortOrder = FileSorts::SortTypes[i].description;
@ -304,7 +304,7 @@ void GuiMenu::openUIOptions()
// sort order 'filename, ascending'. // sort order 'filename, ascending'.
if (sortOrder == "") if (sortOrder == "")
sortOrder = Settings::getInstance()->getDefaultString("DefaultSortOrder"); sortOrder = Settings::getInstance()->getDefaultString("DefaultSortOrder");
for (unsigned int i = 0; i < numSortTypes; i++) { for (unsigned int i = 0; i < numSortTypes; ++i) {
const FileData::SortType& sort = FileSorts::SortTypes[i]; const FileData::SortType& sort = FileSorts::SortTypes[i];
if (sort.description == sortOrder) if (sort.description == sortOrder)
default_sort_order->add(sort.description, &sort, true); default_sort_order->add(sort.description, &sort, true);
@ -861,7 +861,7 @@ void GuiMenu::openOtherOptions()
displayIndex.push_back("2"); displayIndex.push_back("2");
displayIndex.push_back("3"); displayIndex.push_back("3");
displayIndex.push_back("4"); displayIndex.push_back("4");
for (auto it = displayIndex.cbegin(); it != displayIndex.cend(); it++) for (auto it = displayIndex.cbegin(); it != displayIndex.cend(); ++it)
display_index->add(*it, *it, display_index->add(*it, *it,
Settings::getInstance()->getInt("DisplayIndex") == atoi((*it).c_str())); Settings::getInstance()->getInt("DisplayIndex") == atoi((*it).c_str()));
s->addWithLabel("DISPLAY/MONITOR INDEX (REQUIRES RESTART)", display_index); s->addWithLabel("DISPLAY/MONITOR INDEX (REQUIRES RESTART)", display_index);
@ -881,7 +881,7 @@ void GuiMenu::openOtherOptions()
std::vector<std::string> screenmode; std::vector<std::string> screenmode;
screenmode.push_back("normal"); screenmode.push_back("normal");
screenmode.push_back("borderless"); screenmode.push_back("borderless");
for (auto it = screenmode.cbegin(); it != screenmode.cend(); it++) for (auto it = screenmode.cbegin(); it != screenmode.cend(); ++it)
fullscreen_mode->add(*it, *it, Settings::getInstance()->getString("FullscreenMode") == *it); fullscreen_mode->add(*it, *it, Settings::getInstance()->getString("FullscreenMode") == *it);
s->addWithLabel("FULLSCREEN MODE (REQUIRES RESTART)", fullscreen_mode); s->addWithLabel("FULLSCREEN MODE (REQUIRES RESTART)", fullscreen_mode);
s->addSaveFunc([fullscreen_mode, s] { s->addSaveFunc([fullscreen_mode, s] {
@ -943,7 +943,7 @@ void GuiMenu::openOtherOptions()
saveModes.push_back("on exit"); saveModes.push_back("on exit");
saveModes.push_back("always"); saveModes.push_back("always");
saveModes.push_back("never"); saveModes.push_back("never");
for (auto it = saveModes.cbegin(); it != saveModes.cend(); it++) { for (auto it = saveModes.cbegin(); it != saveModes.cend(); ++it) {
save_gamelist_mode->add(*it, *it, save_gamelist_mode->add(*it, *it,
Settings::getInstance()->getString("SaveGamelistsMode") == *it); Settings::getInstance()->getString("SaveGamelistsMode") == *it);
} }
@ -957,7 +957,7 @@ void GuiMenu::openOtherOptions()
// be changes that will otherwise be lost. // be changes that will otherwise be lost.
if (Settings::getInstance()->getString("SaveGamelistsMode") == "always") { if (Settings::getInstance()->getString("SaveGamelistsMode") == "always") {
for (auto it = SystemData::sSystemVector.cbegin(); for (auto it = SystemData::sSystemVector.cbegin();
it != SystemData::sSystemVector.cend(); it++) it != SystemData::sSystemVector.cend(); ++it)
(*it)->writeMetaData(); (*it)->writeMetaData();
} }
s->setNeedsSaving(); s->setNeedsSaving();

View file

@ -108,23 +108,23 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
mGrid.setEntry(mScrollDown, glm::ivec2{1, 1}, false, false, glm::ivec2{1, 1}); mGrid.setEntry(mScrollDown, glm::ivec2{1, 1}, false, false, glm::ivec2{1, 1});
// Populate list. // Populate list.
for (auto iter = mdd.cbegin(); iter != mdd.cend(); iter++) { for (auto it = mdd.cbegin(); it != mdd.cend(); ++it) {
std::shared_ptr<GuiComponent> ed; std::shared_ptr<GuiComponent> ed;
std::string currentKey = iter->key; std::string currentKey = it->key;
std::string originalValue = mMetaData->get(iter->key); std::string originalValue = mMetaData->get(it->key);
std::string gamePath; std::string gamePath;
// Don't add statistics. // Don't add statistics.
if (iter->isStatistic) if (it->isStatistic)
continue; continue;
// Don't show the alternative emulator entry if the corresponding option has been disabled. // Don't show the alternative emulator entry if the corresponding option has been disabled.
if (!Settings::getInstance()->getBool("AlternativeEmulatorPerGame") && if (!Settings::getInstance()->getBool("AlternativeEmulatorPerGame") &&
iter->type == MD_ALT_EMULATOR) { it->type == MD_ALT_EMULATOR) {
ed = std::make_shared<TextComponent>( ed = std::make_shared<TextComponent>(
window, "", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT); window, "", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT);
assert(ed); assert(ed);
ed->setValue(mMetaData->get(iter->key)); ed->setValue(mMetaData->get(it->key));
mEditors.push_back(ed); mEditors.push_back(ed);
continue; continue;
} }
@ -133,12 +133,11 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
// entry instead of for instance the spacer. That is so because ComponentList // entry instead of for instance the spacer. That is so because ComponentList
// always looks for the help prompt at the back of the element stack. // always looks for the help prompt at the back of the element stack.
ComponentListRow row; ComponentListRow row;
auto lbl = auto lbl = std::make_shared<TextComponent>(mWindow, Utils::String::toUpper(it->displayName),
std::make_shared<TextComponent>(mWindow, Utils::String::toUpper(iter->displayName),
Font::get(FONT_SIZE_SMALL), 0x777777FF); Font::get(FONT_SIZE_SMALL), 0x777777FF);
row.addElement(lbl, true); // Label. row.addElement(lbl, true); // Label.
switch (iter->type) { switch (it->type) {
case MD_BOOL: { case MD_BOOL: {
ed = std::make_shared<SwitchComponent>(window); ed = std::make_shared<SwitchComponent>(window);
// Make the switches slightly smaller. // Make the switches slightly smaller.
@ -195,7 +194,7 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
bracket->setResize(glm::vec2{0.0f, lbl->getFont()->getLetterHeight()}); bracket->setResize(glm::vec2{0.0f, lbl->getFont()->getLetterHeight()});
row.addElement(bracket, false); row.addElement(bracket, false);
const std::string title = iter->displayPrompt; const std::string title = it->displayPrompt;
// OK callback (apply new value to ed). // OK callback (apply new value to ed).
auto updateVal = [ed, originalValue](const std::string& newVal) { auto updateVal = [ed, originalValue](const std::string& newVal) {
@ -279,7 +278,7 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
bracket->setResize(glm::vec2{0.0f, lbl->getFont()->getLetterHeight()}); bracket->setResize(glm::vec2{0.0f, lbl->getFont()->getLetterHeight()});
row.addElement(bracket, false); row.addElement(bracket, false);
const std::string title = iter->displayPrompt; const std::string title = it->displayPrompt;
// OK callback (apply new value to ed). // OK callback (apply new value to ed).
auto updateVal = [this, ed, originalValue](const std::string& newVal) { auto updateVal = [this, ed, originalValue](const std::string& newVal) {
@ -417,8 +416,8 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
bracket->setResize(glm::vec2{0.0f, lbl->getFont()->getLetterHeight()}); bracket->setResize(glm::vec2{0.0f, lbl->getFont()->getLetterHeight()});
row.addElement(bracket, false); row.addElement(bracket, false);
bool multiLine = iter->type == MD_MULTILINE_STRING; bool multiLine = it->type == MD_MULTILINE_STRING;
const std::string title = iter->displayPrompt; const std::string title = it->displayPrompt;
gamePath = Utils::FileSystem::getStem(mScraperParams.game->getPath()); gamePath = Utils::FileSystem::getStem(mScraperParams.game->getPath());
@ -473,18 +472,18 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
assert(ed); assert(ed);
mList->addRow(row); mList->addRow(row);
if (iter->type == MD_ALT_EMULATOR && mInvalidEmulatorEntry == true) { if (it->type == MD_ALT_EMULATOR && mInvalidEmulatorEntry == true) {
ed->setValue(ViewController::EXCLAMATION_CHAR + " " + originalValue); ed->setValue(ViewController::EXCLAMATION_CHAR + " " + originalValue);
} }
else if (iter->type == MD_CONTROLLER && mMetaData->get(iter->key) != "") { else if (it->type == MD_CONTROLLER && mMetaData->get(it->key) != "") {
std::string displayName = BadgeComponent::getDisplayName(mMetaData->get(iter->key)); std::string displayName = BadgeComponent::getDisplayName(mMetaData->get(it->key));
if (displayName != "unknown") if (displayName != "unknown")
ed->setValue(displayName); ed->setValue(displayName);
else else
ed->setValue(ViewController::EXCLAMATION_CHAR + " " + mMetaData->get(iter->key)); ed->setValue(ViewController::EXCLAMATION_CHAR + " " + mMetaData->get(it->key));
} }
else { else {
ed->setValue(mMetaData->get(iter->key)); ed->setValue(mMetaData->get(it->key));
} }
mEditors.push_back(ed); mEditors.push_back(ed);
@ -609,7 +608,7 @@ void GuiMetaDataEd::save()
bool hideGameWhileHidden = false; bool hideGameWhileHidden = false;
bool setGameAsCounted = false; bool setGameAsCounted = false;
for (unsigned int i = 0; i < mEditors.size(); i++) { for (unsigned int i = 0; i < mEditors.size(); ++i) {
if (mMetaDataDecl.at(i).isStatistic) if (mMetaDataDecl.at(i).isStatistic)
continue; continue;
@ -730,7 +729,7 @@ void GuiMetaDataEd::fetchDone(const ScraperSearchResult& result)
// Check if any values were manually changed before starting the scraping. // Check if any values were manually changed before starting the scraping.
// If so, it's these values we should compare against when scraping, not // If so, it's these values we should compare against when scraping, not
// the values previously saved for the game. // the values previously saved for the game.
for (unsigned int i = 0; i < mEditors.size(); i++) { for (unsigned int i = 0; i < mEditors.size(); ++i) {
const std::string& key = mMetaDataDecl.at(i).key; const std::string& key = mMetaDataDecl.at(i).key;
if (metadata->get(key) != mEditors[i]->getValue()) if (metadata->get(key) != mEditors[i]->getValue())
metadata->set(key, mEditors[i]->getValue()); metadata->set(key, mEditors[i]->getValue());
@ -739,7 +738,7 @@ void GuiMetaDataEd::fetchDone(const ScraperSearchResult& result)
GuiScraperSearch::saveMetadata(result, *metadata, mScraperParams.game); GuiScraperSearch::saveMetadata(result, *metadata, mScraperParams.game);
// Update the list with the scraped metadata values. // Update the list with the scraped metadata values.
for (unsigned int i = 0; i < mEditors.size(); i++) { for (unsigned int i = 0; i < mEditors.size(); ++i) {
const std::string& key = mMetaDataDecl.at(i).key; const std::string& key = mMetaDataDecl.at(i).key;
if (key == "controller" && metadata->get(key) != "") { if (key == "controller" && metadata->get(key) != "") {
std::string displayName = BadgeComponent::getDisplayName(metadata->get(key)); std::string displayName = BadgeComponent::getDisplayName(metadata->get(key));
@ -765,7 +764,7 @@ void GuiMetaDataEd::close()
{ {
// Find out if the user made any changes. // Find out if the user made any changes.
bool metadataUpdated = false; bool metadataUpdated = false;
for (unsigned int i = 0; i < mEditors.size(); i++) { for (unsigned int i = 0; i < mEditors.size(); ++i) {
const std::string& key = mMetaDataDecl.at(i).key; const std::string& key = mMetaDataDecl.at(i).key;
std::string mMetaDataValue = mMetaData->get(key); std::string mMetaDataValue = mMetaData->get(key);
std::string mEditorsValue = mEditors.at(i)->getValue(); std::string mEditorsValue = mEditors.at(i)->getValue();

View file

@ -251,11 +251,11 @@ void GuiOfflineGenerator::update(int deltaTime)
mMiximageGeneratorThread.join(); mMiximageGeneratorThread.join();
mMiximageGenerator.reset(); mMiximageGenerator.reset();
if (!mGeneratorFuture.get()) { if (!mGeneratorFuture.get()) {
mImagesGenerated++; ++mImagesGenerated;
TextureResource::manualUnload(mGame->getMiximagePath(), false); TextureResource::manualUnload(mGame->getMiximagePath(), false);
mProcessingVal->setText(""); mProcessingVal->setText("");
if (mOverwriting) { if (mOverwriting) {
mImagesOverwritten++; ++mImagesOverwritten;
mOverwriting = false; mOverwriting = false;
} }
} }
@ -263,10 +263,10 @@ void GuiOfflineGenerator::update(int deltaTime)
std::string errorMessage = mResultMessage + " (" + mGameName + ")"; std::string errorMessage = mResultMessage + " (" + mGameName + ")";
mLastErrorVal->setText(errorMessage); mLastErrorVal->setText(errorMessage);
LOG(LogInfo) << "GuiOfflineGenerator: " << errorMessage; LOG(LogInfo) << "GuiOfflineGenerator: " << errorMessage;
mGamesFailed++; ++mGamesFailed;
} }
mGame = nullptr; mGame = nullptr;
mGamesProcessed++; ++mGamesProcessed;
} }
} }
@ -284,8 +284,8 @@ void GuiOfflineGenerator::update(int deltaTime)
if (!Settings::getInstance()->getBool("MiximageOverwrite") && if (!Settings::getInstance()->getBool("MiximageOverwrite") &&
mGame->getMiximagePath() != "") { mGame->getMiximagePath() != "") {
mGamesProcessed++; ++mGamesProcessed;
mGamesSkipped++; ++mGamesSkipped;
mSkippedVal->setText(std::to_string(mGamesSkipped)); mSkippedVal->setText(std::to_string(mGamesSkipped));
} }
else { else {

View file

@ -30,7 +30,7 @@ GuiScraperMenu::GuiScraperMenu(Window* window, std::string title)
std::vector<std::string> scrapers = getScraperList(); std::vector<std::string> scrapers = getScraperList();
// Select either the first entry or the one read from the settings, // Select either the first entry or the one read from the settings,
// just in case the scraper from settings has vanished. // just in case the scraper from settings has vanished.
for (auto it = scrapers.cbegin(); it != scrapers.cend(); it++) for (auto it = scrapers.cbegin(); it != scrapers.cend(); ++it)
mScraper->add(*it, *it, *it == Settings::getInstance()->getString("Scraper")); mScraper->add(*it, *it, *it == Settings::getInstance()->getString("Scraper"));
// If there are no objects returned, then there must be a manually modified entry in the // If there are no objects returned, then there must be a manually modified entry in the
// configuration file. Simply set the scraper to "screenscraper" in this case. // configuration file. Simply set the scraper to "screenscraper" in this case.
@ -104,7 +104,7 @@ GuiScraperMenu::GuiScraperMenu(Window* window, std::string title)
// Add systems (all systems with an existing platform ID are listed). // Add systems (all systems with an existing platform ID are listed).
mSystems = std::make_shared<OptionListComponent<SystemData*>>(mWindow, getHelpStyle(), mSystems = std::make_shared<OptionListComponent<SystemData*>>(mWindow, getHelpStyle(),
"SCRAPE THESE SYSTEMS", true); "SCRAPE THESE SYSTEMS", true);
for (unsigned int i = 0; i < SystemData::sSystemVector.size(); i++) { for (unsigned int i = 0; i < SystemData::sSystemVector.size(); ++i) {
if (!SystemData::sSystemVector[i]->hasPlatformId(PlatformIds::PLATFORM_IGNORE)) { if (!SystemData::sSystemVector[i]->hasPlatformId(PlatformIds::PLATFORM_IGNORE)) {
mSystems->add(SystemData::sSystemVector[i]->getFullName(), SystemData::sSystemVector[i], mSystems->add(SystemData::sSystemVector[i]->getFullName(), SystemData::sSystemVector[i],
!SystemData::sSystemVector[i]->getPlatformIds().empty()); !SystemData::sSystemVector[i]->getPlatformIds().empty());
@ -155,9 +155,9 @@ GuiScraperMenu::~GuiScraperMenu()
// remembered throughout the program session. // remembered throughout the program session.
std::vector<SystemData*> sys = mSystems->getSelectedObjects(); std::vector<SystemData*> sys = mSystems->getSelectedObjects();
for (auto it = SystemData::sSystemVector.cbegin(); // Line break. for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) { it != SystemData::sSystemVector.cend(); ++it) {
(*it)->setScrapeFlag(false); (*it)->setScrapeFlag(false);
for (auto it_sys = sys.cbegin(); it_sys != sys.cend(); it_sys++) { for (auto it_sys = sys.cbegin(); it_sys != sys.cend(); ++it_sys) {
if ((*it)->getFullName() == (*it_sys)->getFullName()) if ((*it)->getFullName() == (*it_sys)->getFullName())
(*it)->setScrapeFlag(true); (*it)->setScrapeFlag(true);
} }
@ -658,7 +658,7 @@ void GuiScraperMenu::openOfflineGenerator(GuiSettings* settings)
std::queue<FileData*> gameQueue; std::queue<FileData*> gameQueue;
std::vector<SystemData*> systems = mSystems->getSelectedObjects(); std::vector<SystemData*> systems = mSystems->getSelectedObjects();
for (auto sys = systems.cbegin(); sys != systems.cend(); sys++) { for (auto sys = systems.cbegin(); sys != systems.cend(); ++sys) {
std::vector<FileData*> games = (*sys)->getRootFolder()->getChildrenRecursive(); std::vector<FileData*> games = (*sys)->getRootFolder()->getChildrenRecursive();
// Sort the games by "filename, ascending". // Sort the games by "filename, ascending".
@ -953,7 +953,7 @@ void GuiScraperMenu::pressedStart()
mMenu.save(); mMenu.save();
std::vector<SystemData*> sys = mSystems->getSelectedObjects(); std::vector<SystemData*> sys = mSystems->getSelectedObjects();
for (auto it = sys.cbegin(); it != sys.cend(); it++) { for (auto it = sys.cbegin(); it != sys.cend(); ++it) {
if ((*it)->getPlatformIds().empty()) { if ((*it)->getPlatformIds().empty()) {
std::string warningString; std::string warningString;
if (sys.size() == 1) { if (sys.size() == 1) {
@ -1070,12 +1070,12 @@ std::queue<ScraperSearchParams> GuiScraperMenu::getSearches(std::vector<SystemDa
GameFilterFunc selector) GameFilterFunc selector)
{ {
std::queue<ScraperSearchParams> queue; std::queue<ScraperSearchParams> queue;
for (auto sys = systems.cbegin(); sys != systems.cend(); sys++) { for (auto sys = systems.cbegin(); sys != systems.cend(); ++sys) {
std::vector<FileData*> games = (*sys)->getRootFolder()->getScrapeFilesRecursive( std::vector<FileData*> games = (*sys)->getRootFolder()->getScrapeFilesRecursive(
Settings::getInstance()->getBool("ScraperIncludeFolders"), Settings::getInstance()->getBool("ScraperIncludeFolders"),
Settings::getInstance()->getBool("ScraperExcludeRecursively"), Settings::getInstance()->getBool("ScraperExcludeRecursively"),
Settings::getInstance()->getBool("ScraperRespectExclusions")); Settings::getInstance()->getBool("ScraperRespectExclusions"));
for (auto game = games.cbegin(); game != games.cend(); game++) { for (auto game = games.cbegin(); game != games.cend(); ++game) {
if (selector((*sys), (*game))) { if (selector((*sys), (*game))) {
ScraperSearchParams search; ScraperSearchParams search;
search.game = *game; search.game = *game;

View file

@ -178,7 +178,7 @@ GuiScraperMulti::~GuiScraperMulti()
if (mTotalSuccessful > 0) { if (mTotalSuccessful > 0) {
// Sort all systems to possibly update their view style from Basic to Detailed or Video. // Sort all systems to possibly update their view style from Basic to Detailed or Video.
for (auto it = SystemData::sSystemVector.cbegin(); // Line break. for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) { it != SystemData::sSystemVector.cend(); ++it) {
(*it)->sortSystem(); (*it)->sortSystem();
} }
} }
@ -278,8 +278,8 @@ void GuiScraperMulti::acceptResult(const ScraperSearchResult& result)
search.system->getIndex()->addToIndex(search.game); search.system->getIndex()->addToIndex(search.game);
mSearchQueue.pop(); mSearchQueue.pop();
mCurrentGame++; ++mCurrentGame;
mTotalSuccessful++; ++mTotalSuccessful;
CollectionSystemsManager::get()->refreshCollectionSystems(search.game); CollectionSystemsManager::get()->refreshCollectionSystems(search.game);
doNextSearch(); doNextSearch();
} }
@ -287,8 +287,8 @@ void GuiScraperMulti::acceptResult(const ScraperSearchResult& result)
void GuiScraperMulti::skip() void GuiScraperMulti::skip()
{ {
mSearchQueue.pop(); mSearchQueue.pop();
mCurrentGame++; ++mCurrentGame;
mTotalSkipped++; ++mTotalSkipped;
mSearchComp->decreaseScrapeCount(); mSearchComp->decreaseScrapeCount();
mSearchComp->unsetRefinedSearch(); mSearchComp->unsetRefinedSearch();
doNextSearch(); doNextSearch();

View file

@ -123,7 +123,7 @@ GuiScraperSearch::GuiScraperSearch(Window* window, SearchType type, unsigned int
mMD_Grid = std::make_shared<ComponentGrid>( mMD_Grid = std::make_shared<ComponentGrid>(
mWindow, glm::ivec2{2, static_cast<int>(mMD_Pairs.size() * 2 - 1)}); mWindow, glm::ivec2{2, static_cast<int>(mMD_Pairs.size() * 2 - 1)});
unsigned int i = 0; unsigned int i = 0;
for (auto it = mMD_Pairs.cbegin(); it != mMD_Pairs.cend(); it++) { for (auto it = mMD_Pairs.cbegin(); it != mMD_Pairs.cend(); ++it) {
mMD_Grid->setEntry(it->first, glm::ivec2{0, i}, false, true); mMD_Grid->setEntry(it->first, glm::ivec2{0, i}, false, true);
mMD_Grid->setEntry(it->second, glm::ivec2{1, i}, false, it->resize); mMD_Grid->setEntry(it->second, glm::ivec2{1, i}, false, it->resize);
i += 2; i += 2;
@ -246,14 +246,14 @@ void GuiScraperSearch::resizeMetadata()
// Update label fonts. // Update label fonts.
float maxLblWidth = 0; float maxLblWidth = 0;
for (auto it = mMD_Pairs.cbegin(); it != mMD_Pairs.cend(); it++) { for (auto it = mMD_Pairs.cbegin(); it != mMD_Pairs.cend(); ++it) {
it->first->setFont(fontLbl); it->first->setFont(fontLbl);
it->first->setSize(0, 0); it->first->setSize(0, 0);
if (it->first->getSize().x > maxLblWidth) if (it->first->getSize().x > maxLblWidth)
maxLblWidth = it->first->getSize().x + (16.0f * Renderer::getScreenWidthModifier()); maxLblWidth = it->first->getSize().x + (16.0f * Renderer::getScreenWidthModifier());
} }
for (unsigned int i = 0; i < mMD_Pairs.size(); i++) for (unsigned int i = 0; i < mMD_Pairs.size(); ++i)
mMD_Grid->setRowHeightPerc( mMD_Grid->setRowHeightPerc(
i * 2, (fontLbl->getLetterHeight() + (2.0f * Renderer::getScreenHeightModifier())) / i * 2, (fontLbl->getLetterHeight() + (2.0f * Renderer::getScreenHeightModifier())) /
mMD_Grid->getSize().y); mMD_Grid->getSize().y);
@ -386,7 +386,7 @@ void GuiScraperSearch::onSearchDone(const std::vector<ScraperSearchResult>& resu
mFoundGame = true; mFoundGame = true;
ComponentListRow row; ComponentListRow row;
for (size_t i = 0; i < results.size(); i++) { for (size_t i = 0; i < results.size(); ++i) {
row.elements.clear(); row.elements.clear();
row.addElement( row.addElement(
std::make_shared<TextComponent>( std::make_shared<TextComponent>(
@ -434,7 +434,7 @@ void GuiScraperSearch::onSearchError(const std::string& error, HttpReq::Status s
Settings::getInstance()->getBool("ScraperRetryPeerVerification")) { Settings::getInstance()->getBool("ScraperRetryPeerVerification")) {
LOG(LogError) << "GuiScraperSearch: " << Utils::String::replace(error, "\n", ""); LOG(LogError) << "GuiScraperSearch: " << Utils::String::replace(error, "\n", "");
mRetrySearch = true; mRetrySearch = true;
mRetryCount++; ++mRetryCount;
LOG(LogError) << "GuiScraperSearch: Attempting automatic retry " << mRetryCount << " of " LOG(LogError) << "GuiScraperSearch: Attempting automatic retry " << mRetryCount << " of "
<< FAILED_VERIFICATION_RETRIES; << FAILED_VERIFICATION_RETRIES;
return; return;
@ -652,7 +652,7 @@ void GuiScraperSearch::update(int deltaTime)
} }
else { else {
std::string gameIDs; std::string gameIDs;
for (auto it = mScraperResults.cbegin(); it != mScraperResults.cend(); it++) for (auto it = mScraperResults.cbegin(); it != mScraperResults.cend(); ++it)
gameIDs += it->gameID + ','; gameIDs += it->gameID + ',';
// Remove the last comma // Remove the last comma
@ -674,8 +674,8 @@ void GuiScraperSearch::update(int deltaTime)
mScraperResults.clear(); mScraperResults.clear();
// Combine the intial scrape results with the media URL results. // Combine the intial scrape results with the media URL results.
for (auto it = results_media.cbegin(); it != results_media.cend(); it++) { for (auto it = results_media.cbegin(); it != results_media.cend(); ++it) {
for (unsigned int i = 0; i < results_scrape.size(); i++) { for (unsigned int i = 0; i < results_scrape.size(); ++i) {
if (results_scrape[i].gameID == it->gameID) { if (results_scrape[i].gameID == it->gameID) {
results_scrape[i].box3DUrl = it->box3DUrl; results_scrape[i].box3DUrl = it->box3DUrl;
results_scrape[i].backcoverUrl = it->backcoverUrl; results_scrape[i].backcoverUrl = it->backcoverUrl;
@ -867,7 +867,7 @@ bool GuiScraperSearch::saveMetadata(const ScraperSearchResult& result,
if (defaultName == metadata.get("name")) if (defaultName == metadata.get("name"))
hasDefaultName = true; hasDefaultName = true;
for (unsigned int i = 0; i < mMetaDataDecl.size(); i++) { for (unsigned int i = 0; i < mMetaDataDecl.size(); ++i) {
// Skip elements that are tagged not to be scraped. // Skip elements that are tagged not to be scraped.
if (!mMetaDataDecl.at(i).shouldScrape) if (!mMetaDataDecl.at(i).shouldScrape)

View file

@ -86,7 +86,7 @@ public:
void decreaseScrapeCount() void decreaseScrapeCount()
{ {
if (mScrapeCount > 0) if (mScrapeCount > 0)
mScrapeCount--; --mScrapeCount;
} }
void unsetRefinedSearch() { mRefinedSearch = false; } void unsetRefinedSearch() { mRefinedSearch = false; }
bool getRefinedSearch() { return mRefinedSearch; } bool getRefinedSearch() { return mRefinedSearch; }

View file

@ -42,7 +42,7 @@ GuiScreensaverOptions::GuiScreensaverOptions(Window* window, const std::string&
screensavers.push_back("black"); screensavers.push_back("black");
screensavers.push_back("slideshow"); screensavers.push_back("slideshow");
screensavers.push_back("video"); screensavers.push_back("video");
for (auto it = screensavers.cbegin(); it != screensavers.cend(); it++) for (auto it = screensavers.cbegin(); it != screensavers.cend(); ++it)
screensaver_type->add(*it, *it, screensaver_type->add(*it, *it,
Settings::getInstance()->getString("ScreensaverType") == *it); Settings::getInstance()->getString("ScreensaverType") == *it);
addWithLabel("SCREENSAVER TYPE", screensaver_type); addWithLabel("SCREENSAVER TYPE", screensaver_type);

View file

@ -56,7 +56,7 @@ void GuiSettings::save()
if (!mSaveFuncs.size()) if (!mSaveFuncs.size())
return; return;
for (auto it = mSaveFuncs.cbegin(); it != mSaveFuncs.cend(); it++) for (auto it = mSaveFuncs.cbegin(); it != mSaveFuncs.cend(); ++it)
(*it)(); (*it)();
if (mNeedsSaving) if (mNeedsSaving)
@ -72,7 +72,7 @@ void GuiSettings::save()
if (mNeedsSorting) { if (mNeedsSorting) {
for (auto it = SystemData::sSystemVector.cbegin(); it != SystemData::sSystemVector.cend(); for (auto it = SystemData::sSystemVector.cbegin(); it != SystemData::sSystemVector.cend();
it++) { ++it) {
if (!(!mNeedsSortingCollections && (*it)->isCollection())) if (!(!mNeedsSortingCollections && (*it)->isCollection()))
(*it)->sortSystem(true); (*it)->sortSystem(true);
@ -84,7 +84,7 @@ void GuiSettings::save()
if (mNeedsResetFilters) { if (mNeedsResetFilters) {
for (auto it = SystemData::sSystemVector.cbegin(); // Line break. for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) { it != SystemData::sSystemVector.cend(); ++it) {
if ((*it)->getThemeFolder() == "custom-collections") { if ((*it)->getThemeFolder() == "custom-collections") {
for (FileData* customSystem : (*it)->getRootFolder()->getChildrenListToDisplay()) for (FileData* customSystem : (*it)->getRootFolder()->getChildrenListToDisplay())
customSystem->getSystem()->getIndex()->resetFilters(); customSystem->getSystem()->getIndex()->resetFilters();

View file

@ -177,7 +177,7 @@ bool parseArgs(int argc, char* argv[])
// We need to process --home before any call to Settings::getInstance(), // We need to process --home before any call to Settings::getInstance(),
// because settings are loaded from the home path. // because settings are loaded from the home path.
for (int i = 1; i < argc; i++) { for (int i = 1; i < argc; ++i) {
if (strcmp(argv[i], "--home") == 0) { if (strcmp(argv[i], "--home") == 0) {
if (i >= argc - 1) { if (i >= argc - 1) {
std::cerr << "Error: No home path supplied with \'--home'\n"; std::cerr << "Error: No home path supplied with \'--home'\n";
@ -202,10 +202,10 @@ bool parseArgs(int argc, char* argv[])
} }
} }
for (int i = 1; i < argc; i++) { for (int i = 1; i < argc; ++i) {
// Skip past --home flag as we already processed it. // Skip past --home flag as we already processed it.
if (strcmp(argv[i], "--home") == 0) { if (strcmp(argv[i], "--home") == 0) {
i++; // Skip the argument value. ++i; // Skip the argument value.
continue; continue;
} }
if (strcmp(argv[i], "--display") == 0) { if (strcmp(argv[i], "--display") == 0) {
@ -216,7 +216,7 @@ bool parseArgs(int argc, char* argv[])
int DisplayIndex = atoi(argv[i + 1]); int DisplayIndex = atoi(argv[i + 1]);
Settings::getInstance()->setInt("DisplayIndex", DisplayIndex); Settings::getInstance()->setInt("DisplayIndex", DisplayIndex);
settingsNeedSaving = true; settingsNeedSaving = true;
i++; ++i;
} }
else if (strcmp(argv[i], "--resolution") == 0) { else if (strcmp(argv[i], "--resolution") == 0) {
if (i >= argc - 2) { if (i >= argc - 2) {
@ -271,7 +271,7 @@ bool parseArgs(int argc, char* argv[])
} }
int rotate = atoi(argv[i + 1]); int rotate = atoi(argv[i + 1]);
Settings::getInstance()->setInt("ScreenRotate", rotate); Settings::getInstance()->setInt("ScreenRotate", rotate);
i++; ++i;
} }
// On Unix, enable settings for the fullscreen mode. // On Unix, enable settings for the fullscreen mode.
// On macOS and Windows only windowed mode is supported. // On macOS and Windows only windowed mode is supported.
@ -302,7 +302,7 @@ bool parseArgs(int argc, char* argv[])
} }
bool vSync = (vSyncValue == "on" || vSyncValue == "1") ? true : false; bool vSync = (vSyncValue == "on" || vSyncValue == "1") ? true : false;
Settings::getInstance()->setBool("VSync", vSync); Settings::getInstance()->setBool("VSync", vSync);
i++; ++i;
} }
else if (strcmp(argv[i], "--max-vram") == 0) { else if (strcmp(argv[i], "--max-vram") == 0) {
if (i >= argc - 1) { if (i >= argc - 1) {
@ -312,7 +312,7 @@ bool parseArgs(int argc, char* argv[])
int maxVRAM = atoi(argv[i + 1]); int maxVRAM = atoi(argv[i + 1]);
Settings::getInstance()->setInt("MaxVRAM", maxVRAM); Settings::getInstance()->setInt("MaxVRAM", maxVRAM);
settingsNeedSaving = true; settingsNeedSaving = true;
i++; ++i;
} }
else if (strcmp(argv[i], "--no-splash") == 0) { else if (strcmp(argv[i], "--no-splash") == 0) {
Settings::getInstance()->setBool("SplashScreen", false); Settings::getInstance()->setBool("SplashScreen", false);

View file

@ -183,7 +183,7 @@ void thegamesdb_generate_json_scraper_requests(
bool first = true; bool first = true;
platformQueryParam += "&filter%5Bplatform%5D="; platformQueryParam += "&filter%5Bplatform%5D=";
for (auto platformIt = platforms.cbegin(); // Line break. for (auto platformIt = platforms.cbegin(); // Line break.
platformIt != platforms.cend(); platformIt++) { platformIt != platforms.cend(); ++platformIt) {
auto mapIt = gamesdb_new_platformid_map.find(*platformIt); auto mapIt = gamesdb_new_platformid_map.find(*platformIt);
if (mapIt != gamesdb_new_platformid_map.cend()) { if (mapIt != gamesdb_new_platformid_map.cend()) {
if (!first) if (!first)
@ -258,7 +258,7 @@ namespace
std::string out = ""; std::string out = "";
bool first = true; bool first = true;
for (int i = 0; i < static_cast<int>(v.Size()); i++) { for (int i = 0; i < static_cast<int>(v.Size()); ++i) {
auto mapIt = resources.gamesdb_new_developers_map.find(getIntOrThrow(v[i])); auto mapIt = resources.gamesdb_new_developers_map.find(getIntOrThrow(v[i]));
if (mapIt == resources.gamesdb_new_developers_map.cend()) if (mapIt == resources.gamesdb_new_developers_map.cend())
@ -280,7 +280,7 @@ namespace
std::string out = ""; std::string out = "";
bool first = true; bool first = true;
for (int i = 0; i < static_cast<int>(v.Size()); i++) { for (int i = 0; i < static_cast<int>(v.Size()); ++i) {
auto mapIt = resources.gamesdb_new_publishers_map.find(getIntOrThrow(v[i])); auto mapIt = resources.gamesdb_new_publishers_map.find(getIntOrThrow(v[i]));
if (mapIt == resources.gamesdb_new_publishers_map.cend()) if (mapIt == resources.gamesdb_new_publishers_map.cend())
@ -302,7 +302,7 @@ namespace
std::string out = ""; std::string out = "";
bool first = true; bool first = true;
for (int i = 0; i < static_cast<int>(v.Size()); i++) { for (int i = 0; i < static_cast<int>(v.Size()); ++i) {
auto mapIt = resources.gamesdb_new_genres_map.find(getIntOrThrow(v[i])); auto mapIt = resources.gamesdb_new_genres_map.find(getIntOrThrow(v[i]));
if (mapIt == resources.gamesdb_new_genres_map.cend()) if (mapIt == resources.gamesdb_new_genres_map.cend())
@ -375,7 +375,7 @@ void processMediaURLs(const Value& images,
ScraperSearchResult result; ScraperSearchResult result;
// Step through each game ID in the JSON server response. // Step through each game ID in the JSON server response.
for (auto it = images.MemberBegin(); it != images.MemberEnd(); it++) { for (auto it = images.MemberBegin(); it != images.MemberEnd(); ++it) {
result.gameID = it->name.GetString(); result.gameID = it->name.GetString();
const Value& gameMedia = images[it->name]; const Value& gameMedia = images[it->name];
result.coverUrl = ""; result.coverUrl = "";
@ -386,7 +386,7 @@ void processMediaURLs(const Value& images,
// Quite excessive testing for valid values, but you never know what the server has // Quite excessive testing for valid values, but you never know what the server has
// returned and we don't want to crash the program due to malformed data. // returned and we don't want to crash the program due to malformed data.
if (gameMedia.IsArray()) { if (gameMedia.IsArray()) {
for (SizeType i = 0; i < gameMedia.Size(); i++) { for (SizeType i = 0; i < gameMedia.Size(); ++i) {
std::string mediatype; std::string mediatype;
std::string mediaside; std::string mediaside;
if (gameMedia[i]["type"].IsString()) if (gameMedia[i]["type"].IsString())
@ -455,7 +455,7 @@ void TheGamesDBJSONRequest::process(const std::unique_ptr<HttpReq>& req,
// Find how many more requests we can make before the scraper // Find how many more requests we can make before the scraper
// request allowance counter is reset. // request allowance counter is reset.
if (doc.HasMember("remaining_monthly_allowance") && doc.HasMember("extra_allowance")) { if (doc.HasMember("remaining_monthly_allowance") && doc.HasMember("extra_allowance")) {
for (size_t i = 0; i < results.size(); i++) { for (size_t i = 0; i < results.size(); ++i) {
results[i].scraperRequestAllowance = results[i].scraperRequestAllowance =
doc["remaining_monthly_allowance"].GetInt() + doc["extra_allowance"].GetInt(); doc["remaining_monthly_allowance"].GetInt() + doc["extra_allowance"].GetInt();
} }
@ -476,7 +476,7 @@ void TheGamesDBJSONRequest::process(const std::unique_ptr<HttpReq>& req,
const Value& games = doc["data"]["games"]; const Value& games = doc["data"]["games"];
resources.ensureResources(); resources.ensureResources();
for (int i = 0; i < static_cast<int>(games.Size()); i++) { for (int i = 0; i < static_cast<int>(games.Size()); ++i) {
auto& v = games[i]; auto& v = games[i];
try { try {
processGame(v, results); processGame(v, results);

View file

@ -93,7 +93,7 @@ void TheGamesDBJSONRequestResources::ensureResources()
if (checkLoaded()) if (checkLoaded())
return; return;
for (int i = 0; i < MAX_WAIT_ITER; i++) { for (int i = 0; i < MAX_WAIT_ITER; ++i) {
if (gamesdb_developers_resource_request && if (gamesdb_developers_resource_request &&
saveResource(gamesdb_developers_resource_request.get(), gamesdb_new_developers_map, saveResource(gamesdb_developers_resource_request.get(), gamesdb_new_developers_map,
@ -191,8 +191,8 @@ int TheGamesDBJSONRequestResources::loadResource(std::unordered_map<int, std::st
} }
auto& data = doc["data"][resource_name.c_str()]; auto& data = doc["data"][resource_name.c_str()];
for (Value::ConstMemberIterator itr = data.MemberBegin(); itr != data.MemberEnd(); itr++) { for (Value::ConstMemberIterator it = data.MemberBegin(); it != data.MemberEnd(); ++it) {
auto& entry = itr->value; auto& entry = it->value;
if (!entry.IsObject() || !entry.HasMember("id") || !entry["id"].IsInt() || if (!entry.IsObject() || !entry.HasMember("id") || !entry["id"].IsInt() ||
!entry.HasMember("name") || !entry["name"].IsString()) !entry.HasMember("name") || !entry["name"].IsString())
continue; continue;

View file

@ -82,7 +82,7 @@ std::unique_ptr<ScraperSearchHandle> startMediaURLsFetch(const std::string& game
std::vector<std::string> getScraperList() std::vector<std::string> getScraperList()
{ {
std::vector<std::string> list; std::vector<std::string> list;
for (auto it = scraper_request_funcs.cbegin(); it != scraper_request_funcs.cend(); it++) for (auto it = scraper_request_funcs.cbegin(); it != scraper_request_funcs.cend(); ++it)
list.push_back(it->first); list.push_back(it->first);
return list; return list;
@ -257,7 +257,7 @@ MDResolveHandle::MDResolveHandle(const ScraperSearchResult& result,
#endif #endif
} }
for (auto it = scrapeFiles.cbegin(); it != scrapeFiles.cend(); it++) { for (auto it = scrapeFiles.cbegin(); it != scrapeFiles.cend(); ++it) {
std::string ext; std::string ext;
@ -384,7 +384,7 @@ void MDResolveHandle::update()
it = mFuncs.erase(it); it = mFuncs.erase(it);
continue; continue;
} }
it++; ++it;
} }
if (mFuncs.empty()) if (mFuncs.empty())
@ -477,11 +477,11 @@ void MediaDownloadHandle::update()
// Skip the first line as this can apparently lead to false positives. // Skip the first line as this can apparently lead to false positives.
FreeImage_GetPixelColor(tempImage, 0, 1, &firstPixel); FreeImage_GetPixelColor(tempImage, 0, 1, &firstPixel);
for (unsigned int x = 0; x < width; x++) { for (unsigned int x = 0; x < width; ++x) {
if (!emptyImage) if (!emptyImage)
break; break;
// Skip the last line as well. // Skip the last line as well.
for (unsigned int y = 1; y < height - 1; y++) { for (unsigned int y = 1; y < height - 1; ++y) {
FreeImage_GetPixelColor(tempImage, x, y, &currPixel); FreeImage_GetPixelColor(tempImage, x, y, &currPixel);
if (currPixel.rgbBlue != firstPixel.rgbBlue || if (currPixel.rgbBlue != firstPixel.rgbBlue ||
currPixel.rgbGreen != firstPixel.rgbGreen || currPixel.rgbGreen != firstPixel.rgbGreen ||

View file

@ -195,7 +195,7 @@ void screenscraper_generate_scraper_requests(const ScraperSearchParams& params,
std::vector<unsigned short> p_ids; std::vector<unsigned short> p_ids;
// Get the IDs of each platform from the ScreenScraper list. // Get the IDs of each platform from the ScreenScraper list.
for (auto platformIt = platforms.cbegin(); platformIt != platforms.cend(); platformIt++) { for (auto platformIt = platforms.cbegin(); platformIt != platforms.cend(); ++platformIt) {
auto mapIt = screenscraper_platformid_map.find(*platformIt); auto mapIt = screenscraper_platformid_map.find(*platformIt);
if (mapIt != screenscraper_platformid_map.cend()) { if (mapIt != screenscraper_platformid_map.cend()) {
@ -222,7 +222,7 @@ void screenscraper_generate_scraper_requests(const ScraperSearchParams& params,
auto last = std::unique(p_ids.begin(), p_ids.end()); auto last = std::unique(p_ids.begin(), p_ids.end());
p_ids.erase(last, p_ids.end()); p_ids.erase(last, p_ids.end());
for (auto platform = p_ids.cbegin(); platform != p_ids.cend(); platform++) { for (auto platform = p_ids.cbegin(); platform != p_ids.cend(); ++platform) {
path += "&systemeid="; path += "&systemeid=";
path += HttpReq::urlEncode(std::to_string(*platform)); path += HttpReq::urlEncode(std::to_string(*platform));
requests.push( requests.push(
@ -266,7 +266,7 @@ void ScreenScraperRequest::process(const std::unique_ptr<HttpReq>& req,
// returned instead of a valid game name, and retrying a second time returns the proper // returned instead of a valid game name, and retrying a second time returns the proper
// name. But it's basically impossible to know which is the case, and we really can't // name. But it's basically impossible to know which is the case, and we really can't
// compensate for errors in the scraper service. // compensate for errors in the scraper service.
for (auto it = results.cbegin(); it != results.cend(); it++) { for (auto it = results.cbegin(); it != results.cend(); ++it) {
std::string gameName = Utils::String::toUpper((*it).mdl.get("name")); std::string gameName = Utils::String::toUpper((*it).mdl.get("name"));
if (gameName.substr(0, 12) == "ZZZ(NOTGAME)") { if (gameName.substr(0, 12) == "ZZZ(NOTGAME)") {
LOG(LogWarning) << "ScreenScraperRequest - Received \"ZZZ(notgame)\" as game name, " LOG(LogWarning) << "ScreenScraperRequest - Received \"ZZZ(notgame)\" as game name, "
@ -637,7 +637,7 @@ void ScreenScraperRequest::processList(const pugi::xml_document& xmldoc,
// Otherwise if the first platform returns >= 7 games // Otherwise if the first platform returns >= 7 games
// but the second platform contains the relevant game, // but the second platform contains the relevant game,
// the relevant result would not be shown. // the relevant result would not be shown.
for (int i = 0; game && i < MAX_SCRAPER_RESULTS; i++) { for (int i = 0; game && i < MAX_SCRAPER_RESULTS; ++i) {
std::string id = game.child("id").text().get(); std::string id = game.child("id").text().get();
std::string name = game.child("nom").text().get(); std::string name = game.child("nom").text().get();
std::string platformId = game.child("systemeid").text().get(); std::string platformId = game.child("systemeid").text().get();

View file

@ -644,7 +644,7 @@ void SystemView::renderCarousel(const glm::mat4& trans)
} }
for (int i = center - logoCount / 2 + bufferLeft; // Line break. for (int i = center - logoCount / 2 + bufferLeft; // Line break.
i <= center + logoCount / 2 + bufferRight; i++) { i <= center + logoCount / 2 + bufferRight; ++i) {
int index = i; int index = i;
while (index < 0) while (index < 0)
@ -709,7 +709,7 @@ void SystemView::renderExtras(const glm::mat4& trans, float lower, float upper)
glm::ivec2{static_cast<int>(mSize.x), static_cast<int>(mSize.y)}); glm::ivec2{static_cast<int>(mSize.x), static_cast<int>(mSize.y)});
for (int i = extrasCenter + logoBuffersLeft[bufferIndex]; for (int i = extrasCenter + logoBuffersLeft[bufferIndex];
i <= extrasCenter + logoBuffersRight[bufferIndex]; i++) { i <= extrasCenter + logoBuffersRight[bufferIndex]; ++i) {
int index = i; int index = i;
while (index < 0) while (index < 0)
index += static_cast<int>(mEntries.size()); index += static_cast<int>(mEntries.size());
@ -730,7 +730,7 @@ void SystemView::renderExtras(const glm::mat4& trans, float lower, float upper)
glm::ivec2{static_cast<int>(extrasTrans[3].x), static_cast<int>(extrasTrans[3].y)}, glm::ivec2{static_cast<int>(extrasTrans[3].x), static_cast<int>(extrasTrans[3].y)},
glm::ivec2{static_cast<int>(mSize.x), static_cast<int>(mSize.y)}); glm::ivec2{static_cast<int>(mSize.x), static_cast<int>(mSize.y)});
SystemViewData data = mEntries.at(index).data; SystemViewData data = mEntries.at(index).data;
for (unsigned int j = 0; j < data.backgroundExtras.size(); j++) { for (unsigned int j = 0; j < data.backgroundExtras.size(); ++j) {
GuiComponent* extra = data.backgroundExtras[j]; GuiComponent* extra = data.backgroundExtras[j];
if (extra->getZIndex() >= lower && extra->getZIndex() < upper) if (extra->getZIndex() >= lower && extra->getZIndex() < upper)
extra->render(extrasTrans); extra->render(extrasTrans);

View file

@ -55,7 +55,7 @@ void UIModeController::monitorUIMode()
mCurrentUIMode = uimode; mCurrentUIMode = uimode;
// Reset filters and sort gamelists (which will update the game counter). // Reset filters and sort gamelists (which will update the game counter).
for (auto it = SystemData::sSystemVector.cbegin(); // Line break. for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) { it != SystemData::sSystemVector.cend(); ++it) {
(*it)->sortSystem(true); (*it)->sortSystem(true);
(*it)->getIndex()->resetFilters(); (*it)->getIndex()->resetFilters();
if ((*it)->getThemeFolder() == "custom-collections") { if ((*it)->getThemeFolder() == "custom-collections") {
@ -90,7 +90,7 @@ bool UIModeController::inputIsMatch(InputConfig* config, Input input)
for (auto valstring : mInputVals) { for (auto valstring : mInputVals) {
if (config->isMappedLike(valstring, input) && if (config->isMappedLike(valstring, input) &&
(mPassKeySequence[mPassKeyCounter] == valstring[0])) { (mPassKeySequence[mPassKeyCounter] == valstring[0])) {
mPassKeyCounter++; ++mPassKeyCounter;
return true; return true;
} }
} }

View file

@ -249,7 +249,7 @@ void ViewController::goToStart(bool playTransition)
auto requestedSystem = Settings::getInstance()->getString("StartupSystem"); auto requestedSystem = Settings::getInstance()->getString("StartupSystem");
if ("" != requestedSystem && "retropie" != requestedSystem) { if ("" != requestedSystem && "retropie" != requestedSystem) {
for (auto it = SystemData::sSystemVector.cbegin(); // Line break. for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) { it != SystemData::sSystemVector.cend(); ++it) {
if ((*it)->getName() == requestedSystem) { if ((*it)->getName() == requestedSystem) {
goToGameList(*it); goToGameList(*it);
if (!playTransition) if (!playTransition)
@ -769,7 +769,7 @@ std::shared_ptr<IGameListView> ViewController::getGameListView(SystemData* syste
if (selectedViewStyle == AUTOMATIC) { if (selectedViewStyle == AUTOMATIC) {
std::vector<FileData*> files = system->getRootFolder()->getFilesRecursive(GAME | FOLDER); std::vector<FileData*> files = system->getRootFolder()->getFilesRecursive(GAME | FOLDER);
for (auto it = files.cbegin(); it != files.cend(); it++) { for (auto it = files.cbegin(); it != files.cend(); ++it) {
if (themeHasVideoView && !(*it)->getVideoPath().empty()) { if (themeHasVideoView && !(*it)->getVideoPath().empty()) {
selectedViewStyle = VIDEO; selectedViewStyle = VIDEO;
break; break;
@ -920,7 +920,7 @@ void ViewController::render(const glm::mat4& parentTrans)
getSystemListView()->render(trans); getSystemListView()->render(trans);
// Draw the gamelists. // Draw the gamelists.
for (auto it = mGameListViews.cbegin(); it != mGameListViews.cend(); it++) { for (auto it = mGameListViews.cbegin(); it != mGameListViews.cend(); ++it) {
// Same thing as for the system view, limit the rendering only to what needs to be drawn. // Same thing as for the system view, limit the rendering only to what needs to be drawn.
if (it->second == mCurrentView || (it->second == mPreviousView && isCameraMoving())) { if (it->second == mCurrentView || (it->second == mPreviousView && isCameraMoving())) {
// Clipping. // Clipping.
@ -951,7 +951,7 @@ void ViewController::preload()
unsigned int systemCount = static_cast<int>(SystemData::sSystemVector.size()); unsigned int systemCount = static_cast<int>(SystemData::sSystemVector.size());
for (auto it = SystemData::sSystemVector.cbegin(); it != SystemData::sSystemVector.cend(); for (auto it = SystemData::sSystemVector.cbegin(); it != SystemData::sSystemVector.cend();
it++) { ++it) {
if (Settings::getInstance()->getBool("SplashScreen") && if (Settings::getInstance()->getBool("SplashScreen") &&
Settings::getInstance()->getBool("SplashScreenProgress")) { Settings::getInstance()->getBool("SplashScreenProgress")) {
mWindow->renderLoadingScreen( mWindow->renderLoadingScreen(
@ -986,7 +986,7 @@ void ViewController::preload()
void ViewController::reloadGameListView(IGameListView* view, bool reloadTheme) void ViewController::reloadGameListView(IGameListView* view, bool reloadTheme)
{ {
for (auto it = mGameListViews.cbegin(); it != mGameListViews.cend(); it++) { for (auto it = mGameListViews.cbegin(); it != mGameListViews.cend(); ++it) {
if (it->second.get() == view) { if (it->second.get() == view) {
bool isCurrent = (mCurrentView == it->second); bool isCurrent = (mCurrentView == it->second);
SystemData* system = it->first; SystemData* system = it->first;
@ -1036,14 +1036,14 @@ void ViewController::reloadAll()
// Clear all GameListViews. // Clear all GameListViews.
std::map<SystemData*, FileData*> cursorMap; std::map<SystemData*, FileData*> cursorMap;
for (auto it = mGameListViews.cbegin(); it != mGameListViews.cend(); it++) for (auto it = mGameListViews.cbegin(); it != mGameListViews.cend(); ++it)
cursorMap[it->first] = it->second->getCursor(); cursorMap[it->first] = it->second->getCursor();
mGameListViews.clear(); mGameListViews.clear();
mCurrentView = nullptr; mCurrentView = nullptr;
// Load themes, create GameListViews and reset filters. // Load themes, create GameListViews and reset filters.
for (auto it = cursorMap.cbegin(); it != cursorMap.cend(); it++) { for (auto it = cursorMap.cbegin(); it != cursorMap.cend(); ++it) {
it->first->loadTheme(); it->first->loadTheme();
it->first->getIndex()->resetFilters(); it->first->getIndex()->resetFilters();
getGameListView(it->first)->setCursor(it->second); getGameListView(it->first)->setCursor(it->second);

View file

@ -72,7 +72,7 @@ void BasicGameListView::populateList(const std::vector<FileData*>& files, FileDa
mList.clear(); mList.clear();
mHeaderText.setText(mRoot->getSystem()->getFullName()); mHeaderText.setText(mRoot->getSystem()->getFullName());
if (files.size() > 0) { if (files.size() > 0) {
for (auto it = files.cbegin(); it != files.cend(); it++) { for (auto it = files.cbegin(); it != files.cend(); ++it) {
if (!mFirstGameEntry && (*it)->getType() == GAME) if (!mFirstGameEntry && (*it)->getType() == GAME)
mFirstGameEntry = (*it); mFirstGameEntry = (*it);
// Add a leading tick mark icon to the game name if it's part of the custom collection // Add a leading tick mark icon to the game name if it's part of the custom collection

View file

@ -158,7 +158,7 @@ void DetailedGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& them
"md_lbl_rating", "md_lbl_releasedate", "md_lbl_developer", "md_lbl_publisher", "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_genre", "md_lbl_players", "md_lbl_lastplayed", "md_lbl_playcount"};
for (unsigned int i = 0; i < labels.size(); i++) for (unsigned int i = 0; i < labels.size(); ++i)
labels[i]->applyTheme(theme, getName(), lblElements[i], ALL); labels[i]->applyTheme(theme, getName(), lblElements[i], ALL);
initMDValues(); initMDValues();
@ -168,7 +168,7 @@ void DetailedGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& them
"md_publisher", "md_genre", "md_players", "md_publisher", "md_genre", "md_players",
"md_lastplayed", "md_playcount"}; "md_lastplayed", "md_playcount"};
for (unsigned int i = 0; i < values.size(); i++) for (unsigned int i = 0; i < values.size(); ++i)
values[i]->applyTheme(theme, getName(), valElements[i], ALL ^ ThemeFlags::TEXT); values[i]->applyTheme(theme, getName(), valElements[i], ALL ^ ThemeFlags::TEXT);
mDescContainer.applyTheme(theme, getName(), "md_description", mDescContainer.applyTheme(theme, getName(), "md_description",
@ -200,7 +200,7 @@ void DetailedGameListView::initMDLabels()
const float colSize = (mSize.x * 0.48f) / colCount; const float colSize = (mSize.x * 0.48f) / colCount;
const float rowPadding = 0.01f * mSize.y; const float rowPadding = 0.01f * mSize.y;
for (unsigned int i = 0; i < components.size(); i++) { for (unsigned int i = 0; i < components.size(); ++i) {
const unsigned int row = i % rowCount; const unsigned int row = i % rowCount;
glm::vec3 pos{}; glm::vec3 pos{};
if (row == 0) { if (row == 0) {
@ -236,7 +236,7 @@ void DetailedGameListView::initMDValues()
float bottom = 0.0f; float bottom = 0.0f;
const float colSize = (mSize.x * 0.48f) / 2.0f; const float colSize = (mSize.x * 0.48f) / 2.0f;
for (unsigned int i = 0; i < labels.size(); i++) { for (unsigned int i = 0; i < labels.size(); ++i) {
const float heightDiff = (labels[i]->getSize().y - values[i]->getSize().y) / 2.0f; const float heightDiff = (labels[i]->getSize().y - values[i]->getSize().y) / 2.0f;
values[i]->setPosition(labels[i]->getPosition() + values[i]->setPosition(labels[i]->getPosition() +
glm::vec3{labels[i]->getSize().x, heightDiff, 0.0f}); glm::vec3{labels[i]->getSize().x, heightDiff, 0.0f});
@ -460,7 +460,7 @@ void DetailedGameListView::updateInfoPanel()
std::vector<TextComponent*> labels = getMDLabels(); std::vector<TextComponent*> labels = getMDLabels();
comps.insert(comps.cend(), labels.cbegin(), labels.cend()); comps.insert(comps.cend(), labels.cbegin(), labels.cend());
for (auto it = comps.cbegin(); it != comps.cend(); it++) { for (auto it = comps.cbegin(); it != comps.cend(); ++it) {
GuiComponent* comp = *it; GuiComponent* comp = *it;
// An animation is playing, then animate if reverse != fadingOut. // An animation is playing, then animate if reverse != fadingOut.
// An animation is not playing, then animate if opacity != our target opacity. // An animation is not playing, then animate if opacity != our target opacity.

View file

@ -217,7 +217,7 @@ void GridGameListView::populateList(const std::vector<FileData*>& files, FileDat
mGrid.clear(); mGrid.clear();
mHeaderText.setText(mRoot->getSystem()->getFullName()); mHeaderText.setText(mRoot->getSystem()->getFullName());
if (files.size() > 0) { if (files.size() > 0) {
for (auto it = files.cbegin(); it != files.cend(); it++) { for (auto it = files.cbegin(); it != files.cend(); ++it) {
if (!firstGameEntry && (*it)->getType() == GAME) if (!firstGameEntry && (*it)->getType() == GAME)
firstGameEntry = (*it); firstGameEntry = (*it);
mGrid.add((*it)->getName(), getImagePath(*it), *it); mGrid.add((*it)->getName(), getImagePath(*it), *it);
@ -250,7 +250,7 @@ void GridGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
"md_lbl_rating", "md_lbl_releasedate", "md_lbl_developer", "md_lbl_publisher", "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_genre", "md_lbl_players", "md_lbl_lastplayed", "md_lbl_playcount"};
for (unsigned int i = 0; i < labels.size(); i++) for (unsigned int i = 0; i < labels.size(); ++i)
labels[i]->applyTheme(theme, getName(), lblElements[i], ALL); labels[i]->applyTheme(theme, getName(), lblElements[i], ALL);
initMDValues(); initMDValues();
@ -260,7 +260,7 @@ void GridGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
"md_publisher", "md_genre", "md_players", "md_publisher", "md_genre", "md_players",
"md_lastplayed", "md_playcount"}; "md_lastplayed", "md_playcount"};
for (unsigned int i = 0; i < values.size(); i++) for (unsigned int i = 0; i < values.size(); ++i)
values[i]->applyTheme(theme, getName(), valElements[i], ALL ^ ThemeFlags::TEXT); values[i]->applyTheme(theme, getName(), valElements[i], ALL ^ ThemeFlags::TEXT);
mDescContainer.applyTheme(theme, getName(), "md_description", mDescContainer.applyTheme(theme, getName(), "md_description",
@ -304,7 +304,7 @@ void GridGameListView::initMDLabels()
const float colSize = (mSize.x * 0.48f) / colCount; const float colSize = (mSize.x * 0.48f) / colCount;
const float rowPadding = 0.01f * mSize.y; const float rowPadding = 0.01f * mSize.y;
for (unsigned int i = 0; i < components.size(); i++) { for (unsigned int i = 0; i < components.size(); ++i) {
const unsigned int row = i % rowCount; const unsigned int row = i % rowCount;
glm::vec3 pos{}; glm::vec3 pos{};
if (row == 0) { if (row == 0) {
@ -340,7 +340,7 @@ void GridGameListView::initMDValues()
float bottom = 0.0f; float bottom = 0.0f;
const float colSize = (mSize.x * 0.48f) / 2.0f; const float colSize = (mSize.x * 0.48f) / 2.0f;
for (unsigned int i = 0; i < labels.size(); i++) { for (unsigned int i = 0; i < labels.size(); ++i) {
const float heightDiff = (labels[i]->getSize().y - values[i]->getSize().y) / 2.0f; const float heightDiff = (labels[i]->getSize().y - values[i]->getSize().y) / 2.0f;
values[i]->setPosition(labels[i]->getPosition() + values[i]->setPosition(labels[i]->getPosition() +
glm::vec3{labels[i]->getSize().x, heightDiff, 0.0f}); glm::vec3{labels[i]->getSize().x, heightDiff, 0.0f});
@ -486,7 +486,7 @@ void GridGameListView::updateInfoPanel()
std::vector<TextComponent*> labels = getMDLabels(); std::vector<TextComponent*> labels = getMDLabels();
comps.insert(comps.cend(), labels.cbegin(), labels.cend()); comps.insert(comps.cend(), labels.cbegin(), labels.cend());
for (auto it = comps.cbegin(); it != comps.cend(); it++) { for (auto it = comps.cbegin(); it != comps.cend(); ++it) {
GuiComponent* comp = *it; GuiComponent* comp = *it;
// An animation is playing, then animate if reverse != fadingOut. // An animation is playing, then animate if reverse != fadingOut.
// An animation is not playing, then animate if opacity != our target opacity. // An animation is not playing, then animate if opacity != our target opacity.

View file

@ -123,7 +123,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
// Check if there is an entry in the cursor stack history matching any entry // Check if there is an entry in the cursor stack history matching any entry
// in the currect folder. If so, select that entry. // in the currect folder. If so, select that entry.
for (auto it = mCursorStackHistory.begin(); // Line break. for (auto it = mCursorStackHistory.begin(); // Line break.
it != mCursorStackHistory.end(); it++) { it != mCursorStackHistory.end(); ++it) {
if (std::find(listEntries.begin(), listEntries.end(), *it) != if (std::find(listEntries.begin(), listEntries.end(), *it) !=
listEntries.end()) { listEntries.end()) {
newCursor = *it; newCursor = *it;
@ -246,7 +246,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
// remove it so we don't get multiple entries. // remove it so we don't get multiple entries.
std::vector<FileData*> listEntries = std::vector<FileData*> listEntries =
mRandomGame->getSystem()->getRootFolder()->getChildrenListToDisplay(); mRandomGame->getSystem()->getRootFolder()->getChildrenListToDisplay();
for (auto it = mCursorStackHistory.begin(); it != mCursorStackHistory.end(); it++) { for (auto it = mCursorStackHistory.begin(); it != mCursorStackHistory.end(); ++it) {
if (std::find(listEntries.begin(), listEntries.end(), *it) != if (std::find(listEntries.begin(), listEntries.end(), *it) !=
listEntries.end()) { listEntries.end()) {
mCursorStackHistory.erase(it); mCursorStackHistory.erase(it);
@ -465,7 +465,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
// onFileChanged() which will trigger populateList(). // onFileChanged() which will trigger populateList().
if (isEditing) { if (isEditing) {
for (auto it = SystemData::sSystemVector.begin(); for (auto it = SystemData::sSystemVector.begin();
it != SystemData::sSystemVector.end(); it++) { it != SystemData::sSystemVector.end(); ++it) {
ViewController::get()->getGameListView((*it))->onFileChanged( ViewController::get()->getGameListView((*it))->onFileChanged(
ViewController::get()->getGameListView((*it))->getCursor(), false); ViewController::get()->getGameListView((*it))->getCursor(), false);
} }
@ -541,7 +541,7 @@ void ISimpleGameListView::generateFirstLetterIndex(const std::vector<FileData*>&
bool foldersOnTop = Settings::getInstance()->getBool("FoldersOnTop"); bool foldersOnTop = Settings::getInstance()->getBool("FoldersOnTop");
// Find out if there are only favorites and/or only folders in the list. // Find out if there are only favorites and/or only folders in the list.
for (auto it = files.begin(); it != files.end(); it++) { for (auto it = files.begin(); it != files.end(); ++it) {
if (!((*it)->getFavorite())) if (!((*it)->getFavorite()))
onlyFavorites = false; onlyFavorites = false;
if (!((*it)->getType() == FOLDER)) if (!((*it)->getType() == FOLDER))
@ -549,7 +549,7 @@ void ISimpleGameListView::generateFirstLetterIndex(const std::vector<FileData*>&
} }
// Build the index. // Build the index.
for (auto it = files.begin(); it != files.end(); it++) { for (auto it = files.begin(); it != files.end(); ++it) {
if ((*it)->getType() == FOLDER && (*it)->getFavorite() && favoritesSorting && if ((*it)->getType() == FOLDER && (*it)->getFavorite() && favoritesSorting &&
!onlyFavorites) { !onlyFavorites) {
hasFavorites = true; hasFavorites = true;

View file

@ -179,7 +179,7 @@ void VideoGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
"md_lbl_rating", "md_lbl_releasedate", "md_lbl_developer", "md_lbl_publisher", "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_genre", "md_lbl_players", "md_lbl_lastplayed", "md_lbl_playcount"};
for (unsigned int i = 0; i < labels.size(); i++) for (unsigned int i = 0; i < labels.size(); ++i)
labels[i]->applyTheme(theme, getName(), lblElements[i], ALL); labels[i]->applyTheme(theme, getName(), lblElements[i], ALL);
initMDValues(); initMDValues();
@ -189,7 +189,7 @@ void VideoGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
"md_publisher", "md_genre", "md_players", "md_publisher", "md_genre", "md_players",
"md_lastplayed", "md_playcount"}; "md_lastplayed", "md_playcount"};
for (unsigned int i = 0; i < values.size(); i++) for (unsigned int i = 0; i < values.size(); ++i)
values[i]->applyTheme(theme, getName(), valElements[i], ALL ^ ThemeFlags::TEXT); values[i]->applyTheme(theme, getName(), valElements[i], ALL ^ ThemeFlags::TEXT);
mDescContainer.applyTheme(theme, getName(), "md_description", mDescContainer.applyTheme(theme, getName(), "md_description",
@ -221,7 +221,7 @@ void VideoGameListView::initMDLabels()
const float colSize = (mSize.x * 0.48f) / colCount; const float colSize = (mSize.x * 0.48f) / colCount;
const float rowPadding = 0.01f * mSize.y; const float rowPadding = 0.01f * mSize.y;
for (unsigned int i = 0; i < components.size(); i++) { for (unsigned int i = 0; i < components.size(); ++i) {
const unsigned int row = i % rowCount; const unsigned int row = i % rowCount;
glm::vec3 pos{}; glm::vec3 pos{};
if (row == 0) { if (row == 0) {
@ -257,7 +257,7 @@ void VideoGameListView::initMDValues()
float bottom = 0.0f; float bottom = 0.0f;
const float colSize = (mSize.x * 0.48f) / 2.0f; const float colSize = (mSize.x * 0.48f) / 2.0f;
for (unsigned int i = 0; i < labels.size(); i++) { for (unsigned int i = 0; i < labels.size(); ++i) {
const float heightDiff = (labels[i]->getSize().y - values[i]->getSize().y) / 2.0f; const float heightDiff = (labels[i]->getSize().y - values[i]->getSize().y) / 2.0f;
values[i]->setPosition(labels[i]->getPosition() + values[i]->setPosition(labels[i]->getPosition() +
glm::vec3{labels[i]->getSize().x, heightDiff, 0.0f}); glm::vec3{labels[i]->getSize().x, heightDiff, 0.0f});
@ -499,7 +499,7 @@ void VideoGameListView::updateInfoPanel()
std::vector<TextComponent*> labels = getMDLabels(); std::vector<TextComponent*> labels = getMDLabels();
comps.insert(comps.cend(), labels.cbegin(), labels.cend()); comps.insert(comps.cend(), labels.cbegin(), labels.cend());
for (auto it = comps.cbegin(); it != comps.cend(); it++) { for (auto it = comps.cbegin(); it != comps.cend(); ++it) {
GuiComponent* comp = *it; GuiComponent* comp = *it;
// An animation is playing, then animate if reverse != fadingOut. // An animation is playing, then animate if reverse != fadingOut.
// An animation is not playing, then animate if opacity != our target opacity // An animation is not playing, then animate if opacity != our target opacity