Some cosmetic code cleanup.

This commit is contained in:
Leon Styhre 2021-01-19 22:29:13 +01:00
parent e4f440ca9a
commit 735ce39812
10 changed files with 33 additions and 33 deletions

View file

@ -61,7 +61,7 @@ CollectionSystemsManager::CollectionSystemsManager(Window* window) : mWindow(win
(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.
@ -171,8 +171,8 @@ void CollectionSystemsManager::saveCustomCollection(SystemData* sys)
configFileIn.close();
for (std::unordered_map<std::string, FileData*>::const_iterator
iter = games.cbegin(); iter != games.cend(); ++iter) {
std::string path = iter->first;
it = games.cbegin(); 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%.
if (path.find(rompath) == 0)
@ -1303,7 +1303,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.cbegin(); it != dirContent.cend(); it++) {
if (Utils::FileSystem::isDirectory(*it)) {
// ... here you have a directory.
std::string folder = *it;
@ -1328,7 +1328,7 @@ std::vector<std::string> CollectionSystemsManager::getCollectionsFromConfigFolde
Utils::FileSystem::stringList dirContent =
Utils::FileSystem::getDirContent(configPath);
for (Utils::FileSystem::stringList::const_iterator
it = dirContent.cbegin(); it != dirContent.cend(); ++it) {
it = dirContent.cbegin(); it != dirContent.cend(); it++) {
if (Utils::FileSystem::isRegularFile(*it)) {
// It's a file.
std::string filename = Utils::FileSystem::getFileName(*it);

View file

@ -138,7 +138,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 hidden files and folders.
@ -190,7 +190,7 @@ void SystemData::indexAllGameFilters(const FileData* folder)
const std::vector<FileData*>& children = folder->getChildren();
for (std::vector<FileData*>::const_iterator it = children.cbegin();
it != children.cend(); ++it) {
it != children.cend(); it++) {
switch ((*it)->getType()) {
case GAME: {
mFilterIndex->addToIndex(*it);

View file

@ -441,7 +441,7 @@ void SystemScreensaver::update(int deltaTime)
void SystemScreensaver::generateImageList()
{
for (auto it = SystemData::sSystemVector.cbegin();
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;
@ -458,7 +458,7 @@ void SystemScreensaver::generateImageList()
void SystemScreensaver::generateVideoList()
{
for (auto it = SystemData::sSystemVector.cbegin();
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;

View file

@ -55,7 +55,7 @@ void GuiGamelistFilter::resetAllFilters()
{
mFilterIndex->resetFilters();
for (std::map<FilterIndexType, std::shared_ptr< OptionListComponent<std::string>>>::
const_iterator it = mFilterOptions.cbegin(); it != mFilterOptions.cend(); ++it ) {
const_iterator it = mFilterOptions.cbegin(); it != mFilterOptions.cend(); it++) {
std::shared_ptr<OptionListComponent<std::string>> optionList = it->second;
optionList->selectNone();
}
@ -138,7 +138,7 @@ void GuiGamelistFilter::applyFilters()
{
std::vector<FilterDataDecl> decls = mFilterIndex->getFilterDataDecls();
for (std::map<FilterIndexType, std::shared_ptr<OptionListComponent<std::string>>>::
const_iterator it = mFilterOptions.cbegin(); it != mFilterOptions.cend(); ++it ) {
const_iterator it = mFilterOptions.cbegin(); it != mFilterOptions.cend(); it++) {
std::shared_ptr<OptionListComponent<std::string>> optionList = it->second;
std::vector<std::string> filters = optionList->getSelectedObjects();
mFilterIndex->setFilter(it->first, &filters);

View file

@ -51,7 +51,7 @@ GuiInfoPopup::GuiInfoPopup(
mSize[0] = mSize.x() + paddingX;
mSize[1] = mSize.y() + paddingY;
float posX = Renderer::getScreenWidth()*0.5f - mSize.x()*0.5f;
float posX = Renderer::getScreenWidth()* 0.5f - mSize.x() * 0.5f;
float posY = Renderer::getScreenHeight() * 0.02f;
setPosition(posX, posY, 0);
@ -106,13 +106,13 @@ bool GuiInfoPopup::updateState()
return false;
}
else if (curTime - mStartTime <= 500) {
alpha = ((curTime - mStartTime)*255/500);
alpha = ((curTime - mStartTime) * 255 / 500);
}
else if (curTime - mStartTime < mDuration - 500) {
alpha = 255;
}
else {
alpha = ((-(curTime - mStartTime - mDuration)*255)/500);
alpha = ((-(curTime - mStartTime - mDuration) * 255) / 500);
}
mGrid->setOpacity(static_cast<unsigned char>(alpha));

View file

@ -173,7 +173,7 @@ bool parseArgs(int argc, char* argv[])
int width = atoi(argv[i + 1]);
int height = atoi(argv[i + 2]);
i += 2; // skip the argument value
i += 2; // Skip the argument value.
Settings::getInstance()->setInt("WindowWidth", width);
Settings::getInstance()->setInt("WindowHeight", height);
}
@ -185,7 +185,7 @@ bool parseArgs(int argc, char* argv[])
int width = atoi(argv[i + 1]);
int height = atoi(argv[i + 2]);
i += 2; // skip the argument value
i += 2; // Skip the argument value.
Settings::getInstance()->setInt("ScreenWidth", width);
Settings::getInstance()->setInt("ScreenHeight", height);
}
@ -197,7 +197,7 @@ bool parseArgs(int argc, char* argv[])
int x = atoi(argv[i + 1]);
int y = atoi(argv[i + 2]);
i += 2; // skip the argument value
i += 2; // Skip the argument value.
Settings::getInstance()->setInt("ScreenOffsetX", x);
Settings::getInstance()->setInt("ScreenOffsetY", y);
}
@ -208,7 +208,7 @@ bool parseArgs(int argc, char* argv[])
}
int rotate = atoi(argv[i + 1]);
++i; // skip the argument value
i++; // Skip the argument value.
Settings::getInstance()->setInt("ScreenRotate", rotate);
}
else if (strcmp(argv[i], "--max-vram") == 0) {
@ -218,7 +218,7 @@ bool parseArgs(int argc, char* argv[])
}
int maxVRAM = atoi(argv[i + 1]);
Settings::getInstance()->setInt("MaxVRAM", maxVRAM);
++i; // skip the argument value
i++; // Skip the argument value.
}
else if (strcmp(argv[i], "--gamelist-only") == 0) {
Settings::getInstance()->setBool("ParseGamelistOnly", true);

View file

@ -232,7 +232,7 @@ std::string getDeveloperString(const Value& v)
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())
@ -254,7 +254,7 @@ std::string getPublisherString(const Value& v)
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())
@ -276,7 +276,7 @@ std::string getGenreString(const Value& v)
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())
@ -448,7 +448,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

@ -88,7 +88,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(),
@ -187,7 +187,7 @@ int TheGamesDBJSONRequestResources::loadResource(
}
auto& data = doc["data"][resource_name.c_str()];
for (Value::ConstMemberIterator itr = data.MemberBegin(); itr != data.MemberEnd(); ++itr) {
for (Value::ConstMemberIterator itr = data.MemberBegin(); itr != data.MemberEnd(); itr++) {
auto& entry = itr->value;
if (!entry.IsObject() || !entry.HasMember("id") || !entry["id"].IsInt() ||
!entry.HasMember("name") || !entry["name"].IsString())

View file

@ -189,7 +189,7 @@ void BasicGameListView::launch(FileData* game)
ViewController::get()->triggerGameLaunch(game);
}
void BasicGameListView::remove(FileData *game, bool deleteFile)
void BasicGameListView::remove(FileData* game, bool deleteFile)
{
// Delete the game file on the filesystem.
if (deleteFile)
@ -228,7 +228,7 @@ void BasicGameListView::remove(FileData *game, bool deleteFile)
}
}
void BasicGameListView::removeMedia(FileData *game)
void BasicGameListView::removeMedia(FileData* game)
{
// Remove all game media files on the filesystem.
if (Utils::FileSystem::exists(game->getVideoPath()))

View file

@ -108,7 +108,7 @@ GridGameListView::GridGameListView(
addChild(&mName);
mDescContainer.setPosition(mSize.x() * padding, mSize.y() * 0.65f);
mDescContainer.setSize(mSize.x() * (0.50f - 2*padding), mSize.y() -
mDescContainer.setSize(mSize.x() * (0.50f - 2 * padding), mSize.y() -
mDescContainer.getPosition().y());
mDescContainer.setAutoScroll(true);
mDescContainer.setDefaultZIndex(40);
@ -120,21 +120,21 @@ GridGameListView::GridGameListView(
mMarquee.setOrigin(0.5f, 0.5f);
mMarquee.setPosition(mSize.x() * 0.25f, mSize.y() * 0.10f);
mMarquee.setMaxSize(mSize.x() * (0.5f - 2*padding), mSize.y() * 0.18f);
mMarquee.setMaxSize(mSize.x() * (0.5f - 2 * padding), mSize.y() * 0.18f);
mMarquee.setDefaultZIndex(35);
mMarquee.setVisible(false);
addChild(&mMarquee);
mImage.setOrigin(0.5f, 0.5f);
mImage.setPosition(2.0f, 2.0f);
mImage.setMaxSize(mSize.x() * (0.50f - 2*padding), mSize.y() * 0.4f);
mImage.setMaxSize(mSize.x() * (0.50f - 2 * padding), mSize.y() * 0.4f);
mImage.setDefaultZIndex(10);
mImage.setVisible(false);
addChild(&mImage);
mVideo->setOrigin(0.5f, 0.5f);
mVideo->setPosition(mSize.x() * 0.25f, mSize.y() * 0.4f);
mVideo->setSize(mSize.x() * (0.5f - 2*padding), mSize.y() * 0.4f);
mVideo->setSize(mSize.x() * (0.5f - 2 * padding), mSize.y() * 0.4f);
mVideo->setDefaultZIndex(15);
mVideo->setVisible(false);
addChild(mVideo);
@ -538,7 +538,7 @@ void GridGameListView::launch(FileData* game)
ViewController::get()->triggerGameLaunch(game);
}
void GridGameListView::remove(FileData *game, bool deleteFile)
void GridGameListView::remove(FileData* game, bool deleteFile)
{
// Delete the game file on the filesystem.
if (deleteFile)
@ -572,7 +572,7 @@ void GridGameListView::remove(FileData *game, bool deleteFile)
onFileChanged(parent, false);
}
void GridGameListView::removeMedia(FileData *game)
void GridGameListView::removeMedia(FileData* game)
{
// Remove all game media files on the filesystem.
if (Utils::FileSystem::exists(game->getVideoPath()))