diff options
author | Max Horn | 2003-06-07 00:49:36 +0000 |
---|---|---|
committer | Max Horn | 2003-06-07 00:49:36 +0000 |
commit | 49b9a8fc9d999b82c3e694a6da672b259089fe97 (patch) | |
tree | 518372b3be43f44b83e07dd5e70aec2645b6e419 | |
parent | 55d3168c59d9e8244705e44e82602c69b2b8d7f2 (diff) | |
download | scummvm-rg350-49b9a8fc9d999b82c3e694a6da672b259089fe97.tar.gz scummvm-rg350-49b9a8fc9d999b82c3e694a6da672b259089fe97.tar.bz2 scummvm-rg350-49b9a8fc9d999b82c3e694a6da672b259089fe97.zip |
follow our coding conventions
svn-id: r8377
-rw-r--r-- | scumm/actor.cpp | 2 | ||||
-rw-r--r-- | scumm/akos.cpp | 10 | ||||
-rw-r--r-- | scumm/bomp.cpp | 12 | ||||
-rw-r--r-- | scumm/charset.cpp | 10 | ||||
-rw-r--r-- | scumm/debugger.cpp | 8 | ||||
-rw-r--r-- | scumm/dialogs.cpp | 2 | ||||
-rw-r--r-- | scumm/gfx.cpp | 28 | ||||
-rw-r--r-- | scumm/imuse_digi.cpp | 28 | ||||
-rw-r--r-- | scumm/nut_renderer.cpp | 26 | ||||
-rw-r--r-- | scumm/script.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v5.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 10 | ||||
-rw-r--r-- | scumm/script_v8.cpp | 2 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 12 | ||||
-rw-r--r-- | scumm/sound.cpp | 14 | ||||
-rw-r--r-- | scumm/string.cpp | 8 |
17 files changed, 89 insertions, 89 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index d5a2d42c8b..633097630c 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -1387,7 +1387,7 @@ void Actor::walkActorOld() { return; walkbox = walkdata.destbox; - } while(1); + } while (1); moving |= MF_LAST_LEG; calcMovementFactor(walkdata.destx, walkdata.desty); diff --git a/scumm/akos.cpp b/scumm/akos.cpp index 0514a3908d..cbc7761c0a 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -924,7 +924,7 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { int32 skip_x, skip_y, cur_x, cur_y; const byte transparency = (_vm->_features & GF_HUMONGOUS) ? 0 : 255; - if(!_mirror) { + if (!_mirror) { clip_left = (_actorX - xmoveCur - _width) + 1; } else { clip_left = _actorX + xmoveCur; @@ -948,17 +948,17 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { clip_left = 0; } - if(clip_right > maxw) { + if (clip_right > maxw) { cur_x -= clip_right - maxw; clip_right = maxw; } - if(clip_top < 0) { + if (clip_top < 0) { skip_y -= clip_top; clip_top = 0; } - if(clip_bottom > maxh) { + if (clip_bottom > maxh) { cur_y -= clip_bottom - maxh; clip_bottom = maxh; } @@ -999,7 +999,7 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { out_height++; cur_x -= skip_x; - if(cur_x < 0) { + if (cur_x < 0) { cur_x = -cur_x; } cur_x++; diff --git a/scumm/bomp.cpp b/scumm/bomp.cpp index 1a02ba3995..50c5cecab9 100644 --- a/scumm/bomp.cpp +++ b/scumm/bomp.cpp @@ -97,7 +97,7 @@ void bompDecodeLineReverse(byte *dst, const byte *src, int size) { } void bompApplyMask(byte *line_buffer, byte *mask, byte maskbit, int32 size, byte transparency) { - while(1) { + while (1) { do { if (size-- == 0) return; @@ -129,7 +129,7 @@ void bompApplyShadow(int shadowMode, const byte *shadowPalette, const byte *line } } void bompApplyShadow0(const byte *line_buffer, byte *dst, int32 size, byte transparency) { - while(size-- > 0) { + while (size-- > 0) { byte tmp = *line_buffer++; if (tmp != transparency) { *dst = tmp; @@ -139,7 +139,7 @@ void bompApplyShadow0(const byte *line_buffer, byte *dst, int32 size, byte trans } void bompApplyShadow1(const byte *shadowPalette, const byte *line_buffer, byte *dst, int32 size, byte transparency) { - while(size-- > 0) { + while (size-- > 0) { byte tmp = *line_buffer++; if (tmp != transparency) { if (tmp == 13) { @@ -152,7 +152,7 @@ void bompApplyShadow1(const byte *shadowPalette, const byte *line_buffer, byte * } void bompApplyShadow3(const byte *shadowPalette, const byte *line_buffer, byte *dst, int32 size, byte transparency) { - while(size-- > 0) { + while (size-- > 0) { byte tmp = *line_buffer++; if (tmp != transparency) { if (tmp < 8) { @@ -424,7 +424,7 @@ int32 setupBompScale(byte * scaling, int32 size, byte scale) { byte * tmp_scaling = scaling; byte a = 0; - while((count--) != 0) { + while ((count--) != 0) { tmp = *(tmp_ptr + 3); a <<= 1; if (scale < tmp) { @@ -477,7 +477,7 @@ int32 setupBompScale(byte * scaling, int32 size, byte scale) { count = (size + 7) >> 3; byte ret_value = 0; - while(count--) { + while (count--) { tmp = *scaling++; assert(tmp < sizeof(_bompBitsTable)); ret_value += _bompBitsTable[tmp]; diff --git a/scumm/charset.cpp b/scumm/charset.cpp index e9b7a6ec46..ae05e3767a 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -79,7 +79,7 @@ void CharsetRendererV3::setCurID(byte id) { // do spacing for variable width old-style font int CharsetRendererClassic::getCharWidth(byte chr) { - if(chr >= 0x80 && _vm->_CJKMode) + if (chr >= 0x80 && _vm->_CJKMode) return 6; int spacing = 0; @@ -605,7 +605,7 @@ void CharsetRendererClassic::printChar(int chr) { _vm->_charsetColorMap[1] = _color; - if(is2byte) { + if (is2byte) { _dropShadow = true; charPtr = g_scumm->get2byteCharPtr(chr); width = g_scumm->_2byteWidth; @@ -691,7 +691,7 @@ void CharsetRendererClassic::printChar(int chr) { + vs->xstart + drawTop * _vm->_screenWidth + _left; } - if(is2byte) { + if (is2byte) { drawBits1(vs, dst, charPtr, mask, drawTop, origWidth, origHeight); } else { byte bpp = *_fontPtr; @@ -776,7 +776,7 @@ void CharsetRendererCommon::drawBits1(VirtScreen *vs, byte *dst, const byte *src maskpos = 0; for (x = 0; x < width; x++) { - if((x % 8) == 0) + if ((x % 8) == 0) bits = *src++; if (bits & revBitMask[x % 8]) { if (_dropShadow) { @@ -866,7 +866,7 @@ void CharsetRendererNut::printChar(int chr) { int width = _current->getCharWidth(chr); int height = _current->getCharHeight(chr); - if(chr >= 256 && _vm->_CJKMode) + if (chr >= 256 && _vm->_CJKMode) width = 16; _hasMask = true; diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index 79c91c92ba..5918bc2aa5 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -225,7 +225,7 @@ void ScummDebugger::enter() { if (i == 0) continue; - } while(RunCommand(buf)); + } while (RunCommand(buf)); #endif } @@ -246,7 +246,7 @@ bool ScummDebugger::RunCommand(const char *inputOrig) { param[num_params++] = input; } - for(i=0; i < _dcmd_count; i++) { + for (i=0; i < _dcmd_count; i++) { if (!strcmp(_dcmds[i].name, param[0])) { bool result = (this->*_dcmds[i].function)(num_params, param); free(input); @@ -255,7 +255,7 @@ bool ScummDebugger::RunCommand(const char *inputOrig) { } // It's not a command, so things get a little tricky for variables. Do fuzzy matching to ignore things like subscripts. - for(i = 0; i < _dvar_count; i++) { + for (i = 0; i < _dvar_count; i++) { if (!strncmp(_dvars[i].name, param[0], strlen(_dvars[i].name))) { if (num_params > 1) { // Alright, we need to check the TYPE of the variable to deref and stuff... the array stuff is a bit ugly :) @@ -1003,7 +1003,7 @@ bool ScummDebugger::TabComplete(const char *input, char*& completion) { unsigned int matchlen = 0; char match[30]; // the max. command name is 30 chars - for(int i=0; i < _dcmd_count; i++) { + for (int i=0; i < _dcmd_count; i++) { if (!strncmp(_dcmds[i].name, input, inputlen)) { unsigned int commandlen = strlen(_dcmds[i].name); if (commandlen == inputlen) { // perfect match diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp index 1b5b73483e..55ac8447b4 100644 --- a/scumm/dialogs.cpp +++ b/scumm/dialogs.cpp @@ -327,7 +327,7 @@ void SaveLoadDialog::fillList() { _scumm->listSavegames(avail_saves, ARRAYSIZE(avail_saves), mgr); for (; i < ARRAYSIZE(avail_saves); i++) { - if(avail_saves[i]) + if (avail_saves[i]) _scumm->getSavegameName(i, name, mgr); else name[0] = 0; diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 0b4249d92d..905350145a 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -1383,12 +1383,12 @@ void Gdi::decodeC64Gfx(const byte *src, byte *dst, int size) { int x, z; byte color, run, common[4]; - for(z = 0; z < 4; z++) { + for (z = 0; z < 4; z++) { common[z] = *src++; } x = 0; - while(x < size){ + while (x < size){ color = *src++; if (color < 0x40) { for (z = 0; z <= color; z++) { @@ -1414,37 +1414,37 @@ void Gdi::decodeStripEGA(byte *dst, const byte *src, int height) { byte color = 0; int run = 0, x = 0, y = 0, z; - while(x < 8) { + while (x < 8) { color = *src++; - if(color & 0x80) { + if (color & 0x80) { run = color & 0x3f; - if(color & 0x40) { + if (color & 0x40) { color = *src++; - if(run == 0) { + if (run == 0) { run = *src++; } - for(z = 0; z < run; z++) { + for (z = 0; z < run; z++) { *(dst + y * _vm->_screenWidth + x) = (z&1) ? (color & 0xf) : (color >> 4); y++; - if(y >= height) { + if (y >= height) { y = 0; x++; } } } else { - if(run == 0) { + if (run == 0) { run = *src++; } - for(z = 0; z < run; z++) { + for (z = 0; z < run; z++) { *(dst + y * _vm->_screenWidth + x) = *(dst + y * _vm->_screenWidth + x - 1); y++; - if(y >= height) { + if (y >= height) { y = 0; x++; } @@ -1452,15 +1452,15 @@ void Gdi::decodeStripEGA(byte *dst, const byte *src, int height) { } } else { run = color >> 4; - if(run == 0) { + if (run == 0) { run = *src++; } - for(z = 0; z < run; z++) { + for (z = 0; z < run; z++) { *(dst + y * _vm->_screenWidth + x) = color & 0xf; y++; - if(y >= height) { + if (y >= height) { y = 0; x++; } diff --git a/scumm/imuse_digi.cpp b/scumm/imuse_digi.cpp index 5800b555a0..223e9bf32e 100644 --- a/scumm/imuse_digi.cpp +++ b/scumm/imuse_digi.cpp @@ -33,7 +33,7 @@ static void imus_digital_handler(void *engine) { // Avoid race condition - if(engine && ((Scumm *)engine)->_imuseDigital) + if (engine && ((Scumm *)engine)->_imuseDigital) ((Scumm *)engine)->_imuseDigital->handler(); } @@ -747,7 +747,7 @@ void IMuseDigital::handler() { } if (_channel[l]._bits == 12) { - for(i = 0; i < (mixer_size / 4); i++) { + for (i = 0; i < (mixer_size / 4); i++) { byte sample1 = buf[i * 4 + 0]; byte sample2 = buf[i * 4 + 1]; byte sample3 = buf[i * 4 + 2]; @@ -760,7 +760,7 @@ void IMuseDigital::handler() { buf[i * 4 + 3] = (byte)(sample_b & 0xff); } } else if (_channel[l]._bits == 8) { - for(i = 0; i < (mixer_size / 2); i++) { + for (i = 0; i < (mixer_size / 2); i++) { buf[i * 2 + 0] = (byte)(((int8)(buf[i * 2 + 0] ^ 0x80) * _channel[l]._volumeRight) >> 8) ^ 0x80; buf[i * 2 + 1] = (byte)(((int8)(buf[i * 2 + 1] ^ 0x80) * _channel[l]._volume) >> 8) ^ 0x80; } @@ -783,11 +783,11 @@ void IMuseDigital::startSound(int sound) { debug(5, "IMuseDigital::startSound(%d)", sound); int32 l; - for(l = 0; l < MAX_DIGITAL_CHANNELS; l++) { - if(_channel[l]._used == false) { + for (l = 0; l < MAX_DIGITAL_CHANNELS; l++) { + if (_channel[l]._used == false) { byte *ptr = _scumm->getResourceAddress(rtSound, sound); byte *s_ptr = ptr; - if(ptr == NULL) { + if (ptr == NULL) { warning("IMuseDigital::startSound(%d) NULL resource pointer", sound); return; } @@ -1064,7 +1064,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i case 0: // play music (state) debug(5, "IMuseDigital::doCommand 0x1000 (%d)", b); if (_scumm->_gameId == GID_DIG) { - for(l = 0;; l++) { + for (l = 0;; l++) { if (_digStateMusicMap[l].room == -1) { return 1; } @@ -1084,7 +1084,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i return 0; } - for(l = 0;; l++) { + for (l = 0;; l++) { if (_comiStateMusicTable[l].index == -1) { return 1; } @@ -1097,14 +1097,14 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i } } } else if (_scumm->_gameId == GID_FT) { - for(l = 0;; l++) { + for (l = 0;; l++) { if (_ftStateMusicTable[l].index == -1) { return 1; } if (_ftStateMusicTable[l].index == b) { debug(5, "Play imuse music: %s, %s", _ftStateMusicTable[l].name, _ftStateMusicTable[l].audioname); if (_ftStateMusicTable[l].audioname[0] != 0) { - for(r = 0; r < _scumm->_numAudioNames; r++) { + for (r = 0; r < _scumm->_numAudioNames; r++) { if (strcmp(_ftStateMusicTable[l].audioname, &_scumm->_audioNames[r * 9]) == 0) { startSound(r); doCommand(12, r, 1536, _ftStateMusicTable[l].volume, 0, 0, 0, 0); @@ -1118,7 +1118,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i case 1: // play music (seq) debug(5, "IMuseDigital::doCommand 0x1001 (%d)", b); if (_scumm->_gameId == GID_DIG) { - for(l = 0;; l++) { + for (l = 0;; l++) { if (_digSeqMusicTable[l].index == -1) { return 1; } @@ -1131,7 +1131,7 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i } } } else if (_scumm->_gameId == GID_CMI) { - for(l = 0;; l++) { + for (l = 0;; l++) { if (_comiSeqMusicTable[l].index == -1) { return 1; } @@ -1144,14 +1144,14 @@ int32 IMuseDigital::doCommand(int a, int b, int c, int d, int e, int f, int g, i } } } else if (_scumm->_gameId == GID_FT) { - for(l = 0;; l++) { + for (l = 0;; l++) { if (_ftSeqMusicTable[l].index == -1) { return 1; } if (_ftSeqMusicTable[l].index == b) { debug(5, "Play imuse music: %s, %s", _ftSeqMusicTable[l].name, _ftSeqMusicTable[l].audioname); if (_ftSeqMusicTable[l].audioname[0] != 0) { - for(r = 0; r < _scumm->_numAudioNames; r++) { + for (r = 0; r < _scumm->_numAudioNames; r++) { if (strcmp(_ftSeqMusicTable[l].audioname, &_scumm->_audioNames[r * 9]) == 0) { startSound(r); doCommand(12, r, 1536, _ftSeqMusicTable[l].volume, 0, 0, 0, 0); diff --git a/scumm/nut_renderer.cpp b/scumm/nut_renderer.cpp index d25ba15d07..d9aed3b943 100644 --- a/scumm/nut_renderer.cpp +++ b/scumm/nut_renderer.cpp @@ -29,13 +29,13 @@ NutRenderer::NutRenderer(Scumm *vm) : _loaded(false), _nbChars(0) { - for(int i = 0; i < 256; i++) + for (int i = 0; i < 256; i++) _chars[i].src = NULL; } NutRenderer::~NutRenderer() { - for(int i = 0; i < _nbChars; i++) { - if(_chars[i].src) + for (int i = 0; i < _nbChars; i++) { + if (_chars[i].src) delete []_chars[i].src; } } @@ -134,15 +134,15 @@ int NutRenderer::getCharWidth(byte c) { return 0; } - if(c >= 0x80 && _vm->_CJKMode) { - if(_vm->_gameId == GID_CMI) + if (c >= 0x80 && _vm->_CJKMode) { + if (_vm->_gameId == GID_CMI) return 8; - if(_vm->_gameId == GID_DIG) + if (_vm->_gameId == GID_DIG) return 6; return 0; } - if(c >= _nbChars) + if (c >= _nbChars) error("invalid character in NutRenderer::getCharWidth : %d (%d)", c, _nbChars); return _chars[c].width; @@ -155,15 +155,15 @@ int NutRenderer::getCharHeight(byte c) { return 0; } - if(c >= 0x80 && _vm->_CJKMode) { - if(_vm->_gameId == GID_CMI) + if (c >= 0x80 && _vm->_CJKMode) { + if (_vm->_gameId == GID_CMI) return 16; - if(_vm->_gameId == GID_DIG) + if (_vm->_gameId == GID_DIG) return 10; return 0; } - if(c >= _nbChars) + if (c >= _nbChars) error("invalid character in NutRenderer::getCharHeight : %d (%d)", c, _nbChars); return _chars[c].height; @@ -199,7 +199,7 @@ void NutRenderer::drawShadowChar(int c, int x, int y, byte color, bool useMask) if (useMask) mask = _vm->getMaskBuffer(x, y, 0); - if(c >= 256 && _vm->_CJKMode) + if (c >= 256 && _vm->_CJKMode) draw2byte(dst, mask, c, x, y, color); else drawChar(dst, mask, (byte)c, x, y, color); @@ -260,7 +260,7 @@ void NutRenderer::draw2byte(byte *dst, byte *mask, int c, int x, int y, byte col maskmask = revBitMask[x & 7]; maskpos = 0; for (int tx = 0; tx < width; tx++) { - if((tx % 8) == 0) + if ((tx % 8) == 0) bits = *src++; if (x + tx < 0 || x + tx >= _vm->_screenWidth || y + ty < 0 || y + ty >= _vm->_screenHeight) continue; diff --git a/scumm/script.cpp b/scumm/script.cpp index 118f887b92..eb62fc03a7 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -546,7 +546,7 @@ void Scumm::writeVar(uint var, int value) { int bit = var & 0xF; var = (var >> 4) & 0xFF; checkRange(_numVariables - 1, 0, var, "Variable %d out of range(wzb)"); - if(value) + if (value) _scummVars[var] |= ( 1 << bit ); else _scummVars[var] &= ~( 1 << bit ); diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 502b5361eb..6429e9fe6b 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -1338,7 +1338,7 @@ void Scumm_v2::o2_setObjectName() { return; // Silently fail for now name = objptr + *(objptr + 14); - while(name[size++]) + while (name[size++]) ; if (i > size) { diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index ea7e3b94c0..ce579f4991 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -1506,7 +1506,7 @@ void Scumm_v5::o5_resourceRoutines() { // FIXME - this probably can be removed eventually, I don't think the following // check will ever be triggered, but then I could be wrong and it's better // to play it safe. - if((_opcode & 0x3F) != (_opcode & 0x1F)) + if ((_opcode & 0x3F) != (_opcode & 0x1F)) error("Oops, this shouldn't happen: o5_resourceRoutines opcode %d", _opcode); } diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 31eeef87a0..a664e5ac87 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -2693,24 +2693,24 @@ void Scumm_v6::o6_kernelGetFunctions() { */ - if((args[1] == 27) && (_lastKeyHit == 27)) { + if ((args[1] == 27) && (_lastKeyHit == 27)) { push(1); // abort return; } - if( ((args[1] == 328) || (args[1] == 336) || (args[1] == 13)) && + if ( ((args[1] == 328) || (args[1] == 336) || (args[1] == 13)) && ((VAR(VAR_LEFTBTN_HOLD)) || (_lastKeyHit == 13) || (_lastKeyHit == 274) || (_lastKeyHit == 273)) ) { push(1); // thrust return; } - if(((args[1] == 97) || (args[1] == 331)) && (_lastKeyHit == 276)) { + if (((args[1] == 97) || (args[1] == 331)) && (_lastKeyHit == 276)) { push(1); // left return; } - if(((args[1] == 115) || (args[1] == 333)) && (_lastKeyHit == 275)) { + if (((args[1] == 115) || (args[1] == 333)) && (_lastKeyHit == 275)) { push(1); // right return; } @@ -2845,7 +2845,7 @@ void Scumm_v6::o6_findAllObjects() { defineArray(0, 5, 0, _numLocalObjects + 1); writeArray(0, 0, 0, _numLocalObjects); - while(i < _numLocalObjects) { + while (i < _numLocalObjects) { writeArray(0, 0, i, _objs[i].obj_nr); i++; } diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 9d3a2b15b5..ca5c982d44 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -786,7 +786,7 @@ void Scumm_v8::o8_createBoxMatrix() { createBoxMatrix(); - for(i = 1; i < _numActors; i++) { + for (i = 1; i < _numActors; i++) { a = &_actors[i]; if (a && a->isInCurrentRoom()) a->adjustActorPos(); diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index 26f90953a0..f18986ff4f 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -673,7 +673,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst) // Load CJK font _CJKMode = false; - if((_gameId == GID_DIG || _gameId == GID_CMI) && (_language == KO_KOR || _language == JA_JPN || _language == ZH_TWN)) { + if ((_gameId == GID_DIG || _gameId == GID_CMI) && (_language == KO_KOR || _language == JA_JPN || _language == ZH_TWN)) { File fp; const char *fontFile = NULL; switch(_language) { @@ -686,13 +686,13 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst) fontFile = (_gameId == GID_DIG) ? "kanji16.fnt" : "japanese.fnt"; break; case ZH_TWN: - if(_gameId == GID_CMI) { + if (_gameId == GID_CMI) { _CJKMode = true; fontFile = "chinese.fnt"; } break; } - if(_CJKMode && fp.open(fontFile, getGameDataPath(), 1)) { + if (_CJKMode && fp.open(fontFile, getGameDataPath(), 1)) { debug(2, "Loading CJK Font"); fp.seek(2,SEEK_CUR); _2byteWidth = fp.readByte(); //FIXME: is this correct? @@ -1432,7 +1432,7 @@ void Scumm::initRoomSubBlocks() { // if (_version == 1) { _IM00_offs = 0; - for(i = 0; i < 4; i++){ + for (i = 0; i < 4; i++){ gdi._C64Colors[i] = roomptr[6 + i]; } gdi.decodeC64Gfx(roomptr + READ_LE_UINT16(roomptr + 10), gdi._C64CharMap, 2048); @@ -1921,7 +1921,7 @@ void Scumm::processKbd() { _virtualMouse.x = _mouse.x + virtscr[0].xstart; - if(_features & GF_NEW_CAMERA) + if (_features & GF_NEW_CAMERA) _virtualMouse.y = _mouse.y + camera._cur.y - (_screenHeight / 2); else _virtualMouse.y = _mouse.y; @@ -2399,7 +2399,7 @@ void Scumm::mainRun() { int delta = 0; int diff = _system->get_msecs(); - for(;;) { + for (;;) { #ifdef __PALM_OS__ if (_quit) // palmfixme : need to check for autosave on exit return; diff --git a/scumm/sound.cpp b/scumm/sound.cpp index a02218282d..3e5bdb0200 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -58,7 +58,7 @@ void Sound::addSoundToQueue(int sound) { _scumm->ensureResourceLoaded(rtSound, sound); addSoundToQueue2(sound); } else { - // WARNING ! This may break something, maybe this sould be put inside if(_gameID == GID_FT) ? + // WARNING ! This may break something, maybe this sould be put inside if (_gameID == GID_FT) ? // But why addSoundToQueue should not queue sound ? _scumm->ensureResourceLoaded(rtSound, sound); addSoundToQueue2(sound); @@ -128,7 +128,7 @@ byte *Sound::readCreativeVocFile(byte *ptr, uint32 &size, uint32 &rate, uint32 & assert(code == ~version + 0x1234); bool quit = 0; byte *ret_sound = 0; size = 0, loops = 0; - while(!quit) { + while (!quit) { int len = READ_LE_UINT32(ptr + offset); offset += 4; code = len & 0xFF; @@ -141,8 +141,8 @@ byte *Sound::readCreativeVocFile(byte *ptr, uint32 &size, uint32 &rate, uint32 & len -= 2; rate = 1000000L / (256L - time_constant); debug(9, "VOC Data Bloc : %d, %d, %d", rate, packing, len); - if(packing == 0) { - if(size) { + if (packing == 0) { + if (size) { ret_sound = (byte *)realloc(ret_sound, size + len); } else { ret_sound = (byte *)malloc(len); @@ -964,7 +964,7 @@ uint32 Sound::decode12BitsSample(byte *src, byte **dst, uint32 size, bool stereo byte *ptr = *dst = (byte *)malloc(s_size); uint32 tmp; - while(loop_size--) { + while (loop_size--) { byte v1 = *src++; byte v2 = *src++; byte v3 = *src++; @@ -1098,7 +1098,7 @@ void Sound::bundleMusicHandler(Scumm *scumm) { } ptr += 12; - while(tag != MKID_BE('DATA')) { + while (tag != MKID_BE('DATA')) { tag = READ_BE_UINT32(ptr); ptr += 4; switch(tag) { case MKID_BE('FRMT'): @@ -1227,7 +1227,7 @@ int Sound::playBundleSound(char *sound) { } ptr += 12; - while(tag != MKID_BE('DATA')) { + while (tag != MKID_BE('DATA')) { tag = READ_BE_UINT32(ptr); ptr += 4; switch(tag) { case MKID_BE('FRMT'): diff --git a/scumm/string.cpp b/scumm/string.cpp index 6e0a2b898a..8f21d2d49e 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -242,7 +242,7 @@ void Scumm::CHARSET_1() { if (c != 0xFF) { _charset->_left = _charset->_nextLeft; _charset->_top = _charset->_nextTop; - if(c & 0x80 && _CJKMode) + if (c & 0x80 && _CJKMode) c += *buffer++ * 256; if (_version <= 3) { _charset->printChar(c); @@ -431,7 +431,7 @@ void Scumm::drawString(int a) { if (_string[a].no_talk_anim == 0) _charset->_blitAlso = true; } - if(c >= 0x80 && _CJKMode) + if (c >= 0x80 && _CJKMode) c += buf[i++] * 256; _charset->printChar(c); _charset->_blitAlso = false; @@ -735,7 +735,7 @@ void Scumm::drawBlastTexts() { if (c != 0 && c != 0xFF) { _charset->_left = _charset->_nextLeft; _charset->_top = _charset->_nextTop; - if(c >= 0x80 && _CJKMode) + if (c >= 0x80 && _CJKMode) c += *buf++ * 256; _charset->printChar(c); _charset->_nextLeft = _charset->_left; @@ -775,7 +775,7 @@ void Scumm::loadLanguageBundle() { } else { return; } - if(file.isOpen() == false) { + if (file.isOpen() == false) { _existLanguageFile = false; return; } |