From 88913c0139ac6d1dfb356d3048702b7bc8ef4079 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 20 Jun 2011 00:59:48 +0200 Subject: ALL: Remove trailing whitespaces This tries to make our code a bit more compliant with our code formatting conventions. For future use, this is the command I used: git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//' --- engines/sci/console.cpp | 18 +++++++++--------- engines/sci/detection_tables.h | 4 ++-- engines/sci/engine/features.h | 2 +- engines/sci/engine/kernel.h | 2 +- engines/sci/engine/kernel_tables.h | 6 +++--- engines/sci/engine/kevent.cpp | 2 +- engines/sci/engine/kfile.cpp | 6 +++--- engines/sci/engine/kgraphics.cpp | 12 ++++++------ engines/sci/engine/kmisc.cpp | 6 +++--- engines/sci/engine/kmovement.cpp | 4 ++-- engines/sci/engine/kpathing.cpp | 6 +++--- engines/sci/engine/kscripts.cpp | 2 +- engines/sci/engine/kstring.cpp | 8 ++++---- engines/sci/engine/kvideo.cpp | 6 +++--- engines/sci/engine/object.cpp | 10 +++++----- engines/sci/engine/object.h | 4 ++-- engines/sci/engine/savegame.h | 2 +- engines/sci/engine/script.cpp | 2 +- engines/sci/engine/script_patches.cpp | 10 +++++----- engines/sci/engine/scriptdebug.cpp | 12 ++++++------ engines/sci/engine/segment.cpp | 2 +- engines/sci/engine/selector.cpp | 2 +- engines/sci/engine/selector.h | 2 +- engines/sci/engine/state.cpp | 4 ++-- engines/sci/engine/static_selectors.cpp | 8 ++++---- engines/sci/engine/vm.cpp | 22 +++++++++++----------- engines/sci/engine/vm_types.cpp | 12 ++++++------ engines/sci/engine/workarounds.cpp | 2 +- engines/sci/event.cpp | 4 ++-- engines/sci/graphics/animate.cpp | 4 ++-- engines/sci/graphics/compare.h | 2 +- engines/sci/graphics/coordadjuster.h | 4 ++-- engines/sci/graphics/menu.cpp | 4 ++-- engines/sci/graphics/palette.cpp | 8 ++++---- engines/sci/graphics/palette.h | 2 +- engines/sci/graphics/picture.cpp | 6 +++--- engines/sci/graphics/ports.cpp | 2 +- engines/sci/graphics/view.cpp | 6 +++--- engines/sci/parser/said.cpp | 10 +++++----- engines/sci/resource.cpp | 26 +++++++++++++------------- engines/sci/resource_audio.cpp | 4 ++-- engines/sci/sci.cpp | 6 +++--- engines/sci/sci.h | 4 ++-- engines/sci/sound/audio.cpp | 2 +- engines/sci/sound/drivers/amigamac.cpp | 6 +++--- engines/sci/sound/music.cpp | 4 ++-- engines/sci/video/robot_decoder.cpp | 24 ++++++++++++------------ engines/sci/video/seq_decoder.h | 2 +- 48 files changed, 154 insertions(+), 154 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index b1b5f81995..2f69d5caa1 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -255,7 +255,7 @@ void Console::postEnter() { videoDecoder = new RobotDecoder(g_system->getMixer(), _engine->getPlatform() == Common::kPlatformMacintosh); } else if (_videoFile.hasSuffix(".duk")) { duckMode = true; - videoDecoder = new Video::AviDecoder(g_system->getMixer()); + videoDecoder = new Video::AviDecoder(g_system->getMixer()); #endif } else if (_videoFile.hasSuffix(".avi")) { videoDecoder = new Video::AviDecoder(g_system->getMixer()); @@ -895,7 +895,7 @@ bool Console::cmdVerifyScripts(int argc, const char **argv) { return true; } -// Same as in sound/drivers/midi.cpp +// Same as in sound/drivers/midi.cpp uint8 getGmInstrument(const Mt32ToGmMap &Mt32Ins) { if (Mt32Ins.gmInstr == MIDI_MAPPED_TO_RHYTHM) return Mt32Ins.gmRhythmKey + 0x80; @@ -913,7 +913,7 @@ bool Console::cmdShowInstruments(int argc, const char **argv) { MidiPlayer *player = MidiPlayer_Midi_create(doSoundVersion); MidiParser_SCI *parser = new MidiParser_SCI(doSoundVersion, 0); parser->setMidiDriver(player); - + Common::List *resources = _engine->getResMan()->listResources(kResourceTypeSound); Common::sort(resources->begin(), resources->end()); Common::List::iterator itr = resources->begin(); @@ -984,7 +984,7 @@ bool Console::cmdShowInstruments(int argc, const char **argv) { if (channel != 15) { // SCI special byte instrument = *channelData++; if (!firstOneShown) - firstOneShown = true; + firstOneShown = true; else DebugPrintf(","); @@ -1577,7 +1577,7 @@ bool Console::cmdPlayVideo(int argc, const char **argv) { Common::String filename = argv[1]; filename.toLowercase(); - if (filename.hasSuffix(".seq") || filename.hasSuffix(".avi") || filename.hasSuffix(".vmd") || + if (filename.hasSuffix(".seq") || filename.hasSuffix(".avi") || filename.hasSuffix(".vmd") || filename.hasSuffix(".rbt") || filename.hasSuffix(".duk")) { _videoFile = filename; _videoFrameDelay = (argc == 2) ? 10 : atoi(argv[2]); @@ -1699,7 +1699,7 @@ bool Console::cmdShowSavedBits(int argc, const char **argv) { return true; } - // Now we _finally_ know these are valid saved bits + // Now we _finally_ know these are valid saved bits Common::Rect rect; byte mask; @@ -1829,7 +1829,7 @@ bool Console::cmdPrintSegmentTable(int argc, const char **argv) { case SEG_TYPE_STRING: DebugPrintf("T SCI32 strings (%d)", (*(StringTable *)mobj).entries_used); break; -#endif +#endif default: DebugPrintf("I Invalid (type = %x)", mobj->getType()); @@ -2954,8 +2954,8 @@ void Console::printKernelCallsFound(int kernelFuncNum, bool showFoundScripts) { uint16 argc2 = opparams[1]; if (kFuncNum == kernelFuncNum) { - DebugPrintf("Called from script %d, object %s, method %s(%d) with %d bytes for arguments\n", - itr->getNumber(), objName, + DebugPrintf("Called from script %d, object %s, method %s(%d) with %d bytes for arguments\n", + itr->getNumber(), objName, _engine->getKernel()->getSelectorName(obj->getFuncSelector(i)).c_str(), i, argc2); } } diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 73f4e4e89f..4634edb1a8 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -2346,7 +2346,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { //{"ressci.007", 0, "3aae6559aa1df273bc542d5ac6330d75", 25859038}, AD_LISTEND}, Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH }, - + // Phantasmagoria - English DOS Demo // Executable scanning reports "2.100.002" {"phantasmagoria", "Demo", { @@ -3479,7 +3479,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { // Space Quest 4 - English Macintosh // Executable scanning reports "x.yyy.zzz" - // VERSION file reports "1.148" + // VERSION file reports "1.148" {"sq4", "", { {"resource.map", 0, "6ffc6f76c4127d140759a512ab9a07be", 6042}, {"resource.000", 0, "6a538b389705232cf9b2d7de2cf9c0a7", 224833}, diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h index 07ba626d15..4592c5be9c 100644 --- a/engines/sci/engine/features.h +++ b/engines/sci/engine/features.h @@ -75,7 +75,7 @@ public: * @return Message function type, SCI_VERSION_1_LATE / SCI_VERSION_1_1 */ SciVersion detectMessageFunctionType(); - + #ifdef ENABLE_SCI32 /** * Autodetects the kernel functions used in SCI2.1 diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 68b1601580..ff3c67c84b 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -272,7 +272,7 @@ private: // Kernel-related lists Common::StringArray _selectorNames; Common::StringArray _kernelNames; - + const Common::String _invalid; }; diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index 31ef64d109..0c5d4e680d 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -558,16 +558,16 @@ static SciKernelMapEntry s_kernelMap[] = { // SetWindowsOption is used to set Windows specific options, like for example the title bar visibility of // the game window in Phantasmagoria 2. We ignore these settings completely. { MAP_EMPTY(SetWindowsOption), SIG_EVERYWHERE, "ii", NULL, NULL }, - + // Used by the Windows version of Phantasmagoria 1 to get the video speed setting. This is called after - // kGetConfig and overrides the setting obtained by it. It is a dummy function in the DOS Version. We can + // kGetConfig and overrides the setting obtained by it. It is a dummy function in the DOS Version. We can // just use GetConfig and mark this one as empty, like the DOS version does. { MAP_EMPTY(GetSierraProfileInt), SIG_EVERYWHERE, "(.*)", NULL, NULL }, // Unused / debug SCI2.1 unused functions, always mapped to kDummy // The debug functions are called from the inbuilt debugger or polygon - // editor in SCI2.1 games. Related objects are: PEditor, EditablePolygon, + // editor in SCI2.1 games. Related objects are: PEditor, EditablePolygon, // aeDisplayClass and scalerCode { MAP_DUMMY(FindSelector), SIG_EVERYWHERE, "(.*)", NULL, NULL }, { MAP_DUMMY(FindClass), SIG_EVERYWHERE, "(.*)", NULL, NULL }, diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp index 2cd6b198de..df3b3efd57 100644 --- a/engines/sci/engine/kevent.cpp +++ b/engines/sci/engine/kevent.cpp @@ -194,7 +194,7 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { // Wait a bit here, so that the CPU isn't maxed out when the game // is waiting for user input (e.g. when showing text boxes) - bug // #3037874. Make sure that we're not delaying while the game is - // benchmarking, as that will affect the final benchmarked result - + // benchmarking, as that will affect the final benchmarked result - // check bugs #3058865 and #3127824 if (s->_gameIsBenchmarking) { // Game is benchmarking, don't add a delay diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index e1e52215d2..1bd6754ca5 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -208,7 +208,7 @@ reg_t kFClose(EngineState *s, int argc, reg_t *argv) { reg_t kFPuts(EngineState *s, int argc, reg_t *argv) { int handle = argv[0].toUint16(); Common::String data = s->_segMan->getString(argv[1]); - + FileHandle *f = getFileFromHandle(s, handle); if (f) f->_out->write(data.c_str(), data.size()); @@ -812,7 +812,7 @@ reg_t kFileIOReadRaw(EngineState *s, int argc, reg_t *argv) { int bytesRead = 0; char *buf = new char[size]; debugC(kDebugLevelFile, "kFileIO(readRaw): %d, %d", handle, size); - + FileHandle *f = getFileFromHandle(s, handle); if (f) { bytesRead = f->_in->read(buf, size); @@ -910,7 +910,7 @@ reg_t kFileIOSeek(EngineState *s, int argc, reg_t *argv) { int offset = argv[1].toUint16(); int whence = argv[2].toUint16(); debugC(kDebugLevelFile, "kFileIO(seek): %d, %d, %d", handle, offset, whence); - + FileHandle *f = getFileFromHandle(s, handle); if (f) diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 6c96266922..36de767464 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -151,7 +151,7 @@ static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) { case 2: pos.y = argv[1].toSint16(); pos.x = argv[0].toSint16(); - + g_sci->_gfxCursor->kernelSetPos(pos); break; case 4: { @@ -192,7 +192,7 @@ static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) { break; case 10: // Freddy pharkas, when using the whiskey glass to read the prescription (bug #3034973) - g_sci->_gfxCursor->kernelSetZoomZone(argv[0].toUint16(), + g_sci->_gfxCursor->kernelSetZoomZone(argv[0].toUint16(), Common::Rect(argv[1].toUint16(), argv[2].toUint16(), argv[3].toUint16(), argv[4].toUint16()), argv[5].toUint16(), argv[6].toUint16(), argv[7].toUint16(), argv[8].toUint16(), argv[9].toUint16()); @@ -428,7 +428,7 @@ reg_t kCanBeHere(EngineState *s, int argc, reg_t *argv) { reg_t kCantBeHere(EngineState *s, int argc, reg_t *argv) { reg_t curObject = argv[0]; reg_t listReference = (argc > 1) ? argv[1] : NULL_REG; - + reg_t canBeHere = g_sci->_gfxCompare->kernelCanBeHere(curObject, listReference); return canBeHere; } @@ -1279,7 +1279,7 @@ reg_t kCantBeHere32(EngineState *s, int argc, reg_t *argv) { // TODO // reg_t curObject = argv[0]; // reg_t listReference = (argc > 1) ? argv[1] : NULL_REG; - + return NULL_REG; } @@ -1642,8 +1642,8 @@ reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) { reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv) { // TODO: This defines the resolution that the fonts are supposed to be displayed // in. Currently, this is only used for showing high-res fonts in GK1 Mac, but - // should be extended to handle other font resolutions such as those - + // should be extended to handle other font resolutions such as those + int xResolution = argv[0].toUint16(); //int yResolution = argv[1].toUint16(); diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index daed248db1..e6837242e4 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -75,11 +75,11 @@ reg_t kGameIsRestarting(EngineState *s, int argc, reg_t *argv) { } break; case GID_SQ4: - // In SQ4 (floppy and CD) the sequel police appear way too quickly in + // In SQ4 (floppy and CD) the sequel police appear way too quickly in // the Skate-o-rama rooms, resulting in all sorts of timer issues, like // #3109139 (which occurs because a police officer instantly teleports // just before Roger exits and shoots him). We throttle these scenes a - // bit more, in order to prevent timer bugs related to the sequel police + // bit more, in order to prevent timer bugs related to the sequel police if (s->currentRoomNumber() == 405 || s->currentRoomNumber() == 406 || s->currentRoomNumber() == 410 || s->currentRoomNumber() == 411) { s->_throttleTrigger = true; @@ -186,7 +186,7 @@ reg_t kSetDebug(EngineState *s, int argc, reg_t *argv) { if (g_sci->getGameId() != GID_GK1) { debug("Debug mode activated"); - + g_sci->getDebugger()->attach(); } diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp index 31715f19d3..14f7db47a0 100644 --- a/engines/sci/engine/kmovement.cpp +++ b/engines/sci/engine/kmovement.cpp @@ -239,7 +239,7 @@ reg_t kInitBresen(EngineState *s, int argc, reg_t *argv) { client_step--; if (!client_step) - error("kInitBresen failed"); + error("kInitBresen failed"); client_xStep--; } @@ -440,7 +440,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) { invokeSelector(s, clientLooper, SELECTOR(doit), argc, argv, 2, params); } s->r_acc = SIGNAL_REG; - + } else { // is blocked if (avoiderHeading == -1) diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 8904a48978..375aeaa06b 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -1110,7 +1110,7 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) { // Make sure that we have enough points if (pointList.maxSize < size * POLY_POINT_SIZE) { warning("convert_polygon: Not enough memory allocated for polygon points. " - "Expected %d, got %d. Skipping polygon", + "Expected %d, got %d. Skipping polygon", size * POLY_POINT_SIZE, pointList.maxSize); return NULL; } @@ -1202,7 +1202,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co change_polygons_opt_0(pf_s); Common::Point *new_start = fixup_start_point(pf_s, start); - + if (!new_start) { warning("AvoidPath: Couldn't fixup start position for pathfinding"); delete pf_s; @@ -1210,7 +1210,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co } Common::Point *new_end = fixup_end_point(pf_s, end); - + if (!new_end) { warning("AvoidPath: Couldn't fixup end position for pathfinding"); delete new_start; diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index d83254b2c4..93c1fffe3c 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -163,7 +163,7 @@ reg_t kClone(EngineState *s, int argc, reg_t *argv) { // extend the internal storage size. if (infoSelector & kInfoFlagClone) parentObj = s->_segMan->getObject(parentAddr); - + *cloneObj = *parentObj; // Mark as clone diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index c3c10bd2a2..07b87a7cbc 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -427,7 +427,7 @@ reg_t kGetFarText(EngineState *s, int argc, reg_t *argv) { } seeker = (char *)textres->data; - + // The second parameter (counter) determines the number of the string // inside the text resource. while (counter--) { @@ -715,7 +715,7 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) { // triggers an assert when doing string2[i + index2]. for (uint16 i = 0; i < count; i++) string1->setValue(i + index1, string2[i + index2]); - + return strAddress; } case 7: { // Cmp @@ -781,14 +781,14 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) { return NULL_REG; case 15: { // upper Common::String string = s->_segMan->getString(argv[1]); - + string.toUppercase(); s->_segMan->strcpy(argv[1], string.c_str()); return NULL_REG; } case 16: { // lower Common::String string = s->_segMan->getString(argv[1]); - + string.toLowercase(); s->_segMan->strcpy(argv[1], string.c_str()); return NULL_REG; diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index 9a60f39c85..6d810d516c 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -65,7 +65,7 @@ void playVideo(Video::VideoDecoder *videoDecoder, VideoState videoState) { scaleBuffer = new byte[width * height * bytesPerPixel]; } - uint16 x, y; + uint16 x, y; // Sanity check... if (videoState.x > 0 && videoState.y > 0 && isVMD) { @@ -94,7 +94,7 @@ void playVideo(Video::VideoDecoder *videoDecoder, VideoState videoState) { if (frame) { if (scaleBuffer) { - // TODO: Probably should do aspect ratio correction in e.g. GK1 Windows + // TODO: Probably should do aspect ratio correction in e.g. GK1 Windows g_sci->_gfxScreen->scale2x((byte *)frame->pixels, scaleBuffer, videoDecoder->getWidth(), videoDecoder->getHeight(), bytesPerPixel); g_system->copyRectToScreen(scaleBuffer, pitch, x, y, width, height); } else { @@ -130,7 +130,7 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) { uint16 screenWidth = g_system->getWidth(); uint16 screenHeight = g_system->getHeight(); - + Video::VideoDecoder *videoDecoder = 0; if (argv[0].segment != 0) { diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp index f09f18298a..a1854a2723 100644 --- a/engines/sci/engine/object.cpp +++ b/engines/sci/engine/object.cpp @@ -259,13 +259,13 @@ void Object::initSelectorsSci3(const byte *buf) { // two selectors are always reserved (because their storage // space is used by the typeMask). // We don't know beforehand how many methods and properties - // there are, so we count them first. + // there are, so we count them first. for (int groupNr = 0; groupNr < groups; ++groupNr) { byte groupLocation = groupInfo[groupNr]; const byte *seeker = selectorBase + groupLocation * 32 * 2; if (groupLocation != 0) { - // This object actually has selectors belonging to this group + // This object actually has selectors belonging to this group int typeMask = READ_SCI11ENDIAN_UINT32(seeker); for (int bit = 2; bit < 32; ++bit) { @@ -277,7 +277,7 @@ void Object::initSelectorsSci3(const byte *buf) { } else { // Undefined selector } - + } } } @@ -296,7 +296,7 @@ void Object::initSelectorsSci3(const byte *buf) { const byte *seeker = selectorBase + groupLocation * 32 * 2; if (groupLocation != 0) { - // This object actually has selectors belonging to this group + // This object actually has selectors belonging to this group int typeMask = READ_SCI11ENDIAN_UINT32(seeker); int groupBaseId = groupNr * 32; @@ -323,7 +323,7 @@ void Object::initSelectorsSci3(const byte *buf) { } else { // Undefined selector } - + } } } diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h index 80c8e9e83d..0ca16b48a2 100644 --- a/engines/sci/engine/object.h +++ b/engines/sci/engine/object.h @@ -79,7 +79,7 @@ public: } reg_t getSpeciesSelector() const { - if (getSciVersion() <= SCI_VERSION_2_1) + if (getSciVersion() <= SCI_VERSION_2_1) return _variables[_offset]; else // SCI3 return _speciesSelectorSci3; @@ -93,7 +93,7 @@ public: } reg_t getSuperClassSelector() const { - if (getSciVersion() <= SCI_VERSION_2_1) + if (getSciVersion() <= SCI_VERSION_2_1) return _variables[_offset + 1]; else // SCI3 return _superClassPosSci3; diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h index fbd77eb076..1d899b0d37 100644 --- a/engines/sci/engine/savegame.h +++ b/engines/sci/engine/savegame.h @@ -51,7 +51,7 @@ struct EngineState; * 19 - exportsAreWide * 18 - SCI32 arrays/strings * 17 - sound - * + * */ enum { diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index a38aa06bc4..01e1afe5ea 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -160,7 +160,7 @@ void Script::load(ResourceManager *resMan) { _numExports = 0; _synonyms = 0; _numSynonyms = 0; - + if (getSciVersion() <= SCI_VERSION_1_LATE) { _exportTable = (const uint16 *)findBlockSCI0(SCI_OBJ_EXPORTS); if (_exportTable) { diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 2d3d8f6155..a714980a35 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -209,7 +209,7 @@ const byte ecoquest2SignatureEcorderTutorial[] = { const uint16 ecoquest2PatchEcorderTutorial[] = { 0x31, 0x23, // bnt [next state] (save 1 byte) - // The parameter count below should be 7, but we're out of bytes + // The parameter count below should be 7, but we're out of bytes // to patch! A workaround has been added because of this 0x78, // push1 (parameter count) //0x39, 0x07, // pushi 07 (parameter count) @@ -221,7 +221,7 @@ const uint16 ecoquest2PatchEcorderTutorial[] = { 0x78, // push1 (visual screen) 0x39, 0x17, // pushi 17 (color) 0x43, 0x6c, 0x0e, // call kGraph - // The parameter count below should be 5, but we're out of bytes + // The parameter count below should be 5, but we're out of bytes // to patch! A workaround has been added because of this 0x78, // push1 (parameter count) //0x39, 0x05, // pushi 05 (parameter count) @@ -697,7 +697,7 @@ const SciScriptSignature laurabow2Signatures[] = { // =========================================================================== // Mother Goose SCI1/SCI1.1 -// MG::replay somewhat calculates the savedgame-id used when saving again +// MG::replay somewhat calculates the savedgame-id used when saving again // this doesn't work right and we remove the code completely. // We set the savedgame-id directly right after restoring in kRestoreGame. const byte mothergoose256SignatureReplay[] = { @@ -1034,7 +1034,7 @@ const uint16 sq1vgaPatchEgoShowsCard[] = { // script, description, magic DWORD, adjust const SciScriptSignature sq1vgaSignatures[] = { - { 58, "Sarien armory droid zapping ego first time", 1, PATCH_MAGICDWORD( 0x72, 0x88, 0x15, 0x36 ), -70, + { 58, "Sarien armory droid zapping ego first time", 1, PATCH_MAGICDWORD( 0x72, 0x88, 0x15, 0x36 ), -70, sq1vgaSignatureEgoShowsCard, sq1vgaPatchEgoShowsCard }, SCI_SIGNATUREENTRY_TERMINATOR}; @@ -1087,7 +1087,7 @@ void Script::applyPatch(const uint16 *patch, byte *scriptData, const uint32 scri } patch++; patchWord = *patch; - } + } } // will return -1 if no match was found, otherwise an offset to the start of the signature match diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 957930784b..3a18fbc68f 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -72,7 +72,7 @@ reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode const byte *scr; int scr_size; reg_t retval = make_reg(pos.segment, pos.offset + 1); - uint16 param_value = 0xffff; // Suppress GCC warning by setting default value, chose value as invalid to getKernelName etc. + uint16 param_value = 0xffff; // Suppress GCC warning by setting default value, chose value as invalid to getKernelName etc. int i = 0; Kernel *kernel = g_sci->getKernel(); @@ -617,8 +617,8 @@ void debugSelectorCall(reg_t send_obj, Selector selector, int argc, StackPtr arg Console *con = g_sci->getSciDebugger(); #ifdef VM_DEBUG_SEND - debugN("Send to %04x:%04x (%s), selector %04x (%s):", PRINT_REG(send_obj), - s->_segMan->getObjectName(send_obj), selector, + debugN("Send to %04x:%04x (%s), selector %04x (%s):", PRINT_REG(send_obj), + s->_segMan->getObjectName(send_obj), selector, g_sci->getKernel()->getSelectorName(selector).c_str()); #endif // VM_DEBUG_SEND @@ -644,18 +644,18 @@ void debugSelectorCall(reg_t send_obj, Selector selector, int argc, StackPtr arg reg_t selectorValue = *varp.getPointer(segMan); if (!argc && (activeBreakpointTypes & BREAK_SELECTORREAD)) { if (g_sci->checkSelectorBreakpoint(BREAK_SELECTORREAD, send_obj, selector)) - con->DebugPrintf("Read from selector (%s:%s): %04x:%04x\n", + con->DebugPrintf("Read from selector (%s:%s): %04x:%04x\n", objectName, selectorName, PRINT_REG(selectorValue)); } else if (argc && (activeBreakpointTypes & BREAK_SELECTORWRITE)) { if (g_sci->checkSelectorBreakpoint(BREAK_SELECTORWRITE, send_obj, selector)) - con->DebugPrintf("Write to selector (%s:%s): change %04x:%04x to %04x:%04x\n", + con->DebugPrintf("Write to selector (%s:%s): change %04x:%04x to %04x:%04x\n", objectName, selectorName, PRINT_REG(selectorValue), PRINT_REG(argp[1])); } if (argc > 1) - debug(kDebugLevelScripts, "Write to selector (%s:%s): change %04x:%04x to %04x:%04x, argc == %d\n", + debug(kDebugLevelScripts, "Write to selector (%s:%s): change %04x:%04x to %04x:%04x, argc == %d\n", objectName, selectorName, PRINT_REG(selectorValue), PRINT_REG(argp[1]), argc); } diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index 5d8a81a7f1..3f11d6ff49 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -255,7 +255,7 @@ SegmentRef ArrayTable::dereference(reg_t pointer) { return ret; } -void ArrayTable::freeAtAddress(SegManager *segMan, reg_t sub_addr) { +void ArrayTable::freeAtAddress(SegManager *segMan, reg_t sub_addr) { _table[sub_addr.offset].destroy(); freeEntry(sub_addr.offset); } diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp index 2edbea9676..c2f857f319 100644 --- a/engines/sci/engine/selector.cpp +++ b/engines/sci/engine/selector.cpp @@ -212,7 +212,7 @@ void writeSelector(SegManager *segMan, reg_t object, Selector selectorId, reg_t *address.getPointer(segMan) = value; } -void invokeSelector(EngineState *s, reg_t object, int selectorId, +void invokeSelector(EngineState *s, reg_t object, int selectorId, int k_argc, StackPtr k_argp, int argc, const reg_t *argv) { int i; int framesize = 2 + 1 * argc; diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h index f13c13e00c..085dd6e832 100644 --- a/engines/sci/engine/selector.h +++ b/engines/sci/engine/selector.h @@ -185,7 +185,7 @@ void writeSelector(SegManager *segMan, reg_t object, Selector selectorId, reg_t /** * Invokes a selector from an object. */ -void invokeSelector(EngineState *s, reg_t object, int selectorId, +void invokeSelector(EngineState *s, reg_t object, int selectorId, int k_argc, StackPtr k_argp, int argc = 0, const reg_t *argv = 0); } // End of namespace Sci diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 3328f80de1..4ea9f72054 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -144,7 +144,7 @@ void EngineState::wait(int16 ticks) { void EngineState::initGlobals() { Script *script_000 = _segMan->getScript(1); - + if (!script_000->_localsBlock) error("Script 0 has no locals block"); @@ -331,7 +331,7 @@ void SciEngine::checkVocabularySwitch() { uint16 parserLanguage = 1; if (SELECTOR(parseLang) != -1) parserLanguage = readSelectorValue(_gamestate->_segMan, _gameObjectAddress, SELECTOR(parseLang)); - + if (parserLanguage != _vocabularyLanguage) { delete _vocabulary; _vocabulary = new Vocabulary(_resMan, parserLanguage > 1 ? true : false); diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp index 6526eff2db..cca4c47be8 100644 --- a/engines/sci/engine/static_selectors.cpp +++ b/engines/sci/engine/static_selectors.cpp @@ -96,7 +96,7 @@ static const char * const sci2Selectors[] = { "center", "all", "show", "textLeft", "textTop", // 115 - 119 "textRight", "textBottom", "borderColor", "titleFore", "titleBack", // 120 - 124 "titleFont", "dimmed", "frameOut", "lastKey", "magnifier", // 125 - 129 - "magPower", "mirrored", "pitch", "roll", "yaw", // 130 - 134 + "magPower", "mirrored", "pitch", "roll", "yaw", // 130 - 134 "left", "right", "top", "bottom", "numLines" // 135 - 139 }; #endif @@ -265,8 +265,8 @@ void Kernel::findSpecificSelectors(Common::StringArray &selectorNames) { if (targetClass) { if (classReferences[i].selectorType == kSelectorMethod) { if (targetClass->getMethodCount() < selectorOffset + 1) - error("The %s class has less than %d methods (%d)", - classReferences[i].className, selectorOffset + 1, + error("The %s class has less than %d methods (%d)", + classReferences[i].className, selectorOffset + 1, targetClass->getMethodCount()); targetSelectorPos = targetClass->getFuncSelector(selectorOffset); @@ -275,7 +275,7 @@ void Kernel::findSpecificSelectors(Common::StringArray &selectorNames) { selectorOffset += (getSciVersion() <= SCI_VERSION_1_LATE) ? 3 : 8; if (targetClass->getVarCount() < selectorOffset + 1) - error("The %s class has less than %d variables (%d)", + error("The %s class has less than %d variables (%d)", classReferences[i].className, selectorOffset + 1, targetClass->getVarCount()); diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 1517355365..db682de16f 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -42,7 +42,7 @@ const reg_t NULL_REG = {0, 0}; const reg_t SIGNAL_REG = {0, SIGNAL_OFFSET}; const reg_t TRUE_REG = {0, 1}; //#define VM_DEBUG_SEND -// Enable the define below to have the VM abort on cases where a conditional +// Enable the define below to have the VM abort on cases where a conditional // statement is followed by an unconditional jump (which will most likely lead // to an infinite loop). Aids in detecting script bugs such as #3040722. //#define ABORT_ON_INFINITE_LOOP @@ -130,14 +130,14 @@ static reg_t read_var(EngineState *s, int type, int index) { if (solution.type == WORKAROUND_NONE) { #ifdef RELEASE_BUILD // If we are running an official ScummVM release -> fake 0 in unknown cases - warning("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)", + warning("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)", index, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); s->variables[type][index] = NULL_REG; break; #else - error("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)", + error("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)", index, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); #endif @@ -366,8 +366,8 @@ static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) { switch (solution.type) { case WORKAROUND_NONE: kernel->signatureDebug(kernelCall.signature, argc, argv); - error("[VM] k%s[%x]: signature mismatch via method %s::%s (room %d, script %d, localCall 0x%x)", - kernelCall.name, kernelCallNr, originReply.objectName.c_str(), originReply.methodName.c_str(), + error("[VM] k%s[%x]: signature mismatch via method %s::%s (room %d, script %d, localCall 0x%x)", + kernelCall.name, kernelCallNr, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); break; case WORKAROUND_IGNORE: // don't do kernel call, leave acc alone @@ -418,12 +418,12 @@ static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) { int callNameLen = strlen(kernelCall.name); if (strncmp(kernelCall.name, kernelSubCall.name, callNameLen) == 0) { const char *subCallName = kernelSubCall.name + callNameLen; - error("[VM] k%s(%s): signature mismatch via method %s::%s (room %d, script %d, localCall %x)", - kernelCall.name, subCallName, originReply.objectName.c_str(), originReply.methodName.c_str(), + error("[VM] k%s(%s): signature mismatch via method %s::%s (room %d, script %d, localCall %x)", + kernelCall.name, subCallName, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); } - error("[VM] k%s: signature mismatch via method %s::%s (room %d, script %d, localCall %x)", - kernelSubCall.name, originReply.objectName.c_str(), originReply.methodName.c_str(), + error("[VM] k%s: signature mismatch via method %s::%s (room %d, script %d, localCall %x)", + kernelSubCall.name, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); break; } @@ -828,10 +828,10 @@ void run_vm(EngineState *s) { uint16 localCallOffset = s->xs->addr.pc.offset + opparams[0]; - ExecStack xstack(s->xs->objp, s->xs->objp, s->xs->sp, + ExecStack xstack(s->xs->objp, s->xs->objp, s->xs->sp, (call_base->requireUint16()) + s->r_rest, call_base, s->xs->local_segment, make_reg(s->xs->addr.pc.segment, localCallOffset), - NULL_SELECTOR, -1, localCallOffset, s->_executionStack.size() - 1, + NULL_SELECTOR, -1, localCallOffset, s->_executionStack.size() - 1, EXEC_STACK_TYPE_CALL); s->_executionStack.push_back(xstack); diff --git a/engines/sci/engine/vm_types.cpp b/engines/sci/engine/vm_types.cpp index e39c7708ad..b95fd58129 100644 --- a/engines/sci/engine/vm_types.cpp +++ b/engines/sci/engine/vm_types.cpp @@ -32,8 +32,8 @@ reg_t reg_t::lookForWorkaround(const reg_t right) const { SciTrackOriginReply originReply; SciWorkaroundSolution solution = trackOriginAndFindWorkaround(0, arithmeticWorkarounds, &originReply); if (solution.type == WORKAROUND_NONE) - error("Invalid arithmetic operation (params: %04x:%04x and %04x:%04x) from method %s::%s (room %d, script %d, localCall %x)", - PRINT_REG(*this), PRINT_REG(right), originReply.objectName.c_str(), + error("Invalid arithmetic operation (params: %04x:%04x and %04x:%04x) from method %s::%s (room %d, script %d, localCall %x)", + PRINT_REG(*this), PRINT_REG(right), originReply.objectName.c_str(), originReply.methodName.c_str(), g_sci->getEngineState()->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset); assert(solution.type == WORKAROUND_FAKE); @@ -56,7 +56,7 @@ reg_t reg_t::operator+(const reg_t right) const { return make_reg(segment, offset + right.toSint16()); default: return lookForWorkaround(right); - } + } } else if (isNumber() && right.isPointer()) { // Adding a pointer to a number, flip the order return right + *this; @@ -94,9 +94,9 @@ reg_t reg_t::operator/(const reg_t right) const { reg_t reg_t::operator%(const reg_t right) const { if (isNumber() && right.isNumber() && !right.isNull()) { - // Support for negative numbers was added in Iceman, and perhaps in + // Support for negative numbers was added in Iceman, and perhaps in // SCI0 0.000.685 and later. Theoretically, this wasn't really used - // in SCI0, so the result is probably unpredictable. Such a case + // in SCI0, so the result is probably unpredictable. Such a case // would indicate either a script bug, or a modulo on an unsigned // integer larger than 32767. In any case, such a case should be // investigated, instead of being silently accepted. @@ -178,7 +178,7 @@ int reg_t::cmp(const reg_t right, bool treatAsUnsigned) const { if (treatAsUnsigned || !isNumber()) return toUint16() - right.toUint16(); else - return toSint16() - right.toSint16(); + return toSint16() - right.toSint16(); } else if (pointerComparisonWithInteger(right)) { return 1; } else if (right.pointerComparisonWithInteger(*this)) { diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index 464b4d8d5b..768ba28518 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -447,7 +447,7 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun do { workaround = workaroundList; while (workaround->methodName) { - bool objectNameMatches = (workaround->objectName == NULL) || + bool objectNameMatches = (workaround->objectName == NULL) || (workaround->objectName == g_sci->getSciLanguageString(searchObjectName, K_LANG_ENGLISH)); // Special case: in the fanmade Russian translation of SQ4, all diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index 74879f6c63..c14cfada07 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -261,7 +261,7 @@ SciEvent EventManager::getScummVMEvent() { else if ((modifiers & Common::KBD_CTRL) && input.character > 0 && input.character < 27) input.character += 96; // 0x01 -> 'a' } - + // If no actual key was pressed (e.g. if only a modifier key was pressed), // ignore the event if (!input.character) @@ -277,7 +277,7 @@ void EventManager::updateScreen() { if (g_system->getMillis() - s->_screenUpdateTime >= 1000 / 60) { g_system->updateScreen(); s->_screenUpdateTime = g_system->getMillis(); - // Throttle the checking of shouldQuit() to 60fps as well, since + // Throttle the checking of shouldQuit() to 60fps as well, since // Engine::shouldQuit() invokes 2 virtual functions // (EventManager::shouldQuit() and EventManager::shouldRTL()), // which is very expensive to invoke constantly without any diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index c36ecd112a..18f8511953 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -201,7 +201,7 @@ void GfxAnimate::fill(byte &old_picNotValid) { adjustInvalidCels(view, it); processViewScaling(view, it); setNsRect(view, it); - + //warning("%s view %d, loop %d, cel %d, signal %x", _s->_segMan->getObjectName(curObject), it->viewId, it->loopNo, it->celNo, it->signal); // Calculate current priority according to y-coordinate @@ -659,7 +659,7 @@ void GfxAnimate::throttleSpeed() { // No entries drawn -> no speed throttler triggering break; case 1: { - + // One entry drawn -> check if that entry was a speed benchmark view, if not enable speed throttler AnimateEntry *onlyCast = &_lastCastData[0]; if ((onlyCast->viewId == 0) && (onlyCast->loopNo == 13) && (onlyCast->celNo == 0)) { diff --git a/engines/sci/graphics/compare.h b/engines/sci/graphics/compare.h index 83b4f49c08..bacb6e71e2 100644 --- a/engines/sci/graphics/compare.h +++ b/engines/sci/graphics/compare.h @@ -51,7 +51,7 @@ private: GfxCoordAdjuster *_coordAdjuster; uint16 isOnControl(uint16 screenMask, const Common::Rect &rect); - + /** * This function checks whether any of the objects in the given list, * *different* from checkObject, has a brRect which is contained inside diff --git a/engines/sci/graphics/coordadjuster.h b/engines/sci/graphics/coordadjuster.h index 1b8a3e2679..23cf79d209 100644 --- a/engines/sci/graphics/coordadjuster.h +++ b/engines/sci/graphics/coordadjuster.h @@ -68,7 +68,7 @@ public: void moveCursor(Common::Point &pos); Common::Rect pictureGetDisplayArea(); - + private: GfxPorts *_ports; @@ -90,7 +90,7 @@ public: void pictureSetDisplayArea(Common::Rect displayArea); Common::Rect pictureGetDisplayArea(); - + private: SegManager *_segMan; diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 913f680e99..673729784f 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -423,8 +423,8 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) { default: while (itemIterator != itemEnd) { itemEntry = *itemIterator; - if (itemEntry->keyPress == keyPress && - itemEntry->keyModifier == keyModifier && + if (itemEntry->keyPress == keyPress && + itemEntry->keyModifier == keyModifier && itemEntry->enabled) break; itemIterator++; diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index 899ef10b33..c5a3545701 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -71,7 +71,7 @@ GfxPalette::GfxPalette(ResourceManager *resMan, GfxScreen *screen, bool useMergi _macClut = 0; loadMacIconBarPalette(); - + #ifdef ENABLE_SCI32 _clutTable = 0; #endif @@ -236,7 +236,7 @@ static byte blendColors(byte c1, byte c2) { // return (c1/2+c2/2)+((c1&1)+(c2&1))/2; // gamma 2.2 - double t = (pow(c1/255.0, 2.2/1.0) * 255.0) + + double t = (pow(c1/255.0, 2.2/1.0) * 255.0) + (pow(c2/255.0, 2.2/1.0) * 255.0); return (byte)(0.5 + (pow(0.5*t/255.0, 1.0/2.2) * 255.0)); } @@ -378,7 +378,7 @@ bool GfxPalette::merge(Palette *newPalette, bool force, bool forceRealMerge) { break; } } - + // if still no luck - set an approximate color if (j == 256) { newPalette->mapping[i] = res & 0xFF; @@ -991,7 +991,7 @@ void GfxPalette::unloadClut() { delete[] _clutTable; _clutTable = 0; } - + #endif } // End of namespace Sci diff --git a/engines/sci/graphics/palette.h b/engines/sci/graphics/palette.h index 9b0c45baf6..243420cc47 100644 --- a/engines/sci/graphics/palette.h +++ b/engines/sci/graphics/palette.h @@ -125,7 +125,7 @@ private: void loadMacIconBarPalette(); byte *_macClut; - + #ifdef ENABLE_SCI32 byte *_clutTable; #endif diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index ce69ba8922..ecb54e89e8 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -357,7 +357,7 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos curByte = *ptr++; if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y))) _screen->putPixel(x, y, drawMask, curByte, priority, 0); - + if (x == leftX) { ptr += sourcePixelSkipPerRow; x = rightX; @@ -515,7 +515,7 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) { icemanDrawFix = true; } if (g_sci->getGameId() == GID_KQ5) { - // WORKAROUND: ignore the seemingly broken priority of picture 48 + // WORKAROUND: ignore the seemingly broken priority of picture 48 // (island overview). Fixes bug #3041044. if (_resourceId == 48) ignoreBrokenPriority = true; @@ -551,7 +551,7 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) { case PIC_OP_SET_PRIORITY: pic_priority = data[curPos++] & 0x0F; - if (isEGA) + if (isEGA) pic_priority = EGApriority[pic_priority]; if (ignoreBrokenPriority) pic_priority = 255; diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp index 9412976d5b..6b4c8180bf 100644 --- a/engines/sci/graphics/ports.cpp +++ b/engines/sci/graphics/ports.cpp @@ -721,7 +721,7 @@ void GfxPorts::printWindowList(Console *con) { if ((*it)->isWindow()) { Window *wnd = ((Window *)*it); con->DebugPrintf("%d: '%s' at %d, %d, (%d, %d, %d, %d), drawn: %d, style: %d\n", - wnd->id, wnd->title.c_str(), wnd->left, wnd->top, + wnd->id, wnd->title.c_str(), wnd->left, wnd->top, wnd->rect.left, wnd->rect.top, wnd->rect.right, wnd->rect.bottom, wnd->bDrawn, wnd->wndStyle); } diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index afb4c184e8..6ca4903e17 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -202,7 +202,7 @@ void GfxView::initData(GuiResourceId resourceId) { palOffset = READ_SCI11ENDIAN_UINT32(_resourceData + 8); // For SCI32, this is a scale flag - if (getSciVersion() >= SCI_VERSION_2) { + if (getSciVersion() >= SCI_VERSION_2) { _sci2ScaleRes = (Sci32ViewNativeResolution)_resourceData[5]; if (_screen->getUpscaledHires() == GFX_SCREEN_UPSCALED_DISABLED) _sci2ScaleRes = SCI_VIEW_NATIVERES_NONE; @@ -426,7 +426,7 @@ void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCo // compression for SCI1.1+ Mac while (pixelNr < pixelCount) { uint32 pixelLine = pixelNr; - + if (hasByteLengths) { pixelNr += *rlePtr++; runLength = *rlePtr++; @@ -500,7 +500,7 @@ void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCo } else { memcpy(outPtr + pixelNr, literalPtr, MIN(runLength, pixelCount - pixelNr)); literalPtr += runLength; - } + } break; case 0x80: // fill with color if (!literalPos) diff --git a/engines/sci/parser/said.cpp b/engines/sci/parser/said.cpp index 827e28073a..01c25ef401 100644 --- a/engines/sci/parser/said.cpp +++ b/engines/sci/parser/said.cpp @@ -224,7 +224,7 @@ static bool parsePart2(ParseTreeNode* parentNode, bool& nonempty) } else if (said_tokens[said_token] == TOKEN_BRACKETO) { said_token++; - + found = parsePart2(newNode, nonempty); if (found) { @@ -282,7 +282,7 @@ static bool parsePart3(ParseTreeNode* parentNode, bool& nonempty) } else if (said_tokens[said_token] == TOKEN_BRACKETO) { said_token++; - + found = parsePart3(newNode, nonempty); if (found) { @@ -366,7 +366,7 @@ static bool parseRef(ParseTreeNode* parentNode) said_attach_subtree(newParent, 0x144, 0x14f, newNode); newParent = newParent->right; - + newNode = said_branch_node(said_next_node(), 0, 0); found = parseRef(newNode); @@ -381,14 +381,14 @@ static bool parseRef(ParseTreeNode* parentNode) } - } + } // NB: This is not an "else if'. // If there is a "< [ ... ]", that is parsed as "< ..." if (said_tokens[said_token] == TOKEN_BRACKETO) { said_token++; - + found = parseRef(newNode); if (found) { diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 308bd92ef4..fa70481bdc 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -128,7 +128,7 @@ static const char *s_resourceTypeSuffixes[] = { "trn", "rbt", "vmd", "chk", "", "etc", "duk", "clu", "tga", "zzz", "", "", "" -}; +}; const char *getResourceTypeName(ResourceType restype) { if (restype != kResourceTypeInvalid) @@ -449,11 +449,11 @@ bool MacResourceForkResourceSource::isCompressableResource(ResourceType type) co *ptr++ = value; \ } -void MacResourceForkResourceSource::decompressResource(Common::SeekableReadStream *stream, Resource *resource) const { +void MacResourceForkResourceSource::decompressResource(Common::SeekableReadStream *stream, Resource *resource) const { // KQ6 Mac is the only game not compressed. It's not worth writing a // heuristic just for that game. Also, skip over any resource that cannot // be compressed. - bool canBeCompressed = !(g_sci && g_sci->getGameId() == GID_KQ6) && isCompressableResource(resource->_id.getType()); + bool canBeCompressed = !(g_sci && g_sci->getGameId() == GID_KQ6) && isCompressableResource(resource->_id.getType()); uint32 uncompressedSize = 0; // GK2 Mac is crazy. In its Patches resource fork, picture 2315 is not @@ -503,7 +503,7 @@ void MacResourceForkResourceSource::decompressResource(Common::SeekableReadStrea // Copy chunk expanded extraByte1 = stream->readByte(); extraByte2 = stream->readByte(); - + literalLength = extraByte2 & 3; OUTPUT_LITERAL() @@ -824,7 +824,7 @@ void ChunkResourceSource::scanSource(ResourceManager *resMan) { byte *ptr = chunk->data; uint32 firstOffset = 0; - + for (;;) { ResourceType type = resMan->convertResType(*ptr); uint16 number = READ_LE_UINT16(ptr + 1); @@ -844,7 +844,7 @@ void ChunkResourceSource::scanSource(ResourceManager *resMan) { // There's no end marker to the data table, but the first resource // begins directly after the entry table. So, when we hit the first // resource, we're at the end of the entry table. - + if (!firstOffset) firstOffset = entry.offset; @@ -1243,7 +1243,7 @@ ResVersion ResourceManager::detectVolVersion() { for (Common::List::iterator it = _sources.begin(); it != _sources.end(); ++it) { rsrc = *it; - + if (rsrc->getSourceType() == kSourceVolume) { if (rsrc->_resourceFile) { fileStream = rsrc->_resourceFile->createReadStream(); @@ -1291,7 +1291,7 @@ ResVersion ResourceManager::detectVolVersion() { // loading SCI3 volumes, the format is otherwise // identical to SCI2. We therefore get the compression // indicator here, but disregard it in the following - // code. + // code. wCompression = fileStream->readUint16LE(); if (fileStream->eos()) { @@ -1473,7 +1473,7 @@ void ResourceManager::readResourcePatchesBase36() { name = (*x)->getName(); ResourceId resource36 = convertPatchNameBase36((ResourceType)i, name); - + /* if (i == kResourceTypeAudio36) debug("audio36 patch: %s => %s. tuple:%d, %s\n", name.c_str(), inputName.c_str(), resource36.tuple, resource36.toString().c_str()); @@ -1494,7 +1494,7 @@ void ResourceManager::readResourcePatchesBase36() { // Check for SOL as well tag = (tag << 16) | stream->readUint16BE(); - + if (tag != MKTAG('S','O','L',0)) { delete stream; continue; @@ -1613,7 +1613,7 @@ int ResourceManager::readResourceMapSCI0(ResourceSource *map) { warning("Error while reading %s", map->getLocationName().c_str()); return SCI_ERROR_RESMAP_NOT_FOUND; } - + if (offset == 0xFFFFFFFF) break; @@ -2129,7 +2129,7 @@ void ResourceManager::detectSciVersion() { bool oldDecompressors = true; ResourceCompression viewCompression; -#ifdef ENABLE_SCI32 +#ifdef ENABLE_SCI32 viewCompression = getViewCompression(); #else if (_volVersion >= kResVersionSci2) { @@ -2173,7 +2173,7 @@ void ResourceManager::detectSciVersion() { } #endif } - + if (_volVersion == kResVersionSci11Mac) { // SCI32 doesn't have the resource.cfg file, so we can figure out // which of the games are SCI1.1. Note that there are no Mac SCI2 games. diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp index 588ea76ea5..032040fc2c 100644 --- a/engines/sci/resource_audio.cpp +++ b/engines/sci/resource_audio.cpp @@ -356,14 +356,14 @@ int ResourceManager::readAudioMapSCI11(ResourceSource *map) { stream->seek(offset + 1); byte headerSize = stream->readByte(); assert(headerSize == 11 || headerSize == 12); - + stream->skip(5); uint32 size = stream->readUint32LE() + headerSize + 2; addResource(ResourceId(kResourceTypeAudio, n), src, offset, size); } } else { - bool isEarly = (entrySize != 11); + bool isEarly = (entrySize != 11); if (!isEarly) { offset = READ_LE_UINT32(ptr); diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index cc9042ceb7..de1aafb8e2 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -282,7 +282,7 @@ Common::Error SciEngine::run() { // without this games would be pretty badly broken } - // Show any special warnings for buggy scripts with severe game bugs, + // Show any special warnings for buggy scripts with severe game bugs, // which have been patched by Sierra if (getGameId() == GID_LONGBOW) { // Longbow 1.0 has a buggy script which prevents the game @@ -868,7 +868,7 @@ void SciEngine::syncIngameAudioOptions() { _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech } else if (subtitlesOn && speechOn) { // Is it a game that supports simultaneous speech and subtitles? - if (getGameId() == GID_SQ4 + if (getGameId() == GID_SQ4 || getGameId() == GID_FREDDYPHARKAS // TODO: The following need script patches for simultaneous speech and subtitles //|| getGameId() == GID_KQ6 @@ -907,7 +907,7 @@ void SciEngine::loadMacExecutable() { // KQ6/Freddy require the executable to load their icon bar palettes if (hasMacIconBar()) error("Could not load Mac resource fork '%s'", filename.c_str()); - + // TODO: Show some sort of warning dialog saying they can't get any // high-res Mac fonts, when we get to that point ;) } diff --git a/engines/sci/sci.h b/engines/sci/sci.h index 04ccbd97d2..b419d862a4 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -38,7 +38,7 @@ struct ADGameDescription; * Status of this engine: ??? * * Games using this engine: - * - Newer Sierra adventure games (based on FreeSCI) + * - Newer Sierra adventure games (based on FreeSCI) * * @todo give a concrete list of supported games. Could also * list future games, with status for each. @@ -176,7 +176,7 @@ enum SciGameId { GID_FANMADE // FIXME: Do we really need/want this? }; -/** +/** * SCI versions * For more information, check here: * http://wiki.scummvm.org/index.php/Sierra_Game_Versions#SCI_Games diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index 592caa5814..123dd21894 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -285,7 +285,7 @@ Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32 // instead. memcpy(compressedData, audioRes->data, audioRes->size); Common::SeekableReadStream *compressedStream = new Common::MemoryReadStream(compressedData, audioRes->size, DisposeAfterUse::YES); - + switch (audioCompressionType) { case MKTAG('M','P','3',' '): #ifdef USE_MAD diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp index 1436ca45a7..3c750401b9 100644 --- a/engines/sci/sound/drivers/amigamac.cpp +++ b/engines/sci/sound/drivers/amigamac.cpp @@ -178,7 +178,7 @@ int MidiDriver_AmigaMac::interpolate(int8 *samples, frac_t offset, bool isUnsign int diff = (s2 - s1) << 8; return (s1 << 8) + fracToInt(diff * (offset & FRAC_LO_MASK)); } - + int diff = (samples[x + 1] - samples[x]) << 8; return (samples[x] << 8) + fracToInt(diff * (offset & FRAC_LO_MASK)); } @@ -373,7 +373,7 @@ void MidiDriver_AmigaMac::setOutputFrac(int voice) { fnote -= instrument->baseNote; fnote *= 4; // FIXME: check how SSCI maps this - fnote += (_channels[_voices[voice].hw_channel].pitch - 0x2000) / 169; + fnote += (_channels[_voices[voice].hw_channel].pitch - 0x2000) / 169; while (fnote < 0) { divFact *= 2; @@ -617,7 +617,7 @@ int MidiDriver_AmigaMac::open() { } else if (!loadInstrumentsSCI0Mac(stream)) return Common::kUnknownError; } - + MidiDriver_Emulated::open(); _mixer->playStream(Audio::Mixer::kPlainSoundType, &_mixerSoundHandle, this, -1, _mixer->kMaxChannelVolume, 0, DisposeAfterUse::NO); diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index 96cbf135ed..2afab3858d 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -291,8 +291,8 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) { if (_soundVersion >= SCI_VERSION_1_EARLY && g_sci->getPlatform() == Common::kPlatformAmiga) flags = 0; int endPart = track->digitalSampleEnd > 0 ? (track->digitalSampleSize - track->digitalSampleEnd) : 0; - pSnd->pStreamAud = Audio::makeRawStream(channelData + track->digitalSampleStart, - track->digitalSampleSize - track->digitalSampleStart - endPart, + pSnd->pStreamAud = Audio::makeRawStream(channelData + track->digitalSampleStart, + track->digitalSampleSize - track->digitalSampleStart - endPart, track->digitalSampleRate, flags, DisposeAfterUse::NO); delete pSnd->pLoopStream; pSnd->pLoopStream = 0; diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp index d394fd0b2b..77f45e0788 100644 --- a/engines/sci/video/robot_decoder.cpp +++ b/engines/sci/video/robot_decoder.cpp @@ -53,14 +53,14 @@ namespace Sci { // Taken from http://anthonylarme.tripod.com/phantas/phintgtp.html // // (...) What we needed was a way of playing video, but have it blend into -// normal room art instead of occupying its own rectangular area. Room art -// consists of a background pic overlaid with various animating cels -// (traditional lingo: sprites). The cels each have a priority that determines -// who is on top and who is behind in the drawing order. Cels are read from -// *.v56 files (another proprietary format). A Robot is video frames with -// transparent background including priority and x,y information. Thus, it is +// normal room art instead of occupying its own rectangular area. Room art +// consists of a background pic overlaid with various animating cels +// (traditional lingo: sprites). The cels each have a priority that determines +// who is on top and who is behind in the drawing order. Cels are read from +// *.v56 files (another proprietary format). A Robot is video frames with +// transparent background including priority and x,y information. Thus, it is // like a cel, except it comes from an RBT - not a v56. Because it blends into -// our graphics engine, it looks just like a part of the room. A RBT can move +// our graphics engine, it looks just like a part of the room. A RBT can move // around the screen and go behind other objects. (...) #ifdef ENABLE_SCI32 @@ -105,7 +105,7 @@ bool RobotDecoder::loadStream(Common::SeekableReadStream *stream) { _surface = new Graphics::Surface(); readHeaderChunk(); - + // There are several versions of robot files, ranging from 3 to 6. // v3: no known examples // v4: PQ:SWAT demo @@ -223,7 +223,7 @@ void RobotDecoder::calculateVideoDimensions() { // This is an O(n) operation, as each frame has a different size. // We need to know the actual frame size to have a constant video size. uint32 pos = _fileStream->pos(); - + for (uint32 curFrame = 0; curFrame < _header.frameCount; curFrame++) { _fileStream->skip(4); uint16 frameWidth = _fileStream->readUint16(); @@ -327,8 +327,8 @@ const Graphics::Surface *RobotDecoder::decodeNextFrame() { // FIXME: For some reason, there are audio hiccups/gaps if (_header.hasSound) { _fileStream->skip(8); // header - _audioStream->queueBuffer(g_sci->_audio->getDecodedRobotAudioFrame(_fileStream, audioChunkSize - 8), - (audioChunkSize - 8) * 2, DisposeAfterUse::NO, + _audioStream->queueBuffer(g_sci->_audio->getDecodedRobotAudioFrame(_fileStream, audioChunkSize - 8), + (audioChunkSize - 8) * 2, DisposeAfterUse::NO, Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN); } else { _fileStream->skip(audioChunkSize); @@ -359,7 +359,7 @@ void RobotDecoder::close() { } reset(); -} +} #endif diff --git a/engines/sci/video/seq_decoder.h b/engines/sci/video/seq_decoder.h index f5e8ad9b05..800a3c9024 100644 --- a/engines/sci/video/seq_decoder.h +++ b/engines/sci/video/seq_decoder.h @@ -58,7 +58,7 @@ public: Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); } const byte *getPalette() { _dirtyPalette = false; return _palette; } bool hasDirtyPalette() const { return _dirtyPalette; } - + protected: Common::Rational getFrameRate() const { assert(_frameDelay); return Common::Rational(60, _frameDelay); } -- cgit v1.2.3