diff options
Diffstat (limited to 'engines')
31 files changed, 120 insertions, 119 deletions
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index d1bed5d716..14ef169c48 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -435,7 +435,8 @@ const ADGameDescription *AgiMetaEngine::fallbackDetect(const Common::FSList &fsl // If there's game last edit date in the *.wag file, add it to extra if (wagGameLastEdit != NULL) { - if (!_extra.empty() ) _extra += " "; + if (!_extra.empty()) + _extra += " "; _extra += wagGameLastEdit->getData(); debug(3, "Agi::fallbackDetector: Game's last edit date (%s) from WAG file", wagGameLastEdit->getData()); } diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp index 9525d420c6..dad141a254 100644 --- a/engines/gob/hotspots.cpp +++ b/engines/gob/hotspots.cpp @@ -1516,7 +1516,7 @@ void Hotspots::evaluate() { int16 duration = _vm->_game->_script->peekByte(1); byte leaveWindowIndex = 0; - if ( _vm->getGameType() == kGameTypeFascination ) + if (_vm->getGameType() == kGameTypeFascination) leaveWindowIndex = _vm->_game->_script->peekByte(2); byte hotspotIndex1 = _vm->_game->_script->peekByte(3); @@ -1642,7 +1642,7 @@ int16 Hotspots::findCursor(uint16 x, uint16 y) const { int16 deltax = 0; int16 deltay = 0; - if ( _vm->getGameType() == kGameTypeFascination ) + if (_vm->getGameType() == kGameTypeFascination) cursor = curWindow(deltax, deltay); if (cursor == 0) { @@ -2106,7 +2106,7 @@ void Hotspots::fillRect(uint16 x, uint16 y, uint16 width, uint16 height, uint16 _vm->_draw->_spriteBottom = height; _vm->_draw->_backColor = color; - _vm->_draw->spriteOperation(DRAW_FILLRECT | 0x10 ); + _vm->_draw->spriteOperation(DRAW_FILLRECT | 0x10); } void Hotspots::printText(uint16 x, uint16 y, const char *str, uint16 fontIndex, uint16 color) const { diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp index 8b8b55eff8..ec33137739 100644 --- a/engines/gob/scenery.cpp +++ b/engines/gob/scenery.cpp @@ -65,7 +65,7 @@ Scenery::Scenery(GobEngine *vm) : _vm(vm) { _pCaptureCounter = 0; - for (int i = 0; i < 70; i++ ) { + for (int i = 0; i < 70; i++) { _staticPictToSprite[i] = 0; _animPictToSprite[i] = 0; } diff --git a/engines/kyra/resource_intern.cpp b/engines/kyra/resource_intern.cpp index 0d968de9ff..445ea579a0 100644 --- a/engines/kyra/resource_intern.cpp +++ b/engines/kyra/resource_intern.cpp @@ -514,7 +514,7 @@ void FileExpanderSource::advSrcBitsBy1() { _key >>= 1; if (!--_bitsLeft) { if (_dataPtr < _endofBuffer) - _key = ((*_dataPtr++) << 8 ) | (_key & 0xff); + _key = ((*_dataPtr++) << 8) | (_key & 0xff); _bitsLeft = 8; } } diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 7ca3ae89d5..b7e01f31aa 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -787,7 +787,7 @@ void Screen::copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPag } if (y2 < 0) { - if (y2 <= -h ) + if (y2 <= -h) return; h += y2; y1 -= y2; diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index be3dbe5b21..e8ec7bc180 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -637,7 +637,7 @@ void Screen_LoL::copyRegionSpecial(int page1, int w1, int h1, int x1, int y1, in d++; } - for (int ii = (i & 1) ^ 1; ii < ibw_2; ii += 2 ) { + for (int ii = (i & 1) ^ 1; ii < ibw_2; ii += 2) { *d = *s; d += 2; s += 2; diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index 907c5ee7bd..61916b92c0 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -259,7 +259,7 @@ int TIMInterpreter::exec(TIM *tim, bool loop) { if (cur.ip) { cur.ip += cur.ip[0]; cur.lastTime = cur.nextTime; - cur.nextTime += (cur.ip[1] ) * _vm->tickLength(); + cur.nextTime += cur.ip[1] * _vm->tickLength(); } } } diff --git a/engines/kyra/sprites.cpp b/engines/kyra/sprites.cpp index 4fa12fd687..52689869c6 100644 --- a/engines/kyra/sprites.cpp +++ b/engines/kyra/sprites.cpp @@ -71,7 +71,7 @@ void Sprites::setupSceneAnims() { if (_anims[i].script != 0) { data = _anims[i].script; - assert( READ_LE_UINT16(data) == 0xFF86 ); + assert(READ_LE_UINT16(data) == 0xFF86); data += 4; _anims[i].disable = READ_LE_UINT16(data) != 0; @@ -509,7 +509,7 @@ void Sprites::loadDat(const char *filename, SceneExits &exits) { } void Sprites::freeSceneShapes() { - for (int i = 0; i < ARRAYSIZE(_sceneShapes); i++ ) { + for (int i = 0; i < ARRAYSIZE(_sceneShapes); i++) { delete[] _sceneShapes[i]; _sceneShapes[i] = 0; } diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 4b71b1d69d..a06b488c86 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -878,7 +878,7 @@ void KyraEngine_LoK::loadItems() { _shapes[323] = 0; - for (shape = 1; shape < 6; shape++ ) + for (shape = 1; shape < 6; shape++) _shapes[323 + shape] = _screen->encodeShape((shape - 1) * 32, 0, 32, 17, 0); for (shape = 330; shape <= 334; shape++) diff --git a/engines/kyra/text_hof.cpp b/engines/kyra/text_hof.cpp index 9d20cdd51a..4c292b70db 100644 --- a/engines/kyra/text_hof.cpp +++ b/engines/kyra/text_hof.cpp @@ -544,7 +544,7 @@ void KyraEngine_HoF::processDialogue(int dlgOffset, int vocH, int csEntry) { } objectChat((const char *)_unkBuf500Bytes, 0, vocHi, vocLo); } else { - if (activeTimSequence != nextTimSequence ) { + if (activeTimSequence != nextTimSequence) { if (activeTimSequence > -1) { deinitTalkObject(activeTimSequence); activeTimSequence = -1; diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index d6df23d415..884d1a32ac 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -88,7 +88,7 @@ void PathWalker_NS::correctPathPoint(Common::Point &to) { } while ((top > 0) && !IS_PATH_CLEAR(to.x, top)); do { bottom++; - } while ((bottom < maxY) && !IS_PATH_CLEAR(to.x, bottom) ); + } while ((bottom < maxY) && !IS_PATH_CLEAR(to.x, bottom)); top = (top == 0) ? 1000 : to.y - top; bottom = (bottom == maxY) ? 1000 : bottom - to.y; diff --git a/engines/queen/cutaway.cpp b/engines/queen/cutaway.cpp index 6b08dd8d63..11a8704d60 100644 --- a/engines/queen/cutaway.cpp +++ b/engines/queen/cutaway.cpp @@ -283,7 +283,7 @@ void Cutaway::limitBob(CutawayObject &object) { } BobSlot *bob = - _vm->graphics()->bob( _vm->logic()->findBob(object.objectNumber) ); + _vm->graphics()->bob(_vm->logic()->findBob(object.objectNumber)); if (!bob) { warning("Failed to find bob"); @@ -667,7 +667,7 @@ const byte *Cutaway::handleAnimation(const byte *ptr, CutawayObject &object) { // Only flip if we are not moving or it is not a person object if (!(objAnim[i].object > 0 && objAnim[i].object < 4) || - !(objAnim[i].mx || objAnim[i].my) ) + !(objAnim[i].mx || objAnim[i].my)) bob->xflip = objAnim[i].flip; // Add frame alteration @@ -1235,7 +1235,7 @@ void Cutaway::handleText( } BobSlot *bob = - _vm->graphics()->bob( _vm->logic()->findBob(ABS(object.objectNumber)) ); + _vm->graphics()->bob(_vm->logic()->findBob(ABS(object.objectNumber))); _vm->graphics()->setBobText(bob, sentence, x, object.bobStartY, object.specialMove, flags); diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp index 27b1e9c60a..6bc79daa73 100644 --- a/engines/queen/talk.cpp +++ b/engines/queen/talk.cpp @@ -551,11 +551,11 @@ bool Talk::speak(const char *sentence, Person *person, const char *voiceFilePref return personWalking; } - if (0 == strcmp(person->name, "FAYE-H" ) || + if (0 == strcmp(person->name, "FAYE-H") || 0 == strcmp(person->name, "FRANK-H") || 0 == strcmp(person->name, "AZURA-H") || 0 == strcmp(person->name, "X3_RITA") || - (0 == strcmp(person->name, "JOE") && _vm->logic()->currentRoom() == FAYE_HEAD ) || + (0 == strcmp(person->name, "JOE") && _vm->logic()->currentRoom() == FAYE_HEAD) || (0 == strcmp(person->name, "JOE") && _vm->logic()->currentRoom() == AZURA_HEAD) || (0 == strcmp(person->name, "JOE") && _vm->logic()->currentRoom() == FRANK_HEAD)) _talkHead = true; diff --git a/engines/saga/actor.h b/engines/saga/actor.h index 57d06e9e3a..2f8fdea8ec 100644 --- a/engines/saga/actor.h +++ b/engines/saga/actor.h @@ -451,8 +451,8 @@ public: void cmdActorWalkTo(int argc, const char **argv); bool validActorId(uint16 id) { return (id == ID_PROTAG) || ((id >= objectIndexToId(kGameObjectActor, 0)) && (id < objectIndexToId(kGameObjectActor, _actorsCount))); } - int actorIdToIndex(uint16 id) { return (id == ID_PROTAG ) ? 0 : objectIdToIndex(id); } - uint16 actorIndexToId(int index) { return (index == 0 ) ? ID_PROTAG : objectIndexToId(kGameObjectActor, index); } + int actorIdToIndex(uint16 id) { return (id == ID_PROTAG) ? 0 : objectIdToIndex(id); } + uint16 actorIndexToId(int index) { return (index == 0) ? ID_PROTAG : objectIndexToId(kGameObjectActor, index); } ActorData *getActor(uint16 actorId); ActorData *getFirstActor() { return _actors[0]; } diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index c4b4688785..a77ec1c140 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -1398,7 +1398,7 @@ void Interface::setSave(PanelButton *panelButton) { char *fileName; switch (panelButton->id) { case kTextSave: - if (_textInputStringLength == 0 ) { + if (_textInputStringLength == 0) { break; } if (!_vm->isSaveListFull() && (_optionSaveFileTitleNumber == 0)) { @@ -2166,43 +2166,43 @@ void Interface::drawButtonBox(const Rect& rect, ButtonKind kind, bool down) { byte solidColor; byte odl, our, idl, iur; - switch (kind ) { - case kSlider: - cornerColor = 0x8b; - frameColor = _vm->KnownColor2ColorId(kKnownColorBlack); - fillColor = kITEColorLightBlue96; - odl = kITEColorDarkBlue8a; - our = kITEColorLightBlue92; - idl = 0x89; - iur = 0x94; - solidColor = down ? kITEColorLightBlue94 : kITEColorLightBlue96; - break; - case kEdit: - if (_vm->getGameId() == GID_ITE) { - cornerColor = frameColor = fillColor = kITEColorLightBlue96; - our = kITEColorDarkBlue8a; - odl = kITEColorLightBlue94; - solidColor = down ? kITEColorBlue : kITEColorDarkGrey0C; - } else { - cornerColor = frameColor = fillColor = _vm->KnownColor2ColorId(kKnownColorBlack); - our = odl = solidColor = _vm->KnownColor2ColorId(kKnownColorBlack); - } - iur = 0x97; - idl = 0x95; - break; - default: - cornerColor = 0x8b; - frameColor = _vm->KnownColor2ColorId(kKnownColorBlack); - solidColor = fillColor = kITEColorLightBlue96; - odl = kITEColorDarkBlue8a; - our = kITEColorLightBlue94; - idl = 0x97; - iur = 0x95; - if (down) { - SWAP(odl, our); - SWAP(idl, iur); - } - break; + switch (kind) { + case kSlider: + cornerColor = 0x8b; + frameColor = _vm->KnownColor2ColorId(kKnownColorBlack); + fillColor = kITEColorLightBlue96; + odl = kITEColorDarkBlue8a; + our = kITEColorLightBlue92; + idl = 0x89; + iur = 0x94; + solidColor = down ? kITEColorLightBlue94 : kITEColorLightBlue96; + break; + case kEdit: + if (_vm->getGameId() == GID_ITE) { + cornerColor = frameColor = fillColor = kITEColorLightBlue96; + our = kITEColorDarkBlue8a; + odl = kITEColorLightBlue94; + solidColor = down ? kITEColorBlue : kITEColorDarkGrey0C; + } else { + cornerColor = frameColor = fillColor = _vm->KnownColor2ColorId(kKnownColorBlack); + our = odl = solidColor = _vm->KnownColor2ColorId(kKnownColorBlack); + } + iur = 0x97; + idl = 0x95; + break; + default: + cornerColor = 0x8b; + frameColor = _vm->KnownColor2ColorId(kKnownColorBlack); + solidColor = fillColor = kITEColorLightBlue96; + odl = kITEColorDarkBlue8a; + our = kITEColorLightBlue94; + idl = 0x97; + iur = 0x95; + if (down) { + SWAP(odl, our); + SWAP(idl, iur); + } + break; } int x = rect.left; diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp index 8999211f2a..f0ad9bbd5e 100644 --- a/engines/saga/isomap.cpp +++ b/engines/saga/isomap.cpp @@ -303,8 +303,8 @@ void IsoMap::adjustScroll(bool jump) { _viewScroll.x = maxScrollPos.x; } } else { - _viewScroll.y = smoothSlide( _viewScroll.y, minScrollPos.y, maxScrollPos.y ); - _viewScroll.x = smoothSlide( _viewScroll.x, minScrollPos.x, maxScrollPos.x ); + _viewScroll.y = smoothSlide(_viewScroll.y, minScrollPos.y, maxScrollPos.y); + _viewScroll.x = smoothSlide(_viewScroll.x, minScrollPos.x, maxScrollPos.x); } if (_vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP) { @@ -429,7 +429,7 @@ void IsoMap::drawTiles(const Location *location) { workAreaWidth = _vm->getDisplayInfo().width + 128; workAreaHeight = _vm->_scene->getHeight() + 128 + 80; - for (u1 = u0, v1 = v0; metaTileY.y < workAreaHeight; u1--, v1-- ) { + for (u1 = u0, v1 = v0; metaTileY.y < workAreaHeight; u1--, v1--) { metaTileX = metaTileY; for (u2 = u1, v2 = v1; metaTileX.x < workAreaWidth; u2++, v2--, metaTileX.x += 256) { @@ -611,7 +611,7 @@ void IsoMap::drawSpritePlatform(uint16 platformIndex, const Point &point, const for (u = SAGA_PLATFORM_W - 1, copyLocation.u() = location.u() - ((SAGA_PLATFORM_W - 1) << 4); u >= 0 && s.x + 32 > _tileClip.left && s.y - SAGA_MAX_TILE_H < _tileClip.bottom; - u--, copyLocation.u() += 16, s.x -= 16, s.y += 8 ) { + u--, copyLocation.u() += 16, s.x -= 16, s.y += 8) { if (s.x < _tileClip.right && s.y > _tileClip.top) { tileIndex = tilePlatform->tiles[u][v]; @@ -663,7 +663,7 @@ void IsoMap::drawPlatform(uint16 platformIndex, const Point &point, int16 absU, for (u = SAGA_PLATFORM_W - 1; u >= 0 && s.x + 32 > _tileClip.left && s.y - SAGA_MAX_TILE_H < _tileClip.bottom; - u--, s.x -= 16, s.y += 8 ) { + u--, s.x -= 16, s.y += 8) { if (s.x < _tileClip.right && s.y > _tileClip.top) { tileIndex = tilePlatform->tiles[u][v]; @@ -955,7 +955,7 @@ void IsoMap::pushPoint(int16 u, int16 v, uint16 cost, uint16 direction) { } } - if (mid < _queueCount ) { + if (mid < _queueCount) { memmove(tilePoint + 1, tilePoint, (_queueCount - mid) * sizeof (*tilePoint)); } _queueCount++; @@ -1211,7 +1211,7 @@ void IsoMap::placeOnTileMap(const Location &start, Location &result, int16 dista for (dir = 0; dir < 8; dir++) { terrainMask = terraComp[dir]; - if (terrainMask & SAGA_IMPASSABLE ) { + if (terrainMask & SAGA_IMPASSABLE) { continue; } @@ -1352,11 +1352,11 @@ void IsoMap::findDragonTilePath(ActorData* actor,const Location &start, const Lo continue; } - tile = getTile(u1, v1, _platformHeight ); + tile = getTile(u1, v1, _platformHeight); if (tile != NULL) { mask = tile->terrainMask; if (((mask != 0) && (tile->GetFGDAttr() >= kTerrBlock)) || - ((mask != 0xFFFF) && (tile->GetBGDAttr() >= kTerrBlock)) ) { + ((mask != 0xFFFF) && (tile->GetBGDAttr() >= kTerrBlock))) { pcell->visited = 1; } } else { @@ -1453,7 +1453,7 @@ void IsoMap::findDragonTilePath(ActorData* actor,const Location &start, const Lo actor->_walkStepsCount = i; if (i) { actor->setTileDirectionsSize(i, false); - memcpy(actor->_tileDirections, res, i ); + memcpy(actor->_tileDirections, res, i); } } @@ -1586,7 +1586,7 @@ void IsoMap::findTilePath(ActorData* actor, const Location &start, const Locatio actor->_walkStepsCount = i; if (i) { actor->setTileDirectionsSize(i, false); - memcpy(actor->_tileDirections, res, i ); + memcpy(actor->_tileDirections, res, i); } } diff --git a/engines/saga/puzzle.cpp b/engines/saga/puzzle.cpp index 5b13473d77..73839eb6ea 100644 --- a/engines/saga/puzzle.cpp +++ b/engines/saga/puzzle.cpp @@ -459,9 +459,9 @@ void Puzzle::solicitHint() { _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50*1000000, this); _vm->_interface->converseClear(); - _vm->_interface->converseAddText(optionsStr[_lang][kROAccept], 0, 1, 0, 0 ); - _vm->_interface->converseAddText(optionsStr[_lang][kRODecline], 0, 2, 0, 0 ); - _vm->_interface->converseAddText(optionsStr[_lang][kROLater], 0, 0, 0, 0 ); + _vm->_interface->converseAddText(optionsStr[_lang][kROAccept], 0, 1, 0, 0); + _vm->_interface->converseAddText(optionsStr[_lang][kRODecline], 0, 2, 0, 0); + _vm->_interface->converseAddText(optionsStr[_lang][kROLater], 0, 0, 0, 0); _vm->_interface->converseDisplayText(); break; diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index 5fd120ac33..b0e20da48c 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -1315,7 +1315,7 @@ void Script::setVerb(int verb) { // engine did it, but it appears to work. _pointerObject = ID_NOTHING; - setLeftButtonVerb( verb ); + setLeftButtonVerb(verb); showVerb(); } @@ -1549,7 +1549,7 @@ void Script::playfieldClick(const Point& mousePoint, bool leftButton) { } if (_pointerObject != ID_NOTHING) { - hitObject( leftButton ); + hitObject(leftButton); } else { _pendingObject[0] = ID_NOTHING; _pendingObject[1] = ID_NOTHING; @@ -1618,7 +1618,7 @@ void Script::playfieldClick(const Point& mousePoint, bool leftButton) { _vm->_actor->actorWalkTo(ID_PROTAG, pickLocation); } else { if (_pendingVerb == getVerbType(kVerbLookAt)) { - if (objectTypeId(_pendingObject[0]) != kGameObjectActor ) { + if (objectTypeId(_pendingObject[0]) != kGameObjectActor) { _vm->_actor->actorWalkTo(ID_PROTAG, pickLocation); } else { doVerb(); diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 51ec9cfe9e..79f63fded4 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -1134,7 +1134,7 @@ bool Console::cmdRestoreGame(int argc, const char **argv) { } bool Console::cmdRestartGame(int argc, const char **argv) { - _engine->_gamestate->abortScriptProcessing = kAbortRestartGame;; + _engine->_gamestate->abortScriptProcessing = kAbortRestartGame; return Cmd_Exit(0, 0); } diff --git a/engines/sword1/router.cpp b/engines/sword1/router.cpp index 0da1cef6fe..84cc81cd0e 100644 --- a/engines/sword1/router.cpp +++ b/engines/sword1/router.cpp @@ -845,7 +845,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { do { walkAnim[frame].frame += 104;//turning left frame += 1; - } while (frame < lastCount ); + } while (frame < lastCount); } if (((lastDir == 1) || (lastDir == -7)) || ((lastDir == 2) || (lastDir == -6))) { // turn at the end of the current walk @@ -853,7 +853,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { do { walkAnim[frame].frame += 200; //was 60 now 116 frame += 1; - } while (frame < lastCount ); + } while (frame < lastCount); } lastDir = currentDir; } @@ -1272,7 +1272,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) { do { walkAnim[frame].frame += 104;//turning left frame += 1; - } while (frame < lastCount ); + } while (frame < lastCount); } if (((lastDir == 1) || (lastDir == -7)) || ((lastDir == 2) || (lastDir == -6))) { // turn at the end of the current walk @@ -1280,7 +1280,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) { do { walkAnim[frame].frame += 200; //was 60 now 116 frame += 1; - } while (frame < lastCount ); + } while (frame < lastCount); } } // all turns checked @@ -1305,7 +1305,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) { do { walkAnim[frame].frame += 278;//stopping right frame += 1; - } while (frame < lastCount ); + } while (frame < lastCount); walkAnim[stepCount].frame = 308; walkAnim[stepCount].step = 7; walkAnim[stepCount].dir = currentDir; @@ -1316,7 +1316,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) { do { walkAnim[frame].frame += 279;//stopping right frame += 1; - } while (frame < lastCount ); + } while (frame < lastCount); walkAnim[stepCount].frame = 315; walkAnim[stepCount].step = 7; walkAnim[stepCount].dir = currentDir; @@ -1332,7 +1332,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) { do { walkAnim[frame].frame += 244;//stopping left frame += 1; - } while (frame < lastCount ); + } while (frame < lastCount); walkAnim[stepCount].frame = 322; walkAnim[stepCount].step = 7; walkAnim[stepCount].dir = currentDir; @@ -1343,7 +1343,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) { do { walkAnim[frame].frame += 245;//stopping left frame += 1; - } while (frame < lastCount ); + } while (frame < lastCount); walkAnim[stepCount].frame = 329; walkAnim[stepCount].step = 7; walkAnim[stepCount].dir = currentDir; @@ -2097,9 +2097,9 @@ int whatTarget(int32 startX, int32 startY, int32 destX, int32 destY) { int signY = (deltaY > 0); int slope; - if ((ABS(deltaY) * DIAGONALX ) < (ABS(deltaX) * DIAGONALY / 2)) + if ((ABS(deltaY) * DIAGONALX) < (ABS(deltaX) * DIAGONALY / 2)) slope = 0;// its flat - else if ((ABS(deltaY) * DIAGONALX / 2) > (ABS(deltaX) * DIAGONALY ) ) + else if ((ABS(deltaY) * DIAGONALX / 2) > (ABS(deltaX) * DIAGONALY)) slope = 2;// its vertical else slope = 1;// its diagonal diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp index 024b681acb..b07acf9a0b 100644 --- a/engines/sword1/screen.cpp +++ b/engines/sword1/screen.cpp @@ -366,7 +366,7 @@ void Screen::draw() { if (_currentScreen == 54) { // rm54 has a BACKGROUND parallax layer in parallax[0] - if (_parallax[0] && !SwordEngine::isPsx() ) //Avoid drawing this parallax on PSX edition, it gets occluded by background + if (_parallax[0] && !SwordEngine::isPsx()) //Avoid drawing this parallax on PSX edition, it gets occluded by background renderParallax(_parallax[0]); uint8 *src = _layerBlocks[0]; uint8 *dest = _screenBuf; @@ -539,7 +539,7 @@ void Screen::processImage(uint32 id) { || (compact->o_resource == LVSFLY) || (!(compact->o_resource == GEORGE_MEGA) && (sprSizeX < 260)))) drawSprite(sprData + incr, spriteX, spriteY, sprSizeX, sprSizeY, sprPitch); else if (((sprSizeX >= 260) && (sprSizeX < 450)) || ((compact->o_resource == GMWRITH) && (sprSizeX < 515)) // a psx shrinked sprite (1/2 width) - || ((compact->o_resource == GMPOWER) && (sprSizeX < 515)) ) // some needs to be hardcoded, headers don't give useful infos + || ((compact->o_resource == GMPOWER) && (sprSizeX < 515))) // some needs to be hardcoded, headers don't give useful infos drawPsxHalfShrinkedSprite(sprData + incr, spriteX, spriteY, sprSizeX / 2, sprSizeY, sprPitch / 2); else if (sprSizeX >= 450) // A PSX double shrinked sprite (1/3 width) drawPsxFullShrinkedSprite(sprData + incr, spriteX, spriteY, sprSizeX / 3, sprSizeY, sprPitch / 3); @@ -1187,7 +1187,7 @@ void Screen::spriteClipAndSet(uint16 *pSprX, uint16 *pSprY, uint16 *pSprWidth, u gridW *= 2; // and masking problems when sprites are stretched in width uint16 bottomSprPos = (*pSprY + (*pSprHeight) * 2); //Position of bottom line of sprite - if ( bottomSprPos > _scrnSizeY ) { //Check that resized psx sprite isn't drawn outside of screen boundaries + if (bottomSprPos > _scrnSizeY) { //Check that resized psx sprite isn't drawn outside of screen boundaries uint16 outScreen = bottomSprPos - _scrnSizeY; *pSprHeight -= (outScreen % 2) ? (outScreen + 1) / 2 : outScreen / 2; } diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp index e8a20ec2b7..ef3e07fe74 100644 --- a/engines/sword1/text.cpp +++ b/engines/sword1/text.cpp @@ -49,7 +49,7 @@ Text::Text(ObjectMan *pObjMan, ResMan *pResMan, bool czechVersion) { _fontId = (czechVersion) ? CZECH_GAME_FONT : GAME_FONT; _font = (uint8*)_resMan->openFetchRes(_fontId); - _joinWidth = charWidth( SPACE ) - 2 * OVERLAP; + _joinWidth = charWidth(SPACE) - 2 * OVERLAP; _charHeight = _resMan->getUint16(_resMan->fetchFrame(_font, 0)->height); // all chars have the same height for (int i = 0; i < MAX_TEXT_OBS; i++) _textBlocks[i] = NULL; @@ -145,12 +145,12 @@ uint16 Text::analyzeSentence(uint8 *text, uint16 maxWidth, LineInfo *line) { // (with a separating space character - also overlapped) uint16 spaceNeeded = _joinWidth + wordWidth; - if (line[lineNo].width + spaceNeeded <= maxWidth ) { + if (line[lineNo].width + spaceNeeded <= maxWidth) { line[lineNo].width += spaceNeeded; line[lineNo].length += 1 + wordLength; // NB. space+word characters } else { // put word (without separating SPACE) at start of next line lineNo++; - assert( lineNo < MAX_LINES ); + assert(lineNo < MAX_LINES); line[lineNo].width = wordWidth; line[lineNo].length = wordLength; } diff --git a/engines/sword2/mouse.cpp b/engines/sword2/mouse.cpp index 273ad1ec60..4dbb38eaca 100644 --- a/engines/sword2/mouse.cpp +++ b/engines/sword2/mouse.cpp @@ -341,7 +341,7 @@ void Mouse::systemMenuMouse() { if ((icon_list[hit] == OPTIONS_ICON || icon_list[hit] == QUIT_ICON || icon_list[hit] == SAVE_ICON || icon_list[hit] == RESTORE_ICON - || icon_list[hit] == RESTART_ICON ) && Sword2Engine::isPsx() ) + || icon_list[hit] == RESTART_ICON) && Sword2Engine::isPsx()) return; // No save when dead diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp index 4626071b6a..157422cd9d 100644 --- a/engines/toon/anim.cpp +++ b/engines/toon/anim.cpp @@ -158,7 +158,7 @@ void Animation::drawFrame(Graphics::Surface &surface, int32 frame, int32 xx, int int32 destPitch = surface.pitch; uint8 *srcRow = _frames[frame]._data; - uint8 *curRow = (uint8 *)surface.pixels + (yy + _frames[frame]._y1 + _y1) * destPitch + (xx + _x1 + _frames[frame]._x1) ; + uint8 *curRow = (uint8 *)surface.pixels + (yy + _frames[frame]._y1 + _y1) * destPitch + (xx + _x1 + _frames[frame]._x1); for (int32 y = 0; y < rectY; y++) { uint8 *cur = curRow; uint8 *c = srcRow + y * (_frames[frame]._x2 - _frames[frame]._x1); @@ -344,20 +344,20 @@ void Animation::drawFrameOnPicture(int32 frame, int32 xx, int32 yy) { return; if (rectX + xx + _x1 + _frames[frame]._x1 >= pic->getWidth()) - rectX = pic->getWidth() - xx - _x1 - _frames[frame]._x1 ; + rectX = pic->getWidth() - xx - _x1 - _frames[frame]._x1; if (rectX < 0) return; if (rectY + yy + _y1 + _frames[frame]._y1 >= pic->getHeight()) - rectY = pic->getHeight() - yy - _y1 - _frames[frame]._y1 ; + rectY = pic->getHeight() - yy - _y1 - _frames[frame]._y1; if (rectY < 0) return; int32 destPitch = pic->getWidth(); uint8 *c = _frames[frame]._data; - uint8 *curRow = (uint8 *)pic->getDataPtr() + (yy + _frames[frame]._y1 + _y1) * destPitch + (xx + _x1 + _frames[frame]._x1) ; + uint8 *curRow = (uint8 *)pic->getDataPtr() + (yy + _frames[frame]._y1 + _y1) * destPitch + (xx + _x1 + _frames[frame]._x1); for (int32 y = 0; y < rectY; y++) { unsigned char *cur = curRow; for (int32 x = 0; x < rectX; x++) { @@ -477,7 +477,7 @@ void AnimationInstance::setPosition(int32 x, int32 y, int32 z, bool relative) { _y = y; _z = z; } else { - _x = x - _animation->_x1 ; + _x = x - _animation->_x1; _y = y - _animation->_y1; _z = z; } @@ -547,7 +547,7 @@ void AnimationInstance::setX(int32 x, bool relative) { if (relative || !_animation) _x = x; else - _x = x - _animation->_x1 ; + _x = x - _animation->_x1; } void AnimationInstance::setY(int32 y, bool relative) { @@ -555,7 +555,7 @@ void AnimationInstance::setY(int32 y, bool relative) { if (relative || !_animation) _y = y; else - _y = y - _animation->_y1 ; + _y = y - _animation->_y1; } void AnimationInstance::setZ(int32 z, bool relative) { @@ -572,15 +572,15 @@ int32 AnimationInstance::getLayerZ() const { } int32 AnimationInstance::getX2() const { - return _x + _animation->_x1 ; + return _x + _animation->_x1; } int32 AnimationInstance::getY2() const { - return _y + _animation->_y1 ; + return _y + _animation->_y1; } int32 AnimationInstance::getZ2() const { - return _z ; + return _z; } void AnimationInstance::save(Common::WriteStream *stream) { @@ -659,7 +659,7 @@ void AnimationManager::removeInstance(AnimationInstance *instance) { void AnimationManager::removeAllInstances(AnimationInstanceType type) { debugC(1, kDebugAnim, "removeInstance(type)"); - for (int32 i = (int32)_instances.size(); i >= 0 ; i--) { + for (int32 i = (int32)_instances.size(); i >= 0; i--) { if (_instances[i]->getType() & type) _instances.remove_at(i); } diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp index ac92418e81..496d626201 100644 --- a/engines/toon/audio.cpp +++ b/engines/toon/audio.cpp @@ -117,7 +117,7 @@ void AudioManager::playVoice(int32 id, bool genericVoice) { _channels[2]->stop(false); } - Common::SeekableReadStream *stream ; + Common::SeekableReadStream *stream; if (genericVoice) stream = _audioPacks[0]->getStream(id); else @@ -132,7 +132,7 @@ void AudioManager::playSFX(int32 id, int32 volume , bool genericSFX) { debugC(4, kDebugAudio, "playSFX(%d, %d)", id, (genericSFX) ? 1 : 0); // find a free SFX channel - Common::SeekableReadStream *stream ; + Common::SeekableReadStream *stream; if (genericSFX) stream = _audioPacks[2]->getStream(id, true); @@ -288,7 +288,7 @@ bool AudioStreamInstance::readPacket() { void AudioStreamInstance::decodeADPCM(uint8 *comp, int16 *dest, int32 packetSize) { debugC(5, kDebugAudio, "decodeADPCM(comp, dest, %d)", packetSize); - int32 numSamples = 2 * packetSize ; + int32 numSamples = 2 * packetSize; int32 v18 = _lastADPCMval1; int32 v19 = _lastADPCMval2; for (int32 i = 0; i < numSamples; i++) { diff --git a/engines/toon/flux.cpp b/engines/toon/flux.cpp index 524b058e63..9dd38cd37a 100644 --- a/engines/toon/flux.cpp +++ b/engines/toon/flux.cpp @@ -80,7 +80,7 @@ int32 CharacterFlux::fixFacingForAnimation(int32 originalFacing, int32 animation int32 v6 = 1 << originalFacing; int32 facingMask = 0; do { - if ( v6 & animFacingFlag) { + if (v6 & animFacingFlag) { facingMask = v6; } else if (v5 & animFacingFlag) { facingMask = v5; @@ -91,9 +91,9 @@ int32 CharacterFlux::fixFacingForAnimation(int32 originalFacing, int32 animation while (!facingMask); int32 finalFacing = 0; - for (finalFacing = 0; ; ++finalFacing ) { + for (finalFacing = 0; ; ++finalFacing) { facingMask >>= 1; - if ( !facingMask ) + if (!facingMask) break; } diff --git a/engines/toon/hotspot.cpp b/engines/toon/hotspot.cpp index 3ddda1450b..5af61197d7 100644 --- a/engines/toon/hotspot.cpp +++ b/engines/toon/hotspot.cpp @@ -65,7 +65,7 @@ int32 Hotspots::FindBasedOnCorner(int32 x, int32 y) { if (_items[i].getMode() == -1) return _items[i].getRef(); - return i ; + return i; } } } diff --git a/engines/toon/path.cpp b/engines/toon/path.cpp index ab6730eecf..484e621a64 100644 --- a/engines/toon/path.cpp +++ b/engines/toon/path.cpp @@ -99,7 +99,7 @@ int32 PathFindingHeap::pop(int32 *x, int32 *y, int32 *weight) { int32 lT = 1; while (1) { - lT = lMin << 1 ; + lT = lMin << 1; if (lT <= _count) { if (lT < _count) { if (_data[lT + 1]._weight < _data[lT]._weight) @@ -169,7 +169,7 @@ int32 PathFinding::findClosestWalkingPoint(int32 xx, int32 yy, int32 *fxx, int32 origY = yy; for (int y = 0; y < _height; y++) { - for (int x = 0; x < _width ; x++) { + for (int x = 0; x < _width; x++) { if (isWalkable(x, y)) { int32 ndist = (x - xx) * (x - xx) + (y - yy) * (y - yy); int32 ndist2 = (x - origX) * (x - origX) + (y - origY) * (y - origY); diff --git a/engines/toon/picture.cpp b/engines/toon/picture.cpp index 83413d1758..11a5572066 100644 --- a/engines/toon/picture.cpp +++ b/engines/toon/picture.cpp @@ -161,7 +161,7 @@ void Picture::drawMask(Graphics::Surface &surface, int32 x, int32 y, int32 dx, i int32 destPitch = surface.pitch; int32 srcPitch = _width; - uint8 *c = _data + _width * dy + dx ; + uint8 *c = _data + _width * dy + dx; uint8 *curRow = (uint8 *)surface.pixels + y * destPitch + x; for (int32 yy = 0; yy < ry; yy++) { @@ -190,14 +190,14 @@ void Picture::draw(Graphics::Surface &surface, int32 x, int32 y, int32 dx, int32 int32 destPitch = surface.pitch; int32 srcPitch = _width; - uint8 *c = _data + _width * dy + dx ; + uint8 *c = _data + _width * dy + dx; uint8 *curRow = (uint8 *)surface.pixels + y * destPitch + x; for (int32 yy = 0; yy < ry; yy++) { uint8 *curSrc = c; uint8 *cur = curRow; for (int32 xx = 0; xx < rx; xx++) { - *cur = *curSrc ; + *cur = *curSrc; curSrc++; cur++; } diff --git a/engines/toon/resource.cpp b/engines/toon/resource.cpp index 2757c50f00..348aa45ae9 100644 --- a/engines/toon/resource.cpp +++ b/engines/toon/resource.cpp @@ -122,7 +122,7 @@ Common::SeekableReadStream *PakFile::createReadStream(Common::String fileName) { debugC(1, kDebugResource, "createReadStream(%s)", fileName.c_str()); int32 offset = 0; - int32 size = 0 ; + int32 size = 0; for (uint32 i = 0; i < _numFiles; i++) { if (fileName.compareToIgnoreCase(_files[i]._name) == 0) { size = _files[i]._size; diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 02e76b8960..d1145e35e3 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -86,7 +86,7 @@ void ToonEngine::init() { _currentTextLine = 0; _currentTextLineId = -1; _currentTextLineX = 0; - _currentTextLineY = 0 ; + _currentTextLineY = 0; _currentTextLineCharacterId = 0; _saveBufferStream = new Common::MemoryWriteStreamDynamic(); |