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

View file

@ -140,7 +140,7 @@ const std::vector<FileData*> FileData::getChildrenRecursive() const
{
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);
// Recurse through any subdirectories.
if ((*it).second->getType() == FOLDER) {
@ -221,7 +221,7 @@ const std::string FileData::getMediafilePath(const std::string& subdirectory) co
subFolders + "/" + getDisplayName();
// 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];
if (Utils::FileSystem::exists(mediaPath))
return mediaPath;
@ -319,7 +319,7 @@ const std::string FileData::getVideoPath() const
getMediaDirectory() + mSystemName + "/videos" + subFolders + "/" + getDisplayName();
// 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];
if (Utils::FileSystem::exists(mediaPath))
return mediaPath;
@ -333,7 +333,7 @@ const std::vector<FileData*>& FileData::getChildrenListToDisplay()
FileFilterIndex* idx = mSystem->getIndex();
if (idx->isFiltered() || UIModeController::getInstance()->isUIModeKid()) {
mFilteredChildren.clear();
for (auto it = mChildren.cbegin(); it != mChildren.cend(); it++) {
for (auto it = mChildren.cbegin(); it != mChildren.cend(); ++it) {
if (idx->showFile((*it))) {
mFilteredChildren.emplace_back(*it);
}
@ -352,7 +352,7 @@ std::vector<FileData*> FileData::getFilesRecursive(unsigned int typeMask,
std::vector<FileData*> out;
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 (!displayedOnly || !idx->isFiltered() || idx->showFile(*it)) {
if (countAllGames)
@ -367,7 +367,7 @@ std::vector<FileData*> FileData::getFilesRecursive(unsigned int typeMask,
out.insert(out.cend(), subChildren.cbegin(), subChildren.cend());
}
else {
for (auto it2 = subChildren.cbegin(); it2 != subChildren.cend(); it2++) {
for (auto it2 = subChildren.cbegin(); it2 != subChildren.cend(); ++it2) {
if ((*it2)->getCountAsGame())
out.emplace_back(*it2);
}
@ -384,7 +384,7 @@ std::vector<FileData*> FileData::getScrapeFilesRecursive(bool includeFolders,
{
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 (!(respectExclusions && (*it)->getExcludeFromScraper()))
out.emplace_back(*it);
@ -443,7 +443,7 @@ void FileData::removeChild(FileData* file)
assert(mType == FOLDER);
assert(file->getParent() == this);
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) {
file->mParent = nullptr;
mChildren.erase(it);
@ -484,7 +484,7 @@ void FileData::sort(ComparisonFunction& comparator,
!(*it)->getSystem()->isGroupedCustomCollection())
it = mChildren.erase(it);
else
it++;
++it;
}
}
@ -492,7 +492,7 @@ void FileData::sort(ComparisonFunction& comparator,
// The individual collections are however sorted as any normal systems/folders.
if (mSystem->isCollection() && mSystem->getFullName() == "collections") {
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)
(*it)->sort(comparator, gameCount);
tempGameCount.first += gameCount.first;
@ -504,7 +504,7 @@ void FileData::sort(ComparisonFunction& comparator,
}
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) {
mChildrenFolders.emplace_back(mChildren[i]);
}
@ -545,13 +545,13 @@ void FileData::sort(ComparisonFunction& 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.
if ((*it)->getType() == GAME && (*it)->getCountAsGame()) {
if (!isKidMode || (isKidMode && (*it)->getKidgame())) {
gameCount.first++;
++gameCount.first;
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.
if (mSystem->isCollection() && mSystem->getFullName() == "collections") {
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)
(*it)->sortFavoritesOnTop(comparator, gameCount);
tempGameCount.first += gameCount.first;
@ -600,7 +600,7 @@ void FileData::sortFavoritesOnTop(ComparisonFunction& comparator,
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,
// 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
@ -615,9 +615,9 @@ void FileData::sortFavoritesOnTop(ComparisonFunction& comparator,
// Game count, which will be displayed in the system view.
if (mChildren[i]->getType() == GAME && mChildren[i]->getCountAsGame()) {
if (!isKidMode || (isKidMode && mChildren[i]->getKidgame())) {
gameCount.first++;
++gameCount.first;
if (mChildren[i]->getFavorite())
gameCount.second++;
++gameCount.second;
}
}
@ -681,13 +681,13 @@ void FileData::sortFavoritesOnTop(ComparisonFunction& comparator,
// Iterate through any child favorite folders.
for (auto it = mChildrenFavoritesFolders.cbegin(); // Line break.
it != mChildrenFavoritesFolders.cend(); it++) {
it != mChildrenFavoritesFolders.cend(); ++it) {
if ((*it)->getChildren().size() > 0)
(*it)->sortFavoritesOnTop(comparator, gameCount);
}
// 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)
(*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
// any folders that we need to iterate.
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)
(*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()->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 (!isKidMode || (isKidMode && mChildren[i]->getKidgame())) {
gameCount.first++;
++gameCount.first;
if (mChildren[i]->getFavorite())
gameCount.second++;
++gameCount.second;
}
}
// Iterate through any folders.
@ -750,7 +750,7 @@ const FileData::SortType& FileData::getSortTypeFromString(const std::string& des
{
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);
if (sort.description == desc)
return sort;
@ -936,7 +936,7 @@ void FileData::launchGame(Window* window)
else {
if (hasQuotationMark) {
command = command.replace(emuPathPos + quotationMarkPos, 1, "");
emuPathPos--;
--emuPathPos;
command = command.replace(emuPathPos, 1, "");
}
coreFile = Utils::FileSystem::getEscapedPath(coreFile);

View file

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

View file

@ -78,7 +78,7 @@ FileData* findOrCreateFile(SystemData* system, const std::string& path, FileType
treeNode = folder;
}
path_it++;
++path_it;
}
return nullptr;
@ -146,7 +146,7 @@ void parseGamelist(SystemData* system)
std::vector<std::string> tagList = {"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];
FileType type = typeList[i];
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);
// Iterate through all files, checking if they're already in the XML file.
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";
// 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
root.remove_child(fileNode);
if ((*fit)->getDeletionFlag())
numUpdated++;
++numUpdated;
break;
}
}
@ -366,7 +366,7 @@ void updateGamelist(SystemData* system, bool updateAlternativeEmulator)
if (!(*fit)->getDeletionFlag()) {
addFileDataNode(root, *fit, tag, system);
(*fit)->metadata.resetChangedFlag();
numUpdated++;
++numUpdated;
}
}

View file

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

View file

@ -91,8 +91,8 @@ MetaDataList::MetaDataList(MetaDataListType type)
, mWasChanged(false)
{
const std::vector<MetaDataDecl>& mdd = getMDD();
for (auto iter = mdd.cbegin(); iter != mdd.cend(); iter++)
set(iter->key, iter->defaultValue);
for (auto it = mdd.cbegin(); it != mdd.cend(); ++it)
set(it->key, it->defaultValue);
}
MetaDataList MetaDataList::createFromXML(MetaDataListType type,
@ -103,17 +103,17 @@ MetaDataList MetaDataList::createFromXML(MetaDataListType type,
const std::vector<MetaDataDecl>& mdd = mdl.getMDD();
for (auto iter = mdd.cbegin(); iter != mdd.cend(); iter++) {
pugi::xml_node md = node.child(iter->key.c_str());
for (auto it = mdd.cbegin(); it != mdd.cend(); ++it) {
pugi::xml_node md = node.child(it->key.c_str());
if (md && !md.text().empty()) {
// If it's a path, resolve relative paths.
std::string value = md.text().get();
if (iter->type == MD_PATH)
if (it->type == MD_PATH)
value = Utils::FileSystem::resolveRelativePath(value, relativeTo, true);
mdl.set(iter->key, value);
mdl.set(it->key, value);
}
else {
mdl.set(iter->key, iter->defaultValue);
mdl.set(it->key, it->defaultValue);
}
}
return mdl;
@ -125,17 +125,17 @@ void MetaDataList::appendToXML(pugi::xml_node& parent,
{
const std::vector<MetaDataDecl>& mdd = getMDD();
for (auto mddIter = mdd.cbegin(); mddIter != mdd.cend(); mddIter++) {
auto mapIter = mMap.find(mddIter->key);
for (auto it = mdd.cbegin(); it != mdd.cend(); ++it) {
auto mapIter = mMap.find(it->key);
if (mapIter != mMap.cend()) {
// We have this value!
// 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;
// Try and make paths relative if we can.
std::string value = mapIter->second;
if (mddIter->type == MD_PATH)
if (it->type == MD_PATH)
value = Utils::FileSystem::createRelativePath(value, relativeTo, true);
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);
green += screenshotImage(c, r, 0, 1);
blue += screenshotImage(c, r, 0, 2);
counter++;
++counter;
}
if (counter > 0) {

View file

@ -143,7 +143,7 @@ namespace PlatformIds
if (str == "")
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)
return (PlatformId)i;
}

View file

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

View file

@ -433,13 +433,13 @@ void SystemScreensaver::update(int deltaTime)
void SystemScreensaver::generateImageList()
{
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.
if (!(*it)->isGameSystem() || (*it)->isCollection())
continue;
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();
if (imagePath != "")
mImageFiles.push_back((*it2));
@ -450,13 +450,13 @@ void SystemScreensaver::generateImageList()
void SystemScreensaver::generateVideoList()
{
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.
if (!(*it)->isGameSystem() || (*it)->isCollection())
continue;
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();
if (videoPath != "")
mVideoFiles.push_back((*it2));
@ -479,7 +479,7 @@ void SystemScreensaver::generateCustomImageList()
Utils::FileSystem::stringList dirContent = Utils::FileSystem::getDirContent(
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 (imageFilter.find(Utils::FileSystem::getExtension(*it)) != std::string::npos)
mImageCustomFiles.push_back(*it);

View file

@ -29,7 +29,7 @@ GuiAlternativeEmulators::GuiAlternativeEmulators(Window* window)
labelSizeX += 8.0f * Renderer::getScreenHeightModifier();
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
// has an invalid entry.

View file

@ -51,7 +51,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st
// Add automatic systems.
for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it =
autoSystems.cbegin();
it != autoSystems.cend(); it++)
it != autoSystems.cend(); ++it)
collection_systems_auto->add(it->second.decl.fullName, it->second.decl.name,
it->second.isEnabled);
addWithLabel("AUTOMATIC GAME COLLECTIONS", collection_systems_auto);
@ -100,7 +100,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st
// Add custom systems.
for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it =
customSystems.cbegin();
it != customSystems.cend(); it++)
it != customSystems.cend(); ++it)
collection_systems_custom->add(it->second.decl.fullName, it->second.decl.name,
it->second.isEnabled);
@ -168,7 +168,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(Window* window, std::st
std::make_shared<OptionListComponent<std::string>>(mWindow, getHelpStyle(),
"SELECT THEME FOLDER", true);
// Add custom systems.
for (auto it = unusedFolders.cbegin(); it != unusedFolders.cend(); it++) {
for (auto it = unusedFolders.cbegin(); it != unusedFolders.cend(); ++it) {
ComponentListRow row;
std::string name = *it;
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);
for (std::map<std::string, CollectionSystemData, stringComparator>::const_iterator it =
customSystems.cbegin();
it != customSystems.cend(); it++) {
it != customSystems.cend(); ++it) {
ComponentListRow row;
std::string name = (*it).first;
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
// deleted was activated, then exclude it.
for (auto it = selectedCustomCollections.begin();
it != selectedCustomCollections.end(); it++) {
it != selectedCustomCollections.end(); ++it) {
if ((*it) != name) {
if ((*it) != selectedCustomCollections.front() &&
collectionsConfigEntry != "")

View file

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

View file

@ -104,7 +104,7 @@ GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system)
mJumpToLetterList->setKeyRepeat(true, 650, 200);
// 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);
if (mFirstLetterIndex[i] == mCurrentFirstCharacter)
mJumpToLetterList->selectEntry(i);
@ -129,7 +129,7 @@ GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system)
if (!root->getSystem()->isCollection())
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);
if (sort.description == sortType)
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
// currently being edited. This is done cheaply using onFileChanged() which will trigger
// 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))->getCursor(), false);
}
@ -393,7 +393,7 @@ void GuiGamelistOptions::openMetaDataEd()
// Manually reset all the metadata values, set the name to the actual file/folder name.
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 (file->isArcadeGame()) {
// 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 =
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 ||
mFirstLetterIndex.front() == ViewController::FOLDER_CHAR)) {
if (static_cast<char>(toupper(files.at(i)->getSortName().front())) == letter &&
@ -501,7 +501,7 @@ void GuiGamelistOptions::jumpToFirstRow()
getGamelist()->getCursor()->getParent()->getChildrenListToDisplay();
// 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.
for (auto it = files.cbegin(); it != files.cend(); it++) {
for (auto it = files.cbegin(); it != files.cend(); ++it) {
if (!mOnlyHasFolders && mFoldersOnTop && (*it)->getType() == FOLDER) {
continue;
}

View file

@ -149,7 +149,7 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game)
float totalRowHeight = 0.0f;
// 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);
setSize(mSize.x, totalRowHeight);

View file

@ -103,7 +103,7 @@ void GuiMenu::openUIOptions()
mWindow, getHelpStyle(), "GAMELIST ON STARTUP", false);
startup_system->add("NONE", "", Settings::getInstance()->getString("StartupSystem") == "");
for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) {
it != SystemData::sSystemVector.cend(); ++it) {
if ((*it)->getName() != "retropie") {
// If required, abbreviate the system name so it doesn't overlap the setting name.
float maxNameLength = mSize.x * 0.48f;
@ -153,7 +153,7 @@ void GuiMenu::openUIOptions()
transitions.push_back("slide");
transitions.push_back("fade");
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,
Settings::getInstance()->getString("TransitionStyle") == *it);
s->addWithLabel("TRANSITION STYLE", transition_style);
@ -174,7 +174,7 @@ void GuiMenu::openUIOptions()
selectedSet = themeSets.cbegin();
auto theme_set = std::make_shared<OptionListComponent<std::string>>(mWindow, getHelpStyle(),
"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.
float maxNameLength = mSize.x * 0.62f;
theme_set->add(it->first, it->first, it == selectedSet, maxNameLength);
@ -215,7 +215,7 @@ void GuiMenu::openUIOptions()
setMode = "kid";
else
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);
s->addWithLabel("UI MODE", ui_mode);
s->addSaveFunc([ui_mode, this, s] {
@ -253,7 +253,7 @@ void GuiMenu::openUIOptions()
Settings::getInstance()->saveFile();
UIModeController::getInstance()->setCurrentUIMode(selectedMode);
for (auto it = SystemData::sSystemVector.cbegin();
it != SystemData::sSystemVector.cend(); it++) {
it != SystemData::sSystemVector.cend(); ++it) {
if ((*it)->getThemeFolder() == "custom-collections") {
for (FileData* customSystem :
(*it)->getRootFolder()->getChildrenListToDisplay())
@ -293,7 +293,7 @@ void GuiMenu::openUIOptions()
std::make_shared<SortList>(mWindow, getHelpStyle(), "DEFAULT SORT ORDER", false);
// Exclude the System sort options.
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 ==
Settings::getInstance()->getString("DefaultSortOrder")) {
sortOrder = FileSorts::SortTypes[i].description;
@ -304,7 +304,7 @@ void GuiMenu::openUIOptions()
// sort order 'filename, ascending'.
if (sortOrder == "")
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];
if (sort.description == sortOrder)
default_sort_order->add(sort.description, &sort, true);
@ -861,7 +861,7 @@ void GuiMenu::openOtherOptions()
displayIndex.push_back("2");
displayIndex.push_back("3");
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,
Settings::getInstance()->getInt("DisplayIndex") == atoi((*it).c_str()));
s->addWithLabel("DISPLAY/MONITOR INDEX (REQUIRES RESTART)", display_index);
@ -881,7 +881,7 @@ void GuiMenu::openOtherOptions()
std::vector<std::string> screenmode;
screenmode.push_back("normal");
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);
s->addWithLabel("FULLSCREEN MODE (REQUIRES RESTART)", fullscreen_mode);
s->addSaveFunc([fullscreen_mode, s] {
@ -943,7 +943,7 @@ void GuiMenu::openOtherOptions()
saveModes.push_back("on exit");
saveModes.push_back("always");
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,
Settings::getInstance()->getString("SaveGamelistsMode") == *it);
}
@ -957,7 +957,7 @@ void GuiMenu::openOtherOptions()
// be changes that will otherwise be lost.
if (Settings::getInstance()->getString("SaveGamelistsMode") == "always") {
for (auto it = SystemData::sSystemVector.cbegin();
it != SystemData::sSystemVector.cend(); it++)
it != SystemData::sSystemVector.cend(); ++it)
(*it)->writeMetaData();
}
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});
// 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::string currentKey = iter->key;
std::string originalValue = mMetaData->get(iter->key);
std::string currentKey = it->key;
std::string originalValue = mMetaData->get(it->key);
std::string gamePath;
// Don't add statistics.
if (iter->isStatistic)
if (it->isStatistic)
continue;
// Don't show the alternative emulator entry if the corresponding option has been disabled.
if (!Settings::getInstance()->getBool("AlternativeEmulatorPerGame") &&
iter->type == MD_ALT_EMULATOR) {
it->type == MD_ALT_EMULATOR) {
ed = std::make_shared<TextComponent>(
window, "", Font::get(FONT_SIZE_SMALL, FONT_PATH_LIGHT), 0x777777FF, ALIGN_RIGHT);
assert(ed);
ed->setValue(mMetaData->get(iter->key));
ed->setValue(mMetaData->get(it->key));
mEditors.push_back(ed);
continue;
}
@ -133,12 +133,11 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
// 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.
ComponentListRow row;
auto lbl =
std::make_shared<TextComponent>(mWindow, Utils::String::toUpper(iter->displayName),
auto lbl = std::make_shared<TextComponent>(mWindow, Utils::String::toUpper(it->displayName),
Font::get(FONT_SIZE_SMALL), 0x777777FF);
row.addElement(lbl, true); // Label.
switch (iter->type) {
switch (it->type) {
case MD_BOOL: {
ed = std::make_shared<SwitchComponent>(window);
// Make the switches slightly smaller.
@ -195,7 +194,7 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
bracket->setResize(glm::vec2{0.0f, lbl->getFont()->getLetterHeight()});
row.addElement(bracket, false);
const std::string title = iter->displayPrompt;
const std::string title = it->displayPrompt;
// OK callback (apply new value to ed).
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()});
row.addElement(bracket, false);
const std::string title = iter->displayPrompt;
const std::string title = it->displayPrompt;
// OK callback (apply new value to ed).
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()});
row.addElement(bracket, false);
bool multiLine = iter->type == MD_MULTILINE_STRING;
const std::string title = iter->displayPrompt;
bool multiLine = it->type == MD_MULTILINE_STRING;
const std::string title = it->displayPrompt;
gamePath = Utils::FileSystem::getStem(mScraperParams.game->getPath());
@ -473,18 +472,18 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window,
assert(ed);
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);
}
else if (iter->type == MD_CONTROLLER && mMetaData->get(iter->key) != "") {
std::string displayName = BadgeComponent::getDisplayName(mMetaData->get(iter->key));
else if (it->type == MD_CONTROLLER && mMetaData->get(it->key) != "") {
std::string displayName = BadgeComponent::getDisplayName(mMetaData->get(it->key));
if (displayName != "unknown")
ed->setValue(displayName);
else
ed->setValue(ViewController::EXCLAMATION_CHAR + " " + mMetaData->get(iter->key));
ed->setValue(ViewController::EXCLAMATION_CHAR + " " + mMetaData->get(it->key));
}
else {
ed->setValue(mMetaData->get(iter->key));
ed->setValue(mMetaData->get(it->key));
}
mEditors.push_back(ed);
@ -609,7 +608,7 @@ void GuiMetaDataEd::save()
bool hideGameWhileHidden = 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)
continue;
@ -730,7 +729,7 @@ void GuiMetaDataEd::fetchDone(const ScraperSearchResult& result)
// Check if any values were manually changed before starting the scraping.
// If so, it's these values we should compare against when scraping, not
// 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;
if (metadata->get(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);
// 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;
if (key == "controller" && 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.
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;
std::string mMetaDataValue = mMetaData->get(key);
std::string mEditorsValue = mEditors.at(i)->getValue();

View file

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

View file

@ -30,7 +30,7 @@ GuiScraperMenu::GuiScraperMenu(Window* window, std::string title)
std::vector<std::string> scrapers = getScraperList();
// Select either the first entry or the one read from the settings,
// 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"));
// 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.
@ -104,7 +104,7 @@ GuiScraperMenu::GuiScraperMenu(Window* window, std::string title)
// Add systems (all systems with an existing platform ID are listed).
mSystems = std::make_shared<OptionListComponent<SystemData*>>(mWindow, getHelpStyle(),
"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)) {
mSystems->add(SystemData::sSystemVector[i]->getFullName(), SystemData::sSystemVector[i],
!SystemData::sSystemVector[i]->getPlatformIds().empty());
@ -155,9 +155,9 @@ GuiScraperMenu::~GuiScraperMenu()
// remembered throughout the program session.
std::vector<SystemData*> sys = mSystems->getSelectedObjects();
for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) {
it != SystemData::sSystemVector.cend(); ++it) {
(*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())
(*it)->setScrapeFlag(true);
}
@ -658,7 +658,7 @@ void GuiScraperMenu::openOfflineGenerator(GuiSettings* settings)
std::queue<FileData*> gameQueue;
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();
// Sort the games by "filename, ascending".
@ -953,7 +953,7 @@ void GuiScraperMenu::pressedStart()
mMenu.save();
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()) {
std::string warningString;
if (sys.size() == 1) {
@ -1070,12 +1070,12 @@ std::queue<ScraperSearchParams> GuiScraperMenu::getSearches(std::vector<SystemDa
GameFilterFunc selector)
{
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(
Settings::getInstance()->getBool("ScraperIncludeFolders"),
Settings::getInstance()->getBool("ScraperExcludeRecursively"),
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))) {
ScraperSearchParams search;
search.game = *game;

View file

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

View file

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

View file

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

View file

@ -42,7 +42,7 @@ GuiScreensaverOptions::GuiScreensaverOptions(Window* window, const std::string&
screensavers.push_back("black");
screensavers.push_back("slideshow");
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,
Settings::getInstance()->getString("ScreensaverType") == *it);
addWithLabel("SCREENSAVER TYPE", screensaver_type);

View file

@ -56,7 +56,7 @@ void GuiSettings::save()
if (!mSaveFuncs.size())
return;
for (auto it = mSaveFuncs.cbegin(); it != mSaveFuncs.cend(); it++)
for (auto it = mSaveFuncs.cbegin(); it != mSaveFuncs.cend(); ++it)
(*it)();
if (mNeedsSaving)
@ -72,7 +72,7 @@ void GuiSettings::save()
if (mNeedsSorting) {
for (auto it = SystemData::sSystemVector.cbegin(); it != SystemData::sSystemVector.cend();
it++) {
++it) {
if (!(!mNeedsSortingCollections && (*it)->isCollection()))
(*it)->sortSystem(true);
@ -84,7 +84,7 @@ void GuiSettings::save()
if (mNeedsResetFilters) {
for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) {
it != SystemData::sSystemVector.cend(); ++it) {
if ((*it)->getThemeFolder() == "custom-collections") {
for (FileData* customSystem : (*it)->getRootFolder()->getChildrenListToDisplay())
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(),
// 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 (i >= argc - 1) {
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.
if (strcmp(argv[i], "--home") == 0) {
i++; // Skip the argument value.
++i; // Skip the argument value.
continue;
}
if (strcmp(argv[i], "--display") == 0) {
@ -216,7 +216,7 @@ bool parseArgs(int argc, char* argv[])
int DisplayIndex = atoi(argv[i + 1]);
Settings::getInstance()->setInt("DisplayIndex", DisplayIndex);
settingsNeedSaving = true;
i++;
++i;
}
else if (strcmp(argv[i], "--resolution") == 0) {
if (i >= argc - 2) {
@ -271,7 +271,7 @@ bool parseArgs(int argc, char* argv[])
}
int rotate = atoi(argv[i + 1]);
Settings::getInstance()->setInt("ScreenRotate", rotate);
i++;
++i;
}
// On Unix, enable settings for the fullscreen mode.
// 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;
Settings::getInstance()->setBool("VSync", vSync);
i++;
++i;
}
else if (strcmp(argv[i], "--max-vram") == 0) {
if (i >= argc - 1) {
@ -312,7 +312,7 @@ bool parseArgs(int argc, char* argv[])
int maxVRAM = atoi(argv[i + 1]);
Settings::getInstance()->setInt("MaxVRAM", maxVRAM);
settingsNeedSaving = true;
i++;
++i;
}
else if (strcmp(argv[i], "--no-splash") == 0) {
Settings::getInstance()->setBool("SplashScreen", false);

View file

@ -183,7 +183,7 @@ void thegamesdb_generate_json_scraper_requests(
bool first = true;
platformQueryParam += "&filter%5Bplatform%5D=";
for (auto platformIt = platforms.cbegin(); // Line break.
platformIt != platforms.cend(); platformIt++) {
platformIt != platforms.cend(); ++platformIt) {
auto mapIt = gamesdb_new_platformid_map.find(*platformIt);
if (mapIt != gamesdb_new_platformid_map.cend()) {
if (!first)
@ -258,7 +258,7 @@ namespace
std::string out = "";
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]));
if (mapIt == resources.gamesdb_new_developers_map.cend())
@ -280,7 +280,7 @@ namespace
std::string out = "";
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]));
if (mapIt == resources.gamesdb_new_publishers_map.cend())
@ -302,7 +302,7 @@ namespace
std::string out = "";
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]));
if (mapIt == resources.gamesdb_new_genres_map.cend())
@ -375,7 +375,7 @@ void processMediaURLs(const Value& images,
ScraperSearchResult result;
// 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();
const Value& gameMedia = images[it->name];
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
// returned and we don't want to crash the program due to malformed data.
if (gameMedia.IsArray()) {
for (SizeType i = 0; i < gameMedia.Size(); i++) {
for (SizeType i = 0; i < gameMedia.Size(); ++i) {
std::string mediatype;
std::string mediaside;
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
// request allowance counter is reset.
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 =
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"];
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];
try {
processGame(v, results);

View file

@ -93,7 +93,7 @@ void TheGamesDBJSONRequestResources::ensureResources()
if (checkLoaded())
return;
for (int i = 0; i < MAX_WAIT_ITER; i++) {
for (int i = 0; i < MAX_WAIT_ITER; ++i) {
if (gamesdb_developers_resource_request &&
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()];
for (Value::ConstMemberIterator itr = data.MemberBegin(); itr != data.MemberEnd(); itr++) {
auto& entry = itr->value;
for (Value::ConstMemberIterator it = data.MemberBegin(); it != data.MemberEnd(); ++it) {
auto& entry = it->value;
if (!entry.IsObject() || !entry.HasMember("id") || !entry["id"].IsInt() ||
!entry.HasMember("name") || !entry["name"].IsString())
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> 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);
return list;
@ -257,7 +257,7 @@ MDResolveHandle::MDResolveHandle(const ScraperSearchResult& result,
#endif
}
for (auto it = scrapeFiles.cbegin(); it != scrapeFiles.cend(); it++) {
for (auto it = scrapeFiles.cbegin(); it != scrapeFiles.cend(); ++it) {
std::string ext;
@ -384,7 +384,7 @@ void MDResolveHandle::update()
it = mFuncs.erase(it);
continue;
}
it++;
++it;
}
if (mFuncs.empty())
@ -477,11 +477,11 @@ void MediaDownloadHandle::update()
// Skip the first line as this can apparently lead to false positives.
FreeImage_GetPixelColor(tempImage, 0, 1, &firstPixel);
for (unsigned int x = 0; x < width; x++) {
for (unsigned int x = 0; x < width; ++x) {
if (!emptyImage)
break;
// 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);
if (currPixel.rgbBlue != firstPixel.rgbBlue ||
currPixel.rgbGreen != firstPixel.rgbGreen ||

View file

@ -195,7 +195,7 @@ void screenscraper_generate_scraper_requests(const ScraperSearchParams& params,
std::vector<unsigned short> p_ids;
// 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);
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());
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 += HttpReq::urlEncode(std::to_string(*platform));
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
// name. But it's basically impossible to know which is the case, and we really can't
// 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"));
if (gameName.substr(0, 12) == "ZZZ(NOTGAME)") {
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
// but the second platform contains the relevant game,
// 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 name = game.child("nom").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.
i <= center + logoCount / 2 + bufferRight; i++) {
i <= center + logoCount / 2 + bufferRight; ++i) {
int index = i;
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)});
for (int i = extrasCenter + logoBuffersLeft[bufferIndex];
i <= extrasCenter + logoBuffersRight[bufferIndex]; i++) {
i <= extrasCenter + logoBuffersRight[bufferIndex]; ++i) {
int index = i;
while (index < 0)
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>(mSize.x), static_cast<int>(mSize.y)});
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];
if (extra->getZIndex() >= lower && extra->getZIndex() < upper)
extra->render(extrasTrans);

View file

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

View file

@ -249,7 +249,7 @@ void ViewController::goToStart(bool playTransition)
auto requestedSystem = Settings::getInstance()->getString("StartupSystem");
if ("" != requestedSystem && "retropie" != requestedSystem) {
for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); it++) {
it != SystemData::sSystemVector.cend(); ++it) {
if ((*it)->getName() == requestedSystem) {
goToGameList(*it);
if (!playTransition)
@ -769,7 +769,7 @@ std::shared_ptr<IGameListView> ViewController::getGameListView(SystemData* syste
if (selectedViewStyle == AUTOMATIC) {
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()) {
selectedViewStyle = VIDEO;
break;
@ -920,7 +920,7 @@ void ViewController::render(const glm::mat4& parentTrans)
getSystemListView()->render(trans);
// 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.
if (it->second == mCurrentView || (it->second == mPreviousView && isCameraMoving())) {
// Clipping.
@ -951,7 +951,7 @@ void ViewController::preload()
unsigned int systemCount = static_cast<int>(SystemData::sSystemVector.size());
for (auto it = SystemData::sSystemVector.cbegin(); it != SystemData::sSystemVector.cend();
it++) {
++it) {
if (Settings::getInstance()->getBool("SplashScreen") &&
Settings::getInstance()->getBool("SplashScreenProgress")) {
mWindow->renderLoadingScreen(
@ -986,7 +986,7 @@ void ViewController::preload()
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) {
bool isCurrent = (mCurrentView == it->second);
SystemData* system = it->first;
@ -1036,14 +1036,14 @@ void ViewController::reloadAll()
// Clear all GameListViews.
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();
mGameListViews.clear();
mCurrentView = nullptr;
// 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->getIndex()->resetFilters();
getGameListView(it->first)->setCursor(it->second);

View file

@ -72,7 +72,7 @@ void BasicGameListView::populateList(const std::vector<FileData*>& files, FileDa
mList.clear();
mHeaderText.setText(mRoot->getSystem()->getFullName());
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)
mFirstGameEntry = (*it);
// 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_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);
initMDValues();
@ -168,7 +168,7 @@ void DetailedGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& them
"md_publisher", "md_genre", "md_players",
"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);
mDescContainer.applyTheme(theme, getName(), "md_description",
@ -200,7 +200,7 @@ void DetailedGameListView::initMDLabels()
const float colSize = (mSize.x * 0.48f) / colCount;
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;
glm::vec3 pos{};
if (row == 0) {
@ -236,7 +236,7 @@ void DetailedGameListView::initMDValues()
float bottom = 0.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;
values[i]->setPosition(labels[i]->getPosition() +
glm::vec3{labels[i]->getSize().x, heightDiff, 0.0f});
@ -460,7 +460,7 @@ void DetailedGameListView::updateInfoPanel()
std::vector<TextComponent*> labels = getMDLabels();
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;
// An animation is playing, then animate if reverse != fadingOut.
// 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();
mHeaderText.setText(mRoot->getSystem()->getFullName());
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)
firstGameEntry = (*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_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);
initMDValues();
@ -260,7 +260,7 @@ void GridGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
"md_publisher", "md_genre", "md_players",
"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);
mDescContainer.applyTheme(theme, getName(), "md_description",
@ -304,7 +304,7 @@ void GridGameListView::initMDLabels()
const float colSize = (mSize.x * 0.48f) / colCount;
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;
glm::vec3 pos{};
if (row == 0) {
@ -340,7 +340,7 @@ void GridGameListView::initMDValues()
float bottom = 0.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;
values[i]->setPosition(labels[i]->getPosition() +
glm::vec3{labels[i]->getSize().x, heightDiff, 0.0f});
@ -486,7 +486,7 @@ void GridGameListView::updateInfoPanel()
std::vector<TextComponent*> labels = getMDLabels();
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;
// An animation is playing, then animate if reverse != fadingOut.
// 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
// in the currect folder. If so, select that entry.
for (auto it = mCursorStackHistory.begin(); // Line break.
it != mCursorStackHistory.end(); it++) {
it != mCursorStackHistory.end(); ++it) {
if (std::find(listEntries.begin(), listEntries.end(), *it) !=
listEntries.end()) {
newCursor = *it;
@ -246,7 +246,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
// remove it so we don't get multiple entries.
std::vector<FileData*> listEntries =
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) !=
listEntries.end()) {
mCursorStackHistory.erase(it);
@ -465,7 +465,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
// onFileChanged() which will trigger populateList().
if (isEditing) {
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))->getCursor(), false);
}
@ -541,7 +541,7 @@ void ISimpleGameListView::generateFirstLetterIndex(const std::vector<FileData*>&
bool foldersOnTop = Settings::getInstance()->getBool("FoldersOnTop");
// 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()))
onlyFavorites = false;
if (!((*it)->getType() == FOLDER))
@ -549,7 +549,7 @@ void ISimpleGameListView::generateFirstLetterIndex(const std::vector<FileData*>&
}
// 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 &&
!onlyFavorites) {
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_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);
initMDValues();
@ -189,7 +189,7 @@ void VideoGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
"md_publisher", "md_genre", "md_players",
"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);
mDescContainer.applyTheme(theme, getName(), "md_description",
@ -221,7 +221,7 @@ void VideoGameListView::initMDLabels()
const float colSize = (mSize.x * 0.48f) / colCount;
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;
glm::vec3 pos{};
if (row == 0) {
@ -257,7 +257,7 @@ void VideoGameListView::initMDValues()
float bottom = 0.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;
values[i]->setPosition(labels[i]->getPosition() +
glm::vec3{labels[i]->getSize().x, heightDiff, 0.0f});
@ -499,7 +499,7 @@ void VideoGameListView::updateInfoPanel()
std::vector<TextComponent*> labels = getMDLabels();
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;
// An animation is playing, then animate if reverse != fadingOut.
// An animation is not playing, then animate if opacity != our target opacity