diff options
Diffstat (limited to 'engines')
47 files changed, 122 insertions, 127 deletions
diff --git a/engines/agi/preagi_common.cpp b/engines/agi/preagi_common.cpp index 74dcd75edb..e84bf0d1ba 100644 --- a/engines/agi/preagi_common.cpp +++ b/engines/agi/preagi_common.cpp @@ -124,7 +124,7 @@ int PreAgiEngine::getSelection(SelectionTypes type) { while (!shouldQuit()) { while (_eventMan->pollEvent(event)) { - switch(event.type) { + switch (event.type) { case Common::EVENT_RTL: case Common::EVENT_QUIT: return 0; diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp index c06cd94bec..e61637194c 100644 --- a/engines/agi/preagi_mickey.cpp +++ b/engines/agi/preagi_mickey.cpp @@ -295,7 +295,7 @@ void Mickey::getMouseMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow, i int iWord; int *sel = 0; - switch(iRow) { + switch (iRow) { case 0: if (y != IDI_MSA_ROW_MENU_0) return; sel = sel0; @@ -323,7 +323,7 @@ bool Mickey::getMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow) { int x, y; int goIndex = -1, northIndex = -1, southIndex = -1, eastIndex = -1, westIndex = -1; - switch(iRow) { + switch (iRow) { case 0: sel = sel0; break; @@ -361,7 +361,7 @@ bool Mickey::getMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow) { while (!_vm->shouldQuit()) { while (_vm->_system->getEventManager()->pollEvent(event)) { - switch(event.type) { + switch (event.type) { case Common::EVENT_RTL: case Common::EVENT_QUIT: return 0; @@ -679,7 +679,7 @@ void Mickey::playSound(ENUM_MSA_SOUND iSound) { uint8 *buffer = new uint8[1024]; int pBuf = 1; - switch(iSound) { + switch (iSound) { case IDI_MSA_SND_XL30: for (int iNote = 0; iNote < 6; iNote++) { note.counter = _vm->rnd(59600) + 59; @@ -701,7 +701,7 @@ void Mickey::playSound(ENUM_MSA_SOUND iSound) { if (iSound == IDI_MSA_SND_THEME) { while (_vm->_system->getEventManager()->pollEvent(event)) { - switch(event.type) { + switch (event.type) { case Common::EVENT_RTL: case Common::EVENT_QUIT: case Common::EVENT_LBUTTONUP: @@ -769,7 +769,7 @@ void Mickey::drawRoomAnimation() { 0xF0, 1, 0xF9, 2, 43, 45, 0xFF }; - switch(_game.iRoom) { + switch (_game.iRoom) { case IDI_MSA_PIC_EARTH_SHIP: case IDI_MSA_PIC_VENUS_SHIP: case IDI_MSA_PIC_NEPTUNE_SHIP: @@ -835,7 +835,7 @@ void Mickey::drawRoomAnimation() { // draw crystal if (_game.iRoom == IDI_MSA_XTAL_ROOM_XY[_game.iPlanet][0]) { if (!_game.fHasXtal) { - switch(_game.iPlanet) { + switch (_game.iPlanet) { case IDI_MSA_PLANET_VENUS: if (_game.iRmMenu[_game.iRoom] != 2) break; @@ -1488,7 +1488,7 @@ void Mickey::getXtal(int iStr) { } bool Mickey::parse(int cmd, int arg) { - switch(cmd) { + switch (cmd) { // BASIC @@ -2211,7 +2211,7 @@ void Mickey::waitAnyKey(bool anim) { while (!_vm->shouldQuit()) { while (_vm->_system->getEventManager()->pollEvent(event)) { - switch(event.type) { + switch (event.type) { case Common::EVENT_RTL: case Common::EVENT_QUIT: case Common::EVENT_KEYDOWN: diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp index e34949c8fe..04c0d25b11 100644 --- a/engines/agi/preagi_troll.cpp +++ b/engines/agi/preagi_troll.cpp @@ -60,7 +60,7 @@ bool Troll::getMenuSel(const char *szMenu, int *iSel, int nSel) { while (!_vm->shouldQuit()) { while (_vm->_system->getEventManager()->pollEvent(event)) { - switch(event.type) { + switch (event.type) { case Common::EVENT_RTL: case Common::EVENT_QUIT: return 0; @@ -207,7 +207,7 @@ void Troll::waitAnyKeyIntro() { while (!_vm->shouldQuit()) { while (_vm->_system->getEventManager()->pollEvent(event)) { - switch(event.type) { + switch (event.type) { case Common::EVENT_RTL: case Common::EVENT_QUIT: case Common::EVENT_LBUTTONUP: @@ -285,7 +285,7 @@ void Troll::tutorial() { while (!done && !_vm->shouldQuit()) { getMenuSel(IDS_TRO_TUTORIAL_1, &iSel, IDI_TRO_MAX_OPTION); - switch(iSel) { + switch (iSel) { case IDI_TRO_SEL_OPTION_1: _vm->clearScreen(0x22, false); _vm->_gfx->doUpdate(); @@ -579,7 +579,7 @@ void Troll::gameLoop() { roomParam = _roomDescs[_roomPicture - 1].roomDescIndex[currentOption]; - switch(_roomDescs[_roomPicture - 1].optionTypes[currentOption]) { + switch (_roomDescs[_roomPicture - 1].optionTypes[currentOption]) { case OT_FLASHLIGHT: if (!haveFlashlight) { printUserMessage(13); diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index ac0d3625b2..85cf2d29ef 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -266,7 +266,7 @@ int Winnie::parser(int pc, int index, uint8 *buffer) { // extract text from block opcode = *(buffer + pc); - switch(opcode) { + switch (opcode) { case 0: case IDO_WTP_OPTION_0: case IDO_WTP_OPTION_1: @@ -331,9 +331,9 @@ int Winnie::parser(int pc, int index, uint8 *buffer) { } // process selection - switch(iSel) { + switch (iSel) { case IDI_WTP_SEL_HOME: - switch(_room) { + switch (_room) { case IDI_WTP_ROOM_HOME: case IDI_WTP_ROOM_MIST: case IDI_WTP_ROOM_TIGGER: @@ -384,7 +384,7 @@ int Winnie::parser(int pc, int index, uint8 *buffer) { // process script do { opcode = *(buffer + pc++); - switch(opcode) { + switch (opcode) { case IDO_WTP_GOTO_ROOM: opcode = *(buffer + pc++); iNewRoom = opcode; @@ -726,7 +726,7 @@ void Winnie::drawMenu(char *szMenu, int iSel, int fCanSel[]) { if (fCanSel[IDI_WTP_SEL_DROP]) _vm->drawStr(IDI_WTP_ROW_OPTION_4, IDI_WTP_COL_DROP, IDA_DEFAULT, IDS_WTP_DROP); - switch(iSel) { + switch (iSel) { case IDI_WTP_SEL_OPT_1: case IDI_WTP_SEL_OPT_2: case IDI_WTP_SEL_OPT_3: @@ -778,7 +778,7 @@ void Winnie::decMenuSel(int *iSel, int fCanSel[]) { } void Winnie::getMenuMouseSel(int *iSel, int fCanSel[], int x, int y) { - switch(y) { + switch (y) { case IDI_WTP_ROW_OPTION_1: case IDI_WTP_ROW_OPTION_2: case IDI_WTP_ROW_OPTION_3: @@ -816,7 +816,7 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) { while (!_vm->shouldQuit()) { while (_vm->_system->getEventManager()->pollEvent(event)) { - switch(event.type) { + switch (event.type) { case Common::EVENT_RTL: case Common::EVENT_QUIT: return; @@ -865,7 +865,7 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) { _vm->_gfx->setCursorPalette(false); } - switch(*iSel) { + switch (*iSel) { case IDI_WTP_SEL_OPT_1: case IDI_WTP_SEL_OPT_2: case IDI_WTP_SEL_OPT_3: @@ -970,7 +970,7 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) { makeSel(); break; case Common::KEYCODE_RETURN: - switch(*iSel) { + switch (*iSel) { case IDI_WTP_SEL_OPT_1: case IDI_WTP_SEL_OPT_2: case IDI_WTP_SEL_OPT_3: @@ -1036,7 +1036,7 @@ phase2: while (!_vm->shouldQuit()) { for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) { - switch(parser(hdr.ofsBlock[iBlock] - _roomOffset, iBlock, roomdata)) { + switch (parser(hdr.ofsBlock[iBlock] - _roomOffset, iBlock, roomdata)) { case IDI_WTP_PAR_GOTO: goto phase0; break; diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp index 67ae7ef2c2..360fa4bf8c 100644 --- a/engines/agos/event.cpp +++ b/engines/agos/event.cpp @@ -695,7 +695,7 @@ void AGOSEngine_DIMP::dimpIdle() { if (_variableArray[110] > 2) break; n = _rnd.getRandomNumber(6); - switch(n) { + switch (n) { case(0): loadSoundFile("And01.wav");break; case(1): loadSoundFile("And02.wav");break; case(2): loadSoundFile("And03.wav");break; @@ -710,7 +710,7 @@ void AGOSEngine_DIMP::dimpIdle() { if (_variableArray[111] > 2) break; n = _rnd.getRandomNumber(6); - switch(n) { + switch (n) { case(0): loadSoundFile("And08.wav");break; case(1): loadSoundFile("And09.wav");break; case(2): loadSoundFile("And0a.wav");break; @@ -725,7 +725,7 @@ void AGOSEngine_DIMP::dimpIdle() { if (_variableArray[112] > 2) break; n = _rnd.getRandomNumber(4); - switch(n) { + switch (n) { case(0): loadSoundFile("And0f.wav");break; case(1): loadSoundFile("And0g.wav");break; case(2): loadSoundFile("And0h.wav");break; diff --git a/engines/agos/string_pn.cpp b/engines/agos/string_pn.cpp index 0872e9d589..a4e40d8306 100644 --- a/engines/agos/string_pn.cpp +++ b/engines/agos/string_pn.cpp @@ -23,8 +23,6 @@ * */ - - #include "agos/agos.h" #include "agos/intern.h" @@ -34,7 +32,7 @@ uint32 AGOSEngine_PN::ftext(uint32 base, int n) { uint32 b = base; int ct = n; while (ct) { - while(_textBase[b++]) + while (_textBase[b++]) ; ct--; } diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index b148852892..df723dbbba 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -299,7 +299,7 @@ void Game::loop() { } } - if(_vm->_mouse->isCursorOn()) { + if (_vm->_mouse->isCursorOn()) { // Fetch the dedicated objects' title animation / current frame Animation *titleAnim = _vm->_anims->getAnimation(kTitleText); Text *title = reinterpret_cast<Text *>(titleAnim->getFrame()); @@ -787,7 +787,7 @@ void Game::dialogueMenu(int dialogueID) { _dialogueBegin = false; oldLines = _dialogueLinesNum; - } while(!_dialogueExit); + } while (!_dialogueExit); dialogueDone(); _currentDialogue = kNoDialogue; @@ -1562,7 +1562,7 @@ Common::Point WalkingMap::findNearestWalkable(int startX, int startY, Common::Re // such resizing step, it checks some select points on the ellipse for walkability. // It also does the same check for the ellipse perpendicular to it (rotated by 90 degrees). - while(1) { + while (1) { // The default major radius radius += _deltaX; diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index 7cf5ef50a1..aec95241e0 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -369,7 +369,7 @@ void Script::load(Common::Queue<int> ¶ms) { GameObject *obj = _vm->_game->getObject(objID); // If the animation is already loaded, return - for(i = 0; i < obj->_anims.size(); ++i) { + for (i = 0; i < obj->_anims.size(); ++i) { if (obj->_anims[i] == animID) { return; } @@ -384,7 +384,7 @@ void Script::load(Common::Queue<int> ¶ms) { // Care must be taken to store them sorted (increasing order) as some things // depend on this. - for(i = 0; i < obj->_anims.size(); ++i) { + for (i = 0; i < obj->_anims.size(); ++i) { if (obj->_anims[i] > animID) { break; } diff --git a/engines/gob/draw_playtoons.cpp b/engines/gob/draw_playtoons.cpp index 2dcdaba388..df246de281 100644 --- a/engines/gob/draw_playtoons.cpp +++ b/engines/gob/draw_playtoons.cpp @@ -151,7 +151,7 @@ void Draw_Playtoons::spriteOperation(int16 operation) { break; case DRAW_PUTPIXEL: - switch(_pattern & 0xFF) { + switch (_pattern & 0xFF) { case -1: warning("oPlaytoons_spriteOperation: operation DRAW_PUTPIXEL, pattern -1"); break; @@ -180,7 +180,7 @@ void Draw_Playtoons::spriteOperation(int16 operation) { _destSpriteY + (_pattern + 1) / 2); break; case DRAW_FILLRECT: - switch(_pattern & 0xFF) { + switch (_pattern & 0xFF) { case 1: case 2: case 3: @@ -217,7 +217,7 @@ void Draw_Playtoons::spriteOperation(int16 operation) { _destSpriteX + 1, _destSpriteY + 1, _spriteRight + 1, _spriteBottom + 1, _frontColor); } else { - switch(_pattern & 0xFF) { + switch (_pattern & 0xFF) { case 0: _vm->_video->drawLine(*_spritesArray[_destSurface], _destSpriteX, _destSpriteY, diff --git a/engines/gob/inter.h b/engines/gob/inter.h index 157476f241..df5e5ccda1 100644 --- a/engines/gob/inter.h +++ b/engines/gob/inter.h @@ -199,7 +199,7 @@ protected: bool o1_callSub(OpFuncParams ¶ms); bool o1_printTotText(OpFuncParams ¶ms); bool o1_loadCursor(OpFuncParams ¶ms); - bool o1_switch(OpFuncParams ¶ms); + bool o1_switch (OpFuncParams ¶ms); bool o1_repeatUntil(OpFuncParams ¶ms); bool o1_whileDo(OpFuncParams ¶ms); bool o1_if(OpFuncParams ¶ms); diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index d3bd11ab75..51142e3659 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -722,7 +722,7 @@ bool Inter_v1::o1_loadCursor(OpFuncParams ¶ms) { return false; } -bool Inter_v1::o1_switch(OpFuncParams ¶ms) { +bool Inter_v1::o1_switch (OpFuncParams ¶ms) { uint32 offset; checkSwitchTable(offset); diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp index 170ed5ccf4..03bc87fb88 100644 --- a/engines/gob/sound/adlib.cpp +++ b/engines/gob/sound/adlib.cpp @@ -610,7 +610,7 @@ void MDYPlayer::interpret() { do { instr = *_playPos; // printf("instr 0x%X\n", instr); - switch(instr) { + switch (instr) { case 0xF8: _wait = *(_playPos++); break; @@ -640,7 +640,7 @@ void MDYPlayer::interpret() { } channel = (int)(instr & 0x0f); - switch(instr & 0xf0) { + switch (instr & 0xf0) { case 0x90: note = *(_playPos++); volume = *(_playPos++); diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index cf2b360d79..098a698e14 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -279,7 +279,7 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) quitGame(); } } else { - switch(event.kbd.keycode) { + switch (event.kbd.keycode) { case Common::KEYCODE_SPACE: keys = 61; break; diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index 09fb0f0329..5a18869da0 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -1405,7 +1405,7 @@ void LoLEngine::processGasExplosion(int soundId) { } int LoLEngine::smoothScrollDrawSpecialGuiShape(int pageNum) { - if(!_specialGuiShape) + if (!_specialGuiShape) return 0; _screen->clearGuiShapeMemory(pageNum); diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp index 0c9cf6d297..15c9bbdd7e 100644 --- a/engines/kyra/sequences_lol.cpp +++ b/engines/kyra/sequences_lol.cpp @@ -714,7 +714,7 @@ void LoLEngine::showStarcraftLogo() { if (!(shouldQuit() || inputFlag)) { _sound->voicePlay("star2", &_speechHandle); - while(_sound->voiceIsPlaying(&_speechHandle) && !(shouldQuit() || inputFlag)) { + while (_sound->voiceIsPlaying(&_speechHandle) && !(shouldQuit() || inputFlag)) { inputFlag = checkInput(0) & 0xff; delay(_tickLength); } diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp index 61f4c1eac7..79baebeb18 100644 --- a/engines/m4/converse.cpp +++ b/engines/m4/converse.cpp @@ -235,7 +235,7 @@ void ConversationView::selectEntry(int entryIndex) { } void ConversationView::updateState() { - switch(_conversationState) { + switch (_conversationState) { case kConversationOptionsShown: return; case kEntryIsActive: @@ -412,7 +412,7 @@ void Converse::loadConversation(const char *convName) { if (convS->eos()) break; if (debugFlag) printf("***** Pos: %i -> ", chunkPos); - switch(chunk) { + switch (chunk) { case CHUNK_DECL: // Declare if (debugFlag) printf("DECL chunk\n"); data = convS->readUint32LE(); diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 8fadd4e462..edfd14e6c7 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -572,7 +572,7 @@ void Parallaction::runZone(ZonePtr z) { uint16 actionType = ACTIONTYPE(z); debugC(3, kDebugExec, "actionType = %x, itemType = %x", actionType, ITEMTYPE(z)); - switch(actionType) { + switch (actionType) { case kZoneExamine: enterCommentMode(z); diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index c2982185ab..033350643e 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -134,7 +134,7 @@ bool Parallaction_br::processGameEvent(int event) { bool c = true; _input->stopHovering(); - switch(event) { + switch (event) { case kEvIngameMenu: startIngameMenu(); c = false; diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 9604b26026..de3cb1e557 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -256,7 +256,7 @@ bool Parallaction_ns::processGameEvent(int event) { bool c = true; _input->stopHovering(); - switch(event) { + switch (event) { case kEvSaveGame: _saveLoad->saveGame(); break; diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp index 850eb994a7..08a00acd2a 100644 --- a/engines/saga/isomap.cpp +++ b/engines/saga/isomap.cpp @@ -1067,7 +1067,7 @@ void IsoMap::testPossibleDirections(int16 u, int16 v, uint16 terraComp[8], int s memset(terraComp, 0, 8 * sizeof(uint16)); #define FILL_MASK(index, testMask) \ - if ( mask & testMask) { \ + if (mask & testMask) { \ terraComp[index] |= fgdMask; \ } \ if (~mask & testMask) { \ @@ -1370,7 +1370,7 @@ void IsoMap::findDragonTilePath(ActorData* actor,const Location &start, const Lo tile = getTile(u1, v1, _platformHeight ); if (tile != NULL) { mask = tile->terrainMask; - if ( ((mask != 0) && (tile->GetFGDAttr() >= kTerrBlock)) || + if (((mask != 0) && (tile->GetFGDAttr() >= kTerrBlock)) || ((mask != 0xFFFF) && (tile->GetBGDAttr() >= kTerrBlock)) ) { pcell->visited = 1; } diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index 7386b6dd10..84d151223f 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -169,7 +169,7 @@ Common::Error SagaEngine::run() { if (_readingSpeed > 3) _readingSpeed = 0; - switch(getGameId()) { + switch (getGameId()) { case GID_ITE: _resource = new Resource_RSC(this); break; diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 7b20a65e95..5d73fd4fb3 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -1003,7 +1003,7 @@ static reg_t kDoSoundSci1Late(EngineState *s, int argc, reg_t *argv) { * Used for synthesized music playback */ reg_t kDoSound(EngineState *s, int argc, reg_t *argv) { - switch(s->detectDoSoundType()) { + switch (s->detectDoSoundType()) { case SCI_VERSION_0_EARLY: return kDoSoundSci0(s, argc, argv); case SCI_VERSION_1_EARLY: diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index ae9db4cb67..8747ba31b8 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -545,7 +545,7 @@ static byte *find_unique_script_block(EngineState *s, byte *buf, int type) { int seeker_size = READ_LE_UINT16(buf + 2); assert(seeker_size > 0); buf += seeker_size; - } while(1); + } while (1); return NULL; } diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 10d2a957a8..effaac0ca5 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -271,7 +271,7 @@ SciVersion EngineState::detectDoSoundType() { if (!parse_reg_t(this, "?Sound", &soundClass)) { int sum = methodChecksum(soundClass, _kernel->_selectorCache.play, -6, 6); - switch(sum) { + switch (sum) { case 0x1B2: // SCI0 case 0x1AE: // SCI01 _doSoundType = SCI_VERSION_0_EARLY; diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index acb89824b2..f377e77d13 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -403,7 +403,7 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt sendCalls.push(call); break; - } // switch(lookup_selector()) + } // switch (lookup_selector()) framesize -= (2 + argc); argp += argc + 1; @@ -1410,7 +1410,7 @@ void run_vm(EngineState *s, int restoring) { default: error("run_vm(): illegal opcode %x", opnumber); - } // switch(opcode >> 1) + } // switch (opcode >> 1) if (s->_executionStackPosChanged) // Force initialization scriptState.xs = xs_new; diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index f6b24d0a12..f413020267 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -1532,7 +1532,7 @@ ViewType ResourceManager::detectViewType() { Resource *res = findResource(ResourceId(kResourceTypeView, i), 0); if (res) { - switch(res->data[1]) { + switch (res->data[1]) { case 128: // If the 2nd byte is 128, it's a VGA game return kViewVga; diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp index 669a3f7d76..643d919da1 100644 --- a/engines/sci/sfx/core.cpp +++ b/engines/sci/sfx/core.cpp @@ -226,7 +226,7 @@ void SfxPlayer::player_timer_callback(void *refCon) { Common::Error SfxPlayer::init(ResourceManager *resMan, int expected_latency) { MidiDriverType musicDriver = MidiDriver::detectMusicDriver(MDT_PCSPK | MDT_ADLIB); - switch(musicDriver) { + switch (musicDriver) { case MD_ADLIB: _mididrv = new MidiPlayer_Adlib(); break; diff --git a/engines/scumm/player_v2cms.cpp b/engines/scumm/player_v2cms.cpp index d628293d7d..bffe9faf70 100644 --- a/engines/scumm/player_v2cms.cpp +++ b/engines/scumm/player_v2cms.cpp @@ -320,7 +320,7 @@ void CMSEmulator::update(int chip, int16 *buffer, int length) { saa->noise[ch].counter -= saa->noise[ch].freq; while (saa->noise[ch].counter < 0) { saa->noise[ch].counter += _sampleRate; - if( ((saa->noise[ch].level & 0x4000) == 0) == ((saa->noise[ch].level & 0x0040) == 0) ) + if (((saa->noise[ch].level & 0x4000) == 0) == ((saa->noise[ch].level & 0x0040) == 0) ) saa->noise[ch].level = (saa->noise[ch].level << 1) | 1; else saa->noise[ch].level <<= 1; diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp index 5924197d96..c67b7fe675 100644 --- a/engines/sky/logic.cpp +++ b/engines/sky/logic.cpp @@ -23,7 +23,6 @@ * */ - #include "common/endian.h" #include "common/rect.h" #include "common/events.h" @@ -1918,7 +1917,7 @@ bool Logic::fnStartMenu(uint32 firstObject, uint32 b, uint32 c) { uint32 menuLength = 0; for (i = firstObject; i < firstObject + ARRAYSIZE(_objectList); i++) { - if ( _scriptVariables[i] ) + if (_scriptVariables[i]) _objectList[menuLength++] = _scriptVariables[i]; } _scriptVariables[MENU_LENGTH] = menuLength; diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index e5f3b9a04c..2134e7dc2d 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -1032,7 +1032,7 @@ void Control::renderText(const uint8 *str, uint16 x, uint16 y, uint8 mode) { dst[cntx] = sprData[cntx]; } - if(SwordEngine::isPsx()) { //On PSX version we need to double horizontal lines + if (SwordEngine::isPsx()) { //On PSX version we need to double horizontal lines dst += SCREEN_WIDTH; for (uint16 cntx = 0; cntx < _resMan->getUint16(chSpr->width); cntx++) if (sprData[cntx]) @@ -1074,7 +1074,7 @@ void Control::renderVolumeBar(uint8 id, uint8 volL, uint8 volR) { for (uint16 cnty = 0; cnty < barHeight; cnty++) { memcpy(destMem, srcMem, _resMan->getUint16(frHead->width)); - if(SwordEngine::isPsx()) { //linedoubling + if (SwordEngine::isPsx()) { //linedoubling destMem += SCREEN_WIDTH; memcpy(destMem, srcMem, _resMan->getUint16(frHead->width)); } diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp index 26635c2708..f32c422540 100644 --- a/engines/sword1/logic.cpp +++ b/engines/sword1/logic.cpp @@ -23,7 +23,6 @@ * */ - #include "common/endian.h" #include "common/util.h" #include "common/system.h" @@ -114,7 +113,7 @@ void Logic::newScreen(uint32 screen) { } // work around, at screen 69 in psx version TOP menu gets stuck at disabled, fix it at next screen (71) - if( (screen == 71) && (SwordEngine::isPsx())) + if ((screen == 71) && (SwordEngine::isPsx())) _scriptVars[TOP_MENU_DISABLED] = 0; if (SwordEngine::_systemVars.justRestoredGame) { // if we've just restored a game - we want George to be exactly as saved diff --git a/engines/sword1/mouse.cpp b/engines/sword1/mouse.cpp index 020586d702..77e58f8116 100644 --- a/engines/sword1/mouse.cpp +++ b/engines/sword1/mouse.cpp @@ -23,7 +23,6 @@ * */ - #include "common/system.h" #include "graphics/cursorman.h" @@ -245,7 +244,7 @@ void Mouse::createPointer(uint32 ptrId, uint32 luggageId) { if (luggSrc[cntx]) dstData[cntx] = luggSrc[cntx]; - if(SwordEngine::isPsx()) { + if (SwordEngine::isPsx()) { dstData += resSizeX; for (uint32 cntx = 0; cntx < luggSizeX; cntx++) if (luggSrc[cntx]) @@ -267,7 +266,7 @@ void Mouse::createPointer(uint32 ptrId, uint32 luggageId) { if (srcData[cntx]) dstData[cntx] = srcData[cntx]; - if(SwordEngine::isPsx()) { + if (SwordEngine::isPsx()) { dstData +=resSizeX; for (uint32 cntx = 0; cntx < ptrSizeX; cntx++) if (srcData[cntx]) diff --git a/engines/sword1/router.cpp b/engines/sword1/router.cpp index df7640f80b..b8347abd32 100644 --- a/engines/sword1/router.cpp +++ b/engines/sword1/router.cpp @@ -705,7 +705,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { if (lastDir != currentDir) { // get the direction to turn turnDir = currentDir - lastDir; - if ( turnDir < 0) + if (turnDir < 0) turnDir += NO_DIRECTIONS; if (turnDir > 4) @@ -716,7 +716,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { // rotate to new walk direction // for george and nico put in a head turn at the start if ((megaId == GEORGE) || (megaId == NICO)) { - if ( turnDir < 0) { // new frames for turn frames 29oct95jps + if (turnDir < 0) { // new frames for turn frames 29oct95jps module = turnFramesLeft + lastDir; } else { module = turnFramesRight + lastDir; @@ -732,12 +732,12 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { // rotate till were facing new dir then go back 45 degrees while (lastDir != currentDir) { lastDir += turnDir; - if ( turnDir < 0) { // new frames for turn frames 29oct95jps - if ( lastDir < 0) + if (turnDir < 0) { // new frames for turn frames 29oct95jps + if (lastDir < 0) lastDir += NO_DIRECTIONS; module = turnFramesLeft + lastDir; } else { - if ( lastDir > 7) + if (lastDir > 7) lastDir -= NO_DIRECTIONS; module = turnFramesRight + lastDir; } @@ -926,7 +926,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { } else if (_targetDir != lastRealDir) { // rotate to _targetDir // rotate to target direction turnDir = _targetDir - lastRealDir; - if ( turnDir < 0) + if (turnDir < 0) turnDir += NO_DIRECTIONS; if (turnDir > 4) @@ -937,7 +937,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { // rotate to target direction // for george and nico put in a head turn at the start if ((megaId == GEORGE) || (megaId == NICO)) { - if ( turnDir < 0) { // new frames for turn frames 29oct95jps + if (turnDir < 0) { // new frames for turn frames 29oct95jps module = turnFramesLeft + lastDir; } else { module = turnFramesRight + lastDir; @@ -953,12 +953,12 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { // rotate if we need to while (lastRealDir != _targetDir) { lastRealDir += turnDir; - if ( turnDir < 0) { // new frames for turn frames 29oct95jps - if ( lastRealDir < 0) + if (turnDir < 0) { // new frames for turn frames 29oct95jps + if (lastRealDir < 0) lastRealDir += NO_DIRECTIONS; module = turnFramesLeft + lastRealDir; } else { - if ( lastRealDir > 7) + if (lastRealDir > 7) lastRealDir -= NO_DIRECTIONS; module = turnFramesRight + lastRealDir; } @@ -1123,7 +1123,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) { if (lastDir != currentDir) { // get the direction to turn turnDir = currentDir - lastDir; - if ( turnDir < 0) + if (turnDir < 0) turnDir += NO_DIRECTIONS; if (turnDir > 4) @@ -1134,7 +1134,7 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) { // rotate to new walk direction // for george and nico put in a head turn at the start if ((megaId == GEORGE) || (megaId == NICO)) { - if ( turnDir < 0) { // new frames for turn frames 29oct95jps + if (turnDir < 0) { // new frames for turn frames 29oct95jps module = turnFramesLeft + lastDir; } else { module = turnFramesRight + lastDir; @@ -1150,12 +1150,12 @@ int32 Router::solidWalkAnimator(WalkData *walkAnim) { // rotate till were facing new dir then go back 45 degrees while (lastDir != currentDir) { lastDir += turnDir; - if ( turnDir < 0) { // new frames for turn frames 29oct95jps - if ( lastDir < 0) + if (turnDir < 0) { // new frames for turn frames 29oct95jps + if (lastDir < 0) lastDir += NO_DIRECTIONS; module = turnFramesLeft + lastDir; } else { - if ( lastDir > 7) + if (lastDir > 7) lastDir -= NO_DIRECTIONS; module = turnFramesRight + lastDir; } @@ -2125,9 +2125,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 e6193e4137..bef715199c 100644 --- a/engines/sword1/screen.cpp +++ b/engines/sword1/screen.cpp @@ -373,7 +373,7 @@ void Screen::draw(void) { uint8 *src = _layerBlocks[0]; uint8 *dest = _screenBuf; - if(SwordEngine::isPsx()) { + if (SwordEngine::isPsx()) { if (!_psxCache.decodedBackground) _psxCache.decodedBackground = psxShrinkedBackgroundToIndexed(_layerBlocks[0], _scrnSizeX, _scrnSizeY); memcpy(_screenBuf, _psxCache.decodedBackground, _scrnSizeX * _scrnSizeY); @@ -398,7 +398,7 @@ void Screen::draw(void) { } else if (!(SwordEngine::isPsx())) { memcpy(_screenBuf, _layerBlocks[0], _scrnSizeX * _scrnSizeY); } else { //We are using PSX version - if(_currentScreen == 45 || _currentScreen == 55 || + if (_currentScreen == 45 || _currentScreen == 55 || _currentScreen == 57 || _currentScreen == 63 || _currentScreen == 71) { // Width shrinked backgrounds if (!_psxCache.decodedBackground) _psxCache.decodedBackground = psxShrinkedBackgroundToIndexed(_layerBlocks[0], _scrnSizeX, _scrnSizeY); @@ -426,7 +426,7 @@ void Screen::draw(void) { renderParallax(_parallax[1]); // PSX version has parallax layer for this room in an external file (TRAIN.PLX) - if(SwordEngine::isPsx() && _currentScreen == 63) { + if (SwordEngine::isPsx() && _currentScreen == 63) { // FIXME: this should be handled in a cleaner way... if (!_psxCache.extPlxCache) { Common::File parallax; @@ -493,7 +493,7 @@ void Screen::processImage(uint32 id) { uint16 sprSizeX, sprSizeY; if (compact->o_status & STAT_SHRINK) { memset(_shrinkBuffer, 0, SHRINK_BUFFER_SIZE); //Clean shrink buffer to avoid corruption - if( SwordEngine::isPsx() && (compact->o_resource != GEORGE_MEGA)) { //PSX Height shrinked sprites + if (SwordEngine::isPsx() && (compact->o_resource != GEORGE_MEGA)) { //PSX Height shrinked sprites sprSizeX = (scale * _resMan->readUint16(&frameHead->width)) / 256; sprSizeY = (scale * (_resMan->readUint16(&frameHead->height))) / 256 / 2; fastShrink(sprData, _resMan->readUint16(&frameHead->width), (_resMan->readUint16(&frameHead->height)) / 2, scale, _shrinkBuffer); @@ -509,7 +509,7 @@ void Screen::processImage(uint32 id) { sprData = _shrinkBuffer; } else { sprSizeX = _resMan->readUint16(&frameHead->width); - if(SwordEngine::isPsx()) { //PSX sprites are half height + if (SwordEngine::isPsx()) { //PSX sprites are half height sprSizeY = _resMan->readUint16(&frameHead->height) / 2; } else sprSizeY = (_resMan->readUint16(&frameHead->height)); @@ -537,7 +537,7 @@ void Screen::processImage(uint32 id) { spriteClipAndSet(&spriteX, &spriteY, &sprSizeX, &sprSizeY, &incr); if ((sprSizeX > 0) && (sprSizeY > 0)) { - if( (!(SwordEngine::isPsx()) || (compact->o_type == TYPE_TEXT) + if ((!(SwordEngine::isPsx()) || (compact->o_type == TYPE_TEXT) || (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) @@ -666,7 +666,7 @@ void Screen::renderParallax(uint8 *data) { } else paraScrlY = 0; - if(SwordEngine::isPsx()) + if (SwordEngine::isPsx()) drawPsxParallax(data, paraScrlX, scrnScrlX, scrnWidth); else for (uint16 cnty = 0; cnty < scrnHeight; cnty++) { @@ -867,7 +867,7 @@ uint8* Screen::psxBackgroundToIndexed(uint8 *psxBackground, uint32 bakXres, uint for (uint32 currentTile = 0; currentTile < totTiles; currentTile++) { uint32 tileOffset = READ_LE_UINT32(psxBackground + 4 * currentTile); - if(isCompressed) + if (isCompressed) decompressHIF(psxBackground + tileOffset - 4, decomp_tile); //Decompress the tile into decomp_tile else memcpy(decomp_tile, psxBackground + tileOffset - 4, 16*16); @@ -911,7 +911,7 @@ uint8* Screen::psxShrinkedBackgroundToIndexed(uint8 *psxBackground, uint32 bakXr for (currentTile = 0; currentTile < totTiles; currentTile++) { uint32 tileOffset = READ_LE_UINT32(psxBackground + 4 * currentTile); - if(isCompressed) + if (isCompressed) decompressHIF(psxBackground + tileOffset - 4, decomp_tile); //Decompress the tile into decomp_tile else memcpy(decomp_tile, psxBackground + tileOffset - 4, 16 * 16); @@ -949,7 +949,7 @@ uint8* Screen::psxShrinkedBackgroundToIndexed(uint8 *psxBackground, uint32 bakXr for (; currentTile < totTiles + remainingTiles; currentTile++) { uint32 tileOffset = READ_LE_UINT32(psxBackground + 4 * currentTile); - if(isCompressed) + if (isCompressed) decompressHIF(psxBackground + tileOffset - 4, decomp_tile); //Decompress the tile into decomp_tile else memcpy(decomp_tile, psxBackground + tileOffset - 4, 256); @@ -1101,7 +1101,7 @@ void Screen::decompressHIF(uint8 *src, uint8 *dest) { if (info_word == 0xFFFF) return; //Got 0xFFFF code, finished. int32 repeat_count = (info_word >> 12) + 2; //How many time data needs to be refetched - while(repeat_count >= 0) { + while (repeat_count >= 0) { uint8 *old_data_src = dest - ((info_word & 0xFFF) + 1); *dest++ = *old_data_src; repeat_count--; @@ -1187,7 +1187,7 @@ void Screen::spriteClipAndSet(uint16 *pSprX, uint16 *pSprY, uint16 *pSprWidth, u uint16 gridH = (*pSprHeight + (sprY & (SCRNGRID_Y - 1)) + (SCRNGRID_Y - 1)) / SCRNGRID_Y; uint16 gridW = (*pSprWidth + (sprX & (SCRNGRID_X - 1)) + (SCRNGRID_X - 1)) / SCRNGRID_X; - if(SwordEngine::isPsx()) { + if (SwordEngine::isPsx()) { gridH *= 2; // This will correct the PSX sprite being cut at half height gridW *= 2; // and masking problems when sprites are stretched in width @@ -1225,7 +1225,7 @@ void Screen::showFrame(uint16 x, uint16 y, uint32 resId, uint32 frameNo, const b uint8 frame[40 * 40]; int i, j; - if(SwordEngine::isPsx()) + if (SwordEngine::isPsx()) memset(frame, 0, sizeof(frame)); // PSX top menu is black else memset(frame, 199, sizeof(frame)); // Dark gray background diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp index 0c78798a49..d71b5027b8 100644 --- a/engines/sword1/text.cpp +++ b/engines/sword1/text.cpp @@ -106,7 +106,7 @@ void Text::makeTextSprite(uint8 slot, uint8 *text, uint16 maxWidth, uint8 pen) { for (uint16 pos = 0; pos < lines[lineCnt].length; pos++) sprPtr += copyChar(*text++, sprPtr, sprWidth, pen) - OVERLAP; text++; // skip space at the end of the line - if(SwordEngine::isPsx()) //Chars are half height in psx version + if (SwordEngine::isPsx()) //Chars are half height in psx version linePtr += (_charHeight / 2) * sprWidth; else linePtr += _charHeight * sprWidth; @@ -136,7 +136,7 @@ uint16 Text::analyzeSentence(uint8 *text, uint16 maxWidth, LineInfo *line) { text++; wordWidth += OVERLAP; // no overlap on final letter of word! - if ( firstWord ) { // first word on first line, so no separating SPACE needed + if (firstWord) { // first word on first line, so no separating SPACE needed line[0].width = wordWidth; line[0].length = wordLength; firstWord = false; @@ -167,9 +167,9 @@ uint16 Text::copyChar(uint8 ch, uint8 *sprPtr, uint16 sprWidth, uint8 pen) { uint8 *decChr; uint16 frameHeight = 0; - if(SwordEngine::isPsx()) { + if (SwordEngine::isPsx()) { frameHeight = _resMan->getUint16(chFrame->height)/2; - if(_fontId == CZECH_GAME_FONT) { //Czech game fonts are compressed + if (_fontId == CZECH_GAME_FONT) { //Czech game fonts are compressed decBuf = (uint8*) malloc((_resMan->getUint16(chFrame->width))*(_resMan->getUint16(chFrame->height)/2)); Screen::decompressHIF(chData, decBuf); decChr = decBuf; diff --git a/engines/sword2/maketext.cpp b/engines/sword2/maketext.cpp index 0c29e5719c..35f0924404 100644 --- a/engines/sword2/maketext.cpp +++ b/engines/sword2/maketext.cpp @@ -325,7 +325,7 @@ uint16 FontRenderer::charWidth(byte ch, uint32 fontRes) { frame_head.read(charBuf); - if(Sword2Engine::isPsx()) + if (Sword2Engine::isPsx()) free(charBuf); _vm->_resman->closeResource(fontRes); @@ -353,7 +353,7 @@ uint16 FontRenderer::charHeight(uint32 fontRes) { frame_head.read(charbuf); - if(Sword2Engine::isPsx()) + if (Sword2Engine::isPsx()) free(charbuf); _vm->_resman->closeResource(fontRes); diff --git a/engines/sword2/palette.cpp b/engines/sword2/palette.cpp index aa569689ff..84ebd142ca 100644 --- a/engines/sword2/palette.cpp +++ b/engines/sword2/palette.cpp @@ -50,7 +50,7 @@ void Screen::startNewPalette() { // Don't fetch palette match table while using PSX version, // because it is not present. - if(!Sword2Engine::isPsx()) + if (!Sword2Engine::isPsx()) memcpy(_paletteMatch, _vm->fetchPaletteMatchTable(screenFile), PALTABLESIZE); setPalette(0, 256, _vm->fetchPalette(screenFile), RDPAL_FADE); diff --git a/engines/sword2/protocol.cpp b/engines/sword2/protocol.cpp index dcb5b5f5b0..bb5f68fd5f 100644 --- a/engines/sword2/protocol.cpp +++ b/engines/sword2/protocol.cpp @@ -43,7 +43,7 @@ namespace Sword2 { byte *Sword2Engine::fetchPalette(byte *screenFile) { byte *palette; - if(isPsx()) { // PSX version doesn't have a "MultiScreenHeader", instead there's a ScreenHeader and a tag + if (isPsx()) { // PSX version doesn't have a "MultiScreenHeader", instead there's a ScreenHeader and a tag palette = screenFile + ResHeader::size() + ScreenHeader::size() + 2; } else { MultiScreenHeader mscreenHeader; diff --git a/engines/sword2/render.cpp b/engines/sword2/render.cpp index 7d41ccd207..6123986367 100644 --- a/engines/sword2/render.cpp +++ b/engines/sword2/render.cpp @@ -618,7 +618,7 @@ int32 Screen::initialisePsxBackgroundLayer(byte *parallax) { if (!(remLines && posY == _yBlocks[_layer] - 1)) remLines = 32; - for(j = 0; j < remLines; j++) { + for (j = 0; j < remLines; j++) { memcpy(tileChunk + j * BLOCKWIDTH * 2, parallax + stripeOffset + j * BLOCKWIDTH, BLOCKWIDTH); memcpy(tileChunk + j * BLOCKWIDTH * 2 + BLOCKWIDTH, parallax + stripeOffset + j * BLOCKWIDTH, BLOCKWIDTH); } @@ -728,7 +728,7 @@ int32 Screen::initialisePsxParallaxLayer(byte *parallax) { block_has_data = true; // If one of the two grouped blocks is without data, then we also have transparency - if(!firstTilePresent || !secondTilePresent) + if (!firstTilePresent || !secondTilePresent) block_is_transparent = true; } @@ -737,7 +737,7 @@ int32 Screen::initialisePsxParallaxLayer(byte *parallax) { byte *block = data; if (firstTilePresent) { for (k = 0; k < 0x400; k++) { - if ( *(block + k) == 0) { + if (*(block + k) == 0) { block_is_transparent = true; break; } @@ -749,7 +749,7 @@ int32 Screen::initialisePsxParallaxLayer(byte *parallax) { // a second tile, check it if (secondTilePresent && !block_is_transparent) { for (k = 0; k < 0x400; k++) { - if ( *(block + k) == 0) { + if (*(block + k) == 0) { block_is_transparent = true; break; } diff --git a/engines/sword2/router.cpp b/engines/sword2/router.cpp index 2fc5c9efd5..d8789d00fb 100644 --- a/engines/sword2/router.cpp +++ b/engines/sword2/router.cpp @@ -945,11 +945,11 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { // new frames for turn frames 29oct95jps if (turnDir < 0) { - if ( lastDir < 0) + if (lastDir < 0) lastDir += NO_DIRECTIONS; module = _firstStandingTurnLeftFrame + lastDir; } else { - if ( lastDir > 7) + if (lastDir > 7) lastDir -= NO_DIRECTIONS; module = _firstStandingTurnRightFrame + lastDir; } @@ -1208,7 +1208,7 @@ void Router::slidyWalkAnimator(WalkData *walkAnim) { } else if (_targetDir != lastRealDir) { // rotate to target direction turnDir = _targetDir - lastRealDir; - if ( turnDir < 0) + if (turnDir < 0) turnDir += NO_DIRECTIONS; if (turnDir > 4) diff --git a/engines/sword2/sprite.cpp b/engines/sword2/sprite.cpp index 39abb8efe9..3d40c2b858 100644 --- a/engines/sword2/sprite.cpp +++ b/engines/sword2/sprite.cpp @@ -279,7 +279,7 @@ uint32 Screen::decompressHIF(byte *src, byte *dst, uint32 *skipData) { } int32 repeat_count = (info_word >> 12) + 2; // How many time data needs to be refetched - while(repeat_count >= 0) { + while (repeat_count >= 0) { uint16 refetchData = (info_word & 0xFFF) + 1; if (refetchData > decompSize) return 0; // We have a problem here... uint8 *old_data_src = dst - refetchData; @@ -498,7 +498,7 @@ int32 Screen::drawSprite(SpriteInfo *s) { // Decompression and mirroring // ----------------------------------------------------------------- if (s->type & RDSPR_NOCOMPRESSION) { - if(Sword2Engine::isPsx()) { // PSX Uncompressed sprites + if (Sword2Engine::isPsx()) { // PSX Uncompressed sprites if (s->w > 254 && !s->isText) { // We need to recompose these frames recomposePsxSprite(s); } @@ -528,7 +528,7 @@ int32 Screen::drawSprite(SpriteInfo *s) { decompData = decompressHIF(s->data, tempBuf); // Check that we correctly decompressed data - if(!decompData) + if (!decompData) return RDERR_DECOMPRESSION; s->w = (decompData / (s->h / 2)) * 2; @@ -568,7 +568,7 @@ int32 Screen::drawSprite(SpriteInfo *s) { uint32 decompData = decompressHIF(s->data, tempBuf); // Check that we correctly decompressed data - if(!decompData) + if (!decompData) return RDERR_DECOMPRESSION; s->w = (decompData / (s->h / 2)); diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index bee079cda7..d21e5b4eee 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -186,7 +186,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { displayMessage(0x57b2); return true; } else { - for(byte i = 11; i <= 27; i += 4) + for (byte i = 11; i <= 27; i += 4) playSound(76, i); playSound(56, 35); diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index d8d40f64d3..91de759bec 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -50,7 +50,7 @@ void Inventory::init(TeenAgentEngine *engine) { offset[i] = items->readUint16LE(); } - for(byte i = 0; i < 92; ++i) { + for (byte i = 0; i < 92; ++i) { InventoryObject io; uint16 obj_addr = res->dseg.get_word(0xc4a4 + i * 2); if (obj_addr != 0) diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index 196283159d..4f21fb774c 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -116,7 +116,7 @@ void Scene::init(TeenAgentEngine *engine, OSystem *system) { objects.resize(42); walkboxes.resize(42); - for(byte i = 0; i < 42; ++i) { + for (byte i = 0; i < 42; ++i) { Common::Array<Object> &scene_objects = objects[i]; scene_objects.clear(); @@ -151,7 +151,7 @@ Object *Scene::findObject(const Common::Point &point) { Common::Array<Object> &scene_objects = objects[_id - 1]; - for(uint i = 0; i < scene_objects.size(); ++i) { + for (uint i = 0; i < scene_objects.size(); ++i) { Object &obj = scene_objects[i]; if (obj.enabled != 0 && obj.rect.in(point)) return &obj; diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 53d214950e..a1176e04ef 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -134,10 +134,10 @@ void TeenAgentEngine::init() { Resources * res = Resources::instance(); use_hotspots.resize(42); byte *scene_hotspots = res->dseg.ptr(0xbb87); - for(byte i = 0; i < 42; ++i) { + for (byte i = 0; i < 42; ++i) { Common::Array<UseHotspot> & hotspots = use_hotspots[i]; byte * hotspots_ptr = res->dseg.ptr(READ_LE_UINT16(scene_hotspots + i * 2)); - while(*hotspots_ptr) { + while (*hotspots_ptr) { UseHotspot h; h.load(hotspots_ptr); hotspots_ptr += 9; diff --git a/engines/tinsel/coroutine.h b/engines/tinsel/coroutine.h index c562ecdabb..34d4865ce9 100644 --- a/engines/tinsel/coroutine.h +++ b/engines/tinsel/coroutine.h @@ -145,7 +145,7 @@ public: if (&coroParam == &nullContext) assert(!nullContext);\ if (!x) {coroParam = x = new CoroContextTag();}\ CoroContextHolder tmpHolder(coroParam);\ - switch(coroParam->_line) { case 0:; + switch (coroParam->_line) { case 0:; /** * End the code section of a coroutine. diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp index 0b3f2e6e24..9700e8947f 100644 --- a/engines/tinsel/graphics.cpp +++ b/engines/tinsel/graphics.cpp @@ -286,7 +286,7 @@ static void PsxDrawTiles(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool apply p += boxBounds.top * (fourBitClut ? sizeof(uint16) : sizeof(uint32)); for (int yp = boxBounds.top; yp <= boxBounds.bottom; ++yp, p += (fourBitClut ? sizeof(uint16) : sizeof(uint32))) { - if(!fourBitClut) { + if (!fourBitClut) { if (!transparency) Common::copy(p + boxBounds.left, p + boxBounds.right + 1, tempDest + (SCREEN_WIDTH * (yp - boxBounds.top))); else |