aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorMax Horn2009-01-29 05:26:12 +0000
committerMax Horn2009-01-29 05:26:12 +0000
commitac59693be26b4239aaaf380896a1e1b753172546 (patch)
treeb64a9b664917ed86e78e90560b034f0b1ee49054 /engines/gob
parenta0a82d911c77b63f2069dbc39ab26394fe4d377d (diff)
downloadscummvm-rg350-ac59693be26b4239aaaf380896a1e1b753172546.tar.gz
scummvm-rg350-ac59693be26b4239aaaf380896a1e1b753172546.tar.bz2
scummvm-rg350-ac59693be26b4239aaaf380896a1e1b753172546.zip
A ton of code formatting fixes; also fixed warnings about single line loops like 'while(cond);' by inserting newlines
svn-id: r36127
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/game_v1.cpp6
-rw-r--r--engines/gob/game_v2.cpp6
-rw-r--r--engines/gob/goblin.cpp12
-rw-r--r--engines/gob/indeo3.cpp234
-rw-r--r--engines/gob/parse_v1.cpp6
-rw-r--r--engines/gob/parse_v2.cpp6
-rw-r--r--engines/gob/saveload_v2.cpp6
-rw-r--r--engines/gob/saveload_v3.cpp8
-rw-r--r--engines/gob/saveload_v4.cpp4
-rw-r--r--engines/gob/saveload_v6.cpp2
-rw-r--r--engines/gob/scenery.cpp6
-rw-r--r--engines/gob/sound/cdrom.cpp6
12 files changed, 160 insertions, 142 deletions
diff --git a/engines/gob/game_v1.cpp b/engines/gob/game_v1.cpp
index 701b4e82e7..4d392e4ce6 100644
--- a/engines/gob/game_v1.cpp
+++ b/engines/gob/game_v1.cpp
@@ -317,7 +317,8 @@ void Game_v1::popCollisions(void) {
debugC(1, kDebugCollisions, "popCollision");
_collStackSize--;
- for (destPtr = _collisionAreas; destPtr->left != 0xFFFF; destPtr++);
+ for (destPtr = _collisionAreas; destPtr->left != 0xFFFF; destPtr++)
+ ;
srcPtr = _collStack[_collStackSize];
memcpy(destPtr, srcPtr,
@@ -1429,7 +1430,8 @@ int16 Game_v1::inputArea(int16 xPos, int16 yPos, int16 width, int16 height,
if (_vm->_global->_pressedKeys[1] == 0)
continue;
- while (_vm->_global->_pressedKeys[1] != 0);
+ while (_vm->_global->_pressedKeys[1] != 0)
+ ;
continue;
default:
diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp
index ce145cd725..91996c15ab 100644
--- a/engines/gob/game_v2.cpp
+++ b/engines/gob/game_v2.cpp
@@ -398,7 +398,8 @@ void Game_v2::popCollisions(void) {
_lastCollId = _collLasts[_collStackSize].id;
_lastCollAreaIndex = _collLasts[_collStackSize].areaIndex;
- for (destPtr = _collisionAreas; destPtr->left != 0xFFFF; destPtr++);
+ for (destPtr = _collisionAreas; destPtr->left != 0xFFFF; destPtr++)
+ ;
srcPtr = _collStack[_collStackSize];
memcpy(destPtr, srcPtr,
@@ -1583,7 +1584,8 @@ int16 Game_v2::inputArea(int16 xPos, int16 yPos, int16 width, int16 height,
else
handleMouse = 0;
- while (_vm->_global->_pressedKeys[1] != 0);
+ while (_vm->_global->_pressedKeys[1] != 0)
+ ;
continue;
default:
diff --git a/engines/gob/goblin.cpp b/engines/gob/goblin.cpp
index 55758cdfdc..81671b8247 100644
--- a/engines/gob/goblin.cpp
+++ b/engines/gob/goblin.cpp
@@ -659,7 +659,8 @@ void Goblin::adjustDest(int16 posX, int16 posY) {
resDeltaPix = 0;
for (i = 1; (i <= _pressedMapX) &&
- (_vm->_map->getPass(_pressedMapX - i, _pressedMapY) == 0); i++);
+ (_vm->_map->getPass(_pressedMapX - i, _pressedMapY) == 0); i++)
+ ;
if (i <= _pressedMapX) {
resDeltaPix = (i - 1) * 12 + (posX % 12) + 1;
@@ -667,7 +668,8 @@ void Goblin::adjustDest(int16 posX, int16 posY) {
}
for (i = 1; ((i + _pressedMapX) < _vm->_map->_mapWidth) &&
- (_vm->_map->getPass(_pressedMapX + i, _pressedMapY) == 0); i++);
+ (_vm->_map->getPass(_pressedMapX + i, _pressedMapY) == 0); i++)
+ ;
if ((_pressedMapX + i) < _vm->_map->_mapWidth) {
deltaPix = (i * 12) - (posX % 12);
@@ -679,7 +681,8 @@ void Goblin::adjustDest(int16 posX, int16 posY) {
}
for (i = 1; ((i + _pressedMapY) < _vm->_map->_mapHeight) &&
- (_vm->_map->getPass(_pressedMapX, _pressedMapY + i) == 0); i++);
+ (_vm->_map->getPass(_pressedMapX, _pressedMapY + i) == 0); i++)
+ ;
if ((_pressedMapY + i) < _vm->_map->_mapHeight) {
deltaPix = (i * 6) - (posY % 6);
@@ -691,7 +694,8 @@ void Goblin::adjustDest(int16 posX, int16 posY) {
}
for (i = 1; (i <= _pressedMapY) &&
- (_vm->_map->getPass(_pressedMapX, _pressedMapY - i) == 0); i++);
+ (_vm->_map->getPass(_pressedMapX, _pressedMapY - i) == 0); i++)
+ ;
if (i <= _pressedMapY) {
deltaPix = (i * 6) + (posY % 6);
diff --git a/engines/gob/indeo3.cpp b/engines/gob/indeo3.cpp
index cae66e4a5b..e7cd4aa594 100644
--- a/engines/gob/indeo3.cpp
+++ b/engines/gob/indeo3.cpp
@@ -169,11 +169,11 @@ void Indeo3::allocFrames() {
offs += (chroma_pixels + chroma_width);
_iv_frame[1].Vbuf = _iv_frame[0].the_buf + offs;
- for(int i = 1; i <= luma_width; i++)
+ for (int i = 1; i <= luma_width; i++)
_iv_frame[0].Ybuf[-i] = _iv_frame[1].Ybuf[-i] =
_iv_frame[0].Ubuf[-i] = 0x80;
- for(int i = 1; i <= chroma_width; i++) {
+ for (int i = 1; i <= chroma_width; i++) {
_iv_frame[1].Ubuf[-i] = 0x80;
_iv_frame[0].Vbuf[-i] = 0x80;
_iv_frame[1].Vbuf[-i] = 0x80;
@@ -207,7 +207,7 @@ bool Indeo3::decompressFrame(byte *inData, uint32 dataLen,
uint8 flags2 = frame.readByte();
// Finding the reference frame
- if(flags1 & 0x200) {
+ if (flags1 & 0x200) {
_cur_frame = _iv_frame + 1;
_ref_frame = _iv_frame;
} else {
@@ -353,8 +353,8 @@ typedef struct {
/* ---------------------------------------------------------------------- */
#define LV1_CHECK(buf1,rle_v3,lv1,lp2) \
- if((lv1 & 0x80) != 0) { \
- if(rle_v3 != 0) \
+ if ((lv1 & 0x80) != 0) { \
+ if (rle_v3 != 0) \
rle_v3 = 0; \
else { \
rle_v3 = 1; \
@@ -365,10 +365,10 @@ typedef struct {
#define RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3) \
- if(rle_v3 == 0) { \
+ if (rle_v3 == 0) { \
rle_v2 = *buf1; \
rle_v1 = 1; \
- if(rle_v2 > 32) { \
+ if (rle_v2 > 32) { \
rle_v2 -= 32; \
rle_v1 = 0; \
} \
@@ -378,7 +378,7 @@ typedef struct {
#define LP2_CHECK(buf1,rle_v3,lp2) \
- if(lp2 == 0 && rle_v3 != 0) \
+ if (lp2 == 0 && rle_v3 != 0) \
rle_v3 = 0; \
else { \
buf1--; \
@@ -388,7 +388,7 @@ typedef struct {
#define RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2) \
rle_v2--; \
- if(rle_v2 == 0) { \
+ if (rle_v2 == 0) { \
rle_v3 = 0; \
buf1 += 2; \
} \
@@ -417,15 +417,17 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
width_tbl = width_tbl_arr + 1;
i = (width < 0 ? width + 3 : width)/4;
- for(j = -1; j < 8; j++)
+ for (j = -1; j < 8; j++)
width_tbl[j] = i * j;
strip = strip_tbl;
- for(region_160_width = 0; region_160_width < (width - min_width_160); region_160_width += min_width_160);
+ for (region_160_width = 0; region_160_width < (width - min_width_160); region_160_width += min_width_160)
+ ;
strip->ypos = strip->xpos = 0;
- for(strip->width = min_width_160; width > strip->width; strip->width *= 2);
+ for (strip->width = min_width_160; width > strip->width; strip->width *= 2)
+ ;
strip->height = height;
strip->split_direction = 0;
strip->split_flag = 0;
@@ -435,8 +437,8 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
rle_v1 = rle_v2 = rle_v3 = 0;
- while(strip >= strip_tbl) {
- if(bit_pos <= 0) {
+ while (strip >= strip_tbl) {
+ if (bit_pos <= 0) {
bit_pos = 8;
bit_buf = *buf1++;
}
@@ -444,28 +446,28 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
bit_pos -= 2;
cmd = (bit_buf >> bit_pos) & 0x03;
- if(cmd == 0) {
+ if (cmd == 0) {
strip++;
memcpy(strip, strip-1, sizeof(ustr_t));
strip->split_flag = 1;
strip->split_direction = 0;
strip->height = (strip->height > 8 ? ((strip->height+8)>>4)<<3 : 4);
continue;
- } else if(cmd == 1) {
+ } else if (cmd == 1) {
strip++;
memcpy(strip, strip-1, sizeof(ustr_t));
strip->split_flag = 1;
strip->split_direction = 1;
strip->width = (strip->width > 8 ? ((strip->width+8)>>4)<<3 : 4);
continue;
- } else if(cmd == 2) {
- if(strip->usl7 == 0) {
+ } else if (cmd == 2) {
+ if (strip->usl7 == 0) {
strip->usl7 = 1;
ref_vectors = NULL;
continue;
}
- } else if(cmd == 3) {
- if(strip->usl7 == 0) {
+ } else if (cmd == 3) {
+ if (strip->usl7 == 0) {
strip->usl7 = 1;
ref_vectors = (const signed char*)buf2 + (*buf1 * 2);
buf1++;
@@ -475,19 +477,19 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
cur_frm_pos = cur + width * strip->ypos + strip->xpos;
- if((blks_width = strip->width) < 0)
+ if ((blks_width = strip->width) < 0)
blks_width += 3;
blks_width >>= 2;
blks_height = strip->height;
- if(ref_vectors != NULL) {
+ if (ref_vectors != NULL) {
ref_frm_pos = ref + (ref_vectors[0] + strip->ypos) * width +
ref_vectors[1] + strip->xpos;
} else
ref_frm_pos = cur_frm_pos - width_tbl[4];
- if(cmd == 2) {
- if(bit_pos <= 0) {
+ if (cmd == 2) {
+ if (bit_pos <= 0) {
bit_pos = 8;
bit_buf = *buf1++;
}
@@ -495,14 +497,14 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
bit_pos -= 2;
cmd = (bit_buf >> bit_pos) & 0x03;
- if(cmd == 0 || ref_vectors != NULL) {
- for(lp1 = 0; lp1 < blks_width; lp1++) {
- for(i = 0, j = 0; i < blks_height; i++, j += width_tbl[1])
+ if (cmd == 0 || ref_vectors != NULL) {
+ for (lp1 = 0; lp1 < blks_width; lp1++) {
+ for (i = 0, j = 0; i < blks_height; i++, j += width_tbl[1])
((uint32 *)cur_frm_pos)[j] = ((uint32 *)ref_frm_pos)[j];
cur_frm_pos += 4;
ref_frm_pos += 4;
}
- } else if(cmd != 1)
+ } else if (cmd != 1)
return;
} else {
k = *buf1 >> 4;
@@ -510,16 +512,16 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
buf1++;
lv = j + fflags2;
- if((lv - 8) <= 7 && (k == 0 || k == 3 || k == 10)) {
+ if ((lv - 8) <= 7 && (k == 0 || k == 3 || k == 10)) {
cp2 = _ModPred + ((lv - 8) << 7);
cp = ref_frm_pos;
- for(i = 0; i < blks_width << 2; i++) {
+ for (i = 0; i < blks_width << 2; i++) {
int v = *cp >> 1;
*(cp++) = cp2[v];
}
}
- if(k == 1 || k == 4) {
+ if (k == 1 || k == 4) {
lv = (hdr[j] & 0xf) + fflags2;
correction_type_sp[0] = _corrector_type + (lv << 8);
correction_lp[0] = correction + (lv << 8);
@@ -536,9 +538,9 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
switch(k) {
case 1:
case 0: /********** CASE 0 **********/
- for( ; blks_height > 0; blks_height -= 4) {
- for(lp1 = 0; lp1 < blks_width; lp1++) {
- for(lp2 = 0; lp2 < 4; ) {
+ for ( ; blks_height > 0; blks_height -= 4) {
+ for (lp1 = 0; lp1 < blks_width; lp1++) {
+ for (lp2 = 0; lp2 < 4; ) {
k = *buf1++;
cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2];
ref_lp = ((uint32 *)ref_frm_pos) + width_tbl[lp2];
@@ -557,25 +559,25 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
lp2++;
break;
case 2:
- if(lp2 == 0) {
- for(i = 0, j = 0; i < 2; i++, j += width_tbl[1])
+ if (lp2 == 0) {
+ for (i = 0, j = 0; i < 2; i++, j += width_tbl[1])
cur_lp[j] = ref_lp[j];
lp2 += 2;
}
break;
case 3:
- if(lp2 < 2) {
- for(i = 0, j = 0; i < (3 - lp2); i++, j += width_tbl[1])
+ if (lp2 < 2) {
+ for (i = 0, j = 0; i < (3 - lp2); i++, j += width_tbl[1])
cur_lp[j] = ref_lp[j];
lp2 = 3;
}
break;
case 8:
- if(lp2 == 0) {
+ if (lp2 == 0) {
RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
- if(rle_v1 == 1 || ref_vectors != NULL) {
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
+ if (rle_v1 == 1 || ref_vectors != NULL) {
+ for (i = 0, j = 0; i < 4; i++, j += width_tbl[1])
cur_lp[j] = ref_lp[j];
}
@@ -588,21 +590,21 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
case 5:
LP2_CHECK(buf1,rle_v3,lp2)
case 4:
- for(i = 0, j = 0; i < (4 - lp2); i++, j += width_tbl[1])
+ for (i = 0, j = 0; i < (4 - lp2); i++, j += width_tbl[1])
cur_lp[j] = ref_lp[j];
lp2 = 4;
break;
case 7:
- if(rle_v3 != 0)
+ if (rle_v3 != 0)
rle_v3 = 0;
else {
buf1--;
rle_v3 = 1;
}
case 6:
- if(ref_vectors != NULL) {
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
+ if (ref_vectors != NULL) {
+ for (i = 0, j = 0; i < 4; i++, j += width_tbl[1])
cur_lp[j] = ref_lp[j];
}
lp2 = 4;
@@ -613,7 +615,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
lv = (lv1 & 0x7F) << 1;
lv += (lv << 8);
lv += (lv << 16);
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
+ for (i = 0, j = 0; i < 4; i++, j += width_tbl[1])
cur_lp[j] = lv;
LV1_CHECK(buf1,rle_v3,lv1,lp2)
@@ -634,13 +636,13 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
case 4:
case 3: /********** CASE 3 **********/
- if(ref_vectors != NULL)
+ if (ref_vectors != NULL)
return;
flag1 = 1;
- for( ; blks_height > 0; blks_height -= 8) {
- for(lp1 = 0; lp1 < blks_width; lp1++) {
- for(lp2 = 0; lp2 < 4; ) {
+ for ( ; blks_height > 0; blks_height -= 8) {
+ for (lp1 = 0; lp1 < blks_width; lp1++) {
+ for (lp2 = 0; lp2 < 4; ) {
k = *buf1++;
cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2 * 2];
@@ -649,7 +651,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
switch(correction_type_sp[lp2 & 0x01][k]) {
case 0:
cur_lp[width_tbl[1]] = FROM_LE_32(((FROM_LE_32(*ref_lp) >> 1) + correction_lp[lp2 & 0x01][k]) << 1);
- if(lp2 > 0 || flag1 == 0 || strip->ypos != 0)
+ if (lp2 > 0 || flag1 == 0 || strip->ypos != 0)
cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
else
cur_lp[0] = FROM_LE_32(((FROM_LE_32(*ref_lp) >> 1) + correction_lp[lp2 & 0x01][k]) << 1);
@@ -662,7 +664,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
res = ((FROM_LE_16(((uint16 *)ref_lp)[1]) >> 1) + correction_lp[lp2 & 0x01][k]) << 1;
((uint16 *)cur_lp)[width_tbl[2]+1] = FROM_LE_16(res);
- if(lp2 > 0 || flag1 == 0 || strip->ypos != 0)
+ if (lp2 > 0 || flag1 == 0 || strip->ypos != 0)
cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
else
cur_lp[0] = cur_lp[width_tbl[1]];
@@ -671,16 +673,16 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 2:
- if(lp2 == 0) {
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
+ if (lp2 == 0) {
+ for (i = 0, j = 0; i < 4; i++, j += width_tbl[1])
cur_lp[j] = *ref_lp;
lp2 += 2;
}
break;
case 3:
- if(lp2 < 2) {
- for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1])
+ if (lp2 < 2) {
+ for (i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1])
cur_lp[j] = *ref_lp;
lp2 = 3;
}
@@ -691,7 +693,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 7:
- if(rle_v3 != 0)
+ if (rle_v3 != 0)
rle_v3 = 0;
else {
buf1--;
@@ -701,11 +703,11 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 8:
- if(lp2 == 0) {
+ if (lp2 == 0) {
RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
- if(rle_v1 == 1) {
- for(i = 0, j = 0; i < 8; i++, j += width_tbl[1])
+ if (rle_v1 == 1) {
+ for (i = 0, j = 0; i < 8; i++, j += width_tbl[1])
cur_lp[j] = ref_lp[j];
}
@@ -718,7 +720,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
case 5:
LP2_CHECK(buf1,rle_v3,lp2)
case 4:
- for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1])
+ for (i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1])
cur_lp[j] = *ref_lp;
lp2 = 4;
break;
@@ -730,7 +732,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
lv += (lv << 8);
lv += (lv << 16);
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
+ for (i = 0, j = 0; i < 4; i++, j += width_tbl[1])
cur_lp[j] = lv;
LV1_CHECK(buf1,rle_v3,lv1,lp2)
@@ -750,18 +752,18 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 10: /********** CASE 10 **********/
- if(ref_vectors == NULL) {
+ if (ref_vectors == NULL) {
flag1 = 1;
- for( ; blks_height > 0; blks_height -= 8) {
- for(lp1 = 0; lp1 < blks_width; lp1 += 2) {
- for(lp2 = 0; lp2 < 4; ) {
+ for ( ; blks_height > 0; blks_height -= 8) {
+ for (lp1 = 0; lp1 < blks_width; lp1 += 2) {
+ for (lp2 = 0; lp2 < 4; ) {
k = *buf1++;
cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2 * 2];
ref_lp = ((uint32 *)cur_frm_pos) + width_tbl[(lp2 * 2) - 1];
lv1 = ref_lp[0];
lv2 = ref_lp[1];
- if(lp2 == 0 && flag1 != 0) {
+ if (lp2 == 0 && flag1 != 0) {
#if defined(SCUMM_BIG_ENDIAN)
lv1 = lv1 & 0xFF00FF00;
lv1 = (lv1 >> 8) | lv1;
@@ -779,7 +781,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
case 0:
cur_lp[width_tbl[1]] = FROM_LE_32(((FROM_LE_32(lv1) >> 1) + correctionloworder_lp[lp2 & 0x01][k]) << 1);
cur_lp[width_tbl[1]+1] = FROM_LE_32(((FROM_LE_32(lv2) >> 1) + correctionhighorder_lp[lp2 & 0x01][k]) << 1);
- if(lp2 > 0 || strip->ypos != 0 || flag1 == 0) {
+ if (lp2 > 0 || strip->ypos != 0 || flag1 == 0) {
cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
} else {
@@ -792,7 +794,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
case 1:
cur_lp[width_tbl[1]] = FROM_LE_32(((FROM_LE_32(lv1) >> 1) + correctionloworder_lp[lp2 & 0x01][*buf1]) << 1);
cur_lp[width_tbl[1]+1] = FROM_LE_32(((FROM_LE_32(lv2) >> 1) + correctionloworder_lp[lp2 & 0x01][k]) << 1);
- if(lp2 > 0 || strip->ypos != 0 || flag1 == 0) {
+ if (lp2 > 0 || strip->ypos != 0 || flag1 == 0) {
cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
} else {
@@ -804,16 +806,16 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 2:
- if(lp2 == 0) {
- if(flag1 != 0) {
- for(i = 0, j = width_tbl[1]; i < 3; i++, j += width_tbl[1]) {
+ if (lp2 == 0) {
+ if (flag1 != 0) {
+ for (i = 0, j = width_tbl[1]; i < 3; i++, j += width_tbl[1]) {
cur_lp[j] = lv1;
cur_lp[j+1] = lv2;
}
cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
} else {
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) {
+ for (i = 0, j = 0; i < 4; i++, j += width_tbl[1]) {
cur_lp[j] = lv1;
cur_lp[j+1] = lv2;
}
@@ -823,16 +825,16 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 3:
- if(lp2 < 2) {
- if(lp2 == 0 && flag1 != 0) {
- for(i = 0, j = width_tbl[1]; i < 5; i++, j += width_tbl[1]) {
+ if (lp2 < 2) {
+ if (lp2 == 0 && flag1 != 0) {
+ for (i = 0, j = width_tbl[1]; i < 5; i++, j += width_tbl[1]) {
cur_lp[j] = lv1;
cur_lp[j+1] = lv2;
}
cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
} else {
- for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) {
+ for (i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) {
cur_lp[j] = lv1;
cur_lp[j+1] = lv2;
}
@@ -842,18 +844,18 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 8:
- if(lp2 == 0) {
+ if (lp2 == 0) {
RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
- if(rle_v1 == 1) {
- if(flag1 != 0) {
- for(i = 0, j = width_tbl[1]; i < 7; i++, j += width_tbl[1]) {
+ if (rle_v1 == 1) {
+ if (flag1 != 0) {
+ for (i = 0, j = width_tbl[1]; i < 7; i++, j += width_tbl[1]) {
cur_lp[j] = lv1;
cur_lp[j+1] = lv2;
}
cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
} else {
- for(i = 0, j = 0; i < 8; i++, j += width_tbl[1]) {
+ for (i = 0, j = 0; i < 8; i++, j += width_tbl[1]) {
cur_lp[j] = lv1;
cur_lp[j+1] = lv2;
}
@@ -868,15 +870,15 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
case 5:
LP2_CHECK(buf1,rle_v3,lp2)
case 4:
- if(lp2 == 0 && flag1 != 0) {
- for(i = 0, j = width_tbl[1]; i < 7; i++, j += width_tbl[1]) {
+ if (lp2 == 0 && flag1 != 0) {
+ for (i = 0, j = width_tbl[1]; i < 7; i++, j += width_tbl[1]) {
cur_lp[j] = lv1;
cur_lp[j+1] = lv2;
}
cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
} else {
- for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) {
+ for (i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) {
cur_lp[j] = lv1;
cur_lp[j+1] = lv2;
}
@@ -889,8 +891,8 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 7:
- if(lp2 == 0) {
- if(rle_v3 != 0)
+ if (lp2 == 0) {
+ if (rle_v3 != 0)
rle_v3 = 0;
else {
buf1--;
@@ -906,7 +908,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
lv = (lv1 & 0x7F) << 1;
lv += (lv << 8);
lv += (lv << 16);
- for(i = 0, j = 0; i < 8; i++, j += width_tbl[1])
+ for (i = 0, j = 0; i < 8; i++, j += width_tbl[1])
cur_lp[j] = lv;
LV1_CHECK(buf1,rle_v3,lv1,lp2)
break;
@@ -923,9 +925,9 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
flag1 = 0;
}
} else {
- for( ; blks_height > 0; blks_height -= 8) {
- for(lp1 = 0; lp1 < blks_width; lp1 += 2) {
- for(lp2 = 0; lp2 < 4; ) {
+ for ( ; blks_height > 0; blks_height -= 8) {
+ for (lp1 = 0; lp1 < blks_width; lp1 += 2) {
+ for (lp2 = 0; lp2 < 4; ) {
k = *buf1++;
cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2 * 2];
ref_lp = ((uint32 *)ref_frm_pos) + width_tbl[lp2 * 2];
@@ -952,8 +954,8 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 2:
- if(lp2 == 0) {
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) {
+ if (lp2 == 0) {
+ for (i = 0, j = 0; i < 4; i++, j += width_tbl[1]) {
cur_lp[j] = ref_lp[j];
cur_lp[j+1] = ref_lp[j+1];
}
@@ -962,8 +964,8 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 3:
- if(lp2 < 2) {
- for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) {
+ if (lp2 < 2) {
+ for (i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) {
cur_lp[j] = ref_lp[j];
cur_lp[j+1] = ref_lp[j+1];
}
@@ -972,9 +974,9 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 8:
- if(lp2 == 0) {
+ if (lp2 == 0) {
RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
- for(i = 0, j = 0; i < 8; i++, j += width_tbl[1]) {
+ for (i = 0, j = 0; i < 8; i++, j += width_tbl[1]) {
((uint32 *)cur_frm_pos)[j] = ((uint32 *)ref_frm_pos)[j];
((uint32 *)cur_frm_pos)[j+1] = ((uint32 *)ref_frm_pos)[j+1];
}
@@ -989,7 +991,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
LP2_CHECK(buf1,rle_v3,lp2)
case 6:
case 4:
- for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) {
+ for (i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) {
cur_lp[j] = ref_lp[j];
cur_lp[j+1] = ref_lp[j+1];
}
@@ -1002,7 +1004,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
lv = (lv1 & 0x7F) << 1;
lv += (lv << 8);
lv += (lv << 16);
- for(i = 0, j = 0; i < 8; i++, j += width_tbl[1])
+ for (i = 0, j = 0; i < 8; i++, j += width_tbl[1])
((uint32 *)cur_frm_pos)[j] = ((uint32 *)cur_frm_pos)[j+1] = lv;
LV1_CHECK(buf1,rle_v3,lv1,lp2)
break;
@@ -1023,12 +1025,12 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 11: /********** CASE 11 **********/
- if(ref_vectors == NULL)
+ if (ref_vectors == NULL)
return;
- for( ; blks_height > 0; blks_height -= 8) {
- for(lp1 = 0; lp1 < blks_width; lp1++) {
- for(lp2 = 0; lp2 < 4; ) {
+ for ( ; blks_height > 0; blks_height -= 8) {
+ for (lp1 = 0; lp1 < blks_width; lp1++) {
+ for (lp2 = 0; lp2 < 4; ) {
k = *buf1++;
cur_lp = ((uint32 *)cur_frm_pos) + width_tbl[lp2 * 2];
ref_lp = ((uint32 *)ref_frm_pos) + width_tbl[lp2 * 2];
@@ -1055,26 +1057,26 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
break;
case 2:
- if(lp2 == 0) {
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
+ if (lp2 == 0) {
+ for (i = 0, j = 0; i < 4; i++, j += width_tbl[1])
cur_lp[j] = ref_lp[j];
lp2 += 2;
}
break;
case 3:
- if(lp2 < 2) {
- for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1])
+ if (lp2 < 2) {
+ for (i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1])
cur_lp[j] = ref_lp[j];
lp2 = 3;
}
break;
case 8:
- if(lp2 == 0) {
+ if (lp2 == 0) {
RLE_V3_CHECK(buf1,rle_v1,rle_v2,rle_v3)
- for(i = 0, j = 0; i < 8; i++, j += width_tbl[1])
+ for (i = 0, j = 0; i < 8; i++, j += width_tbl[1])
cur_lp[j] = ref_lp[j];
RLE_V2_CHECK(buf1,rle_v2, rle_v3,lp2)
@@ -1088,7 +1090,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
LP2_CHECK(buf1,rle_v3,lp2)
case 4:
case 6:
- for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1])
+ for (i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1])
cur_lp[j] = ref_lp[j];
lp2 = 4;
break;
@@ -1099,7 +1101,7 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
lv = (lv1 & 0x7F) << 1;
lv += (lv << 8);
lv += (lv << 16);
- for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
+ for (i = 0, j = 0; i < 4; i++, j += width_tbl[1])
cur_lp[j] = lv;
LV1_CHECK(buf1,rle_v3,lv1,lp2)
break;
@@ -1123,18 +1125,18 @@ void Indeo3::decodeChunk(byte *cur, byte *ref, int width, int height,
}
}
- if(strip < strip_tbl)
+ if (strip < strip_tbl)
return;
- for( ; strip >= strip_tbl; strip--) {
- if(strip->split_flag != 0) {
+ for ( ; strip >= strip_tbl; strip--) {
+ if (strip->split_flag != 0) {
strip->split_flag = 0;
strip->usl7 = (strip-1)->usl7;
- if(strip->split_direction) {
+ if (strip->split_direction) {
strip->xpos += strip->width;
strip->width = (strip-1)->width - strip->width;
- if(region_160_width <= strip->xpos && width < strip->width + strip->xpos)
+ if (region_160_width <= strip->xpos && width < strip->width + strip->xpos)
strip->width = width - strip->xpos;
} else {
strip->ypos += strip->height;
diff --git a/engines/gob/parse_v1.cpp b/engines/gob/parse_v1.cpp
index ed8868397a..5345089b6c 100644
--- a/engines/gob/parse_v1.cpp
+++ b/engines/gob/parse_v1.cpp
@@ -267,7 +267,8 @@ int16 Parse_v1::parseValExpr(byte stopToken) {
for (brackPos = (stkPos - 2); (brackPos > 0) &&
(operStack[brackPos] < 30) && (operStack[brackPos] != 9);
- brackPos--);
+ brackPos--)
+ ;
if ((operStack[brackPos] >= 30) || (operStack[brackPos] == 9))
brackPos++;
@@ -587,7 +588,8 @@ int16 Parse_v1::parseExpr(byte stopToken, byte *arg_2) {
for (brackStart = (stkPos - 2); (brackStart > 0) &&
(operStack[brackStart] < 30) && (operStack[brackStart] != 9);
- brackStart--);
+ brackStart--)
+ ;
if ((operStack[brackStart] >= 30) || (operStack[brackStart] == 9))
brackStart++;
diff --git a/engines/gob/parse_v2.cpp b/engines/gob/parse_v2.cpp
index fd2726d049..c48610d230 100644
--- a/engines/gob/parse_v2.cpp
+++ b/engines/gob/parse_v2.cpp
@@ -406,7 +406,8 @@ int16 Parse_v2::parseValExpr(byte stopToken) {
for (brackPos = (stkPos - 2); (brackPos > 0) &&
(operStack[brackPos] < 30) && (operStack[brackPos] != 9);
- brackPos--);
+ brackPos--)
+ ;
if ((operStack[brackPos] >= 30) || (operStack[brackPos] == 9))
brackPos++;
@@ -791,7 +792,8 @@ int16 Parse_v2::parseExpr(byte stopToken, byte *arg_2) {
for (brackStart = (stkPos - 2); (brackStart > 0) &&
(operStack[brackStart] < 30) && (operStack[brackStart] != 9);
- brackStart--);
+ brackStart--)
+ ;
if ((operStack[brackStart] >= 30) || (operStack[brackStart] == 9))
brackStart++;
diff --git a/engines/gob/saveload_v2.cpp b/engines/gob/saveload_v2.cpp
index 69bda7de31..e58799a6db 100644
--- a/engines/gob/saveload_v2.cpp
+++ b/engines/gob/saveload_v2.cpp
@@ -113,7 +113,7 @@ bool SaveLoad_v2::loadVersioned(int type, int16 dataVar, int32 size, int32 offse
break;
case kSaveTempSprite:
- if(loadTempSprite(_saveFiles[type], dataVar, size, offset))
+ if (loadTempSprite(_saveFiles[type], dataVar, size, offset))
return true;
warning("While loading the temporary sprite");
@@ -142,7 +142,7 @@ bool SaveLoad_v2::saveVersioned(int type, int16 dataVar, int32 size, int32 offse
break;
case kSaveTempSprite:
- if(saveTempSprite(_saveFiles[type], dataVar, size, offset))
+ if (saveTempSprite(_saveFiles[type], dataVar, size, offset))
return true;
warning("While saving the temporary sprite");
@@ -319,7 +319,7 @@ bool SaveLoad_v2::saveGame(SaveFile &saveFile,
byte sizes[40];
memset(sizes, 0, 40);
- if(!_save->save(0, 40, 0, saveFile.destName, _indexBuffer + (slot * 40), sizes))
+ if (!_save->save(0, 40, 0, saveFile.destName, _indexBuffer + (slot * 40), sizes))
return false;
if (!_save->save(dataVar, size, 40, saveFile.destName, _vm->_inter->_variables))
diff --git a/engines/gob/saveload_v3.cpp b/engines/gob/saveload_v3.cpp
index 265f8a2c62..806ac75939 100644
--- a/engines/gob/saveload_v3.cpp
+++ b/engines/gob/saveload_v3.cpp
@@ -130,7 +130,7 @@ bool SaveLoad_v3::loadVersioned(int type, int16 dataVar, int32 size, int32 offse
break;
case kSaveTempSprite:
- if(loadTempSprite(_saveFiles[type], dataVar, size, offset))
+ if (loadTempSprite(_saveFiles[type], dataVar, size, offset))
return true;
warning("While loading the temporary sprite");
@@ -169,7 +169,7 @@ bool SaveLoad_v3::saveVersioned(int type, int16 dataVar, int32 size, int32 offse
break;
case kSaveTempSprite:
- if(saveTempSprite(_saveFiles[type], dataVar, size, offset))
+ if (saveTempSprite(_saveFiles[type], dataVar, size, offset))
return true;
warning("While saving the temporary sprite");
@@ -489,10 +489,10 @@ bool SaveLoad_v3::saveGame(SaveFile &saveFile,
_hasIndex = false;
- if(!_save->save(0, 500, 0, saveFile.destName, _propBuffer, _propBuffer + 500))
+ if (!_save->save(0, 500, 0, saveFile.destName, _propBuffer, _propBuffer + 500))
return false;
- if(!_save->save(0, 40, 500, saveFile.destName, _indexBuffer + (saveFile.slot * 40), 0))
+ if (!_save->save(0, 40, 500, saveFile.destName, _indexBuffer + (saveFile.slot * 40), 0))
return false;
if (!_save->save(dataVar, size, 540, saveFile.destName, _vm->_inter->_variables))
diff --git a/engines/gob/saveload_v4.cpp b/engines/gob/saveload_v4.cpp
index 28a2a61604..e7df11f6ad 100644
--- a/engines/gob/saveload_v4.cpp
+++ b/engines/gob/saveload_v4.cpp
@@ -397,10 +397,10 @@ bool SaveLoad_v4::saveGame(SaveFile &saveFile,
_hasIndex = false;
- if(!_save->save(0, 500, 0, saveFile.destName, _propBuffer, _propBuffer + 500))
+ if (!_save->save(0, 500, 0, saveFile.destName, _propBuffer, _propBuffer + 500))
return false;
- if(!_save->save(0, 40, 500, saveFile.destName, _indexBuffer + (slot * 40), 0))
+ if (!_save->save(0, 40, 500, saveFile.destName, _indexBuffer + (slot * 40), 0))
return false;
if (!_save->save(dataVar, size, 540, saveFile.destName, _vm->_inter->_variables))
diff --git a/engines/gob/saveload_v6.cpp b/engines/gob/saveload_v6.cpp
index 408b9fa6bd..f0de4d934a 100644
--- a/engines/gob/saveload_v6.cpp
+++ b/engines/gob/saveload_v6.cpp
@@ -244,7 +244,7 @@ bool SaveLoad_v6::saveGame(SaveFile &saveFile,
byte sizes[40];
memset(sizes, 0, 40);
- if(!_save->save(0, 40, 0, saveFile.destName, _indexBuffer + 500 + (slot * 40), sizes))
+ if (!_save->save(0, 40, 0, saveFile.destName, _indexBuffer + 500 + (slot * 40), sizes))
return false;
if (!_save->save(dataVar, size, 40, saveFile.destName, _vm->_inter->_variables))
diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp
index 33e540ace4..16c6079f45 100644
--- a/engines/gob/scenery.cpp
+++ b/engines/gob/scenery.cpp
@@ -184,7 +184,8 @@ int16 Scenery::loadStatic(char search) {
_spriteRefs[sprIndex]++;
} else {
for (sprIndex = 19; _vm->_draw->_spritesArray[sprIndex] != 0;
- sprIndex--);
+ sprIndex--)
+ ;
_staticPictToSprite[7 * sceneryIndex + i] = sprIndex;
_spriteRefs[sprIndex] = 1;
@@ -517,7 +518,8 @@ int16 Scenery::loadAnim(char search) {
_spriteRefs[sprIndex]++;
} else {
for (sprIndex = 19; _vm->_draw->_spritesArray[sprIndex] != 0;
- sprIndex--);
+ sprIndex--)
+ ;
_animPictToSprite[7 * sceneryIndex + i] = sprIndex;
_spriteRefs[sprIndex] = 1;
diff --git a/engines/gob/sound/cdrom.cpp b/engines/gob/sound/cdrom.cpp
index eef8025cc2..b68ebd0c5b 100644
--- a/engines/gob/sound/cdrom.cpp
+++ b/engines/gob/sound/cdrom.cpp
@@ -94,7 +94,8 @@ void CDROM::startTrack(const char *trackName) {
stopPlaying();
_curTrackBuffer = matchPtr;
- while (getTrackPos() >= 0);
+ while (getTrackPos() >= 0)
+ ;
uint32 start = READ_LE_UINT32(matchPtr + 12);
uint32 end = READ_LE_UINT32(matchPtr + 16);
@@ -151,7 +152,8 @@ const char *CDROM::getCurTrack() const {
void CDROM::stopPlaying() {
stop();
- while (getTrackPos() != -1);
+ while (getTrackPos() != -1)
+ ;
}
void CDROM::stop() {