mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-04 09:18:38 +00:00
SCI: Use prefix increment instead of postfix on iterators (more efficient); also correct code formatting issues
svn-id: r47295
This commit is contained in:
parent
a88b2639f5
commit
8559f0c3eb
@ -766,7 +766,7 @@ bool Console::cmdList(int argc, const char **argv) {
|
|||||||
if (++cnt % 4 == 0)
|
if (++cnt % 4 == 0)
|
||||||
DebugPrintf("\n");
|
DebugPrintf("\n");
|
||||||
}
|
}
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
DebugPrintf("\n");
|
DebugPrintf("\n");
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ Common::File *ResourceManager::getVolumeFile(const char *filename) {
|
|||||||
}
|
}
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
it ++;
|
++it;
|
||||||
}
|
}
|
||||||
// adding a new file
|
// adding a new file
|
||||||
file = new Common::File;
|
file = new Common::File;
|
||||||
@ -468,7 +468,7 @@ int ResourceManager::addInternalSources() {
|
|||||||
else if (Common::File::exists("RESOURCE.AUD"))
|
else if (Common::File::exists("RESOURCE.AUD"))
|
||||||
addSource(src, kSourceAudioVolume, "RESOURCE.AUD", 0);
|
addSource(src, kSourceAudioVolume, "RESOURCE.AUD", 0);
|
||||||
|
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -576,14 +576,14 @@ ResourceManager::~ResourceManager() {
|
|||||||
ResourceMap::iterator itr = _resMap.begin();
|
ResourceMap::iterator itr = _resMap.begin();
|
||||||
while (itr != _resMap.end()) {
|
while (itr != _resMap.end()) {
|
||||||
delete itr->_value;
|
delete itr->_value;
|
||||||
itr ++;
|
++itr;
|
||||||
}
|
}
|
||||||
freeResourceSources();
|
freeResourceSources();
|
||||||
|
|
||||||
Common::List<Common::File *>::iterator it = _volumeFiles.begin();
|
Common::List<Common::File *>::iterator it = _volumeFiles.begin();
|
||||||
while (it != _volumeFiles.end()) {
|
while (it != _volumeFiles.end()) {
|
||||||
delete *it;
|
delete *it;
|
||||||
it ++;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -622,8 +622,8 @@ void ResourceManager::printLRU() {
|
|||||||
res = *it;
|
res = *it;
|
||||||
debug("\t%s: %d bytes", res->id.toString().c_str(), res->size);
|
debug("\t%s: %d bytes", res->id.toString().c_str(), res->size);
|
||||||
mem += res->size;
|
mem += res->size;
|
||||||
entries ++;
|
++entries;
|
||||||
it ++;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug("Total: %d entries, %d bytes (mgr says %d)", entries, mem, _memoryLRU);
|
debug("Total: %d entries, %d bytes (mgr says %d)", entries, mem, _memoryLRU);
|
||||||
@ -648,7 +648,7 @@ Common::List<ResourceId> *ResourceManager::listResources(ResourceType type, int
|
|||||||
while (itr != _resMap.end()) {
|
while (itr != _resMap.end()) {
|
||||||
if ((itr->_value->id.type == type) && ((mapNumber == -1) || (itr->_value->id.number == mapNumber)))
|
if ((itr->_value->id.type == type) && ((mapNumber == -1) || (itr->_value->id.number == mapNumber)))
|
||||||
resources->push_back(itr->_value->id);
|
resources->push_back(itr->_value->id);
|
||||||
itr++;
|
++itr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return resources;
|
return resources;
|
||||||
@ -984,7 +984,7 @@ void ResourceManager::readResourcePatches(ResourceSource *source) {
|
|||||||
const char *szResType;
|
const char *szResType;
|
||||||
ResourceSource *psrcPatch;
|
ResourceSource *psrcPatch;
|
||||||
|
|
||||||
for (int i = kResourceTypeView; i < kResourceTypeInvalid; i ++) {
|
for (int i = kResourceTypeView; i < kResourceTypeInvalid; ++i) {
|
||||||
files.clear();
|
files.clear();
|
||||||
szResType = getResourceTypeName((ResourceType)i);
|
szResType = getResourceTypeName((ResourceType)i);
|
||||||
// SCI0 naming - type.nnn
|
// SCI0 naming - type.nnn
|
||||||
@ -995,7 +995,7 @@ void ResourceManager::readResourcePatches(ResourceSource *source) {
|
|||||||
mask = "*.";
|
mask = "*.";
|
||||||
mask += resourceTypeSuffixes[i];
|
mask += resourceTypeSuffixes[i];
|
||||||
SearchMan.listMatchingMembers(files, mask);
|
SearchMan.listMatchingMembers(files, mask);
|
||||||
for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); x++) {
|
for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) {
|
||||||
bool bAdd = false;
|
bool bAdd = false;
|
||||||
name = (*x)->getName();
|
name = (*x)->getName();
|
||||||
// SCI1 scheme
|
// SCI1 scheme
|
||||||
@ -1027,7 +1027,7 @@ void ResourceManager::readWaveAudioPatches() {
|
|||||||
Common::ArchiveMemberList files;
|
Common::ArchiveMemberList files;
|
||||||
SearchMan.listMatchingMembers(files, "*.wav");
|
SearchMan.listMatchingMembers(files, "*.wav");
|
||||||
|
|
||||||
for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); x++) {
|
for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) {
|
||||||
Common::String name = (*x)->getName();
|
Common::String name = (*x)->getName();
|
||||||
|
|
||||||
if (isdigit(name[0])) {
|
if (isdigit(name[0])) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user