aboutsummaryrefslogtreecommitdiff
path: root/engines/sludge
diff options
context:
space:
mode:
authoryinsimei2017-06-05 12:03:50 +0200
committerEugene Sandulenko2017-07-13 18:27:45 +0200
commitdc380b4ba488e0a2f088955a93ac1b55b557a35a (patch)
tree0c1f4c1699f2ceb67eebe7b2fb7a4df79cbbcc88 /engines/sludge
parent39c122385672eadbea674ef0233a80104ae07c48 (diff)
downloadscummvm-rg350-dc380b4ba488e0a2f088955a93ac1b55b557a35a.tar.gz
scummvm-rg350-dc380b4ba488e0a2f088955a93ac1b55b557a35a.tar.bz2
scummvm-rg350-dc380b4ba488e0a2f088955a93ac1b55b557a35a.zip
SLUDGE: align increment operator
Diffstat (limited to 'engines/sludge')
-rw-r--r--engines/sludge/loadsave.cpp12
-rw-r--r--engines/sludge/moreio.cpp6
-rw-r--r--engines/sludge/movie.cpp2
-rw-r--r--engines/sludge/people.cpp18
-rw-r--r--engines/sludge/sprites.cpp6
5 files changed, 22 insertions, 22 deletions
diff --git a/engines/sludge/loadsave.cpp b/engines/sludge/loadsave.cpp
index 50ef4cc6f2..ef50b24393 100644
--- a/engines/sludge/loadsave.cpp
+++ b/engines/sludge/loadsave.cpp
@@ -107,7 +107,7 @@ void saveStack(variableStack *vs, Common::WriteStream *stream) {
stream->writeUint16BE(elements);
search = vs;
- for (a = 0; a < elements; ++a) {
+ for (a = 0; a < elements; a++) {
saveVariable(&search->thisVar, stream);
search = search->next;
}
@@ -333,7 +333,7 @@ void saveFunction(loadedFunction *fun, Common::WriteStream *stream) {
fatal(ERROR_GAME_SAVE_FROZEN);
}
saveStack(fun->stack, stream);
- for (a = 0; a < fun->numLocals; ++a) {
+ for (a = 0; a < fun->numLocals; a++) {
saveVariable(&(fun->localVars[a]), stream);
}
}
@@ -368,7 +368,7 @@ loadedFunction *loadFunction(Common::SeekableReadStream *stream) {
buildFunc->stack = loadStack(stream, NULL);
- for (a = 0; a < buildFunc->numLocals; ++a) {
+ for (a = 0; a < buildFunc->numLocals; a++) {
loadVariable(&(buildFunc->localVars[a]), stream);
}
@@ -442,7 +442,7 @@ bool saveGame(char *fname) {
thisFunction = thisFunction->next;
}
- for (a = 0; a < numGlobals; ++a) {
+ for (a = 0; a < numGlobals; a++) {
saveVariable(&globalVars[a], fp);
}
@@ -543,7 +543,7 @@ bool loadGame(char *fname) {
charOrder = new char[257];
if (! checkNew(charOrder)) return false;
- for (int a = 0; a < 256; ++a) {
+ for (int a = 0; a < 256; a++) {
x = fgetc(fp);
charOrder[x] = a;
}
@@ -591,7 +591,7 @@ bool loadGame(char *fname) {
buildList = &(rFunc->next);
}
- for (a = 0; a < numGlobals; ++a) {
+ for (a = 0; a < numGlobals; a++) {
unlinkVar(globalVars[a]);
loadVariable(&globalVars[a], fp);
}
diff --git a/engines/sludge/moreio.cpp b/engines/sludge/moreio.cpp
index da86553cda..c7e90ff6ee 100644
--- a/engines/sludge/moreio.cpp
+++ b/engines/sludge/moreio.cpp
@@ -43,7 +43,7 @@ bool allowAnyFilename = true;
void writeString(char *s, Common::WriteStream *stream) {
int a, len = strlen(s);
stream->writeUint16BE(len);
- for (a = 0; a < len; ++a) {
+ for (a = 0; a < len; a++) {
stream->writeByte(s[a] + 1);
}
}
@@ -54,7 +54,7 @@ char *readString(Common::SeekableReadStream *stream) {
if (!checkNew(s)) {
return NULL;
}
- for (a = 0; a < len; ++a) {
+ for (a = 0; a < len; a++) {
s[a] = (char)(stream->readByte() - 1);
}
s[len] = 0;
@@ -187,7 +187,7 @@ char *encodeFilename(char *nameIn) {
return newName;
} else {
int a;
- for (a = 0; nameIn[a]; ++a) {
+ for (a = 0; nameIn[a]; a++) {
#ifdef _WIN32
if (nameIn[a] == '/') nameIn[a] = '\\';
#else
diff --git a/engines/sludge/movie.cpp b/engines/sludge/movie.cpp
index cd4ef1bcf8..8aa2ece12c 100644
--- a/engines/sludge/movie.cpp
+++ b/engines/sludge/movie.cpp
@@ -826,7 +826,7 @@ int playMovie(int fileNumber) {
}
}
}
- ++frameCounter;
+ frameCounter++;
} else {
movieHasEnded:
diff --git a/engines/sludge/people.cpp b/engines/sludge/people.cpp
index fb21037b3d..bb23d6ade4 100644
--- a/engines/sludge/people.cpp
+++ b/engines/sludge/people.cpp
@@ -136,7 +136,7 @@ personaAnimation *copyAnim(personaAnimation *orig) {
if (!checkNew(newAnim->frames))
return NULL;
- for (int a = 0; a < num; ++a) {
+ for (int a = 0; a < num; a++) {
newAnim->frames[a].frameNum = orig->frames[a].frameNum;
newAnim->frames[a].howMany = orig->frames[a].howMany;
newAnim->frames[a].noise = orig->frames[a].noise;
@@ -877,7 +877,7 @@ bool addPerson(int x, int y, int objNum, persona *p) {
int timeForAnim(personaAnimation *fram) {
int total = 0;
- for (int a = 0; a < fram->numFrames; ++a) {
+ for (int a = 0; a < fram->numFrames; a++) {
total += fram->frames[a].howMany;
}
return total;
@@ -976,7 +976,7 @@ bool saveAnim(personaAnimation *p, Common::WriteStream *stream) {
if (p->numFrames) {
stream->writeUint32LE(p->theSprites->ID);
- for (int a = 0; a < p->numFrames; ++a) {
+ for (int a = 0; a < p->numFrames; a++) {
stream->writeUint32LE(p->frames[a].frameNum);
stream->writeUint32LE(p->frames[a].howMany);
stream->writeUint32LE(p->frames[a].noise);
@@ -995,7 +995,7 @@ bool loadAnim(personaAnimation *p, Common::SeekableReadStream *stream) {
return false;
p->theSprites = loadBankForAnim(a);
- for (a = 0; a < p->numFrames; ++a) {
+ for (a = 0; a < p->numFrames; a++) {
p->frames[a].frameNum = stream->readUint32LE();
p->frames[a].howMany = stream->readUint32LE();
if (ssgVersion >= VERSION(2, 0)) {
@@ -1014,7 +1014,7 @@ bool loadAnim(personaAnimation *p, Common::SeekableReadStream *stream) {
void debugCostume (char * message, persona * cossy) {
FILE * db = fopen ("debuTURN.txt", "at");
fprintf (db, " %s costume with %i directions...\n", message, cossy->numDirections);
- for (int a = 0; a < cossy->numDirections * 3; ++a) {
+ for (int a = 0; a < cossy->numDirections * 3; a++) {
fprintf (db, " %i frames:", cossy->animation[a]->numFrames);
for (int b = 0; b < cossy->animation[a]->numFrames; b ++) {
fprintf (db, " %i", cossy->animation[a]->frames[b]);
@@ -1028,7 +1028,7 @@ bool loadAnim(personaAnimation *p, Common::SeekableReadStream *stream) {
bool saveCostume(persona *cossy, Common::WriteStream *stream) {
int a;
stream->writeUint16BE(cossy->numDirections);
- for (a = 0; a < cossy->numDirections * 3; ++a) {
+ for (a = 0; a < cossy->numDirections * 3; a++) {
if (!saveAnim(cossy->animation[a], stream))
return false;
}
@@ -1042,7 +1042,7 @@ bool loadCostume(persona *cossy, Common::SeekableReadStream *stream) {
cossy->animation = new personaAnimation *[cossy->numDirections * 3];
if (!checkNew(cossy->animation))
return false;
- for (a = 0; a < cossy->numDirections * 3; ++a) {
+ for (a = 0; a < cossy->numDirections * 3; a++) {
cossy->animation[a] = new personaAnimation;
if (!checkNew(cossy->animation[a]))
return false;
@@ -1069,7 +1069,7 @@ bool savePeople(Common::WriteStream *stream) {
stream->writeUint16BE(countPeople);
me = allPeople;
- for (a = 0; a < countPeople; ++a) {
+ for (a = 0; a < countPeople; a++) {
putFloat(me->x, stream);
putFloat(me->y, stream);
@@ -1132,7 +1132,7 @@ bool loadPeople(Common::SeekableReadStream *stream) {
int a;
allPeople = NULL;
- for (a = 0; a < countPeople; ++a) {
+ for (a = 0; a < countPeople; a++) {
me = new onScreenPerson;
if (!checkNew(me))
return false;
diff --git a/engines/sludge/sprites.cpp b/engines/sludge/sprites.cpp
index 936bb67a6c..0927644909 100644
--- a/engines/sludge/sprites.cpp
+++ b/engines/sludge/sprites.cpp
@@ -225,7 +225,7 @@ bool loadSpriteBank(int fileNum, spriteBank &loadhere, bool isFont) {
// Make palette for version 0, 1, 2
if (!reserveSpritePal(loadhere.myPalette, howmany + startIndex)) return false;
- for (int i = 0; i < howmany; ++i) {
+ for (int i = 0; i < howmany; i++) {
loadhere.myPalette.r[i + startIndex] = (byte)bigDataFile->readByte();
loadhere.myPalette.g[i + startIndex] = (byte)bigDataFile->readByte();
loadhere.myPalette.b[i + startIndex] = (byte)bigDataFile->readByte();
@@ -246,8 +246,8 @@ bool loadSpriteBank(int fileNum, spriteBank &loadhere, bool isFont) {
}
}
fromhere = 0;
- for (int y = 0; y < loadhere.sprites[i].surface.h; ++y) {
- for (int x = 0; x < loadhere.sprites[i].surface.w; ++x) {
+ for (int y = 0; y < loadhere.sprites[i].surface.h; y++) {
+ for (int x = 0; x < loadhere.sprites[i].surface.w; x++) {
byte *target = (byte *)loadhere.sprites[i].surface.getBasePtr(x, y);
unsigned char s = spriteData[i][fromhere++];
if (s) {