From 0aabf95cb84620f7b5a84b09ceddf5d46d93323c Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Mon, 6 Feb 2012 08:06:48 +0100 Subject: SCUMM: match style-guide, add missing spaces between some "if ()", "for ()" --- engines/scumm/actor.cpp | 26 +++++++++++++------------- engines/scumm/costume.cpp | 22 +++++++++++----------- engines/scumm/player_pce.cpp | 22 +++++++++++----------- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 1ba0eafc06..3989d0f803 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -184,7 +184,7 @@ void Actor_v0::initActor(int mode) { _speaking = 0; _animFrameRepeat = 0; - for(int i = 0; i < 8; ++i) { + for (int i = 0; i < 8; ++i) { _limbFrameRepeatNew[i] = 0; _limbFrameRepeat[i] = 0; _limb_flipped[i] = false; @@ -250,7 +250,7 @@ void Actor::stopActorMoving() { _vm->stopScript(_walkScript); _moving = 0; - if(_vm->_game.version == 0) + if (_vm->_game.version == 0) ((Actor_v0 *)this)->setDirection(_facing); } @@ -339,7 +339,7 @@ int Actor::actorWalkStep() { int distX, distY; int nextFacing; - if(_vm->_game.version == 0) + if (_vm->_game.version == 0) ((Actor_v0 *)this)->_animFrameRepeat = -1; _needRedraw = true; @@ -352,7 +352,7 @@ int Actor::actorWalkStep() { _moving |= MF_IN_LEG; // V0: Don't move during the turn - if(_vm->_game.version == 0) + if (_vm->_game.version == 0) return 0; } @@ -389,7 +389,7 @@ int Actor::actorWalkStep() { return 0; } - if(_vm->_game.version == 0) + if (_vm->_game.version == 0) ((Actor_v0 *)this)->animateActor(newDirToOldDir(_facing)); return 1; @@ -1000,7 +1000,7 @@ void Actor_v0::setDirection(int direction) { _animFrameRepeat = -1; animateActor(res); - if(_moving) + if (_moving) animateCostume(); } @@ -1090,7 +1090,7 @@ void Actor::putActor(int dstX, int dstY, int newRoom) { } // V0 always sets the actor to face the camera upon entering a room - if(_vm->_game.version == 0) + if (_vm->_game.version == 0) setDirection(oldDirToNewDir(2)); } @@ -1194,7 +1194,7 @@ static int checkXYInBoxBounds(int boxnum, int x, int y, int &destX, int &destY) int yDist = ABS(y - destY) / 4; int dist; - if(g_scumm->_game.version == 0) + if (g_scumm->_game.version == 0) xDist *= 2; if (xDist < yDist) @@ -1416,7 +1416,7 @@ void Actor::showActor() { a->_costCommand = a->_costCommandNew = 0xFF; - for(int i = 0; i < 8; ++i) { + for (int i = 0; i < 8; ++i) { a->_limbFrameRepeat[i] = 0; a->_limbFrameRepeatNew[i] = 0; } @@ -1967,7 +1967,7 @@ void Actor_v0::startAnimActor(int f) { return; } - if(f == _standFrame) + if (f == _standFrame) setDirection(_facing); } @@ -2886,19 +2886,19 @@ void Actor_v0::animateActor(int anim) { break; } - if(isInCurrentRoom()) { + if (isInCurrentRoom()) { _costCommandNew = anim; _vm->_costumeLoader->costumeDecodeData(this, 0, 0); - if(dir == -1) + if (dir == -1) return; _facing = normalizeAngle(oldDirToNewDir(dir)); } else { - if(anim > 4 && anim <= 7) + if (anim > 4 && anim <= 7) _facing = normalizeAngle(oldDirToNewDir(dir)); } } diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index da6c1a2ae4..5f0df3566a 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -1190,7 +1190,7 @@ byte V0CostumeRenderer::drawLimb(const Actor *a, int limb) { } // Invalid current position? - if(a->_cost.curpos[limb] == 0xFFFF) + if (a->_cost.curpos[limb] == 0xFFFF) return 0; _loaded.loadCostume(a->_costume); @@ -1285,13 +1285,13 @@ void V0CostumeLoader::loadCostume(int id) { void V0CostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) { Actor_v0 *A = (Actor_v0 *)a; - if(!a->_costume) + if (!a->_costume) return; loadCostume(a->_costume); // Invalid costume command? - if(A->_costCommandNew == 0xFF || (A->_costCommand == A->_costCommandNew)) + if (A->_costCommandNew == 0xFF || (A->_costCommand == A->_costCommandNew)) return; A->_costCommand = A->_costCommandNew; @@ -1308,16 +1308,16 @@ void V0CostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) { limbFrameNumber = ((_animCmds + cmd)[limb]); // Is this limb flipped? - if(limbFrameNumber & 0x80) { + if (limbFrameNumber & 0x80) { // Invalid frame? - if(limbFrameNumber == 0xFF) + if (limbFrameNumber == 0xFF) continue; // Store the limb frame number (clear the flipped status) a->_cost.frame[limb] = (limbFrameNumber & 0x7f); - if(A->_limb_flipped[limb] != true) + if (A->_limb_flipped[limb] != true) a->_cost.start[limb] = 0xFFFF; A->_limb_flipped[limb] = true; @@ -1326,7 +1326,7 @@ void V0CostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) { //Store the limb frame number a->_cost.frame[limb] = limbFrameNumber; - if(A->_limb_flipped[limb] != false) + if (A->_limb_flipped[limb] != false) a->_cost.start[limb] = 0xFFFF; A->_limb_flipped[limb] = false; @@ -1349,7 +1349,7 @@ byte V0CostumeLoader::increaseAnims(Actor *a) { int i; byte r = 0; - for(i = 0; i != 8; i++) { + for (i = 0; i != 8; i++) { A->limbFrameCheck(i); r += increaseAnim(a, i); } @@ -1369,7 +1369,7 @@ byte V0CostumeLoader::increaseAnim(Actor *a, int limb) { if (frame == 0xFF) { // Repeat timer has reached 0? - if(A->_limbFrameRepeat[limb] == 0) { + if (A->_limbFrameRepeat[limb] == 0) { // Use the previous frame --A->_cost.curpos[limb]; @@ -1385,7 +1385,7 @@ byte V0CostumeLoader::increaseAnim(Actor *a, int limb) { } else { // Repeat timer enabled? - if(A->_limbFrameRepeat[limb] != -1) + if (A->_limbFrameRepeat[limb] != -1) --A->_limbFrameRepeat[limb]; // No, restart at frame 0 @@ -1394,7 +1394,7 @@ byte V0CostumeLoader::increaseAnim(Actor *a, int limb) { } // Limb frame has changed? - if(limbPrevious == a->_cost.curpos[limb]) + if (limbPrevious == a->_cost.curpos[limb]) return 0; return 1; diff --git a/engines/scumm/player_pce.cpp b/engines/scumm/player_pce.cpp index 786971c683..8d886ee008 100644 --- a/engines/scumm/player_pce.cpp +++ b/engines/scumm/player_pce.cpp @@ -269,13 +269,13 @@ void PSG_HuC6280::init() { reset(); // Make waveform frequency table - for(i = 0; i < 4096; i++) { + for (i = 0; i < 4096; i++) { step = ((_clock / _rate) * 4096) / (i+1); _waveFreqTable[(1 + i) & 0xFFF] = (uint32)step; } // Make noise frequency table - for(i = 0; i < 32; i++) { + for (i = 0; i < 32; i++) { step = ((_clock / _rate) * 32) / (i+1); _noiseFreqTable[i] = (uint32)step; } @@ -283,7 +283,7 @@ void PSG_HuC6280::init() { // Make volume table // PSG_HuC6280 has 48dB volume range spread over 32 steps step = 48.0 / 32.0; - for(i = 0; i < 31; i++) { + for (i = 0; i < 31; i++) { _volumeTable[i] = (uint16)level; level /= pow(10.0, step / 20.0); } @@ -323,7 +323,7 @@ void PSG_HuC6280::write(int offset, byte data) { case 0x04: // Channel control (key-on, DDA mode, volume) // 1-to-0 transition of DDA bit resets waveform index - if((chan->control & 0x40) && ((data & 0x40) == 0)) { + if ((chan->control & 0x40) && ((data & 0x40) == 0)) { chan->index = 0; } chan->control = data; @@ -383,9 +383,9 @@ void PSG_HuC6280::update(int16* samples, int sampleCnt) { // Clear buffer memset(samples, 0, 2 * sampleCnt * sizeof(int16)); - for(ch = 0; ch < 6; ch++) { + for (ch = 0; ch < 6; ch++) { // Only look at enabled channels - if(_channel[ch].control & 0x80) { + if (_channel[ch].control & 0x80) { int lal = (_channel[ch].balance >> 4) & 0x0F; int ral = (_channel[ch].balance >> 0) & 0x0F; int al = _channel[ch].control & 0x1F; @@ -395,25 +395,25 @@ void PSG_HuC6280::update(int16* samples, int sampleCnt) { // Calculate volume just as the patent says vll = (0x1F - lal) + (0x1F - al) + (0x1F - lmal); - if(vll > 0x1F) vll = 0x1F; + if (vll > 0x1F) vll = 0x1F; vlr = (0x1F - ral) + (0x1F - al) + (0x1F - rmal); - if(vlr > 0x1F) vlr = 0x1F; + if (vlr > 0x1F) vlr = 0x1F; vll = _volumeTable[vll]; vlr = _volumeTable[vlr]; // Check channel mode - if(_channel[ch].control & 0x40) { + if (_channel[ch].control & 0x40) { /* DDA mode */ - for(i = 0; i < sampleCnt; i++) { + for (i = 0; i < sampleCnt; i++) { samples[2*i] += (int16)(vll * (_channel[ch].dda - 16)); samples[2*i + 1] += (int16)(vlr * (_channel[ch].dda - 16)); } } else { /* Waveform mode */ uint32 step = _waveFreqTable[_channel[ch].frequency]; - for(i = 0; i < sampleCnt; i += 1) { + for (i = 0; i < sampleCnt; i += 1) { int offset; int16 data; offset = (_channel[ch].counter >> 12) & 0x1F; -- cgit v1.2.3