aboutsummaryrefslogtreecommitdiff
path: root/engines/toltecs
diff options
context:
space:
mode:
authorStrangerke2014-03-02 11:40:05 +0100
committerStrangerke2014-03-02 11:40:05 +0100
commitfd995fa44914e393fe5dc725928af2a297846513 (patch)
tree17b99350b0340b5fb9b8e8fa49ab9bdcc762aa5d /engines/toltecs
parentae258cb350797f41272fdc1878d8cb0d3bacef05 (diff)
downloadscummvm-rg350-fd995fa44914e393fe5dc725928af2a297846513.tar.gz
scummvm-rg350-fd995fa44914e393fe5dc725928af2a297846513.tar.bz2
scummvm-rg350-fd995fa44914e393fe5dc725928af2a297846513.zip
TOLTECS: Apply CppCheck performance recommendations
Diffstat (limited to 'engines/toltecs')
-rw-r--r--engines/toltecs/detection.cpp2
-rw-r--r--engines/toltecs/menu.cpp8
-rw-r--r--engines/toltecs/palette.cpp4
-rw-r--r--engines/toltecs/render.cpp18
4 files changed, 16 insertions, 16 deletions
diff --git a/engines/toltecs/detection.cpp b/engines/toltecs/detection.cpp
index b1ceab9b12..b6c7ad3d2b 100644
--- a/engines/toltecs/detection.cpp
+++ b/engines/toltecs/detection.cpp
@@ -255,7 +255,7 @@ SaveStateList ToltecsMetaEngine::listSaves(const char *target) const {
Common::sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
SaveStateList saveList;
- for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); file++) {
+ for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
// Obtain the last 3 digits of the filename, since they correspond to the save slot
int slotNum = atoi(file->c_str() + file->size() - 3);
diff --git a/engines/toltecs/menu.cpp b/engines/toltecs/menu.cpp
index 2850a399f4..32f2085dba 100644
--- a/engines/toltecs/menu.cpp
+++ b/engines/toltecs/menu.cpp
@@ -195,7 +195,7 @@ void MenuSystem::handleKeyDown(const Common::KeyState& kbd) {
}
ItemID MenuSystem::findItemAt(int x, int y) {
- for (Common::Array<Item>::iterator iter = _items.begin(); iter != _items.end(); iter++) {
+ for (Common::Array<Item>::iterator iter = _items.begin(); iter != _items.end(); ++iter) {
if ((*iter).enabled && (*iter).rect.contains(x, y - _top))
return (*iter).id;
}
@@ -203,7 +203,7 @@ ItemID MenuSystem::findItemAt(int x, int y) {
}
MenuSystem::Item *MenuSystem::getItem(ItemID id) {
- for (Common::Array<Item>::iterator iter = _items.begin(); iter != _items.end(); iter++) {
+ for (Common::Array<Item>::iterator iter = _items.begin(); iter != _items.end(); ++iter) {
if ((*iter).id == id)
return &(*iter);
}
@@ -323,7 +323,7 @@ void MenuSystem::initMenu(MenuID menuID) {
break;
}
- for (Common::Array<Item>::iterator iter = _items.begin(); iter != _items.end(); iter++) {
+ for (Common::Array<Item>::iterator iter = _items.begin(); iter != _items.end(); ++iter) {
if ((*iter).enabled)
drawItem((*iter).id, false);
}
@@ -508,7 +508,7 @@ int MenuSystem::loadSavegamesList() {
filenames = saveFileMan->listSavefiles(pattern.c_str());
Common::sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
- for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); file++) {
+ for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
// Obtain the last 3 digits of the filename, since they correspond to the save slot
int slotNum = atoi(file->c_str() + file->size() - 3);
if (slotNum > maxSlotNum)
diff --git a/engines/toltecs/palette.cpp b/engines/toltecs/palette.cpp
index 5a2c705c5c..ab66e60c9d 100644
--- a/engines/toltecs/palette.cpp
+++ b/engines/toltecs/palette.cpp
@@ -120,7 +120,7 @@ uint16 Palette::findFragment(int16 id) {
debug(0, "Palette::findFragment(%d)", id);
uint16 result = 0;
- for (PaletteFragmentArray::iterator iter = _fragments.begin(); iter != _fragments.end(); iter++) {
+ for (PaletteFragmentArray::iterator iter = _fragments.begin(); iter != _fragments.end(); ++iter) {
PaletteFragment fragment = *iter;
if (fragment.id == id) {
result = (fragment.count << 8) | fragment.index;
@@ -193,7 +193,7 @@ void Palette::saveState(Common::WriteStream *out) {
uint16 fragmentCount = _fragments.size();
out->writeUint16LE(fragmentCount);
- for (PaletteFragmentArray::iterator iter = _fragments.begin(); iter != _fragments.end(); iter++) {
+ for (PaletteFragmentArray::iterator iter = _fragments.begin(); iter != _fragments.end(); ++iter) {
PaletteFragment fragment = *iter;
out->writeUint16LE(fragment.id);
out->writeByte(fragment.index);
diff --git a/engines/toltecs/render.cpp b/engines/toltecs/render.cpp
index 3972462d25..bf68eee94c 100644
--- a/engines/toltecs/render.cpp
+++ b/engines/toltecs/render.cpp
@@ -64,7 +64,7 @@ void RenderQueue::addSprite(SpriteDrawItem &sprite) {
// Add sprite sorted by priority
RenderQueueArray::iterator iter = _currQueue->begin();
while (iter != _currQueue->end() && (*iter).priority <= item.priority) {
- iter++;
+ ++iter;
}
_currQueue->insert(iter, item);
@@ -103,7 +103,7 @@ void RenderQueue::addMask(SegmapMaskRect &mask) {
if (rectIntersectsItem(item.rect)) {
RenderQueueArray::iterator iter = _currQueue->begin();
while (iter != _currQueue->end() && (*iter).priority <= item.priority) {
- iter++;
+ ++iter;
}
_currQueue->insert(iter, item);
}
@@ -118,7 +118,7 @@ void RenderQueue::update() {
if (!doFullRefresh) {
- for (RenderQueueArray::iterator iter = _currQueue->begin(); iter != _currQueue->end(); iter++) {
+ for (RenderQueueArray::iterator iter = _currQueue->begin(); iter != _currQueue->end(); ++iter) {
RenderQueueItem *item = &(*iter);
RenderQueueItem *prevItem = findItemInQueue(_prevQueue, *item);
if (prevItem) {
@@ -133,7 +133,7 @@ void RenderQueue::update() {
}
}
- for (RenderQueueArray::iterator iter = _prevQueue->begin(); iter != _prevQueue->end(); iter++) {
+ for (RenderQueueArray::iterator iter = _prevQueue->begin(); iter != _prevQueue->end(); ++iter) {
RenderQueueItem *prevItem = &(*iter);
RenderQueueItem *item = findItemInQueue(_currQueue, *prevItem);
if (!item) {
@@ -144,7 +144,7 @@ void RenderQueue::update() {
restoreDirtyBackground();
- for (RenderQueueArray::iterator iter = _currQueue->begin(); iter != _currQueue->end(); iter++) {
+ for (RenderQueueArray::iterator iter = _currQueue->begin(); iter != _currQueue->end(); ++iter) {
RenderQueueItem *item = &(*iter);
if (item->flags != kUnchanged)
invalidateItemsByRect(item->rect, item);
@@ -163,7 +163,7 @@ void RenderQueue::update() {
_vm->_screen->_fullRefresh = false;
}
- for (RenderQueueArray::iterator iter = _currQueue->begin(); iter != _currQueue->end(); iter++) {
+ for (RenderQueueArray::iterator iter = _currQueue->begin(); iter != _currQueue->end(); ++iter) {
const RenderQueueItem *item = &(*iter);
if (item->flags == kRefresh || doFullRefresh) {
@@ -208,7 +208,7 @@ void RenderQueue::clear() {
}
bool RenderQueue::rectIntersectsItem(const Common::Rect &rect) {
- for (RenderQueueArray::iterator iter = _currQueue->begin(); iter != _currQueue->end(); iter++) {
+ for (RenderQueueArray::iterator iter = _currQueue->begin(); iter != _currQueue->end(); ++iter) {
const RenderQueueItem *item = &(*iter);
if (rect.intersects(item->rect))
return true;
@@ -220,7 +220,7 @@ RenderQueueItem *RenderQueue::findItemInQueue(RenderQueueArray *queue, const Ren
/* This checks if the given item also exists in the previously drawn frame.
The state of the item (position, color etc) is handled elsewhere.
*/
- for (RenderQueueArray::iterator iter = queue->begin(); iter != queue->end(); iter++) {
+ for (RenderQueueArray::iterator iter = queue->begin(); iter != queue->end(); ++iter) {
RenderQueueItem *prevItem = &(*iter);
if (prevItem->type == item.type) {
switch (item.type) {
@@ -262,7 +262,7 @@ bool RenderQueue::hasItemChanged(const RenderQueueItem &item1, const RenderQueue
}
void RenderQueue::invalidateItemsByRect(const Common::Rect &rect, const RenderQueueItem *item) {
- for (RenderQueueArray::iterator iter = _currQueue->begin(); iter != _currQueue->end(); iter++) {
+ for (RenderQueueArray::iterator iter = _currQueue->begin(); iter != _currQueue->end(); ++iter) {
RenderQueueItem *subItem = &(*iter);
if (item != subItem &&
subItem->flags == kUnchanged &&