diff options
Diffstat (limited to 'engines')
134 files changed, 492 insertions, 492 deletions
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 8c19d03691..3eec33abe5 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -194,7 +194,7 @@ protected: /** * A map containing all the extra game GUI options the engine supports. - */ + */ const ADExtraGuiOptionsMap * const _extraGuiOptions; /** @@ -212,7 +212,7 @@ protected: * * Used to override gameid. * This is a recommended setting to prevent global gameid pollution. - * With this option set, the gameid effectively turns into engineid. + * With this option set, the gameid effectively turns into engineid. * * FIXME: This field actually removes a feature (gameid) in order to * address a more generic problem. We should find a better way to diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 45c00a76ac..98ffca22ed 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -219,7 +219,7 @@ void AgiEngine::processEvents() { case Common::KEYCODE_F6: key = 0x4000; break; - case Common::KEYCODE_F7: + case Common::KEYCODE_F7: key = 0x4100; break; case Common::KEYCODE_F8: diff --git a/engines/agi/detection_tables.h b/engines/agi/detection_tables.h index ab0e9a1fe4..9d67b15adb 100644 --- a/engines/agi/detection_tables.h +++ b/engines/agi/detection_tables.h @@ -706,10 +706,10 @@ static const AGIGameDescription gameDescriptions[] = { FANMADE("Go West, Young Hippie", "ff31484ea465441cb5f3a0f8e956b716"), FANMADE("Good Man (demo v3.41)", "3facd8a8f856b7b6e0f6c3200274d88c"), - GAME_LVFPNF("agi-fanmade", "Groza (russian) [AGDS sample]", "logdir", "421da3a18004122a966d64ab6bd86d2e", -1, + GAME_LVFPNF("agi-fanmade", "Groza (russian) [AGDS sample]", "logdir", "421da3a18004122a966d64ab6bd86d2e", -1, Common::RU_RUS, 0x2440, GF_AGDS, GID_FANMADE, Common::kPlatformPC,GType_V2), - GAME_LVFPNF("agi-fanmade", "Get Outta Space Quest", "logdir", "aaea5b4a348acb669d13b0e6f22d4dc9", -1, + GAME_LVFPNF("agi-fanmade", "Get Outta Space Quest", "logdir", "aaea5b4a348acb669d13b0e6f22d4dc9", -1, Common::EN_ANY, 0x2440, GF_FANMADE, GID_GETOUTTASQ, Common::kPlatformPC,GType_V2), FANMADE_F("Half-Death - Terror At White-Mesa", "b62c05d0ace878261392073f57ae788c", GF_AGIMOUSE), diff --git a/engines/agi/loader_v1.cpp b/engines/agi/loader_v1.cpp index c6a3e66705..189c98ee98 100644 --- a/engines/agi/loader_v1.cpp +++ b/engines/agi/loader_v1.cpp @@ -64,7 +64,7 @@ int AgiLoader_v1::detectGame() { int AgiLoader_v1::loadDir_DDP(AgiDir *agid, int offset, int max) { Common::File fp; - + if (!fp.open(_filenameDisk0)) return errBadFileOpen; @@ -73,13 +73,13 @@ int AgiLoader_v1::loadDir_DDP(AgiDir *agid, int offset, int max) { agid[i].volume = 0xFF; agid[i].offset = _EMPTY; } - + fp.seek(offset, SEEK_SET); for (int i = 0; i <= max; i++) { int b0 = fp.readByte(); int b1 = fp.readByte(); int b2 = fp.readByte(); - + if (b0 == 0xFF && b1 == 0xFF && b2 == 0xFF) { agid[i].volume = 0xFF; agid[i].offset = _EMPTY; @@ -98,7 +98,7 @@ int AgiLoader_v1::loadDir_DDP(AgiDir *agid, int offset, int max) { int AgiLoader_v1::loadDir_BC(AgiDir *agid, int offset, int max) { Common::File fp; - + if (!fp.open(_filenameDisk0)) return errBadFileOpen; @@ -107,13 +107,13 @@ int AgiLoader_v1::loadDir_BC(AgiDir *agid, int offset, int max) { agid[i].volume = 0xFF; agid[i].offset = _EMPTY; } - + fp.seek(offset, SEEK_SET); for (int i = 0; i <= max; i++) { int b0 = fp.readByte(); int b1 = fp.readByte(); int b2 = fp.readByte(); - + if (b0 == 0xFF && b1 == 0xFF && b2 == 0xFF) { agid[i].volume = 0xFF; agid[i].offset = _EMPTY; @@ -171,7 +171,7 @@ uint8 *AgiLoader_v1::loadVolRes(struct AgiDir *agid) { if (offset == _EMPTY) return NULL; - + if (offset > IMAGE_SIZE) { fp.open(_filenameDisk1); offset -= IMAGE_SIZE; @@ -191,7 +191,7 @@ uint8 *AgiLoader_v1::loadVolRes(struct AgiDir *agid) { agid->len = fp.readUint16LE(); data = (uint8 *)calloc(1, agid->len + 32); fp.read(data, agid->len); - + fp.close(); return data; diff --git a/engines/agi/menu.cpp b/engines/agi/menu.cpp index cac1701596..d23a5a2e27 100644 --- a/engines/agi/menu.cpp +++ b/engines/agi/menu.cpp @@ -289,7 +289,7 @@ bool Menu::keyhandler(int key) { _vm->_game.clockEnabled = false; drawMenuBar(); } - + // Mouse handling if (_vm->_mouse.button) { int hmenu, vmenu; diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 7e04328a67..5334407eb8 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -1146,7 +1146,7 @@ void cmdFollowEgo(AgiGame *state, uint8 *p) { vt.parm1 = p1 > vt.stepSize ? p1 : vt.stepSize; vt.parm2 = p2; vt.parm3 = 0xff; - + if (getVersion() < 0x2000) { _v[p2] = 0; vt.flags |= fUpdate | fAnimated; @@ -1270,7 +1270,7 @@ void cmdVersion(AgiGame *state, uint8 *p) { // no Sierra as it wraps textbox Common::String verMsg = TITLE " v%s"; - + int ver = getVersion(); int maj = (ver >> 12) & 0xf; int min = ver & 0xfff; @@ -1839,7 +1839,7 @@ int AgiEngine::runLogic(int n) { // ip = 2; // warning("running logic %d\n", n); // } - + if (_game.exitAllLogics) break; } diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp index a44c68e0fc..4d5e6fffe1 100644 --- a/engines/agi/op_test.cpp +++ b/engines/agi/op_test.cpp @@ -403,7 +403,7 @@ int AgiEngine::testIfCode(int lognum) { case 0xFF: endTest = true; continue; - + default: // Evaluate the command and skip the rest of the instruction _agiCondCommands[op](state, p); diff --git a/engines/agi/opcodes.cpp b/engines/agi/opcodes.cpp index 29fb860635..7a427bd94f 100644 --- a/engines/agi/opcodes.cpp +++ b/engines/agi/opcodes.cpp @@ -130,7 +130,7 @@ AgiInstruction insV1[] = { { "...", "", &cmdUnknown }, // 4E # show.obj { "load.logics", "n", &cmdLoadLogic }, // 4F # load.global.logics { "display", "nnns", &cmdDisplay }, // 50 TODO: 4 vs 3 args - { "prevent.input???", "", &cmdUnknown }, // 51 + { "prevent.input???", "", &cmdUnknown }, // 51 { "...", "", &cmdUnknown }, // 52 # nop { "...", "n", &cmdUnknown }, // 53 # text.screen { "...", "", &cmdUnknown }, // 54 ??? diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 3e63da756d..d451a799a0 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -821,7 +821,7 @@ int AgiEngine::scummVMSaveLoadDialog(bool isSave) { if (slot < 0) return true; - + if (isSave) return doSave(slot, desc); else diff --git a/engines/agi/sound_pcjr.cpp b/engines/agi/sound_pcjr.cpp index d21baa450f..5bffca5765 100644 --- a/engines/agi/sound_pcjr.cpp +++ b/engines/agi/sound_pcjr.cpp @@ -234,7 +234,7 @@ int SoundGenPCJr::getNextNote(int ch) // if tone isn't touched.. it should be inited so it just plays silence // return 0 if it's passing more data // return -1 if it's passing nothing (end of data) -int SoundGenPCJr::getNextNote_v2(int ch) { +int SoundGenPCJr::getNextNote_v2(int ch) { ToneChan *tpcm; SndGenChan *chan; const byte *data; @@ -308,7 +308,7 @@ int SoundGenPCJr::getNextNote_v1(int ch) { _channel[ch].attenuationCopy = 0x0F; return -1; } - + // In the V1 player the default duration for a row is 3 ticks if (duration > 0) { duration--; diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index 1886a74ab1..4877be2647 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -64,7 +64,7 @@ void AgiEngine::printText2(int l, const char *msg, int foff, int xoff, int yoff, // Note: there were extra checks for *m being a cursor character // here (1, 2 or 3), which have been removed, as the cursor - // character is no longer printed via this function. + // character is no longer printed via this function. if (*m >= 0x20) { int ypos = (y1 * CHAR_LINES) + yoff; @@ -73,7 +73,7 @@ void AgiEngine::printText2(int l, const char *msg, int foff, int xoff, int yoff, if (xpos >= GFX_WIDTH) continue; - + _gfx->putTextCharacter(l, xpos, ypos, *m, fg, bg, checkerboard); if (x1 > maxx) diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp index 4400112247..9c5b3d349a 100644 --- a/engines/agi/words.cpp +++ b/engines/agi/words.cpp @@ -41,7 +41,7 @@ int AgiEngine::loadWords_v1(Common::File &f) { int k; debug(0, "Loading dictionary"); - + // Loop through alphabet, as words in the dictionary file are sorted by // first character f.seek(f.pos() + 26 * 2, SEEK_SET); @@ -131,7 +131,7 @@ int AgiEngine::findWord(const char *word, int *flen) { *flen = 0; Common::Array<AgiWord *> &a = _game.words[c]; - + for (int i = 0; i < (int)a.size(); i++) { int wlen = strlen(a[i]->word); // Keep looking till we find the word itself, or the whole phrase. diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index c6bca1a6e6..e13fa214d1 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -142,7 +142,7 @@ void AGOSEngine_Feeble::quickLoadOrSave() { } #endif -// The function uses segments of code from the original game scripts +// The function uses segments of code from the original game scripts // to allow quick loading and saving, but isn't perfect. // // Unfortuntely this allows loading and saving in locations, @@ -1424,7 +1424,7 @@ bool AGOSEngine_Elvira2::loadGame(const char *filename, bool restartMode) { // The floppy disk versions of Simon the Sorcerer 2 block changing // to scrolling rooms, if the copy protection fails. But the copy // protection flags are never set in the CD version. - // Setting this copy protection flag, allows saved games to be shared + // Setting this copy protection flag, allows saved games to be shared // between all versions of Simon the Sorcerer 2. if (getGameType() == GType_SIMON2) { setBitFlag(135, 1); diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp index 85c449eafc..bec41bbbd3 100644 --- a/engines/agos/sound.cpp +++ b/engines/agos/sound.cpp @@ -297,7 +297,7 @@ Audio::AudioStream *RawSound::makeAudioStream(uint sound) { warning("RawSound::makeAudioStream: Could not open file \"%s\"", _filename.c_str()); return NULL; } - + file->seek(_offsets[sound], SEEK_SET); uint size = file->readUint32BE(); return Audio::makeRawStream(new Common::SeekableSubReadStream(file, _offsets[sound] + 4, _offsets[sound] + 4 + size, DisposeAfterUse::YES), 22050, _flags, DisposeAfterUse::YES); diff --git a/engines/cge/bitmap.cpp b/engines/cge/bitmap.cpp index 4f85957b3d..7089c8e0d1 100644 --- a/engines/cge/bitmap.cpp +++ b/engines/cge/bitmap.cpp @@ -94,7 +94,7 @@ Bitmap::Bitmap(CGEEngine *vm, uint16 w, uint16 h, uint8 fill) // Replicate across the entire table for (HideDesc *hdP = b + 1; hdP < (b + _h); hdP++) *hdP = *b; - + b->_skip = 0; // fix the first entry _v = v; _b = b; @@ -357,7 +357,7 @@ bool Bitmap::loadVBM(EncryptedStream *f) { // Read in the palette byte palData[kPalSize]; f->read(palData, kPalSize); - + const byte *srcP = palData; for (int idx = 0; idx < kPalCount; idx++, srcP += 3) { _vm->_bitmapPalette[idx]._r = *srcP; diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp index ecbfba2502..f4f1cd3e0b 100644 --- a/engines/cge/cge_main.cpp +++ b/engines/cge/cge_main.cpp @@ -280,7 +280,7 @@ Common::Error CGEEngine::loadGameState(int slot) { sceneDown(); _hero->park(); resetGame(); - + // If music is playing, kill it. if (_music) _midiPlayer->killMidi(); @@ -508,7 +508,7 @@ void CGEEngine::loadMapping() { if (!cf.err()) { // Move to the data for the given room cf.seek((_now - 1) * kMapArrSize); - + // Read in the data for (int z = 0; z < kMapZCnt; ++z) { cf.read(&_clusterMap[z][0], kMapXCnt); @@ -772,7 +772,7 @@ void System::touch(uint16 mask, int x, int y, Common::KeyCode keyCode) { if (mask & kEventKeyb) { if (keyCode == Common::KEYCODE_ESCAPE) { - // The original was calling keyClick() + // The original was calling keyClick() // The sound is uselessly annoying and noisy, so it has been removed _vm->killText(); if (_vm->_startupMode == 1) { @@ -1044,7 +1044,7 @@ void CGEEngine::loadSprite(const char *fname, int ref, int scene, int col = 0, i uint16 len; for (line = sprf.readLine(); !sprf.eos(); line = sprf.readLine()) { - len = line.size(); + len = line.size(); lcnt++; strcpy(tmpStr, line.c_str()); if (len == 0 || *tmpStr == '.') diff --git a/engines/cge/detection.cpp b/engines/cge/detection.cpp index 2e04b82026..3d6c24d68b 100644 --- a/engines/cge/detection.cpp +++ b/engines/cge/detection.cpp @@ -198,7 +198,7 @@ SaveStateList CGEMetaEngine::listSaves(const char *target) const { SaveStateDescriptor CGEMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String fileName = Common::String::format("%s.%03d", target, slot); Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(fileName); - + if (f) { CGE::SavegameHeader header; @@ -229,7 +229,7 @@ SaveStateDescriptor CGEMetaEngine::querySaveMetaInfos(const char *target, int sl return desc; } } - + return SaveStateDescriptor(); } diff --git a/engines/cge/events.h b/engines/cge/events.h index 522aa67905..ab8d87212d 100644 --- a/engines/cge/events.h +++ b/engines/cge/events.h @@ -105,7 +105,7 @@ private: void handleEvents(); public: EventManager(CGEEngine *vm); - void poll(); + void poll(); void clearEvent(Sprite *spr); CGEEvent &getNextEvent(); diff --git a/engines/cge/fileio.cpp b/engines/cge/fileio.cpp index f23105d823..609d5e86aa 100644 --- a/engines/cge/fileio.cpp +++ b/engines/cge/fileio.cpp @@ -98,7 +98,7 @@ uint16 ResourceManager::XCrypt(void *buf, uint16 length) { for (uint16 i = 0; i < length; i++) *b++ ^= kCryptSeed; - + return kCryptSeed; } diff --git a/engines/cge/text.cpp b/engines/cge/text.cpp index fd4120d49d..a8ce8777c5 100644 --- a/engines/cge/text.cpp +++ b/engines/cge/text.cpp @@ -63,7 +63,7 @@ int16 Text::count() { Common::String line; char tmpStr[kLineMax + 1]; - + int counter = 0; for (line = tf.readLine(); !tf.eos(); line = tf.readLine()) { diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp index 23a9d2ff85..555b703da9 100644 --- a/engines/composer/composer.cpp +++ b/engines/composer/composer.cpp @@ -20,7 +20,7 @@ * */ #include "common/scummsys.h" - + #include "common/config-manager.h" #include "common/events.h" #include "common/file.h" diff --git a/engines/composer/resource.cpp b/engines/composer/resource.cpp index a4e292747c..83e49971fb 100644 --- a/engines/composer/resource.cpp +++ b/engines/composer/resource.cpp @@ -240,7 +240,7 @@ bool ComposerArchive::openStream(Common::SeekableReadStream *stream) { res.flags = flags; debug(4, "Id %d, offset %d, size %d, flags %08x", id, offset, size, flags); } - + stream->seek(oldPos); } diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index cbe17ea4d3..ba79df4822 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -295,7 +295,7 @@ void CruiseMetaEngine::removeSaveState(const char *target, int slot) const { SaveStateDescriptor CruiseMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading( Cruise::CruiseEngine::getSavegameFile(slot)); - + if (f) { Cruise::CruiseSavegameHeader header; Cruise::readSavegameHeader(f, header); diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index cf3dfaa44b..c884075093 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -229,7 +229,7 @@ void MainMenuDialog::save() { "Please consult the README for basic information, and for " "instructions on how to obtain further assistance."), status.getDesc().c_str()); GUI::MessageDialog dialog(failMessage); - dialog.runModal(); + dialog.runModal(); } close(); diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp index 61705a1e59..2d78d05933 100644 --- a/engines/draci/detection.cpp +++ b/engines/draci/detection.cpp @@ -153,7 +153,7 @@ void DraciMetaEngine::removeSaveState(const char *target, int slot) const { SaveStateDescriptor DraciMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading( Draci::DraciEngine::getSavegameFile(slot)); - + if (f) { Draci::DraciSavegameHeader header; Draci::readSavegameHeader(f, header); diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index 6e38d49b94..760d8b7d98 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -284,7 +284,7 @@ public: Common::StringArray filenames = saveFileMan->listSavefiles(pattern); Common::Array<int> slots; for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) { - + // Obtain the last 2 digits of the filename, since they correspond to the save slot int slotNum = atoi(file->c_str() + file->size() - 2); @@ -299,7 +299,7 @@ public: // Load save index Common::String fileEpa = Common::String::format("%s.epa", target); - Common::InSaveFile *epa = saveFileMan->openForLoading(fileEpa); + Common::InSaveFile *epa = saveFileMan->openForLoading(fileEpa); // Get savegame names from index Common::String saveDesc; @@ -307,19 +307,19 @@ public: int line = 1; for (size_t i = 0; i < slots.size(); i++) { // ignore lines corresponding to unused saveslots - for (; line < slots[i]; line++) - epa->readLine(); + for (; line < slots[i]; line++) + epa->readLine(); // copy the name in the line corresponding to the save slot and truncate to 22 characters saveDesc = Common::String(epa->readLine().c_str(), 22); // handle cases where the save directory and save index are detectably out of sync - if (saveDesc == "*") + if (saveDesc == "*") saveDesc = "No name specified."; // increment line number to keep it in sync with slot number - line++; - + line++; + // Insert savegame name into list saveList.push_back(SaveStateDescriptor(slots[i], saveDesc)); } diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index 0ca98d5a7b..5f5d627553 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -516,7 +516,7 @@ uint8 DreamWebEngine::modifyChar(uint8 c) const { case Common::IT_ITA: switch(c) { case 133: - return 'Z' + 1; + return 'Z' + 1; case 130: return 'Z' + 2; case 138: @@ -548,10 +548,10 @@ uint8 DreamWebEngine::modifyChar(uint8 c) const { return c; } } - + Common::String DreamWebEngine::modifyFileName(const char *name) { Common::String fileName(name); - + // Sanity check if (!fileName.hasPrefix("DREAMWEB.")) return fileName; diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index b42591ef91..1e84aba6bd 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -516,7 +516,7 @@ void DreamWebEngine::inToInv() { if (_mouseButton == _oldButton || !(_mouseButton & 1)) return; // notletgo2 - + delPointer(); DynObject *object = getExAd(_itemFrame); object->mapad[0] = 4; @@ -1034,7 +1034,7 @@ void DreamWebEngine::fillOpen() { size = 4; findAllOpen(); for (uint8 i = 0; i < size; ++i) { - uint8 index = _openInvList[i]._index; + uint8 index = _openInvList[i]._index; uint8 type = _openInvList[i]._type; obToInv(index, type, kInventx + i * kItempicsize, kInventy + 96); } diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp index 36a756a49b..dbb81406cd 100644 --- a/engines/dreamweb/people.cpp +++ b/engines/dreamweb/people.cpp @@ -411,7 +411,7 @@ void DreamWebEngine::interviewer(ReelRoutine &routine) { if (routine.reelPointer() != 250 && routine.reelPointer() != 259 && checkSpeed(routine)) routine.incReelPointer(); - + showGameReel(&routine); } @@ -745,7 +745,7 @@ void DreamWebEngine::introMonks2(ReelRoutine &routine) { if (nextReelPointer == 110) { _introCount++; monks2text(); - + if (_introCount == 35) nextReelPointer = 111; else @@ -895,7 +895,7 @@ void DreamWebEngine::helicopter(ReelRoutine &routine) { nextReelPointer = 9; } } - } + } routine.setReelPointer(nextReelPointer); } @@ -1002,7 +1002,7 @@ void DreamWebEngine::businessMan(ReelRoutine &routine) { nextReelPointer = 92; } } - + routine.setReelPointer(nextReelPointer); } @@ -1037,7 +1037,7 @@ void DreamWebEngine::endGameSeq(ReelRoutine &routine) { showGameReel(&routine); routine.mapY = _mapY; - + if (routine.reelPointer() == 145) { routine.setReelPointer(146); rollEndCreditsGameWon(); @@ -1070,7 +1070,7 @@ void DreamWebEngine::poolGuard(ReelRoutine &routine) { if (checkSpeed(routine)) { uint16 nextReelPointer = routine.reelPointer() + 1; - + if (nextReelPointer != 122) { // Not end guard 1 if (nextReelPointer == 147) { @@ -1103,12 +1103,12 @@ void DreamWebEngine::poolGuard(ReelRoutine &routine) { } } } - + routine.setReelPointer(nextReelPointer); } showGameReel(&routine); - + if (routine.reelPointer() != 121 && routine.reelPointer() != 146) { _pointerMode = 0; _vars._watchingTime = 2; diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp index 3a2c45e07b..64b9849980 100644 --- a/engines/dreamweb/print.cpp +++ b/engines/dreamweb/print.cpp @@ -212,7 +212,7 @@ const char *DreamWebEngine::monPrint(const char *string) { while (!done) { uint16 count = getNumber(_monitorCharset, (const uint8 *)iterator, 166, false, &x); - do { + do { char c = *iterator++; if (c == ':') break; diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp index 5b6cf6a6ac..01570c907a 100644 --- a/engines/dreamweb/sprite.cpp +++ b/engines/dreamweb/sprite.cpp @@ -52,7 +52,7 @@ void DreamWebEngine::printASprite(const Sprite *sprite) { } else { x = sprite->x + _mapAdX; } - + uint8 c; if (sprite->walkFrame != 0) c = 8; @@ -97,7 +97,7 @@ void DreamWebEngine::spriteUpdate() { else { backObject(&sprite); } - + if (_nowInNewRoom == 1) break; } @@ -373,7 +373,7 @@ void DreamWebEngine::lockedDoorway(Sprite *sprite, SetObject *objData) { if (sprite->animFrame != 0) --sprite->animFrame; - + _vars._throughDoor = 0; sprite->frameNumber = objData->index = objData->frames[sprite->animFrame]; @@ -407,7 +407,7 @@ void DreamWebEngine::liftSprite(Sprite *sprite, SetObject *objData) { } sprite->animFrame = 12; sprite->frameNumber = objData->index = objData->frames[sprite->animFrame]; - } + } else if (liftFlag == 3) { //openlift if (sprite->animFrame == 12) { _vars._liftFlag = 1; @@ -672,7 +672,7 @@ static const ReelSound g_roomSound6[] = { { 255,0 } }; static const ReelSound g_roomSound8[] = { - + { 12, 51 }, { 13, 53 }, { 14, 14 }, @@ -691,7 +691,7 @@ static const ReelSound g_roomSound10[] = { { 13, 16 }, { 255,0 } }; - + static const ReelSound g_roomSound11[] = { { 13, 20 }, { 255,0 } @@ -779,7 +779,7 @@ static const ReelSound g_roomSound26[] = { { 15, 102 }, // was 90, should be mine cart { 255,0 } }; - + static const ReelSound g_roomSound27[] = { { 22, 36 }, { 13, 125 }, diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp index 50c0ef3161..d2390fb1fd 100644 --- a/engines/dreamweb/vgagrafx.cpp +++ b/engines/dreamweb/vgagrafx.cpp @@ -334,9 +334,9 @@ void DreamWebEngine::zoom() { for (size_t j = 0; j < 23; ++j) { uint8 v = src[j]; dst[2*j+0] = v; - dst[2*j+1] = v; + dst[2*j+1] = v; dst[2*j+320] = v; - dst[2*j+321] = v; + dst[2*j+321] = v; } src += 320; dst += 320*2; diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index 1a3b313649..895686b5e0 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -142,7 +142,7 @@ static const GroovieGameDescription gameDescriptions[] = { { "11h", "Demo", AD_ENTRY1s("disk.1", "aacb32ce07e0df2894bd83a3dee40c12", 70), - Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, + Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOLAUNCHLOAD, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_NOASPECT) }, kGroovieV2, 1 diff --git a/engines/lure/decode.cpp b/engines/lure/decode.cpp index 1338559534..484126c43f 100644 --- a/engines/lure/decode.cpp +++ b/engines/lure/decode.cpp @@ -255,7 +255,7 @@ MemoryBlock *PictureDecoder::vgaDecode(MemoryBlock *src, uint32 maxOutputSize) { decrCtr(); if (shlCarry()) break; - + AL = dataIn->data()[BP + 3]; } else { decrCtr(); @@ -375,7 +375,7 @@ uint32 AnimationDecoder::decode_data(MemoryBlock *src, MemoryBlock *dest, uint32 // Main loop bool loopFlag = true; while (loopFlag) { - for (;;) { + for (;;) { carry = false; rcl(currData, carry); if (--bitCtr == 0) { diff --git a/engines/made/screenfx.cpp b/engines/made/screenfx.cpp index de9231a158..ad71f1fb49 100644 --- a/engines/made/screenfx.cpp +++ b/engines/made/screenfx.cpp @@ -200,10 +200,10 @@ void ScreenEffects::stepBlendedPalette() { setBlendedPalette(_blendedPaletteStatus._palette, _blendedPaletteStatus._newPalette, _blendedPaletteStatus._colorCount, _blendedPaletteStatus._value, _blendedPaletteStatus._maxValue); if (_blendedPaletteStatus._value == _blendedPaletteStatus._maxValue) - _blendedPaletteStatus._value++; - else - _blendedPaletteStatus._value = MIN<int16>(_blendedPaletteStatus._value + _blendedPaletteStatus._incr, _blendedPaletteStatus._maxValue); - } + _blendedPaletteStatus._value++; + else + _blendedPaletteStatus._value = MIN<int16>(_blendedPaletteStatus._value + _blendedPaletteStatus._incr, _blendedPaletteStatus._maxValue); + } } void ScreenEffects::copyFxRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2) { diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index f3b183c84f..c403536e22 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -113,12 +113,12 @@ int QueenMetaEngine::getMaximumSaveSlot() const { return 99; } const ExtraGuiOptions QueenMetaEngine::getExtraGuiOptions(const Common::String &target) const { Common::String guiOptions; ExtraGuiOptions options; - + if (target.empty()) { options.push_back(queenExtraGuiOption); return options; } - + if (ConfMan.hasKey("guioptions", target)) { guiOptions = ConfMan.get("guioptions", target); guiOptions = parseGameGUIOptions(guiOptions); diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index 96746b538c..3efc554cb3 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -948,7 +948,7 @@ void Script::opSpeak(SCRIPTOP_PARAMS) { // scripts change to scene 5, but do not clear the cutaway that appears // before Gorrister's speech starts, resulting in a deadlock. We do this // manually here. - if (_vm->getGameId() == GID_IHNM && _vm->_scene->currentChapterNumber() == 1 && + if (_vm->getGameId() == GID_IHNM && _vm->_scene->currentChapterNumber() == 1 && _vm->_scene->currentSceneNumber() == 5 && _vm->_anim->hasCutaway()) { _vm->_anim->returnFromCutaway(); } diff --git a/engines/sci/engine/file.cpp b/engines/sci/engine/file.cpp index a0f7ebf4a2..3dc042389e 100644 --- a/engines/sci/engine/file.cpp +++ b/engines/sci/engine/file.cpp @@ -95,7 +95,7 @@ reg_t file_open(EngineState *s, const Common::String &filename, int mode, bool u outFile = saveFileMan->openForSaving(wrappedName, isCompressed); if (!outFile) debugC(kDebugLevelFile, " -> file_open(_K_FILE_MODE_CREATE): failed to create file '%s'", englishName.c_str()); - + // QfG1 opens the character export file with _K_FILE_MODE_CREATE first, // closes it immediately and opens it again with this here. Perhaps // other games use this for read access as well. I guess changing this @@ -387,7 +387,7 @@ uint32 VirtualIndexFile::read(char *buffer, uint32 size) { uint32 VirtualIndexFile::write(const char *buffer, uint32 size) { _changed = true; uint32 curPos = _ptr - _buffer; - + // Check if the buffer needs to be resized if (curPos + size >= _bufferSize) { _bufferSize = curPos + size + 1; diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index f5f46285be..b6b36c47e7 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -524,7 +524,7 @@ static SciKernelMapEntry s_kernelMap[] = { { MAP_CALL(PalCycle), SIG_EVERYWHERE, "i(.*)", NULL, NULL }, // SCI2 Empty functions - + // Debug function used to track resources { MAP_EMPTY(ResourceTrack), SIG_EVERYWHERE, "(.*)", NULL, NULL }, // Future TODO: This call is used in the floppy version of QFG4 to add diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index f7cc4f44b5..e977f15c0c 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -340,7 +340,7 @@ reg_t kFileIOClose(EngineState *s, int argc, reg_t *argv) { if (argv[0] == SIGNAL_REG) return s->r_acc; - + uint16 handle = argv[0].toUint16(); #ifdef ENABLE_SCI32 @@ -624,7 +624,7 @@ reg_t kFileIOExists(EngineState *s, int argc, reg_t *argv) { // Special case for KQ6 Mac: The game checks for two video files to see // if they exist before it plays them. Since we support multiple naming // schemes for resource fork files, we also need to support that here in - // case someone has a "HalfDome.bin" file, etc. + // case someone has a "HalfDome.bin" file, etc. if (!exists && g_sci->getGameId() == GID_KQ6 && g_sci->getPlatform() == Common::kPlatformMacintosh && (name == "HalfDome" || name == "Kq6Movie")) exists = Common::MacResManager::exists(name); @@ -998,7 +998,7 @@ reg_t kMakeSaveFileName(EngineState *s, int argc, reg_t *argv) { if ((virtualId < SAVEGAMEID_OFFICIALRANGE_START) || (virtualId > SAVEGAMEID_OFFICIALRANGE_END)) error("kMakeSaveFileName: invalid savegame ID specified"); uint saveSlot = virtualId - SAVEGAMEID_OFFICIALRANGE_START; - + Common::Array<SavegameDesc> saves; listSavegames(saves); diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index 6bf9aff2fe..9b0cb38f51 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -275,7 +275,7 @@ reg_t kRobot(EngineState *s, int argc, reg_t *argv) { // Signal the engine scripts that the video is done writeSelector(s->_segMan, argv[1], SELECTOR(signal), SIGNAL_REG); } else { - writeSelector(s->_segMan, argv[1], SELECTOR(signal), NULL_REG); + writeSelector(s->_segMan, argv[1], SELECTOR(signal), NULL_REG); } break; default: diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index 951fc7c363..04c1dab158 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -825,7 +825,7 @@ byte *SegManager::allocDynmem(int size, const char *descr, reg_t *addr) { } bool SegManager::freeDynmem(reg_t addr) { - if (addr.getSegment() < 1 || addr.getSegment() >= _heap.size() || + if (addr.getSegment() < 1 || addr.getSegment() >= _heap.size() || !_heap[addr.getSegment()] || _heap[addr.getSegment()]->getType() != SEG_TYPE_DYNMEM) return false; // error diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 3f43966976..ef8f165084 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -228,7 +228,7 @@ ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackP uint32 exportAddr = scr->validateExportFunc(pubfunct, false); if (!exportAddr) return NULL; - + // Check if a breakpoint is set on this method g_sci->checkExportBreakpoint(script, pubfunct); diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp index ad1d9e8623..5535a7408a 100644 --- a/engines/sci/graphics/controls32.cpp +++ b/engines/sci/graphics/controls32.cpp @@ -68,7 +68,7 @@ void GfxControls32::kernelTexteditChange(reg_t controlObject) { while (captureEvents) { curEvent = g_sci->getEventManager()->getSciEvent(SCI_EVENT_KEYBOARD | SCI_EVENT_PEEK); - + if (curEvent.type == SCI_EVENT_NONE) { eventMan->getSciEvent(SCI_EVENT_KEYBOARD); // consume the event } else { @@ -170,11 +170,11 @@ void GfxControls32::kernelTexteditChange(reg_t controlObject) { // Note: the following checkAltInput call might make the text // too wide to fit, but SSCI fails to check that too. } - + reg_t hunkId = readSelector(_segMan, controlObject, SELECTOR(bitmap)); Common::Rect nsRect = g_sci->_gfxCompare->getNSRect(controlObject); //texteditCursorErase(); // TODO: Cursor - + // Write back string _segMan->strcpy(textReference, text.c_str()); // Modify the buffer and show it diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 968014c032..8b7fa2c384 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -197,7 +197,7 @@ void GfxFrameout::kernelUpdatePlane(reg_t object) { } else { it->planeOffsetX = 0; } - + if (it->planeRect.top < 0) { it->planeOffsetY = -it->planeRect.top; it->planeRect.top = 0; @@ -420,7 +420,7 @@ void GfxFrameout::deletePlaneItems(reg_t planeObject) { } else { objectMatches = true; } - + if (objectMatches) { FrameoutEntry *itemEntry = *listIterator; listIterator = _screenItems.erase(listIterator); @@ -661,7 +661,7 @@ void GfxFrameout::kernelFrameout() { if (!itemEntry->visible) continue; - + if (itemEntry->object.isNull()) { // Picture cel data _coordAdjuster->fromScriptToDisplay(itemEntry->y, itemEntry->x); @@ -703,7 +703,7 @@ void GfxFrameout::kernelFrameout() { view->getCelRect(itemEntry->loopNo, itemEntry->celNo, itemEntry->x, itemEntry->y, itemEntry->z, itemEntry->celRect); else - view->getCelScaledRect(itemEntry->loopNo, itemEntry->celNo, + view->getCelScaledRect(itemEntry->loopNo, itemEntry->celNo, itemEntry->x, itemEntry->y, itemEntry->z, itemEntry->scaleX, itemEntry->scaleY, itemEntry->celRect); @@ -755,10 +755,10 @@ void GfxFrameout::kernelFrameout() { if (view) { if (!clipRect.isEmpty()) { if ((itemEntry->scaleX == 128) && (itemEntry->scaleY == 128)) - view->draw(itemEntry->celRect, clipRect, translatedClipRect, + view->draw(itemEntry->celRect, clipRect, translatedClipRect, itemEntry->loopNo, itemEntry->celNo, 255, 0, view->isSci2Hires()); else - view->drawScaled(itemEntry->celRect, clipRect, translatedClipRect, + view->drawScaled(itemEntry->celRect, clipRect, translatedClipRect, itemEntry->loopNo, itemEntry->celNo, 255, itemEntry->scaleX, itemEntry->scaleY); } } @@ -817,7 +817,7 @@ void GfxFrameout::printPlaneItemList(Console *con, reg_t planeObject) { for (FrameoutList::iterator listIterator = _screenItems.begin(); listIterator != _screenItems.end(); listIterator++) { FrameoutEntry *e = *listIterator; reg_t itemPlane = readSelector(_segMan, e->object, SELECTOR(plane)); - + if (planeObject == itemPlane) { Common::String curItemName = _segMan->getObjectName(e->object); Common::Rect icr = e->celRect; diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index 89f3625e2c..d20aa80c77 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -559,8 +559,8 @@ reg_t GfxPaint16::kernelDisplay(const char *text, int argc, reg_t *argv) { SciTrackOriginReply originReply; SciWorkaroundSolution solution = trackOriginAndFindWorkaround(0, kDisplay_workarounds, &originReply); if (solution.type == WORKAROUND_NONE) - error("Unknown kDisplay argument (%04x:%04x) from method %s::%s (script %d, localCall %x)", - PRINT_REG(displayArg), originReply.objectName.c_str(), originReply.methodName.c_str(), + error("Unknown kDisplay argument (%04x:%04x) from method %s::%s (script %d, localCall %x)", + PRINT_REG(displayArg), originReply.objectName.c_str(), originReply.methodName.c_str(), originReply.scriptNr, originReply.localCallOffset); assert(solution.type == WORKAROUND_IGNORE); break; diff --git a/engines/sci/sound/drivers/fmtowns.cpp b/engines/sci/sound/drivers/fmtowns.cpp index 6d8bb2e525..21cb2f1e43 100644 --- a/engines/sci/sound/drivers/fmtowns.cpp +++ b/engines/sci/sound/drivers/fmtowns.cpp @@ -52,8 +52,8 @@ public: uint16 _duration; private: - uint8 _id; - uint8 _velo; + uint8 _id; + uint8 _velo; uint8 _program; MidiDriver_FMTowns *_drv; @@ -76,7 +76,7 @@ public: void addChannels(int num); void dropChannels(int num); - + uint8 currentProgram() const; private: @@ -132,7 +132,7 @@ private: TownsMidiPart **_parts; TownsChannel **_out; - + uint8 _masterVolume; bool _soundOn; @@ -590,7 +590,7 @@ void MidiDriver_FMTowns::addMissingChannels() { avlChan -= _parts[i]->_chanMissing; uint8 m = _parts[i]->_chanMissing; _parts[i]->_chanMissing = 0; - _parts[i]->addChannels(m); + _parts[i]->addChannels(m); } else { _parts[i]->_chanMissing -= avlChan; _parts[i]->addChannels(avlChan); @@ -601,7 +601,7 @@ void MidiDriver_FMTowns::addMissingChannels() { void MidiDriver_FMTowns::updateParser() { if (_timerProc) - _timerProc(_timerProcPara); + _timerProc(_timerProcPara); } void MidiDriver_FMTowns::updateChannels() { diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp index 608c77136f..0337a8d306 100644 --- a/engines/sci/video/robot_decoder.cpp +++ b/engines/sci/video/robot_decoder.cpp @@ -109,13 +109,13 @@ bool RobotDecoder::loadStream(Common::SeekableReadStream *stream) { } bool RobotDecoder::load(GuiResourceId id) { - // TODO: RAMA's robot 1003 cannot be played (shown at the menu screen) - + // TODO: RAMA's robot 1003 cannot be played (shown at the menu screen) - // its drawn at odd coordinates. SV can't play it either (along with some // others), so it must be some new functionality added in RAMA's robot // videos. Skip it for now. if (g_sci->getGameId() == GID_RAMA && id == 1003) return false; - + // TODO: The robot video in the Lighthouse demo gets stuck if (g_sci->getGameId() == GID_LIGHTHOUSE && id == 16) return false; @@ -247,7 +247,7 @@ void RobotDecoder::readNextPacket() { audioTrack->queueBuffer(g_sci->_audio->getDecodedRobotAudioFrame(_fileStream, audioChunkSize), audioChunkSize * 2); } else { _fileStream->skip(audioChunkSize); - } + } } void RobotDecoder::readHeaderChunk() { diff --git a/engines/sci/video/robot_decoder.h b/engines/sci/video/robot_decoder.h index ebc3262939..437954f7fb 100644 --- a/engines/sci/video/robot_decoder.h +++ b/engines/sci/video/robot_decoder.h @@ -45,13 +45,13 @@ public: bool loadStream(Common::SeekableReadStream *stream); bool load(GuiResourceId id); void close(); - + void setPos(uint16 x, uint16 y) { _pos = Common::Point(x, y); } Common::Point getPos() const { return _pos; } protected: void readNextPacket(); - + private: class RobotVideoTrack : public FixedRateVideoTrack { public: diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index b8722b6963..0c375efcdd 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -573,19 +573,19 @@ bool Actor_v2::checkWalkboxesHaveDirectPath(Common::Point &foundPath) { return false; } -bool Actor_v0::intersectLineSegments(const Common::Point &line1Start, const Common::Point &line1End, - const Common::Point &line2Start, const Common::Point &line2End, Common::Point &result) +bool Actor_v0::intersectLineSegments(const Common::Point &line1Start, const Common::Point &line1End, + const Common::Point &line2Start, const Common::Point &line2End, Common::Point &result) { const Common::Point v1 = line1End - line1Start; // line1(n1) = line1Start + n1 * v1 const Common::Point v2 = line2End - line2Start; // line2(n2) = line2Start + n2 * v2 - + double det = v2.x * v1.y - v1.x * v2.y; if (det == 0) return false; - double n1 = ((double)v2.x * (line2Start.y - line1Start.y) - + double n1 = ((double)v2.x * (line2Start.y - line1Start.y) - (double)v2.y * (line2Start.x - line1Start.x)) / det; - double n2 = ((double)v1.x * (line2Start.y - line1Start.y) - + double n2 = ((double)v1.x * (line2Start.y - line1Start.y) - (double)v1.y * (line2Start.x - line1Start.x)) / det; // both coefficients have to be in [0, 1], otherwise the intersection is @@ -599,16 +599,16 @@ bool Actor_v0::intersectLineSegments(const Common::Point &line1Start, const Comm } /* - * MM v0 allows the actor to walk in a direct line between boxes to the target + * MM v0 allows the actor to walk in a direct line between boxes to the target * if actor and target share a horizontal or vertical corridor. - * If such a corridor is found the actor is not forced to go horizontally or + * If such a corridor is found the actor is not forced to go horizontally or * vertically from one box to the next but can also walk diagonally. * - * Note: the original v0 interpreter sets the target destination for diagonal + * Note: the original v0 interpreter sets the target destination for diagonal * walking only once and then rechecks whenever the actor reaches a new box if the - * walk destination is still suitable for the current box. - * ScummVM does not perform such a check, so it is possible to leave the walkboxes - * in some cases, for example L-shaped rooms like the swimming pool (actor walks over water) + * walk destination is still suitable for the current box. + * ScummVM does not perform such a check, so it is possible to leave the walkboxes + * in some cases, for example L-shaped rooms like the swimming pool (actor walks over water) * or the medical room (actor walks over examination table). * To solve this we intersect the new walk destination with the actor's walkbox borders, * so a recheck is done when the actor leaves his box. This is done by the @@ -992,7 +992,7 @@ void Actor_v0::setDirection(int direction) { res = 7; // Face Camera break; } - + _animFrameRepeat = -1; animateActor(res); if (_moving) @@ -1408,7 +1408,7 @@ void Actor::showActor() { if (_vm->_game.version == 0) { Actor_v0 *a = ((Actor_v0 *)this); - + a->_costCommand = a->_costCommandNew = 0xFF; for (int i = 0; i < 8; ++i) { @@ -2056,7 +2056,7 @@ void Actor_v0::animateCostume() { void Actor_v0::speakCheck() { if (v0ActorTalkArray[_number] & 0x80) return; - + int cmd = newDirToOldDir(_facing); if (_speaking & 0x80) @@ -2884,7 +2884,7 @@ void Actor_v0::animateActor(int anim) { _costCommandNew = anim; _vm->_costumeLoader->costumeDecodeData(this, 0, 0); - + if (dir == -1) return; diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h index 0ed239d005..a733fdb4ed 100644 --- a/engines/scumm/actor.h +++ b/engines/scumm/actor.h @@ -377,7 +377,7 @@ public: virtual void saveLoadWithSerializer(Serializer *ser); protected: - bool intersectLineSegments(const Common::Point &line1Start, const Common::Point &line1End, + bool intersectLineSegments(const Common::Point &line1Start, const Common::Point &line1End, const Common::Point &line2Start, const Common::Point &line2End, Common::Point &result); virtual bool checkWalkboxesHaveDirectPath(Common::Point &foundPath); }; diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp index 4064853b6b..9ae75b6683 100644 --- a/engines/scumm/charset.cpp +++ b/engines/scumm/charset.cpp @@ -69,7 +69,7 @@ void ScummEngine::loadCJKFont() { _cjkFont->setDrawingMode(Graphics::FontSJIS::kShadowMode); _2byteWidth = _2byteHeight = 12; - _useCJKMode = true; + _useCJKMode = true; #endif } else if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD && _language == Common::JA_JPN) { int numChar = 1413; @@ -499,7 +499,7 @@ int CharsetRendererV3::getCharWidth(uint16 chr) { if (_vm->_useCJKMode && (chr & 0x80)) spacing = _vm->_2byteWidth / 2; - + if (!spacing) spacing = *(_widthTable + chr); @@ -644,7 +644,7 @@ void CharsetRendererV3::printChar(int chr, bool ignoreCharsetMask) { drawBits1(*vs, _left + vs->xstart, drawTop, charPtr, drawTop, origWidth, origHeight); else drawBits1(_vm->_textSurface, _left * _vm->_textSurfaceMultiplier, _top * _vm->_textSurfaceMultiplier, charPtr, drawTop, origWidth, origHeight); - + if (is2byte) { origWidth /= _vm->_textSurfaceMultiplier; height /= _vm->_textSurfaceMultiplier; @@ -1399,7 +1399,7 @@ void CharsetRendererTownsClassic::drawBitsN(const Graphics::Surface&, byte *dst, _vm->_cjkFont->drawChar(_vm->_textSurface, _sjisCurChar, _left * _vm->_textSurfaceMultiplier, (_top - _vm->_screenTop) * _vm->_textSurfaceMultiplier, _vm->_townsCharsetColorMap[1], _shadowColor); return; } - + bool scale2x = (_vm->_textSurfaceMultiplier == 2); dst = (byte *)_vm->_textSurface.pixels + (_top - _vm->_screenTop) * _vm->_textSurface.pitch * _vm->_textSurfaceMultiplier + _left * _vm->_textSurfaceMultiplier; diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h index b8f1d84045..1c1df51921 100644 --- a/engines/scumm/charset.h +++ b/engines/scumm/charset.h @@ -112,7 +112,7 @@ public: class CharsetRendererClassic : public CharsetRendererCommon { protected: virtual void drawBitsN(const Graphics::Surface &s, byte *dst, const byte *src, byte bpp, int drawTop, int width, int height); - void printCharIntern(bool is2byte, const byte *charPtr, int origWidth, int origHeight, int width, int height, VirtScreen *vs, bool ignoreCharsetMask); + void printCharIntern(bool is2byte, const byte *charPtr, int origWidth, int origHeight, int width, int height, VirtScreen *vs, bool ignoreCharsetMask); virtual bool prepareDraw(uint16 chr); int _width, _height, _origWidth, _origHeight; @@ -195,7 +195,7 @@ public: int getCharWidth(uint16 chr); int getFontHeight(); - + private: void enableShadow(bool enable); void drawBits1(Graphics::Surface &dest, int x, int y, const byte *src, int drawTop, int width, int height); diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index 3f89bc9611..4ebdd00fdc 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -1188,7 +1188,7 @@ byte V0CostumeRenderer::drawLimb(const Actor *a, int limb) { _draw_top = 200; _draw_bottom = 0; } - + // Invalid current position? if (a->_cost.curpos[limb] == 0xFFFF) return 0; @@ -1377,7 +1377,7 @@ byte V0CostumeLoader::increaseAnim(Actor *a, int limb) { // Reset the comstume command a0->_costCommandNew = 0xFF; a0->_costCommand = 0xFF; - + // Set the frame/start to invalid a0->_cost.frame[limb] = 0xFFFF; a0->_cost.start[limb] = 0xFFFF; diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 88681898f5..269ae9e10a 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -180,7 +180,7 @@ void ScummEngine_v70he::setDefaultCursor() { 0xff, 0xff, 0xff, 0, 0, 0, }; - + memset(_grabbedCursor, 5, sizeof(_grabbedCursor)); _cursor.hotspotX = _cursor.hotspotY = 2; diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp index edcf2e6fea..dc5acbdb7d 100644 --- a/engines/scumm/debugger.cpp +++ b/engines/scumm/debugger.cpp @@ -382,7 +382,7 @@ bool ScummDebugger::Cmd_Actor(int argc, const char **argv) { DebugPrintf("Actor[%d].costume = %d\n", actnum, a->_costume); } } else if (!strcmp(argv[2], "name")) { - DebugPrintf("Name of actor %d: %s\n", actnum, + DebugPrintf("Name of actor %d: %s\n", actnum, _vm->getObjOrActorName(_vm->actorToObj(actnum))); } else if (!strcmp(argv[2], "condmask")) { if (argc > 3) { diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 0e531daf73..945c5b6611 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -180,7 +180,7 @@ static const ResString string_map_table_v345[] = { // "Moechten Sie wirklich neu starten? (J/N)J" // Will react to J as 'Yes' {5, _s("Are you sure you want to restart? (Y/N)")}, - // I18N: you may specify 'Yes' symbol at the end of the line. See previous comment + // I18N: you may specify 'Yes' symbol at the end of the line. See previous comment {6, _s("Are you sure you want to quit? (Y/N)")}, // Added in SCUMM4 diff --git a/engines/scumm/he/logic/soccer.cpp b/engines/scumm/he/logic/soccer.cpp index 05f377a736..2b29f93173 100644 --- a/engines/scumm/he/logic/soccer.cpp +++ b/engines/scumm/he/logic/soccer.cpp @@ -303,7 +303,7 @@ int LogicHEsoccer::op_1008(int outArray, int srcX, int srcY, int srcZ, int vecX, putInArray(outArray, segmentsSoFar, 5, vecX); putInArray(outArray, segmentsSoFar, 6, vecY); putInArray(outArray, segmentsSoFar++, 7, vecZ); - } + } } else { srcY = 0; int thisVecX = vecX; @@ -628,7 +628,7 @@ int LogicHEsoccer::op_1014(int32 srcX, int32 srcY, int32 srcZ, int32 velX, int32 adjustedVelZ = ((double)srcZ - 3869.0) / 100.0; break; } - + int foundCollision = 0; // work out which collision objects we might collide with (if any) diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp index 399cd91324..77c75c4ad6 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -335,7 +335,7 @@ int ScummEngine::whereIsObject(int object) const { return WIO_NOT_FOUND; if ((_game.version != 0 || OBJECT_V0_TYPE(object) == 0) && - _objectOwnerTable[object] != OF_OWNER_ROOM) + _objectOwnerTable[object] != OF_OWNER_ROOM) { for (i = 0; i < _numInventory; i++) if (_inventory[i] == object) @@ -1225,7 +1225,7 @@ byte *ScummEngine::getOBCDFromObject(int obj, bool v0CheckInventory) { byte *ptr; if ((_game.version != 0 || OBJECT_V0_TYPE(obj) == 0) && - _objectOwnerTable[obj] != OF_OWNER_ROOM) + _objectOwnerTable[obj] != OF_OWNER_ROOM) { if (_game.version == 0 && !v0CheckInventory) return 0; diff --git a/engines/scumm/player_apple2.cpp b/engines/scumm/player_apple2.cpp index a8e150caa9..58e4f78a94 100644 --- a/engines/scumm/player_apple2.cpp +++ b/engines/scumm/player_apple2.cpp @@ -61,8 +61,8 @@ public: private: void _update(int interval /*a*/, int count /*y*/) { // D076 - assert(interval > 0); // 0 == 256? - assert(count > 0); // 0 == 256? + assert(interval > 0); // 0 == 256? + assert(count > 0); // 0 == 256? for (; count >= 0; --count) { _player->speakerToggle(); @@ -99,7 +99,7 @@ public: ++_pos; return false; - } + } return true; } @@ -112,7 +112,7 @@ private: assert(interval > 0); // 0 == 256? int a = (interval >> 3) + count; - for (int y = a; y > 0; --y) { + for (int y = a; y > 0; --y) { _player->generateSamples(1292 - 5*interval); _player->speakerToggle(); @@ -206,7 +206,7 @@ private: _bitmask1 = 0x3; _bitmask2 = 0x3; - + _updateInterval2 = param0; if (_updateInterval2 == 0) _bitmask2 = 0x0; @@ -234,9 +234,9 @@ private: if (_updateRemain2 == 0) { _updateRemain2 = _updateInterval2; - // use only first voice's data (bitmask1) if both voices are triggered + // use only first voice's data (bitmask1) if both voices are triggered if (_updateRemain1 != 0) { - _speakerShiftReg ^= _bitmask2; + _speakerShiftReg ^= _bitmask2; } } @@ -256,7 +256,7 @@ private: protected: const byte *_params; - + byte _updateRemain1; byte _updateRemain2; @@ -309,7 +309,7 @@ private: for (int i = count; i > 0; --i) { _player->generateSamples(10 + 5*interval); _player->speakerToggle(); - + _player->generateSamples(5 + 5*interval); _player->speakerToggle(); } @@ -332,20 +332,20 @@ private: // LD000[loc] ^ LD00A[loc] const byte AppleII_SoundFunction5_Noise::_noiseTable[256] = { - 0x65, 0x1b, 0xda, 0x11, 0x61, 0xe5, 0x77, 0x57, 0x92, 0xc8, 0x51, 0x1c, 0xd4, 0x91, 0x62, 0x63, - 0x00, 0x38, 0x57, 0xd5, 0x18, 0xd8, 0xdc, 0x40, 0x03, 0x86, 0xd3, 0x2f, 0x10, 0x11, 0xd8, 0x3c, - 0xbe, 0x00, 0x19, 0xc5, 0xd2, 0xc3, 0xca, 0x34, 0x00, 0x28, 0xbf, 0xb9, 0x18, 0x20, 0x01, 0xcc, - 0xda, 0x08, 0xbc, 0x75, 0x7c, 0xb0, 0x8d, 0xe0, 0x09, 0x18, 0xbf, 0x5d, 0xe9, 0x8c, 0x75, 0x64, + 0x65, 0x1b, 0xda, 0x11, 0x61, 0xe5, 0x77, 0x57, 0x92, 0xc8, 0x51, 0x1c, 0xd4, 0x91, 0x62, 0x63, + 0x00, 0x38, 0x57, 0xd5, 0x18, 0xd8, 0xdc, 0x40, 0x03, 0x86, 0xd3, 0x2f, 0x10, 0x11, 0xd8, 0x3c, + 0xbe, 0x00, 0x19, 0xc5, 0xd2, 0xc3, 0xca, 0x34, 0x00, 0x28, 0xbf, 0xb9, 0x18, 0x20, 0x01, 0xcc, + 0xda, 0x08, 0xbc, 0x75, 0x7c, 0xb0, 0x8d, 0xe0, 0x09, 0x18, 0xbf, 0x5d, 0xe9, 0x8c, 0x75, 0x64, 0xe5, 0xb5, 0x5d, 0xe0, 0xb7, 0x7d, 0xe9, 0x8c, 0x55, 0x65, 0xc5, 0xb5, 0x5d, 0xd8, 0x09, 0x0d, - 0x64, 0xf0, 0xf0, 0x08, 0x63, 0x03, 0x00, 0x55, 0x35, 0xc0, 0x00, 0x20, 0x74, 0xa5, 0x1e, 0xe3, - 0x00, 0x06, 0x3c, 0x52, 0xd1, 0x70, 0xd0, 0x57, 0x02, 0xf0, 0x00, 0xb6, 0xfc, 0x02, 0x11, 0x9a, - 0x3b, 0xc8, 0x38, 0xdf, 0x1a, 0xb0, 0xd1, 0xb8, 0xd0, 0x18, 0x8a, 0x4a, 0xea, 0x1b, 0x12, 0x5d, - 0x29, 0x58, 0xd8, 0x43, 0xb8, 0x2d, 0xd2, 0x61, 0x10, 0x3c, 0x0c, 0x5d, 0x1b, 0x61, 0x10, 0x3c, + 0x64, 0xf0, 0xf0, 0x08, 0x63, 0x03, 0x00, 0x55, 0x35, 0xc0, 0x00, 0x20, 0x74, 0xa5, 0x1e, 0xe3, + 0x00, 0x06, 0x3c, 0x52, 0xd1, 0x70, 0xd0, 0x57, 0x02, 0xf0, 0x00, 0xb6, 0xfc, 0x02, 0x11, 0x9a, + 0x3b, 0xc8, 0x38, 0xdf, 0x1a, 0xb0, 0xd1, 0xb8, 0xd0, 0x18, 0x8a, 0x4a, 0xea, 0x1b, 0x12, 0x5d, + 0x29, 0x58, 0xd8, 0x43, 0xb8, 0x2d, 0xd2, 0x61, 0x10, 0x3c, 0x0c, 0x5d, 0x1b, 0x61, 0x10, 0x3c, 0x0a, 0x5d, 0x1d, 0x61, 0x10, 0x3c, 0x0b, 0x19, 0x88, 0x21, 0xc0, 0x21, 0x07, 0x00, 0x65, 0x62, - 0x08, 0xe9, 0x36, 0x40, 0x20, 0x41, 0x06, 0x00, 0x20, 0x00, 0x00, 0xed, 0xa3, 0x00, 0x88, 0x06, - 0x98, 0x01, 0x5d, 0x7f, 0x02, 0x1d, 0x78, 0x03, 0x60, 0xcb, 0x3a, 0x01, 0xbd, 0x78, 0x02, 0x5d, - 0x7e, 0x03, 0x1d, 0xf5, 0xa6, 0x40, 0x81, 0xb4, 0xd0, 0x8d, 0xd3, 0xd0, 0x6d, 0xd5, 0x61, 0x48, - 0x61, 0x4d, 0xd1, 0xc8, 0xb1, 0xd8, 0x69, 0xff, 0x61, 0xd9, 0xed, 0xa0, 0xfe, 0x19, 0x91, 0x37, + 0x08, 0xe9, 0x36, 0x40, 0x20, 0x41, 0x06, 0x00, 0x20, 0x00, 0x00, 0xed, 0xa3, 0x00, 0x88, 0x06, + 0x98, 0x01, 0x5d, 0x7f, 0x02, 0x1d, 0x78, 0x03, 0x60, 0xcb, 0x3a, 0x01, 0xbd, 0x78, 0x02, 0x5d, + 0x7e, 0x03, 0x1d, 0xf5, 0xa6, 0x40, 0x81, 0xb4, 0xd0, 0x8d, 0xd3, 0xd0, 0x6d, 0xd5, 0x61, 0x48, + 0x61, 0x4d, 0xd1, 0xc8, 0xb1, 0xd8, 0x69, 0xff, 0x61, 0xd9, 0xed, 0xa0, 0xfe, 0x19, 0x91, 0x37, 0x19, 0x37, 0x00, 0xf1, 0x00, 0x01, 0x1f, 0x00, 0xad, 0xc1, 0x01, 0x01, 0x2e, 0x00, 0x40, 0xc6, 0x7a, 0x9b, 0x95, 0x43, 0xfc, 0x18, 0xd2, 0x9e, 0x2a, 0x5a, 0x4b, 0x2a, 0xb6, 0x87, 0x30, 0x6c }; @@ -394,20 +394,20 @@ void Player_AppleII::startSound(int nr) { case 0: // empty (nothing to play) resetState(); return; - case 1: - _soundFunc = new AppleII_SoundFunction1_FreqUpDown(); + case 1: + _soundFunc = new AppleII_SoundFunction1_FreqUpDown(); break; - case 2: - _soundFunc = new AppleII_SoundFunction2_SymmetricWave(); + case 2: + _soundFunc = new AppleII_SoundFunction2_SymmetricWave(); break; - case 3: - _soundFunc = new AppleII_SoundFunction3_AsymmetricWave(); + case 3: + _soundFunc = new AppleII_SoundFunction3_AsymmetricWave(); break; - case 4: - _soundFunc = new AppleII_SoundFunction4_Polyphone(); + case 4: + _soundFunc = new AppleII_SoundFunction4_Polyphone(); break; - case 5: - _soundFunc = new AppleII_SoundFunction5_Noise(); + case 5: + _soundFunc = new AppleII_SoundFunction5_Noise(); break; } _soundFunc->init(this, _params); @@ -484,7 +484,7 @@ int Player_AppleII::readBuffer(int16 *buffer, const int numSamples) { // toggle speaker on/off void Player_AppleII::speakerToggle() { - _speakerState ^= 0x1; + _speakerState ^= 0x1; } void Player_AppleII::generateSamples(int cycles) { @@ -492,8 +492,8 @@ void Player_AppleII::generateSamples(int cycles) { } void Player_AppleII::wait(int interval, int count /*y*/) { - assert(count > 0); // 0 == 256? - assert(interval > 0); // 0 == 256? + assert(count > 0); // 0 == 256? + assert(interval > 0); // 0 == 256? generateSamples(11 + count*(8 + 5 * interval)); } diff --git a/engines/scumm/player_apple2.h b/engines/scumm/player_apple2.h index b4a7d409fb..e1ec9d8946 100644 --- a/engines/scumm/player_apple2.h +++ b/engines/scumm/player_apple2.h @@ -36,7 +36,7 @@ namespace Scumm { class ScummEngine; /* - * Optimized for use with periodical read/write phases when the buffer + * Optimized for use with periodical read/write phases when the buffer * is filled in a write phase and completely read in a read phase. * The growing strategy is optimized for repeated small (e.g. 2 bytes) * single writes resulting in large buffers @@ -133,7 +133,7 @@ static const double APPLEII_CPU_CLOCK = 1020484.5; // ~ 1.02 MHz /* * Converts the 1-bit speaker state values into audio samples. - * This is done by aggregation of the speaker states at each + * This is done by aggregation of the speaker states at each * CPU cycle in a sampling period into an audio sample. */ class SampleConverter { @@ -144,7 +144,7 @@ private: } public: - SampleConverter() : + SampleConverter() : _cyclesPerSampleFP(0), _missingCyclesFP(0), _sampleCyclesSumFP(0), @@ -156,7 +156,7 @@ public: void reset() { _missingCyclesFP = 0; _sampleCyclesSumFP = 0; - _buffer.clear(); + _buffer.clear(); } uint32 availableSize() const { @@ -245,7 +245,7 @@ public: virtual void setMusicVolume(int vol) { _sampleConverter.setMusicVolume(vol); } void setSampleRate(int rate) { _sampleRate = rate; - _sampleConverter.setSampleRate(rate); + _sampleConverter.setSampleRate(rate); } virtual void startSound(int sound); virtual void stopSound(int sound); diff --git a/engines/scumm/player_towns.cpp b/engines/scumm/player_towns.cpp index 2588026e59..33e3e40e39 100644 --- a/engines/scumm/player_towns.cpp +++ b/engines/scumm/player_towns.cpp @@ -87,7 +87,7 @@ void Player_Towns::restoreAfterLoad() { if (!_v2) restoredSounds.push_back(_pcmCurrentSound[i].index); - + uint8 *ptr = _vm->getResourceAddress(rtSound, _pcmCurrentSound[i].index); if (!ptr) continue; diff --git a/engines/scumm/player_v2cms.cpp b/engines/scumm/player_v2cms.cpp index d4b21774ed..c1242e0645 100644 --- a/engines/scumm/player_v2cms.cpp +++ b/engines/scumm/player_v2cms.cpp @@ -718,38 +718,38 @@ void Player_V2CMS::playMusicChips(const MusicChip *table) { } const Player_V2CMS::MidiNote Player_V2CMS::_midiNotes[132] = { - { 3, 0 }, { 31, 0 }, { 58, 0 }, { 83, 0 }, - { 107, 0 }, { 130, 0 }, { 151, 0 }, { 172, 0 }, - { 191, 0 }, { 209, 0 }, { 226, 0 }, { 242, 0 }, - { 3, 1 }, { 31, 1 }, { 58, 1 }, { 83, 1 }, - { 107, 1 }, { 130, 1 }, { 151, 1 }, { 172, 1 }, - { 191, 1 }, { 209, 1 }, { 226, 1 }, { 242, 1 }, - { 3, 2 }, { 31, 2 }, { 58, 2 }, { 83, 2 }, - { 107, 2 }, { 130, 2 }, { 151, 2 }, { 172, 2 }, - { 191, 2 }, { 209, 2 }, { 226, 2 }, { 242, 2 }, - { 3, 3 }, { 31, 3 }, { 58, 3 }, { 83, 3 }, - { 107, 3 }, { 130, 3 }, { 151, 3 }, { 172, 3 }, - { 191, 3 }, { 209, 3 }, { 226, 3 }, { 242, 3 }, - { 3, 4 }, { 31, 4 }, { 58, 4 }, { 83, 4 }, - { 107, 4 }, { 130, 4 }, { 151, 4 }, { 172, 4 }, - { 191, 4 }, { 209, 4 }, { 226, 4 }, { 242, 4 }, - { 3, 5 }, { 31, 5 }, { 58, 5 }, { 83, 5 }, - { 107, 5 }, { 130, 5 }, { 151, 5 }, { 172, 5 }, - { 191, 5 }, { 209, 5 }, { 226, 5 }, { 242, 5 }, - { 3, 6 }, { 31, 6 }, { 58, 6 }, { 83, 6 }, - { 107, 6 }, { 130, 6 }, { 151, 6 }, { 172, 6 }, - { 191, 6 }, { 209, 6 }, { 226, 6 }, { 242, 6 }, - { 3, 7 }, { 31, 7 }, { 58, 7 }, { 83, 7 }, - { 107, 7 }, { 130, 7 }, { 151, 7 }, { 172, 7 }, - { 191, 7 }, { 209, 7 }, { 226, 7 }, { 242, 7 }, - { 3, 8 }, { 31, 8 }, { 58, 8 }, { 83, 8 }, - { 107, 8 }, { 130, 8 }, { 151, 8 }, { 172, 8 }, - { 191, 8 }, { 209, 8 }, { 226, 8 }, { 242, 8 }, - { 3, 9 }, { 31, 9 }, { 58, 9 }, { 83, 9 }, - { 107, 9 }, { 130, 9 }, { 151, 9 }, { 172, 9 }, - { 191, 9 }, { 209, 9 }, { 226, 9 }, { 242, 9 }, - { 3, 10 }, { 31, 10 }, { 58, 10 }, { 83, 10 }, - { 107, 10 }, { 130, 10 }, { 151, 10 }, { 172, 10 }, + { 3, 0 }, { 31, 0 }, { 58, 0 }, { 83, 0 }, + { 107, 0 }, { 130, 0 }, { 151, 0 }, { 172, 0 }, + { 191, 0 }, { 209, 0 }, { 226, 0 }, { 242, 0 }, + { 3, 1 }, { 31, 1 }, { 58, 1 }, { 83, 1 }, + { 107, 1 }, { 130, 1 }, { 151, 1 }, { 172, 1 }, + { 191, 1 }, { 209, 1 }, { 226, 1 }, { 242, 1 }, + { 3, 2 }, { 31, 2 }, { 58, 2 }, { 83, 2 }, + { 107, 2 }, { 130, 2 }, { 151, 2 }, { 172, 2 }, + { 191, 2 }, { 209, 2 }, { 226, 2 }, { 242, 2 }, + { 3, 3 }, { 31, 3 }, { 58, 3 }, { 83, 3 }, + { 107, 3 }, { 130, 3 }, { 151, 3 }, { 172, 3 }, + { 191, 3 }, { 209, 3 }, { 226, 3 }, { 242, 3 }, + { 3, 4 }, { 31, 4 }, { 58, 4 }, { 83, 4 }, + { 107, 4 }, { 130, 4 }, { 151, 4 }, { 172, 4 }, + { 191, 4 }, { 209, 4 }, { 226, 4 }, { 242, 4 }, + { 3, 5 }, { 31, 5 }, { 58, 5 }, { 83, 5 }, + { 107, 5 }, { 130, 5 }, { 151, 5 }, { 172, 5 }, + { 191, 5 }, { 209, 5 }, { 226, 5 }, { 242, 5 }, + { 3, 6 }, { 31, 6 }, { 58, 6 }, { 83, 6 }, + { 107, 6 }, { 130, 6 }, { 151, 6 }, { 172, 6 }, + { 191, 6 }, { 209, 6 }, { 226, 6 }, { 242, 6 }, + { 3, 7 }, { 31, 7 }, { 58, 7 }, { 83, 7 }, + { 107, 7 }, { 130, 7 }, { 151, 7 }, { 172, 7 }, + { 191, 7 }, { 209, 7 }, { 226, 7 }, { 242, 7 }, + { 3, 8 }, { 31, 8 }, { 58, 8 }, { 83, 8 }, + { 107, 8 }, { 130, 8 }, { 151, 8 }, { 172, 8 }, + { 191, 8 }, { 209, 8 }, { 226, 8 }, { 242, 8 }, + { 3, 9 }, { 31, 9 }, { 58, 9 }, { 83, 9 }, + { 107, 9 }, { 130, 9 }, { 151, 9 }, { 172, 9 }, + { 191, 9 }, { 209, 9 }, { 226, 9 }, { 242, 9 }, + { 3, 10 }, { 31, 10 }, { 58, 10 }, { 83, 10 }, + { 107, 10 }, { 130, 10 }, { 151, 10 }, { 172, 10 }, { 191, 10 }, { 209, 10 }, { 226, 10 }, { 242, 10 } }; diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index beac077fd1..72896e097a 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1298,7 +1298,7 @@ void ScummEngine::saveOrLoad(Serializer *s) { s->saveLoadArrayOf(_16BitPalette, 512, sizeof(_16BitPalette[0]), sleUint16); } - + // FM-Towns specific (extra palette data, color cycle data, etc.) // In earlier save game versions (below 87) the FM-Towns specific data would get saved (and loaded) even in non FM-Towns games. // This would cause an unnecessary save file incompatibility between DS (which uses the DISABLE_TOWNS_DUAL_LAYER_MODE setting) diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp index 44b77f1d18..361287d29f 100644 --- a/engines/scumm/script_v0.cpp +++ b/engines/scumm/script_v0.cpp @@ -602,7 +602,7 @@ void ScummEngine_v0::o_loadRoomWithEgo() { x = r.x; y = r.y; a->putActor(x, y, _currentRoom); - + camera._dest.x = camera._cur.x = a->getPos().x; setCameraAt(a->getPos().x, a->getPos().y); setCameraFollows(a); @@ -635,18 +635,18 @@ void ScummEngine_v0::setMode(byte mode) { case kModeCutscene: _redrawSentenceLine = false; // Note: do not change freeze state here - state = USERSTATE_SET_IFACE | + state = USERSTATE_SET_IFACE | USERSTATE_SET_CURSOR; break; case kModeKeypad: _redrawSentenceLine = false; - state = USERSTATE_SET_IFACE | + state = USERSTATE_SET_IFACE | USERSTATE_SET_CURSOR | USERSTATE_CURSOR_ON | USERSTATE_SET_FREEZE | USERSTATE_FREEZE_ON; break; case kModeNormal: case kModeNoNewKid: - state = USERSTATE_SET_IFACE | USERSTATE_IFACE_ALL | + state = USERSTATE_SET_IFACE | USERSTATE_IFACE_ALL | USERSTATE_SET_CURSOR | USERSTATE_CURSOR_ON | USERSTATE_SET_FREEZE; break; @@ -688,7 +688,7 @@ void ScummEngine_v0::o_animateActor() { Actor_v0 *a = (Actor_v0*) derefActor(act, "o_animateActor"); a->_animFrameRepeat = repeat; - + switch (anim) { case 0xFE: @@ -700,7 +700,7 @@ void ScummEngine_v0::o_animateActor() { // 0x69A3 a->_speaking = 0x00; return; - + case 0xFF: a->stopActorMoving(); return; diff --git a/engines/scumm/script_v2.cpp b/engines/scumm/script_v2.cpp index ce162b4a6a..96d422d5bb 100644 --- a/engines/scumm/script_v2.cpp +++ b/engines/scumm/script_v2.cpp @@ -993,7 +993,7 @@ void ScummEngine_v2::o2_drawSentence() { const byte *temp; int slot = getVerbSlot(VAR(VAR_SENTENCE_VERB), 0); - if (!((_userState & USERSTATE_IFACE_SENTENCE) || + if (!((_userState & USERSTATE_IFACE_SENTENCE) || (_game.platform == Common::kPlatformNES && (_userState & USERSTATE_IFACE_ALL)))) return; @@ -1486,8 +1486,8 @@ void ScummEngine_v2::o2_cutscene() { VAR(VAR_CURSORSTATE) = 200; // Hide inventory, freeze scripts, hide cursor - setUserState(USERSTATE_SET_IFACE | - USERSTATE_SET_CURSOR | + setUserState(USERSTATE_SET_IFACE | + USERSTATE_SET_CURSOR | USERSTATE_SET_FREEZE | USERSTATE_FREEZE_ON); _sentenceNum = 0; diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index a5591b701f..0bf51a2816 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -1097,7 +1097,7 @@ void ScummEngine_v5::o5_getDist() { int r; getResultPos(); - + o1 = getVarOrDirectWord(PARAM_1); o2 = getVarOrDirectWord(PARAM_2); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index c9c9e991e4..2c79fb8de0 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1986,11 +1986,11 @@ Common::Error ScummEngine::go() { if (delta < 1) // Ensure we don't get into an endless loop delta = 1; // by not decreasing sleepers. - // WORKAROUND: walking speed in the original v0/v1 interpreter + // WORKAROUND: walking speed in the original v0/v1 interpreter // is sometimes slower (e.g. during scrolling) than in ScummVM. // This is important for the door-closing action in the dungeon, - // otherwise (delta < 6) a single kid is able to escape. - if ((_game.version == 0 && isScriptRunning(132)) || + // otherwise (delta < 6) a single kid is able to escape. + if ((_game.version == 0 && isScriptRunning(132)) || (_game.version == 1 && isScriptRunning(137))) delta = 6; diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 700389414c..a77c1c0141 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -1372,7 +1372,7 @@ public: public: bool towns_isRectInStringBox(int x1, int y1, int x2, int y2); byte _townsPaletteFlags; - byte _townsCharsetColorMap[16]; + byte _townsCharsetColorMap[16]; protected: void towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, int srcX, int srcY, int w, int h); diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 43c86db85f..a1cecfa0b3 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -957,7 +957,7 @@ void Sound::setupSfxFile() { if (file.open(tmp)) _sfxFilename = tmp; - + if (_vm->_game.heversion <= 74) _sfxFileEncByte = 0x69; @@ -1182,7 +1182,7 @@ int ScummEngine::readSoundResource(ResId idx) { // its sound resources, and Amiga games, which feature only ROL // resources, since we are a doing Midi -> AdLib conversion for // these. - if ((_sound->_musicType == MDT_ADLIB || _sound->_musicType == MDT_TOWNS) && pri != 16 + if ((_sound->_musicType == MDT_ADLIB || _sound->_musicType == MDT_TOWNS) && pri != 16 && pri != 15 && pri != 10 && pri != 2 && _game.platform != Common::kPlatformAmiga) pri = -1; diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index 567ca31485..0d0f6cdb95 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -84,7 +84,7 @@ int ScummEngine_v0::verbPrepIdType(int verbid) { switch (verbid) { case kVerbUse: // depends on object1 return kVerbPrepObject; - case kVerbGive: + case kVerbGive: return kVerbPrepTo; case kVerbUnlock: case kVerbFix: return kVerbPrepWith; @@ -693,7 +693,7 @@ void ScummEngine_v0::verbExec() { if (_activeVerb == kVerbWhatIs) return; - + if (!(_activeVerb == kVerbWalkTo && _activeObject == 0)) { doSentence(_activeVerb, _activeObject, _activeObject2); if (_activeVerb != kVerbWalkTo) { diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp index dfa3ded50b..8f6c2bb6a2 100644 --- a/engines/sky/detection.cpp +++ b/engines/sky/detection.cpp @@ -119,12 +119,12 @@ GameList SkyMetaEngine::getSupportedGames() const { const ExtraGuiOptions SkyMetaEngine::getExtraGuiOptions(const Common::String &target) const { Common::String guiOptions; ExtraGuiOptions options; - + if (target.empty()) { options.push_back(skyExtraGuiOption); return options; } - + if (ConfMan.hasKey("guioptions", target)) { guiOptions = ConfMan.get("guioptions", target); guiOptions = parseGameGUIOptions(guiOptions); diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index f7add4eed2..ff3c897dba 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -69,7 +69,7 @@ static const char *const sequenceList[20] = { }; // This is the list of the names of the PlayStation videos -// TODO: fight.str, flashy.str, +// TODO: fight.str, flashy.str, static const char *const sequenceListPSX[20] = { "e_ferr1", "ladder1", @@ -152,14 +152,14 @@ bool MoviePlayer::load(uint32 id) { warning("%s:%d startFrame (%d) <= lastEnd (%d)", filename.c_str(), lineNo, startFrame, lastEnd); continue; } - + int color = 0; if (*ptr == '@') { ++ptr; color = strtoul(ptr, const_cast<char **>(&ptr), 10); while (*ptr && Common::isSpace(*ptr)) ptr++; - } + } _movieTexts.push_back(MovieText(startFrame, endFrame, ptr, color)); lastEnd = endFrame; diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp index 5d1864d58d..3e70a95699 100644 --- a/engines/sword1/objectman.cpp +++ b/engines/sword1/objectman.cpp @@ -107,7 +107,7 @@ char *ObjectMan::lockText(uint32 textId) { warning("Missing translation for textId %u (\"%s\")", textId, text); unlockText(textId, BS1_ENGLISH); } - + return _missingSubTitleStr; } return text; @@ -164,7 +164,7 @@ char *ObjectMan::lockText(uint32 textId, uint8 lang) { // We use the hardcoded text in this case. if (textId == 2950145) return const_cast<char *>(_translationId2950145[lang]); - + warning("ObjectMan::lockText(%d): text number has no text lines", textId); return NULL; } diff --git a/engines/sword2/sprite.cpp b/engines/sword2/sprite.cpp index cb0923cc2f..91a5e2e86b 100644 --- a/engines/sword2/sprite.cpp +++ b/engines/sword2/sprite.cpp @@ -772,7 +772,7 @@ int32 Screen::drawSprite(SpriteInfo *s) { src = sprite + rs.top * srcPitch + rs.left; dst = _buffer + _screenWide * rd.top + rd.left; - if (s->type & RDSPR_BLEND) { + if (s->type & RDSPR_BLEND) { // The original code had two different blending cases. One for // s->blend & 0x01 and one for s->blend & 0x02. However, the // only values that actually appear in the cluster files are @@ -783,7 +783,7 @@ int32 Screen::drawSprite(SpriteInfo *s) { // The only correct way to simulate this would be using 16-bit mode. // As this is not yet available for this engine, fake transparency is used // as placeholder. - if (!(_renderCaps & RDBLTFX_SPRITEBLEND) || Sword2Engine::isPsx()) { + if (!(_renderCaps & RDBLTFX_SPRITEBLEND) || Sword2Engine::isPsx()) { for (i = 0; i < rs.height(); i++) { for (j = 0; j < rs.width(); j++) { if (src[j] && ((i & 1) == (j & 1))) diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp index 69fae3dc4e..61d53c89a7 100644 --- a/engines/sword25/sfx/soundengine.cpp +++ b/engines/sword25/sfx/soundengine.cpp @@ -370,7 +370,7 @@ bool SoundEngine::unpersist(InputPersistenceBlock &reader) { int loopStart; int loopEnd; uint layer; - + reader.readString(fileName); reader.read(sndType); reader.read(volume); diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp index a784ff5788..0ba8b7cdba 100644 --- a/engines/tinsel/actors.cpp +++ b/engines/tinsel/actors.cpp @@ -319,8 +319,8 @@ static void ActorRestoredProcess(CORO_PARAM, const void *param) { CORO_BEGIN_CODE(_ctx); _ctx->pic = RestoreInterpretContext(r->pic); - - // The newly added check here specially sets the process to RES_NOT when loading a savegame. + + // The newly added check here specially sets the process to RES_NOT when loading a savegame. // This is needed particularly for the Psychiatrist scene in Discworld 1 - otherwise Rincewind // can't go upstairs without leaving the building and returning. If this patch causes problems // in other scenes, an added check for the hCode == 1174490602 could be added. diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp index 6ea18c8268..04bc2856ca 100644 --- a/engines/tinsel/pcode.cpp +++ b/engines/tinsel/pcode.cpp @@ -152,7 +152,7 @@ static const byte fragment12[] = {OP_JMPTRUE | OPSIZE16, FRAGMENT_WORD(1491), OP_IMM | OPSIZE16, FRAGMENT_WORD(322), OP_LIBCALL | OPSIZE8, 46, // Give back the whistle OP_JUMP | OPSIZE16, FRAGMENT_WORD(1568)}; static const byte fragment13[] = {OP_ZERO, OP_GSTORE | OPSIZE16, FRAGMENT_WORD(306)}; -static const byte fragment14[] = {OP_LIBCALL | OPSIZE8, 58, +static const byte fragment14[] = {OP_LIBCALL | OPSIZE8, 58, OP_IMM, FRAGMENT_DWORD((42 << 23)), OP_ONE, OP_ZERO, OP_LIBCALL | OPSIZE8, 44, OP_LIBCALL | OPSIZE8, 97, OP_JUMP | OPSIZE16, FRAGMENT_WORD(2220) }; @@ -222,7 +222,7 @@ const WorkaroundEntry workaroundList[] = { // times would cause the game to crash {TINSEL_V2, true, false, Common::kPlatformUnknown, 1109294728, 0, sizeof(fragment13), fragment13}, - // DW1 PSX DEMO: Alters a script in the PSX DW1 demo to show the Idle animation scene rather than + // DW1 PSX DEMO: Alters a script in the PSX DW1 demo to show the Idle animation scene rather than // quitting the game when no user input happens for a while {TINSEL_V1, true, true, Common::kPlatformPSX, 0, 2186, sizeof(fragment14), fragment14}, diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index 518e27f02b..2ef92d853f 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -502,7 +502,7 @@ static bool DoRestore() { delete f; // Invalid header, or savegame too new -> skip it return false; } - + // Load in the data. For older savegame versions, we potentially need to load the data twice, once // for pre 1.5 savegames, and if that fails, a second time for 1.5 savegames int numInterpreters = hdr.numInterpreters; diff --git a/engines/toltecs/animation.cpp b/engines/toltecs/animation.cpp index eef9cef9ed..084332cf83 100644 --- a/engines/toltecs/animation.cpp +++ b/engines/toltecs/animation.cpp @@ -53,7 +53,7 @@ void AnimationPlayer::start(uint resIndex) { _vm->_arc->closeResource(); debug(1, "AnimationPlayer::start() width = %d; height = %d; frameCount = %d", _width, _height, _frameCount); - + _vm->_sceneWidth = _width; _vm->_sceneHeight = _height; @@ -63,7 +63,7 @@ void AnimationPlayer::start(uint resIndex) { _frameNumber = 0; // TODO mov screenFlag01, 0FFFFh // TODO mov animDrawFrameFlag, 0FFFFh - + _firstNextFrameOffset = _nextFrameOffset; _firstCurFrameSize = _curFrameSize; _firstNextFrameSize = _nextFrameSize; @@ -81,25 +81,25 @@ void AnimationPlayer::nextFrame() { } else { _frameNumber++; } - + debug(1, "AnimationPlayer::nextFrame() frameNumber = %d", _frameNumber); if (_keepFrameCounter > 0) { _keepFrameCounter--; return; } - + _vm->_arc->openResource(_resIndex); _vm->_arc->seek(_nextFrameOffset, SEEK_CUR); _curFrameSize = _nextFrameSize; - + if (_curFrameSize == 0) _curFrameSize = 1; - + _vm->_arc->read(_animBuffer, _curFrameSize); _nextFrameSize = _vm->_arc->readUint32LE(); _nextFrameOffset += _curFrameSize + 4; - + if (_curFrameSize > 1) { unpackFrame(); // TODO mov animDrawFrameFlag, 0FFFFh diff --git a/engines/toltecs/animation.h b/engines/toltecs/animation.h index 22576d7535..54ec5d8afa 100644 --- a/engines/toltecs/animation.h +++ b/engines/toltecs/animation.h @@ -54,7 +54,7 @@ public: uint16 _width, _height; uint16 _frameNumber, _frameCount; uint32 _keepFrameCounter; - + uint32 _curFrameSize; uint32 _nextFrameSize, _nextFrameOffset; diff --git a/engines/toltecs/menu.cpp b/engines/toltecs/menu.cpp index dfdad74839..c214205624 100644 --- a/engines/toltecs/menu.cpp +++ b/engines/toltecs/menu.cpp @@ -75,7 +75,7 @@ int MenuSystem::run(MenuID menuId) { update(); _vm->_system->updateScreen(); } - + // Restore original background memcpy(_vm->_screen->_frontScreen, backgroundOrig.getBasePtr(0,0), 640 * 400); _vm->_system->copyRectToScreen(_vm->_screen->_frontScreen, 640, 0, 0, 640, 400); @@ -86,7 +86,7 @@ int MenuSystem::run(MenuID menuId) { _background->free(); delete _background; - return 0; + return 0; } void MenuSystem::update() { @@ -539,7 +539,7 @@ void MenuSystem::setCfgVoices(bool value, bool active) { void MenuSystem::drawVolumeBar(ItemID itemID) { int w = 440, y, volume; char text[21]; - + switch (itemID) { case kItemIdMaster: // unused in ScummVM, always 20 y = 130 + 25 * 0; @@ -567,13 +567,13 @@ void MenuSystem::drawVolumeBar(ItemID itemID) { Font font(_vm->_res->load(_vm->_screen->getFontResIndex(1))->data); restoreRect(390, y - font.getHeight(), 100, 25); - + for (int i = 0; i < volume; i++) text[i] = '|'; text[volume] = 0; - + drawString(0, y, w, 0, 246, text); - + } void MenuSystem::changeVolumeBar(ItemID itemID, int delta) { diff --git a/engines/toltecs/menu.h b/engines/toltecs/menu.h index 9234a56398..a72205c2e5 100644 --- a/engines/toltecs/menu.h +++ b/engines/toltecs/menu.h @@ -80,7 +80,7 @@ public: int run(MenuID menuId); void update(); void handleEvents(); - + protected: struct Item { @@ -91,7 +91,7 @@ protected: int x, y, w; uint fontNum; }; - + struct SavegameItem { int _slotNum; Common::String _description; @@ -116,20 +116,20 @@ protected: Common::Array<Item> _items; Common::Array<SavegameItem> _savegames; - + void addClickTextItem(ItemID id, int x, int y, int w, uint fontNum, const char *caption, byte defaultColor, byte activeColor); void drawItem(ItemID itemID, bool active); void handleMouseMove(int x, int y); void handleMouseClick(int x, int y); void handleKeyDown(const Common::KeyState& kbd); - + ItemID findItemAt(int x, int y); Item *getItem(ItemID id); void setItemCaption(Item *item, const char *caption); void initMenu(MenuID menuID); - + void enterItem(ItemID id); void leaveItem(ItemID id); void clickItem(ItemID id); diff --git a/engines/toltecs/microtiles.cpp b/engines/toltecs/microtiles.cpp index 0b61ac38a5..60e65bdaf3 100644 --- a/engines/toltecs/microtiles.cpp +++ b/engines/toltecs/microtiles.cpp @@ -138,7 +138,7 @@ Common::Rect * MicroTileArray::getRectangles(int *num_rects, int min_x, int min_ x0 = CLIP (x0, min_x, max_x); y0 = CLIP (y0, min_y, max_y); y1 = CLIP (y1, min_y, max_y); - + // FIXME: Why is the following code in an #if block? #if 1 start = i; diff --git a/engines/toltecs/movie.cpp b/engines/toltecs/movie.cpp index 74364630f5..75127d7159 100644 --- a/engines/toltecs/movie.cpp +++ b/engines/toltecs/movie.cpp @@ -61,7 +61,7 @@ void MoviePlayer::playMovie(uint resIndex) { int16 savedCameraY = _vm->_cameraY; int16 savedGuiHeight = _vm->_guiHeight; byte moviePalette[768]; - + _vm->_isSaveAllowed = false; memset(moviePalette, 0, sizeof(moviePalette)); @@ -105,7 +105,7 @@ void MoviePlayer::playMovie(uint resIndex) { uint32 chunkSize = _vm->_arc->readUint32LE(); debug(0, "chunkType = %d; chunkSize = %d", chunkType, chunkSize); - + // Skip audio chunks - we've already queued them in // fetchAudioChunks() above if (chunkType == kChunkAudio) { @@ -178,7 +178,7 @@ void MoviePlayer::playMovie(uint resIndex) { default: error("MoviePlayer::playMovie(%04X) Unknown chunk type %d at %08X", resIndex, chunkType, _vm->_arc->pos() - 5 - chunkSize); } - + if (!handleInput()) break; } @@ -189,7 +189,7 @@ void MoviePlayer::playMovie(uint resIndex) { _vm->_mixer->stopHandle(_audioStreamHandle); _vm->_arc->closeResource(); - + debug(0, "playMovie() done"); _vm->_sceneWidth = savedSceneWidth; diff --git a/engines/toltecs/movie.h b/engines/toltecs/movie.h index aecfac240f..8fa48975d7 100644 --- a/engines/toltecs/movie.h +++ b/engines/toltecs/movie.h @@ -36,7 +36,7 @@ public: ~MoviePlayer(); void playMovie(uint resIndex); - + protected: ToltecsEngine *_vm; Audio::QueuingAudioStream *_audioStream; @@ -47,11 +47,11 @@ protected: void unpackPalette(byte *source, byte *dest, int elemCount, int elemSize); void unpackRle(byte *source, byte *dest); - + void fetchAudioChunks(); - + bool handleInput(); - + }; } // End of namespace Toltecs diff --git a/engines/toltecs/music.cpp b/engines/toltecs/music.cpp index 2cd36cad9f..830e4a97da 100644 --- a/engines/toltecs/music.cpp +++ b/engines/toltecs/music.cpp @@ -60,7 +60,7 @@ void MusicPlayer::playMIDI(const byte *data, uint32 size, bool loop) { memcpy(_buffer, data, size); MidiParser *parser; - + if (!memcmp(data, "FORM", 4)) parser = MidiParser::createParser_XMIDI(NULL); else diff --git a/engines/toltecs/palette.cpp b/engines/toltecs/palette.cpp index 706218e0ba..74683c6d7a 100644 --- a/engines/toltecs/palette.cpp +++ b/engines/toltecs/palette.cpp @@ -31,7 +31,7 @@ namespace Toltecs { Palette::Palette(ToltecsEngine *vm) : _vm(vm) { clearFragments(); - + memset(_colorTransTable, 0, sizeof(_colorTransTable)); } @@ -81,7 +81,7 @@ void Palette::setDeltaPalette(byte *palette, byte mask, int8 deltaValue, int16 c if (mask & 4) colors[index * 3 + 2] = CLIP<int>(rgb + deltaValue, 0, 63) << 2; index++; } - + debug(0, "startIndex = %d; colorCount = %d", startIndex, colorCount); _vm->_system->getPaletteManager()->setPalette((const byte *)colors, 0, 256); @@ -101,9 +101,9 @@ void Palette::addFragment(uint resIndex, int16 id) { Resource *fragmentResource = _vm->_res->load(resIndex); byte count = fragmentResource->size / 3; - + memcpy(&_mainPalette[_fragmentIndex * 3], fragmentResource->data, count * 3); - + PaletteFragment fragment; fragment.id = id; fragment.index = _fragmentIndex; @@ -126,7 +126,7 @@ uint16 Palette::findFragment(int16 id) { break; } } - + debug(0, "Palette::findFragment() result = %04X", result); return result; @@ -140,9 +140,9 @@ void Palette::clearFragments() { void Palette::buildColorTransTable(byte limit, int8 deltaValue, byte mask) { byte r = 0, g = 0, b = 0; - + mask &= 7; - + for (int i = 0; i < 256; i++) { if (deltaValue < 0) { @@ -161,7 +161,7 @@ void Palette::buildColorTransTable(byte limit, int8 deltaValue, byte mask) { b -= deltaValue; } } - + int bestIndex = 0; uint16 bestMatch = 0xFFFF; @@ -174,7 +174,7 @@ void Palette::buildColorTransTable(byte limit, int8 deltaValue, byte mask) { bestIndex = j; } } - + _colorTransTable[i] = bestIndex; } diff --git a/engines/toltecs/palette.h b/engines/toltecs/palette.h index 7bcf06e027..570f51777e 100644 --- a/engines/toltecs/palette.h +++ b/engines/toltecs/palette.h @@ -66,7 +66,7 @@ protected: int16 id; byte index, count; }; - + typedef Common::Array<PaletteFragment> PaletteFragmentArray; ToltecsEngine *_vm; diff --git a/engines/toltecs/render.cpp b/engines/toltecs/render.cpp index 3f5356493e..4c41e6ce00 100644 --- a/engines/toltecs/render.cpp +++ b/engines/toltecs/render.cpp @@ -114,7 +114,7 @@ void RenderQueue::addMask(SegmapMaskRect &mask) { void RenderQueue::update() { bool doFullRefresh = _vm->_screen->_fullRefresh; - + _updateUta->clear(); if (!doFullRefresh) { @@ -166,7 +166,7 @@ void RenderQueue::update() { for (RenderQueueArray::iterator iter = _currQueue->begin(); iter != _currQueue->end(); iter++) { const RenderQueueItem *item = &(*iter); - + if (item->flags == kRefresh || doFullRefresh) { switch (item->type) { @@ -200,7 +200,7 @@ void RenderQueue::update() { SWAP(_currQueue, _prevQueue); _currQueue->clear(); - + } void RenderQueue::clear() { @@ -249,16 +249,16 @@ bool RenderQueue::hasItemChanged(const RenderQueueItem &item1, const RenderQueue if (item1.type != item2.type) return true; - + if (item1.rect.left != item2.rect.left || item1.rect.top != item2.rect.top || item1.rect.right != item2.rect.right || item1.rect.bottom != item2.rect.bottom) return true; - + if (item1.type == kText && item1.text.color != item2.text.color) return true; - + return false; } @@ -268,7 +268,7 @@ void RenderQueue::invalidateItemsByRect(const Common::Rect &rect, const RenderQu if (item != subItem && subItem->flags == kUnchanged && rect.intersects(subItem->rect)) { - + subItem->flags = kRefresh; invalidateItemsByRect(subItem->rect, subItem); } diff --git a/engines/toltecs/render.h b/engines/toltecs/render.h index bb9ec29959..59d7a3ddb9 100644 --- a/engines/toltecs/render.h +++ b/engines/toltecs/render.h @@ -75,7 +75,7 @@ public: void addMask(SegmapMaskRect &mask); void update(); void clear(); - + protected: typedef Common::List<RenderQueueItem> RenderQueueArray; @@ -87,7 +87,7 @@ protected: RenderQueueItem *findItemInQueue(RenderQueueArray *queue, const RenderQueueItem &item); bool hasItemChanged(const RenderQueueItem &item1, const RenderQueueItem &item2); void invalidateItemsByRect(const Common::Rect &rect, const RenderQueueItem *item); - + void addDirtyRect(const Common::Rect &rect); void restoreDirtyBackground(); void updateDirtyRects(); diff --git a/engines/toltecs/resource.cpp b/engines/toltecs/resource.cpp index b95e0444b1..0b9f7c8fcd 100644 --- a/engines/toltecs/resource.cpp +++ b/engines/toltecs/resource.cpp @@ -66,7 +66,7 @@ void ArchiveReader::dump(uint resIndex, const char *prefix) { byte *data = new byte[resourceSize]; Common::String fn; - + if (prefix) fn = Common::String::format("%s_%04X.0", prefix, resIndex); else @@ -117,11 +117,11 @@ Resource *ResourceCache::load(uint resIndex) { resItem->data = new byte[resItem->size]; _vm->_arc->read(resItem->data, resItem->size); _vm->_arc->closeResource(); - + _cache[resIndex] = resItem; - + return resItem; - + } } diff --git a/engines/toltecs/saveload.cpp b/engines/toltecs/saveload.cpp index 4de25101d2..6c195a34c2 100644 --- a/engines/toltecs/saveload.cpp +++ b/engines/toltecs/saveload.cpp @@ -92,7 +92,7 @@ void ToltecsEngine::savegame(const char *filename, const char *description) { byte descriptionLen = strlen(description); out->writeByte(descriptionLen); out->write(description, descriptionLen); - + Graphics::saveThumbnail(*out); // Not used yet, reserved for future usage @@ -149,13 +149,13 @@ void ToltecsEngine::loadgame(const char *filename) { SaveHeader header; kReadSaveHeaderError errorCode = readSaveHeader(in, false, header); - + if (errorCode != kRSHENoError) { warning("Error loading savegame '%s'", filename); delete in; return; } - + _sound->stopAll(); _music->stopSequence(); g_engine->setTotalPlayTime(header.playTime * 1000); @@ -181,7 +181,7 @@ void ToltecsEngine::loadgame(const char *filename) { _mouseX = in->readUint16LE(); _mouseY = in->readUint16LE(); _mouseDisabled = in->readUint16LE(); - + _system->warpMouse(_mouseX, _mouseY); _system->showMouse(_mouseDisabled == 0); diff --git a/engines/toltecs/screen.cpp b/engines/toltecs/screen.cpp index 7ec6e940dd..32202ad13e 100644 --- a/engines/toltecs/screen.cpp +++ b/engines/toltecs/screen.cpp @@ -73,7 +73,7 @@ Screen::~Screen() { delete[] _frontScreen; delete[] _backScreen; - + delete _renderQueue; } @@ -129,7 +129,7 @@ void Screen::drawGuiImage(int16 x, int16 y, uint resIndex) { byte *dest = _frontScreen + x + (y + _vm->_cameraHeight) * 640; //debug(0, "Screen::drawGuiImage() x = %d; y = %d; w = %d; h = %d; resIndex = %d", x, y, width, height, resIndex); - + while (workHeight > 0) { int count = 1; byte pixel = *imageData++; @@ -247,7 +247,7 @@ void Screen::addAnimatedSprite(int16 x, int16 y, int16 fragmentId, byte *data, i } else { loopNum |= 0x8000; } - + WRITE_LE_UINT16(spriteItem + 0, loopNum); WRITE_LE_UINT16(spriteItem + 4, frameNum); @@ -308,9 +308,9 @@ void Screen::updateVerbLine(int16 slotIndex, int16 slotOffset) { wrapState.len2 = 0; y = _verbLineY; - + memset(wrapState.textBuffer, 0, sizeof(wrapState.textBuffer)); - + for (int16 i = 0; i <= _verbLineNum; i++) { wrapState.sourceString = _vm->_script->getSlotData(_verbLineItems[i].slotIndex) + _verbLineItems[i].slotOffset; len = wrapGuiText(_fontResIndexArray[0], _verbLineWidth, wrapState); @@ -331,19 +331,19 @@ void Screen::updateVerbLine(int16 slotIndex, int16 slotOffset) { wrapState.sourceString++; wrapState.len1 -= len; wrapState.len2 = len + 1; - + drawGuiText(_verbLineX - 1 - (wrapState.width / 2), y, 0xF9, 0xFF, _fontResIndexArray[0], wrapState); wrapState.destString = wrapState.textBuffer; wrapState.width = 0; len = wrapGuiText(_fontResIndexArray[0], _verbLineWidth, wrapState); wrapState.len1 += len; - + y += 9; } y += 9; } - + wrapState.len1 -= len; wrapState.len2 = len; @@ -463,7 +463,7 @@ void Screen::addTalkTextRect(Font &font, int16 x, int16 &y, int16 length, int16 textRect->x = CLIP<int16>(x - width / 2, 0, 640); item->lineCount++; } - + y += font.getHeight() - 1; } @@ -559,7 +559,7 @@ int16 Screen::wrapGuiText(uint fontResIndex, int maxWidth, GuiTextWrapState &wra Font font(_vm->_res->load(fontResIndex)->data); int16 len = 0; - + while (*wrapState.sourceString >= 0x20 && *wrapState.sourceString < 0xF0) { byte ch = *wrapState.sourceString; byte charWidth; @@ -573,9 +573,9 @@ int16 Screen::wrapGuiText(uint fontResIndex, int maxWidth, GuiTextWrapState &wra wrapState.width += charWidth; *wrapState.destString++ = *wrapState.sourceString++; } - + return len; - + } void Screen::drawGuiText(int16 x, int16 y, byte fontColor1, byte fontColor2, uint fontResIndex, GuiTextWrapState &wrapState) { @@ -765,7 +765,7 @@ void Screen::loadState(Common::ReadStream *in) { _verbLineItems[i].slotIndex = in->readUint16LE(); _verbLineItems[i].slotOffset = in->readUint16LE(); } - + // Load talk text items _talkTextX = in->readUint16LE(); _talkTextY = in->readUint16LE(); @@ -786,7 +786,7 @@ void Screen::loadState(Common::ReadStream *in) { _talkTextItems[i].lines[j].length = in->readUint16LE(); } } - + // Load GUI bitmap { byte *gui = _frontScreen + _vm->_cameraHeight * 640; diff --git a/engines/toltecs/screen.h b/engines/toltecs/screen.h index 988f59c840..315e9a45c3 100644 --- a/engines/toltecs/screen.h +++ b/engines/toltecs/screen.h @@ -154,15 +154,15 @@ public: ~Screen(); void unpackRle(byte *source, byte *dest, uint16 width, uint16 height); - + void loadMouseCursor(uint resIndex); - + void drawGuiImage(int16 x, int16 y, uint resIndex); - + void startShakeScreen(int16 shakeCounter); void stopShakeScreen(); void updateShakeScreen(); - + // Sprite list void addStaticSprite(byte *spriteItem); void addAnimatedSprite(int16 x, int16 y, int16 fragmentId, byte *data, int16 *spriteArray, bool loop, int mode); @@ -175,7 +175,7 @@ public: // Verb line void updateVerbLine(int16 slotIndex, int16 slotOffset); - + // Talk text void updateTalkText(int16 slotIndex, int16 slotOffset); void addTalkTextRect(Font &font, int16 x, int16 &y, int16 length, int16 width, TalkTextItem *item); @@ -207,7 +207,7 @@ public: int16 slotIndex; int16 slotOffset; }; - + struct Rect { int16 x, y, width, height; }; @@ -215,7 +215,7 @@ public: ToltecsEngine *_vm; byte *_frontScreen, *_backScreen; - + uint _fontResIndexArray[10]; byte _fontColor1, _fontColor2; @@ -229,7 +229,7 @@ public: VerbLineItem _verbLineItems[8]; int16 _verbLineX, _verbLineY, _verbLineWidth; int16 _verbLineCount; - + // Talk text int16 _talkTextX, _talkTextY; int16 _talkTextMaxWidth; diff --git a/engines/toltecs/script.cpp b/engines/toltecs/script.cpp index 40b13526cf..03a2b66088 100644 --- a/engines/toltecs/script.cpp +++ b/engines/toltecs/script.cpp @@ -197,7 +197,7 @@ void ScriptInterpreter::runScript() { _vm->saveGameState(_vm->_saveLoadSlot, _vm->_saveLoadDescription); _vm->_saveLoadRequested = 0; } - + if (_switchLocalDataNear) { _switchLocalDataNear = false; _localData = getSlotData(_regs.reg4); @@ -214,7 +214,7 @@ void ScriptInterpreter::runScript() { _localData = _stack + 2; _switchLocalDataNear = true; } - + byte opcode = readByte(); execOpcode(opcode); @@ -547,7 +547,7 @@ const char *getVarName(uint variable) { int16 ScriptInterpreter::getGameVar(uint variable) { debug(0, "ScriptInterpreter::getGameVar(%d{%s})", variable, getVarName(variable)); - + switch (variable) { case 0: return _vm->_mouseDisabled; case 1: return _vm->_mouseY; @@ -579,7 +579,7 @@ int16 ScriptInterpreter::getGameVar(uint variable) { void ScriptInterpreter::setGameVar(uint variable, int16 value) { debug(0, "ScriptInterpreter::setGameVar(%d{%s}, %d)", variable, getVarName(variable), value); - + switch (variable) { case 0: _vm->_mouseDisabled = value; @@ -718,7 +718,7 @@ void ScriptInterpreter::saveState(Common::WriteStream *out) { // Save stack out->write(_stack, kScriptStackSize); out->writeUint16LE(_savedSp); - + // Save IP out->writeUint16LE((int16)(_code - getSlotData(_regs.reg4))); @@ -1046,14 +1046,14 @@ void ScriptInterpreter::sfHandleInput() { Only scancodes known to be used (so far) are converted */ switch (_vm->_keyState.keycode) { - case Common::KEYCODE_ESCAPE: + case Common::KEYCODE_ESCAPE: keyCode = 1; break; case Common::KEYCODE_F10: keyCode = 68; break; default: - break; + break; } } localWrite16(varOfs, keyCode); @@ -1068,7 +1068,7 @@ void ScriptInterpreter::sfRunOptionsScreen() { of data so the game doesn't stall while playing (due to the slow speed of CD-Drives back then). This is not needed in ScummVM since all supported systems are fast enough to load data in-game. */ - + void ScriptInterpreter::sfPrecacheSprites() { // See note above } diff --git a/engines/toltecs/script.h b/engines/toltecs/script.h index 7a50d22ff2..89dca4598f 100644 --- a/engines/toltecs/script.h +++ b/engines/toltecs/script.h @@ -90,13 +90,13 @@ protected: bool _cmpBitTest; ScriptSlot _slots[kMaxScriptSlots]; - + ScriptRegs _regs; int16 _savedSp; byte readByte(); int16 readInt16(); - + void execOpcode(byte opcode); void setupScriptFunctions(); diff --git a/engines/toltecs/segmap.cpp b/engines/toltecs/segmap.cpp index f7d806c67b..b06c0af675 100644 --- a/engines/toltecs/segmap.cpp +++ b/engines/toltecs/segmap.cpp @@ -48,7 +48,7 @@ void SegmentMap::load(byte *source) { uint16 maskRectCount = READ_LE_UINT16(source); source += 2; uint16 maskRectDataSize = maskRectCount * 12 + 2; - + debug(0, "SegmentMap::load() maskRectCount = %d", maskRectCount); for (uint16 i = 0; i < maskRectCount; i++) { @@ -74,25 +74,25 @@ void SegmentMap::load(byte *source) { // Load path rects source += 2; // skip rects array size - + uint16 pathRectCount = READ_LE_UINT16(source); source += 2; - + debug(0, "SegmentMap::load() pathRectCount = %d", pathRectCount); - + for (uint16 i = 0; i < pathRectCount; i++) { SegmapPathRect pathRect; pathRect.y1 = READ_LE_UINT16(source); pathRect.x1 = READ_LE_UINT16(source + 2); pathRect.y2 = pathRect.y1 + READ_LE_UINT16(source + 4); pathRect.x2 = pathRect.x1 + READ_LE_UINT16(source + 6); - + debug(0, "SegmentMap::load() (%d, %d, %d, %d)", pathRect.x1, pathRect.y1, pathRect.x2, pathRect.y2); source += 8; _pathRects.push_back(pathRect); } - + // Load info rects source += 2; // skip rects array size @@ -141,7 +141,7 @@ void SegmentMap::adjustPathPoint(int16 &x, int16 &y) { uint32 minDistance = 0xFFFFFFFF, distance; int16 adjustedX = 0, adjustedY = 0, x2, y2; - + for (int16 rectIndex = 0; rectIndex < (int16)_pathRects.size(); rectIndex++) { if (x >= _pathRects[rectIndex].x1 && x < _pathRects[rectIndex].x2) { @@ -174,7 +174,7 @@ void SegmentMap::adjustPathPoint(int16 &x, int16 &y) { } } - + x = adjustedX; y = adjustedY; @@ -318,7 +318,7 @@ void SegmentMap::findPath(int16 *pointsArray, int16 destX, int16 destY, int16 so pointsArray[0] = 0; pointsArray[1] = TO_LE_16(_pathNodesCount + 1); } - + debug(0, "SegmentMap::findPath() count = %d", FROM_LE_16(pointsArray[1])); #if 0 // DEBUG: Draw the path we found @@ -335,7 +335,7 @@ void SegmentMap::findPath(int16 *pointsArray, int16 destX, int16 destY, int16 so sy = y; } #endif - + } int8 SegmentMap::getScalingAtPoint(int16 x, int16 y) { diff --git a/engines/toltecs/segmap.h b/engines/toltecs/segmap.h index 30182a6b71..dda0edeb88 100644 --- a/engines/toltecs/segmap.h +++ b/engines/toltecs/segmap.h @@ -61,14 +61,14 @@ public: void getRgbModifiertAtPoint(int16 x, int16 y, int16 id, byte &r, byte &g, byte &b); void addMasksToRenderQueue(); - + //protected: public: // for debugging purposes struct SegmapPathRect { int16 x1, y1, x2, y2; }; - + struct SegmapInfoRect { int16 y, x; int16 height, width; @@ -78,11 +78,11 @@ public: // for debugging purposes return py >= y && py <= y + height && px >= x && px <= x + width; } }; - + struct PathPoint { int16 y, x; }; - + typedef Common::Array<SegmapMaskRect> SegmapMaskRectArray; typedef Common::Array<SegmapPathRect> SegmapPathRectArray; typedef Common::Array<SegmapInfoRect> SegmapInfoRectArray; diff --git a/engines/toltecs/sound.cpp b/engines/toltecs/sound.cpp index 2705efe5f0..4b281392e5 100644 --- a/engines/toltecs/sound.cpp +++ b/engines/toltecs/sound.cpp @@ -57,7 +57,7 @@ void Sound::playSpeech(int16 resIndex) { void Sound::playSound(int16 resIndex, int16 type, int16 volume) { debug(0, "playSound(%d, %d, %d)", resIndex, type, volume); - + internalPlaySound(resIndex, type, volume, 0); } @@ -66,7 +66,7 @@ void Sound::playSoundAtPos(int16 resIndex, int16 x, int16 y) { int16 volume = 50 + ABS(_vm->_segmap->getScalingAtPoint(x, y)) / 2; int16 panning = 0, deltaX = 0; - + if (_vm->_cameraX > x) deltaX = _vm->_cameraX - x; else if (_vm->_cameraX + 640 < x) @@ -75,7 +75,7 @@ void Sound::playSoundAtPos(int16 resIndex, int16 x, int16 y) { deltaX = 600; volume = ((100 - deltaX / 6) * volume) / 100; - + if (_vm->_cameraX + 320 != x) { panning = CLIP(x - (_vm->_cameraX + 320), -381, 381) / 3; } @@ -86,7 +86,7 @@ void Sound::playSoundAtPos(int16 resIndex, int16 x, int16 y) { void Sound::internalPlaySound(int16 resIndex, int16 type, int16 volume, int16 panning) { // Change the game's sound volume (0 - 100) to Scummvm's scale (0 - 255) volume = (volume == -1) ? 255 : volume * 255 / 100; - + if (resIndex == -1) { // Stop all sounds _vm->_mixer->stopAll(); @@ -108,7 +108,7 @@ void Sound::internalPlaySound(int16 resIndex, int16 type, int16 volume, int16 pa // Stop speech and play new sound stopSpeech(); } - + // Play new sound in empty channel int freeChannel = -1; for (int i = 0; i < kMaxChannels; i++) { @@ -117,7 +117,7 @@ void Sound::internalPlaySound(int16 resIndex, int16 type, int16 volume, int16 pa break; } } - + // If all channels are in use no new sound will be played if (freeChannel >= 0) { Resource *soundResource = _vm->_res->load(resIndex); @@ -140,7 +140,7 @@ void Sound::internalPlaySound(int16 resIndex, int16 type, int16 volume, int16 pa } } - + } void Sound::updateSpeech() { diff --git a/engines/toltecs/sprite.cpp b/engines/toltecs/sprite.cpp index 7a02663793..6101eb7d85 100644 --- a/engines/toltecs/sprite.cpp +++ b/engines/toltecs/sprite.cpp @@ -199,7 +199,7 @@ bool Screen::createSpriteDrawItem(const DrawRequest &drawRequest, SpriteDrawItem sprite.frameNum = frameNum; spriteData = _vm->_res->load(drawRequest.resIndex)->data; - + if (drawRequest.flags & 0x1000) { sprite.flags |= 4; } @@ -207,7 +207,7 @@ bool Screen::createSpriteDrawItem(const DrawRequest &drawRequest, SpriteDrawItem if (drawRequest.flags & 0x2000) { sprite.flags |= 0x10; } - + if (drawRequest.flags & 0x4000) { sprite.flags |= 0x40; } @@ -218,7 +218,7 @@ bool Screen::createSpriteDrawItem(const DrawRequest &drawRequest, SpriteDrawItem if (spriteFrameEntry.w == 0 || spriteFrameEntry.h == 0) return false; - + sprite.offset = spriteFrameEntry.offset; sprite.width = spriteFrameEntry.w; @@ -263,12 +263,12 @@ bool Screen::createSpriteDrawItem(const DrawRequest &drawRequest, SpriteDrawItem xoffs -= (xoffs * scaleValue) / 100; yoffs -= (yoffs * scaleValue) / 100; } - + } - + sprite.x -= xoffs; sprite.y -= yoffs; - + sprite.yerror = sprite.ydelta; // Now we check if the sprite needs to be clipped @@ -283,7 +283,7 @@ bool Screen::createSpriteDrawItem(const DrawRequest &drawRequest, SpriteDrawItem sprite.height -= clipHeight; if (sprite.height <= 0) return false; - + sprite.y = _vm->_cameraY; // If the sprite is scaled @@ -311,7 +311,7 @@ bool Screen::createSpriteDrawItem(const DrawRequest &drawRequest, SpriteDrawItem } sprite.yerror = chopHeight; } - + spriteFrameData = spriteData + sprite.offset; // Now the sprite's offset is adjusted to point to the starting line if ((sprite.flags & 0x10) == 0) { @@ -439,7 +439,7 @@ void Screen::drawSpriteCore(byte *dest, SpriteFilter &reader, const SpriteDrawIt SpriteReaderStatus status; PixelPacket packet; - + byte *destp = dest; int16 skipX = sprite.skipX; @@ -459,7 +459,7 @@ void Screen::drawSpriteCore(byte *dest, SpriteFilter &reader, const SpriteDrawIt status = reader.readPacket(packet); } } - + if (w - packet.count < 0) packet.count = w; diff --git a/engines/toltecs/toltecs.cpp b/engines/toltecs/toltecs.cpp index b1f60c5cc7..71264a69cc 100644 --- a/engines/toltecs/toltecs.cpp +++ b/engines/toltecs/toltecs.cpp @@ -80,7 +80,7 @@ Common::Error ToltecsEngine::run() { _flag01 = 0; _saveLoadRequested = 0; - + _cameraX = 0; _cameraY = 0; _newCameraX = 0; @@ -91,7 +91,7 @@ Common::Error ToltecsEngine::run() { _sceneWidth = 0; _sceneHeight = 0; - + _doSpeech = true; _doText = true; @@ -121,7 +121,7 @@ Common::Error ToltecsEngine::run() { _moviePlayer = new MoviePlayer(this); _music = new Music(_arc); _menuSystem = new MenuSystem(this); - + _sound = new Sound(this); _cfgText = ConfMan.getBool("subtitles"); @@ -186,7 +186,7 @@ Common::Error ToltecsEngine::run() { delete _music; delete _moviePlayer; delete _menuSystem; - + delete _sound; return Common::kNoError; @@ -250,7 +250,7 @@ void ToltecsEngine::loadScene(uint resIndex) { _screen->_fullRefresh = true; _screen->_renderQueue->clear(); - + } void ToltecsEngine::updateScreen() { @@ -426,7 +426,7 @@ void ToltecsEngine::setCamera(int16 x, int16 y) { _screen->finishTalkTextItems(); _screen->clearSprites(); - + _cameraX = x; _newCameraX = x; @@ -495,9 +495,9 @@ void ToltecsEngine::updateCamera() { } void ToltecsEngine::talk(int16 slotIndex, int16 slotOffset) { - + byte *scanData = _script->getSlotData(slotIndex) + slotOffset; - + while (*scanData < 0xF0) { if (*scanData == 0x19) { scanData++; @@ -510,7 +510,7 @@ void ToltecsEngine::talk(int16 slotIndex, int16 slotOffset) { } scanData++; } - + if (*scanData == 0xFE) { if (_doSpeech) { int16 resIndex = READ_LE_UINT16(scanData + 1); @@ -544,7 +544,7 @@ void ToltecsEngine::walk(byte *walkData) { walkInfo.xerror = READ_LE_UINT16(walkData + 14); walkInfo.mulValue = READ_LE_UINT16(walkData + 16); walkInfo.scaling = READ_LE_UINT16(walkData + 18); - + walkInfo.scaling = -_segmap->getScalingAtPoint(walkInfo.x, walkInfo.y); if (walkInfo.y1 < walkInfo.y2) @@ -552,7 +552,7 @@ void ToltecsEngine::walk(byte *walkData) { else ystep = 1; ydelta = ABS(walkInfo.y1 - walkInfo.y2) * _walkSpeedY; - + if (walkInfo.x1 < walkInfo.x2) xstep = -1; else @@ -615,11 +615,11 @@ void ToltecsEngine::walk(byte *walkData) { } -int16 ToltecsEngine::findRectAtPoint(byte *rectData, int16 x, int16 y, int16 index, int16 itemSize, +int16 ToltecsEngine::findRectAtPoint(byte *rectData, int16 x, int16 y, int16 index, int16 itemSize, byte *rectDataEnd) { rectData += index * itemSize; - + while (rectData < rectDataEnd) { int16 rectY = READ_LE_UINT16(rectData); if (rectY == -10) @@ -637,7 +637,7 @@ int16 ToltecsEngine::findRectAtPoint(byte *rectData, int16 x, int16 y, int16 ind index++; rectData += itemSize; } - + return -1; } diff --git a/engines/toltecs/toltecs.h b/engines/toltecs/toltecs.h index e82a88bcfc..b95a4f77cb 100644 --- a/engines/toltecs/toltecs.h +++ b/engines/toltecs/toltecs.h @@ -134,8 +134,8 @@ public: void talk(int16 slotIndex, int16 slotOffset); void walk(byte *walkData); - - int16 findRectAtPoint(byte *rectData, int16 x, int16 y, int16 index, int16 itemSize, + + int16 findRectAtPoint(byte *rectData, int16 x, int16 y, int16 index, int16 itemSize, byte *rectDataEnd); int _cfgVoicesVolume, _cfgMusicVolume, _cfgSoundFXVolume; @@ -163,7 +163,7 @@ public: uint _sceneResIndex; int16 _sceneWidth, _sceneHeight; - + int _counter01, _counter02; bool _movieSceneFlag; byte _flag01; @@ -174,7 +174,7 @@ public: int16 _guiHeight; bool _doSpeech, _doText; - + int16 _walkSpeedY, _walkSpeedX; Common::KeyState _keyState; diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 7bca40b850..23c655e35a 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -72,9 +72,9 @@ static const MusicFileEntry kMusicFiles[] = { static const char *const kJingleFileNames[] = { - "S00.ADP", "S01.ADP", "S02.ADP", "S03.ADP", "S04.ADP", - "S05.ADP", "S06.ADP", "S07.ADP", "S08.ADP", "S09.ADP", - "S10.ADP", "S11.ADP", "S12.ADP", "S13.ADP", "S14.ADP", + "S00.ADP", "S01.ADP", "S02.ADP", "S03.ADP", "S04.ADP", + "S05.ADP", "S06.ADP", "S07.ADP", "S08.ADP", "S09.ADP", + "S10.ADP", "S11.ADP", "S12.ADP", "S13.ADP", "S14.ADP", "S15.ADP", "S16.ADP", "S17.ADP", "S18.ADP" }; diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp index c8919dbdb5..fa018b4464 100644 --- a/engines/tony/font.cpp +++ b/engines/tony/font.cpp @@ -925,7 +925,7 @@ RMDialogChoice::RMDialogChoice() { _hUnreg = CoroScheduler.createEvent(false, false); _bRemoveFromOT = false; - + _curAdded = 0; _bShow = false; } diff --git a/engines/tony/gfxcore.cpp b/engines/tony/gfxcore.cpp index 25ea10d417..04ce01b0ed 100644 --- a/engines/tony/gfxcore.cpp +++ b/engines/tony/gfxcore.cpp @@ -361,7 +361,7 @@ void RMGfxTargetBuffer::addPrim(RMGfxPrimitive *prim) { void RMGfxTargetBuffer::addDirtyRect(const Common::Rect &r) { assert(r.isValidRect()); if (_trackDirtyRects && r.width() > 0 && r.height() > 0) - _currentDirtyRects.push_back(r); + _currentDirtyRects.push_back(r); } Common::List<Common::Rect> &RMGfxTargetBuffer::getDirtyRects() { diff --git a/engines/tony/inventory.cpp b/engines/tony/inventory.cpp index d758c3ff74..12540e5b7f 100644 --- a/engines/tony/inventory.cpp +++ b/engines/tony/inventory.cpp @@ -711,7 +711,7 @@ int RMInventory::loadState(byte *state) { _curPos = 0; _bCombining = false; - + _items[29]._icon.setPattern(1); if (_nInv > 8) diff --git a/engines/tony/loc.cpp b/engines/tony/loc.cpp index 665afa9180..18470aa6fc 100644 --- a/engines/tony/loc.cpp +++ b/engines/tony/loc.cpp @@ -668,7 +668,7 @@ void RMItem::setPattern(int nPattern, bool bPlayP0) { if (_nCurPattern > 0) _patterns[_nCurPattern].stopSfx(_sfx); } - + // Remember the current pattern _nCurPattern = nPattern; @@ -1661,7 +1661,7 @@ RMCharacter::RMCharacter() { _bMovingWithoutMinpath = false; _bDrawNow = false; _bNeedToStop = false; - + memset(_path, 0, sizeof(_path)); _pos.set(0, 0); diff --git a/engines/tony/mpal/mpalutils.cpp b/engines/tony/mpal/mpalutils.cpp index 92d4af37fc..0919aed5ac 100644 --- a/engines/tony/mpal/mpalutils.cpp +++ b/engines/tony/mpal/mpalutils.cpp @@ -81,7 +81,7 @@ Common::SeekableReadStream *RMRes::getReadStream() { } bool RMRes::isValid() { - return _h != NULL; + return _h != NULL; } /****************************************************************************\ diff --git a/engines/tony/mpal/mpalutils.h b/engines/tony/mpal/mpalutils.h index 629e157e29..d92bb6f9a2 100644 --- a/engines/tony/mpal/mpalutils.h +++ b/engines/tony/mpal/mpalutils.h @@ -59,7 +59,7 @@ class RMResRaw : public RMRes { public: RMResRaw(uint32 resID); virtual ~RMResRaw(); - + const byte *dataPointer(); operator const byte*(); diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp index 710fe7ca68..695801ad90 100644 --- a/engines/tony/tony.cpp +++ b/engines/tony/tony.cpp @@ -244,16 +244,16 @@ bool TonyEngine::loadTonyDat() { expectedLangVariant = 0; break; } - + int numVariant = in.readUint16BE(); if (expectedLangVariant > numVariant) { msg = Common::String::format("Font variant not present in 'tony.dat'. Get it from the ScummVM website"); GUIErrorMessage(msg); warning("%s", msg.c_str()); - + return false; } - + in.seek(in.pos() + (2 * 256 * 8 * expectedLangVariant)); for (int i = 0; i < 256; i++) { _cTableDialog[i] = in.readSint16BE(); diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp index 013be84b4b..c9c450424f 100644 --- a/engines/tony/window.cpp +++ b/engines/tony/window.cpp @@ -256,7 +256,7 @@ void RMWindow::plotLines(const byte *lpBuf, const Common::Point ¢er, int x, } void RMWindow::showDirtyRects(bool v) { - _showDirtyRects = v; + _showDirtyRects = v; } /****************************************************************************\ diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp index 3877fa2a6c..38b1f4f6e1 100644 --- a/engines/toon/detection.cpp +++ b/engines/toon/detection.cpp @@ -84,7 +84,7 @@ static const ADGameDescription gameDescriptions[] = { {"study.svl", 0, "d4aff126ee27be3c3d25e2996369d7cb", 2324368}, }, Common::RU_RUS, Common::kPlatformPC, ADGF_NO_FLAGS, GUIO0() - }, + }, { "toon", "", { diff --git a/engines/toon/movie.h b/engines/toon/movie.h index e795182cba..4dd6583bf6 100644 --- a/engines/toon/movie.h +++ b/engines/toon/movie.h @@ -40,7 +40,7 @@ protected: SmackerVideoTrack *createVideoTrack(uint32 width, uint32 height, uint32 frameCount, const Common::Rational &frameRate, uint32 flags, uint32 signature) const; private: - bool _lowRes; + bool _lowRes; }; class Movie { diff --git a/engines/toon/picture.cpp b/engines/toon/picture.cpp index 204b0fe576..f59cdca064 100644 --- a/engines/toon/picture.cpp +++ b/engines/toon/picture.cpp @@ -71,7 +71,7 @@ bool Picture::loadPicture(const Common::String &file) { _data = new uint8[decSize + 100]; _paletteEntries = READ_LE_UINT16(fileData + 14) / 3; _useFullPalette = (_paletteEntries == 256); - + if (_paletteEntries) { _palette = new uint8[_paletteEntries * 3]; memcpy(_palette, fileData + 16, _paletteEntries * 3); diff --git a/engines/tsage/blue_force/blueforce_scenes7.cpp b/engines/tsage/blue_force/blueforce_scenes7.cpp index bb29ad1f34..4cdd2f3f15 100644 --- a/engines/tsage/blue_force/blueforce_scenes7.cpp +++ b/engines/tsage/blue_force/blueforce_scenes7.cpp @@ -159,7 +159,7 @@ void Scene710::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_skipSpeaker); _stripManager.addSpeaker(&_lauraSpeaker); _stripManager.addSpeaker(&_gameTextSpeaker); - + _kid.postInit(); _kid._moveDiff = Common::Point(4, 2); _laura.postInit(); diff --git a/engines/tsage/blue_force/blueforce_speakers.cpp b/engines/tsage/blue_force/blueforce_speakers.cpp index 8af18b43b8..2a57616640 100644 --- a/engines/tsage/blue_force/blueforce_speakers.cpp +++ b/engines/tsage/blue_force/blueforce_speakers.cpp @@ -809,7 +809,7 @@ void SpeakerGiggles::setText(const Common::String &msg) { SpeakerFBI::SpeakerFBI(): VisualSpeaker() { _color1 = 27; _color2 = 89; - + _speakerName = "FBI"; } @@ -832,7 +832,7 @@ void SpeakerFBI::setText(const Common::String &msg) { SpeakerNico::SpeakerNico(): VisualSpeaker() { _color1 = 105; _color2 = 102; - + _speakerName = "NICO"; } @@ -845,7 +845,7 @@ void SpeakerNico::setText(const Common::String &msg) { _object1.fixPriority(254); _object1.setPosition(Common::Point(BF_GLOBALS._sceneManager._scene->_sceneBounds.left + 262, BF_GLOBALS._sceneManager._scene->_sceneBounds.top + 166)); - + _object2.postInit(); _object2.setVisage(905); _object2.setStrip2(1); @@ -862,7 +862,7 @@ void SpeakerNico::setText(const Common::String &msg) { SpeakerDA::SpeakerDA(): VisualSpeaker() { _color1 = 82; _color2 = 80; - + _speakerName = "DA"; } @@ -875,7 +875,7 @@ void SpeakerDA::setText(const Common::String &msg) { _object1.fixPriority(254); _object1.setPosition(Common::Point(BF_GLOBALS._sceneManager._scene->_sceneBounds.left + 84, BF_GLOBALS._sceneManager._scene->_sceneBounds.top + 166)); - + _object2.postInit(); _object2.setVisage(915); _object2.setStrip2(1); @@ -892,7 +892,7 @@ void SpeakerDA::setText(const Common::String &msg) { SpeakerGrandma::SpeakerGrandma(): VisualSpeaker() { _color1 = 20; _color2 = 23; - + _speakerName = "GRANDMA"; } @@ -905,7 +905,7 @@ void SpeakerGrandma::setText(const Common::String &msg) { _object1.fixPriority(254); _object1.setPosition(Common::Point(BF_GLOBALS._sceneManager._scene->_sceneBounds.left + 43, BF_GLOBALS._sceneManager._scene->_sceneBounds.top + 166)); - + _object2.postInit(); _object2.setVisage(274); _object2.setStrip2(3); @@ -922,7 +922,7 @@ void SpeakerGrandma::setText(const Common::String &msg) { SpeakerLyle::SpeakerLyle(): VisualSpeaker() { _color1 = 29; _color2 = 89; - + _speakerName = "LYLE"; } @@ -935,7 +935,7 @@ void SpeakerLyle::setText(const Common::String &msg) { _object1.fixPriority(254); _object1.setPosition(Common::Point(BF_GLOBALS._sceneManager._scene->_sceneBounds.left + 75, BF_GLOBALS._sceneManager._scene->_sceneBounds.top + 166)); - + _object2.postInit(); _object2.setVisage(278); _object2.setStrip2(1); @@ -952,7 +952,7 @@ void SpeakerLyle::setText(const Common::String &msg) { SpeakerGranText::SpeakerGranText(): VisualSpeaker() { _color1 = 20; _color2 = 23; - + _speakerName = "GRANTEXT"; } @@ -961,7 +961,7 @@ SpeakerGranText::SpeakerGranText(): VisualSpeaker() { SpeakerLyleText::SpeakerLyleText(): VisualSpeaker() { _color1 = 29; _color2 = 89; - + _speakerName = "LYLETEXT"; } @@ -969,7 +969,7 @@ SpeakerLyleText::SpeakerLyleText(): VisualSpeaker() { SpeakerKate::SpeakerKate(): VisualSpeaker() { _color1 = 108; - + _speakerName = "KATE"; } @@ -982,7 +982,7 @@ void SpeakerKate::setText(const Common::String &msg) { _object1.fixPriority(254); _object1.setPosition(Common::Point(BF_GLOBALS._sceneManager._scene->_sceneBounds.left + 270, BF_GLOBALS._sceneManager._scene->_sceneBounds.top + 166)); - + _object2.postInit(); _object2.setVisage(122); _object2.setStrip2(1); @@ -1000,7 +1000,7 @@ void SpeakerKate::setText(const Common::String &msg) { SpeakerTony::SpeakerTony(): VisualSpeaker() { _color1 = 108; _color2 = 8; - + _speakerName = "TONY"; } diff --git a/engines/tsage/blue_force/blueforce_speakers.h b/engines/tsage/blue_force/blueforce_speakers.h index 508279a929..e406a50fbe 100644 --- a/engines/tsage/blue_force/blueforce_speakers.h +++ b/engines/tsage/blue_force/blueforce_speakers.h @@ -290,7 +290,7 @@ public: virtual Common::String getClassName() { return "FBI"; } virtual void setText(const Common::String &msg); }; - + class SpeakerNico: public VisualSpeaker { public: SpeakerNico(); @@ -340,7 +340,7 @@ public: class SpeakerKate: public VisualSpeaker { public: SpeakerKate(); - + virtual Common::String getClassName() { return "SpeakerKate"; } virtual void setText(const Common::String &msg); }; @@ -348,7 +348,7 @@ public: class SpeakerTony: public VisualSpeaker { public: SpeakerTony(); - + virtual Common::String getClassName() { return "SpeakerTony"; } virtual void setText(const Common::String &msg); }; diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index bcadfdc201..a35d663b93 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -156,7 +156,7 @@ public: SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const { Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading( generateGameStateFileName(target, slot)); - + if (f) { TsAGE::tSageSavegameHeader header; TsAGE::Saver::readSavegameHeader(f, header); diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index de9463268b..4589a926c9 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -205,7 +205,7 @@ void Globals::dispatchSounds() { void TsAGE2Globals::reset() { Globals::reset(); - + // Reset the inventory T2_GLOBALS._uiElements.updateInventory(); T2_GLOBALS._uiElements._scoreValue = 0; @@ -277,7 +277,7 @@ void BlueForceGlobals::synchronize(Serializer &s) { void BlueForceGlobals::reset() { TsAGE2Globals::reset(); _scenePalette.clearListeners(); - + _scrollFollower = &_player; _bookmark = bNone; @@ -368,7 +368,7 @@ namespace Ringworld2 { void Ringworld2Globals::reset() { Globals::reset(); - + // Reset the inventory R2_INVENTORY.reset(); T2_GLOBALS._uiElements.updateInventory(); @@ -526,7 +526,7 @@ void Ringworld2Globals::synchronize(Serializer &s) { for (i = 0; i < MAX_CHARACTERS; ++i) s.syncAsByte(_v565F1[i]); - + s.syncAsByte(_v565AE); s.syncAsByte(_v566A4); s.syncAsByte(_v566A5); diff --git a/engines/tsage/ringworld/ringworld_logic.cpp b/engines/tsage/ringworld/ringworld_logic.cpp index 7d571b40d7..0584570ac2 100644 --- a/engines/tsage/ringworld/ringworld_logic.cpp +++ b/engines/tsage/ringworld/ringworld_logic.cpp @@ -610,7 +610,7 @@ void NamedHotspot::doAction(int action) { case CURSOR_USE: if (_useLineNum == -1) break; - + SceneItem::display(_resNum, _useLineNum, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); return; case CURSOR_TALK: diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index a06899fe5a..97042cb621 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -1695,7 +1695,7 @@ bool AnimationPlayer::load(int animId, Action *endAction) { _playbackTickPrior = -1; _playbackTick = 0; - // The final multiplication is used to deliberately slow down playback, since the original + // The final multiplication is used to deliberately slow down playback, since the original // was slowed down by the amount of time spent to decode and display the frames _frameDelay = (60 / _subData._frameRate) * 8; _gameFrame = R2_GLOBALS._events.getFrameNumber(); @@ -1706,7 +1706,7 @@ bool AnimationPlayer::load(int animId, Action *endAction) { int v = (_subData._sliceSize + 2) * _subData._ySlices * _subData._framesPerSlices; _dataNeeded = (_subData._field16 / _subData._framesPerSlices) + v + 96; } - + debugC(1, ktSageDebugGraphics, "Data needed %d", _dataNeeded); // Set up animation data objects @@ -1760,7 +1760,7 @@ bool AnimationPlayer::load(int animId, Action *endAction) { byte r = _subData._palData[idx * 3]; byte g = _subData._palData[idx * 3 + 1]; byte b = _subData._palData[idx * 3 + 2]; - + int palIndex = R2_GLOBALS._scenePalette.indexOf(r, g, b); _palIndexes[idx] = palIndex; } diff --git a/engines/tsage/scenes.h b/engines/tsage/scenes.h index 2daa71ba98..d5ac88c692 100644 --- a/engines/tsage/scenes.h +++ b/engines/tsage/scenes.h @@ -67,7 +67,7 @@ public: void setZoomPercents(int yStart, int minPercent, int yEnd, int maxPercent); void loadBackground(int xAmount, int yAmount); - + void loadSceneData(int sceneNum); }; diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 40f4dfcfd2..87697f950b 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -45,7 +45,7 @@ TSageEngine::TSageEngine(OSystem *system, const tSageGameDescription *gameDesc) else if (g_vm->getGameID() == GType_BlueForce) _debugger = new BlueForceDebugger(); else if (g_vm->getGameID() == GType_Ringworld2) - _debugger = new Ringworld2Debugger(); + _debugger = new Ringworld2Debugger(); } Common::Error TSageEngine::init() { @@ -92,7 +92,7 @@ void TSageEngine::initialize() { g_resourceManager->addLib("TSAGE.RLB"); } g_globals = new BlueForce::BlueForceGlobals(); - + // Setup the user interface T2_GLOBALS._uiElements.setup(Common::Point(0, UI_INTERFACE_Y - 2)); @@ -107,7 +107,7 @@ void TSageEngine::initialize() { // Reset all global variables R2_GLOBALS.reset(); - } + } g_globals->gfxManager().setDefaults(); diff --git a/engines/wintermute/base/base_engine.cpp b/engines/wintermute/base/base_engine.cpp index 2368f8b106..8146d14beb 100644 --- a/engines/wintermute/base/base_engine.cpp +++ b/engines/wintermute/base/base_engine.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -25,7 +25,7 @@ * http://dead-code.org/redir.php?target=wmelite * Copyright (c) 2011 Jan Nedoma */ - + #include "engines/wintermute/base/base_file_manager.h" #include "engines/wintermute/base/base_game.h" #include "engines/wintermute/base/base_engine.h" @@ -71,10 +71,10 @@ void BaseEngine::LOG(bool res, const char *fmt, ...) { secs = secs % 3600; uint32 mins = secs / 60; secs = secs % 60; - + char buff[512]; va_list va; - + va_start(va, fmt); vsprintf(buff, fmt, va); va_end(va); @@ -82,7 +82,7 @@ void BaseEngine::LOG(bool res, const char *fmt, ...) { if (instance()._gameRef) { instance()._gameRef->LOG("%s", buff); } else { - debugCN(kWintermuteDebugLog, "%02d:%02d:%02d: %s\n", hours, mins, secs, buff); + debugCN(kWintermuteDebugLog, "%02d:%02d:%02d: %s\n", hours, mins, secs, buff); } } diff --git a/engines/wintermute/base/base_engine.h b/engines/wintermute/base/base_engine.h index 1cef7b33ba..1ed0e3ab01 100644 --- a/engines/wintermute/base/base_engine.h +++ b/engines/wintermute/base/base_engine.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -25,7 +25,7 @@ * http://dead-code.org/redir.php?target=wmelite * Copyright (c) 2011 Jan Nedoma */ - + #ifndef WINTERMUTE_BASE_ENGINE_H #define WINTERMUTE_BASE_ENGINE_H diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp index 622e85cc11..7b0024414e 100644 --- a/engines/wintermute/base/base_game.cpp +++ b/engines/wintermute/base/base_game.cpp @@ -740,7 +740,7 @@ bool BaseGame::loadBuffer(byte *buffer, bool complete) { TOKEN_TABLE(LOCAL_SAVE_DIR) TOKEN_TABLE(COMPAT_KILL_METHOD_THREADS) TOKEN_TABLE_END - + // Declare a few variables necessary for moving data from these settings over to the renderer: // The values are the same as the defaults set in BaseRenderer. int loadImageX = 0; @@ -3624,7 +3624,7 @@ bool BaseGame::persist(BasePersistenceManager *persistMgr) { persistMgr->transfer(TMEMBER(_musicCrossfadeChannel1)); persistMgr->transfer(TMEMBER(_musicCrossfadeChannel2)); persistMgr->transfer(TMEMBER(_musicCrossfadeSwap)); - + _renderer->persistSaveLoadImages(persistMgr); persistMgr->transfer(TMEMBER_INT(_textEncoding)); diff --git a/engines/wintermute/base/file/base_package.cpp b/engines/wintermute/base/file/base_package.cpp index 9780992652..51a1558a7c 100644 --- a/engines/wintermute/base/file/base_package.cpp +++ b/engines/wintermute/base/file/base_package.cpp @@ -86,16 +86,16 @@ void TPackageHeader::readFromStream(Common::ReadStream *stream) { _magic1 = stream->readUint32LE(); _magic2 = stream->readUint32LE(); _packageVersion = stream->readUint32LE(); - + _gameVersion = stream->readUint32LE(); - + _priority = stream->readByte(); _cd = stream->readByte(); _masterIndex = stream->readByte(); stream->readByte(); // To align the next byte... - + _creationTime = stream->readUint32LE(); - + stream->read(_desc, 100); _numDirs = stream->readUint32LE(); } diff --git a/engines/wintermute/base/gfx/base_renderer.cpp b/engines/wintermute/base/gfx/base_renderer.cpp index 9205438a5b..e7ffc14c25 100644 --- a/engines/wintermute/base/gfx/base_renderer.cpp +++ b/engines/wintermute/base/gfx/base_renderer.cpp @@ -129,13 +129,13 @@ void BaseRenderer::initSaveLoad(bool isSaving, bool quickSave) { _indicatorDisplay = true; _indicatorProgress = 0; _hasDrawnSaveLoadImage = false; - + if (isSaving && !quickSave) { delete _saveLoadImage; _saveLoadImage = NULL; if (_saveImageName.size()) { _saveLoadImage = createSurface(); - + if (!_saveLoadImage || DID_FAIL(_saveLoadImage->create(_saveImageName, true, 0, 0, 0))) { delete _saveLoadImage; _saveLoadImage = NULL; @@ -146,7 +146,7 @@ void BaseRenderer::initSaveLoad(bool isSaving, bool quickSave) { _saveLoadImage = NULL; if (_loadImageName.size()) { _saveLoadImage = createSurface(); - + if (!_saveLoadImage || DID_FAIL(_saveLoadImage->create(_loadImageName, true, 0, 0, 0))) { delete _saveLoadImage; _saveLoadImage = NULL; @@ -360,7 +360,7 @@ bool BaseRenderer::displayIndicator() { flip(); _hasDrawnSaveLoadImage = true; } - + if ((!_indicatorDisplay && _indicatorWidth <= 0) || _indicatorHeight <= 0) { return STATUS_OK; } @@ -369,7 +369,7 @@ bool BaseRenderer::displayIndicator() { for (int i = 0; i < _indicatorHeight; i++) { drawLine(_indicatorX, _indicatorY + i, _indicatorX + curWidth, _indicatorY + i, _indicatorColor); } - + setup2D(); _indicatorWidthDrawn = curWidth; if (_indicatorWidthDrawn) { diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp index 03ec827668..7970a25300 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp @@ -261,7 +261,7 @@ void BaseRenderOSystem::fade(uint16 alpha) { void BaseRenderOSystem::fadeToColor(byte r, byte g, byte b, byte a, Common::Rect *rect) { // This particular warning is rather messy, as this function is called a ton, // thus we avoid printing it more than once. - + // TODO: Add fading with dirty rects. if (!_disableDirtyRects) { warning("BaseRenderOSystem::FadeToColor - Breaks when using dirty rects"); diff --git a/engines/wintermute/base/saveload.cpp b/engines/wintermute/base/saveload.cpp index 0ca68c743f..12204e1b35 100644 --- a/engines/wintermute/base/saveload.cpp +++ b/engines/wintermute/base/saveload.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -45,11 +45,11 @@ namespace Wintermute { bool SaveLoad::loadGame(const Common::String &filename, BaseGame *gameRef) { gameRef->LOG(0, "Loading game '%s'...", filename.c_str()); - + bool ret; - + gameRef->_renderer->initSaveLoad(false); - + gameRef->_loadInProgress = true; BasePersistenceManager *pm = new BasePersistenceManager(); if (DID_SUCCEED(ret = pm->initLoad(filename))) { @@ -61,20 +61,20 @@ bool SaveLoad::loadGame(const Common::String &filename, BaseGame *gameRef) { // data initialization after load SaveLoad::initAfterLoad(); - + gameRef->applyEvent("AfterLoad", true); - + gameRef->displayContent(true, false); //_renderer->flip(); } } } - + delete pm; gameRef->_loadInProgress = false; - + gameRef->_renderer->endSaveLoad(); - + //_gameRef->LOG(0, "Load end %d", BaseUtils::GetUsedMemMB()); // AdGame: if (DID_SUCCEED(ret)) { @@ -85,13 +85,13 @@ bool SaveLoad::loadGame(const Common::String &filename, BaseGame *gameRef) { bool SaveLoad::saveGame(int slot, const char *desc, bool quickSave, BaseGame *gameRef) { Common::String filename = SaveLoad::getSaveSlotFilename(slot); - + gameRef->LOG(0, "Saving game '%s'...", filename.c_str()); - + gameRef->applyEvent("BeforeSave", true); - + bool ret; - + BasePersistenceManager *pm = new BasePersistenceManager(); if (DID_SUCCEED(ret = pm->initSave(desc))) { gameRef->_renderer->initSaveLoad(true, quickSave); // TODO: The original code inited the indicator before the conditionals @@ -104,11 +104,11 @@ bool SaveLoad::saveGame(int slot, const char *desc, bool quickSave, BaseGame *ga } } } - + delete pm; - + gameRef->_renderer->endSaveLoad(); - + return ret; } @@ -166,21 +166,21 @@ Common::String SaveLoad::getSaveSlotFilename(int slot) { bool SaveLoad::getSaveSlotDescription(int slot, char *buffer) { buffer[0] = '\0'; - + Common::String filename = getSaveSlotFilename(slot); BasePersistenceManager *pm = new BasePersistenceManager(); if (!pm) { return false; } - + if (!(pm->initLoad(filename))) { delete pm; return false; } - + strcpy(buffer, pm->_savedDescription); delete pm; - + return true; } @@ -199,6 +199,6 @@ bool SaveLoad::emptySaveSlot(int slot) { delete pm; return true; } - - + + } // end of namespace Wintermute diff --git a/engines/wintermute/base/saveload.h b/engines/wintermute/base/saveload.h index e448cc8814..722f7a89b6 100644 --- a/engines/wintermute/base/saveload.h +++ b/engines/wintermute/base/saveload.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -25,7 +25,7 @@ * http://dead-code.org/redir.php?target=wmelite * Copyright (c) 2011 Jan Nedoma */ - + #ifndef WINTERMUTE_SAVEGAME_H #define WINTERMUTE_SAVEGAME_H @@ -39,7 +39,7 @@ public: static bool isSaveSlotUsed(int slot); static bool getSaveSlotDescription(int slot, char *buffer); static Common::String getSaveSlotFilename(int slot); - + static bool loadGame(const Common::String &filename, BaseGame *gameRef); static bool saveGame(int slot, const char *desc, bool quickSave, BaseGame *gameRef); static bool initAfterLoad(); diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp index da01259b1b..9319899495 100644 --- a/engines/wintermute/graphics/transparent_surface.cpp +++ b/engines/wintermute/graphics/transparent_surface.cpp @@ -52,13 +52,13 @@ TransparentSurface::TransparentSurface(const Surface &surf, bool copyData) : Sur void doBlitOpaque(byte *ino, byte* outo, uint32 width, uint32 height, uint32 pitch, int32 inStep, int32 inoStep) { byte *in, *out; - + #ifdef SCUMM_LITTLE_ENDIAN const int aIndex = 3; #else const int aIndex = 0; #endif - + for (uint32 i = 0; i < height; i++) { out = outo; in = ino; @@ -121,7 +121,7 @@ void TransparentSurface::doBlitAlpha(byte *ino, byte* outo, uint32 width, uint32 int a = (pix >> aShift) & 0xff; int outb, outg, outr, outa; in += inStep; - + switch (a) { case 0: // Full transparency out += 4; diff --git a/engines/wintermute/persistent.h b/engines/wintermute/persistent.h index 5bcf30787d..c862df5d6b 100644 --- a/engines/wintermute/persistent.h +++ b/engines/wintermute/persistent.h @@ -52,7 +52,7 @@ namespace Wintermute { virtual bool persist(BasePersistenceManager* PersistMgr);\ void* operator new (size_t size);\ void operator delete(void* p);\ - + #define IMPLEMENT_PERSISTENT(class_name, persistent_class)\ const char class_name::_className[] = #class_name;\ @@ -80,7 +80,7 @@ namespace Wintermute { SystemClassRegistry::getInstance()->unregisterInstance(#class_name, p);\ ::operator delete(p);\ }\ - + #define TMEMBER(member_name) #member_name, &member_name #define TMEMBER_INT(member_name) #member_name, (int*)&member_name |