diff options
author | Johannes Schickel | 2010-01-25 01:39:44 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-25 01:39:44 +0000 |
commit | aed02365ec81e77b3c8aa4f4ecd9a9d3893326f2 (patch) | |
tree | 95f119e687a666f65aad5041910c43bdfd4f2929 /engines/sci | |
parent | ec14cd6e6add76ce4f719edd7ce508d67ebd9f14 (diff) | |
download | scummvm-rg350-aed02365ec81e77b3c8aa4f4ecd9a9d3893326f2.tar.gz scummvm-rg350-aed02365ec81e77b3c8aa4f4ecd9a9d3893326f2.tar.bz2 scummvm-rg350-aed02365ec81e77b3c8aa4f4ecd9a9d3893326f2.zip |
Strip trailing spaces/tabs.
svn-id: r47541
Diffstat (limited to 'engines/sci')
48 files changed, 180 insertions, 180 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 8c25561391..7c45365a19 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -1394,7 +1394,7 @@ bool Console::cmdSongInfo(int argc, const char **argv) { } reg_t addr; - + if (parse_reg_t(_vm->_gamestate, argv[1], &addr, false)) { DebugPrintf("Invalid address passed.\n"); DebugPrintf("Check the \"addresses\" command on how to use addresses\n"); @@ -1437,7 +1437,7 @@ bool Console::cmdToggleSound(int argc, const char **argv) { } reg_t id; - + if (parse_reg_t(_vm->_gamestate, argv[1], &id, false)) { DebugPrintf("Invalid address passed.\n"); DebugPrintf("Check the \"addresses\" command on how to use addresses\n"); @@ -1538,7 +1538,7 @@ bool Console::cmdIsSample(int argc, const char **argv) { return true; } - DebugPrintf("Sample size: %d, sample rate: %d, channels: %d, digital channel number: %d\n", + DebugPrintf("Sample size: %d, sample rate: %d, channels: %d, digital channel number: %d\n", track->digitalSampleSize, track->digitalSampleRate, track->channelCount, track->digitalChannelNr); #endif @@ -1578,7 +1578,7 @@ bool Console::cmdGCShowReachable(int argc, const char **argv) { } reg_t addr; - + if (parse_reg_t(_vm->_gamestate, argv[1], &addr, false)) { DebugPrintf("Invalid address passed.\n"); DebugPrintf("Check the \"addresses\" command on how to use addresses\n"); @@ -1607,7 +1607,7 @@ bool Console::cmdGCShowFreeable(int argc, const char **argv) { } reg_t addr; - + if (parse_reg_t(_vm->_gamestate, argv[1], &addr, false)) { DebugPrintf("Invalid address passed.\n"); DebugPrintf("Check the \"addresses\" command on how to use addresses\n"); @@ -1637,7 +1637,7 @@ bool Console::cmdGCNormalize(int argc, const char **argv) { } reg_t addr; - + if (parse_reg_t(_vm->_gamestate, argv[1], &addr, false)) { DebugPrintf("Invalid address passed.\n"); DebugPrintf("Check the \"addresses\" command on how to use addresses\n"); @@ -1760,7 +1760,7 @@ bool Console::cmdValueType(int argc, const char **argv) { } reg_t val; - + if (parse_reg_t(_vm->_gamestate, argv[1], &val, false)) { DebugPrintf("Invalid address passed.\n"); DebugPrintf("Check the \"addresses\" command on how to use addresses\n"); @@ -1798,7 +1798,7 @@ bool Console::cmdViewListNode(int argc, const char **argv) { } reg_t addr; - + if (parse_reg_t(_vm->_gamestate, argv[1], &addr, false)) { DebugPrintf("Invalid address passed.\n"); DebugPrintf("Check the \"addresses\" command on how to use addresses\n"); @@ -1928,7 +1928,7 @@ bool Console::cmdViewObject(int argc, const char **argv) { } reg_t addr; - + if (parse_reg_t(_vm->_gamestate, argv[1], &addr, false)) { DebugPrintf("Invalid address passed.\n"); DebugPrintf("Check the \"addresses\" command on how to use addresses\n"); @@ -1969,7 +1969,7 @@ bool Console::cmdSetAccumulator(int argc, const char **argv) { } reg_t val; - + if (parse_reg_t(_vm->_gamestate, argv[1], &val, false)) { DebugPrintf("Invalid address passed.\n"); DebugPrintf("Check the \"addresses\" command on how to use addresses\n"); @@ -2219,13 +2219,13 @@ bool Console::cmdSend(int argc, const char **argv) { } reg_t object; - + if (parse_reg_t(_vm->_gamestate, argv[1], &object, false)) { DebugPrintf("Invalid address \"%s\" passed.\n", argv[1]); DebugPrintf("Check the \"addresses\" command on how to use addresses\n"); return true; } - + const char *selector_name = argv[2]; int selector_id = _vm->getKernel()->findSelector(selector_name); diff --git a/engines/sci/console.h b/engines/sci/console.h index c42603273c..5917d64e02 100644 --- a/engines/sci/console.h +++ b/engines/sci/console.h @@ -61,7 +61,7 @@ private: bool cmdSuffixes(int argc, const char **argv); bool cmdParseGrammar(int argc, const char **argv); bool cmdParserNodes(int argc, const char **argv); - bool cmdParserWords(int argc, const char **argv); + bool cmdParserWords(int argc, const char **argv); bool cmdSentenceFragments(int argc, const char **argv); bool cmdParse(int argc, const char **argv); bool cmdSetParseNodes(int argc, const char **argv); diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index c313a5d237..780e744f9b 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -256,7 +256,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl // The existence of 7.pat indicates a Mac game if (filename.contains("7.pat")) s_fallbackDesc.platform = Common::kPlatformMacintosh; - + // The data files for Atari ST versions are the same as their DOS counterparts } @@ -317,7 +317,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl // Where XXXX is the English string, #Y a separator indicating the language // (e.g. #G for German) and ZZZZ is the translated text // NOTE: This doesn't work for games which use message instead of text resources - // (like, for example, Eco Quest 1 and all SCI1.1 games and newer, e.g. Freddy Pharkas). + // (like, for example, Eco Quest 1 and all SCI1.1 games and newer, e.g. Freddy Pharkas). // As far as we know, these games store the messages of each language in separate // resources, and it's not possible to detect that easily // Also look for "%J" which is used in japanese games diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index bc2d8e6b8c..7f16054271 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -1018,7 +1018,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {"resource.000", 0, "233394a5f33b475ae5975e7e9a420865", 8376352}, {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE }, - + // King's Quest 6 - English Windows CD (from the King's Quest Collection) // Executable scanning reports "1.cfs.158", VERSION file reports "1.034 9/11/94 - KQ6 version 1.000.00G" // SCI interpreter version 1.001.054 @@ -1039,7 +1039,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NONE }, #ifdef ENABLE_SCI32 - + // King's Quest 7 - English Windows (from abevi) // VERSION 1.65c @@ -2225,7 +2225,7 @@ static const struct ADGameDescription SciGameDescriptions[] = { {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH }, - + // Quest for Glory 3 - English DOS Non-Interactive Demo (from FRG) // Executable scanning reports "1.001.021", VERSION file reports "1.000, 0.001.059, 6.12.92" {"qfg3", "Demo", { diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index d524901952..0a543eec56 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -332,7 +332,7 @@ SciKernelFunction kfunct_mappers[] = { DEFUN("TextColors", kTextColors, ".*"), DEFUN("TextFonts", kTextFonts, ".*"), DEFUN("Portrait", kPortrait, ".*"), - + #ifdef ENABLE_SCI32 // SCI2 Kernel Functions DEFUN("IsHiRes", kIsHiRes, ""), @@ -436,7 +436,7 @@ void Kernel::loadSelectorNames() { // Check if we have a table for this game // Some demos do not have a selector table Common::StringList staticSelectorTable = checkStaticSelectorNames(); - + if (staticSelectorTable.empty()) error("Kernel: Could not retrieve selector names"); else @@ -447,7 +447,7 @@ void Kernel::loadSelectorNames() { if (oldScriptHeader) _selectorNames.push_back(staticSelectorTable[i]); } - + return; } @@ -627,7 +627,7 @@ void Kernel::mapFunctions() { } } // for all functions requesting to be mapped - debugC(2, kDebugLevelVM, "Handled %d/%d kernel functions, mapping %d and ignoring %d.\n", + debugC(2, kDebugLevelVM, "Handled %d/%d kernel functions, mapping %d and ignoring %d.\n", mapped + ignored, _kernelNames.size(), mapped, ignored); return; @@ -648,7 +648,7 @@ int determine_reg_type(SegManager *segMan, reg_t reg) { switch (mobj->getType()) { case SEG_TYPE_SCRIPT: - if (reg.offset <= (*(Script *)mobj)._bufSize && + if (reg.offset <= (*(Script *)mobj)._bufSize && reg.offset >= -SCRIPT_OBJECT_MAGIC_OFFSET && RAW_IS_OBJECT((*(Script *)mobj)._buf + reg.offset)) { return ((Script *)mobj)->getObject(reg.offset) ? KSIG_OBJECT : KSIG_REF; @@ -779,7 +779,7 @@ void Kernel::setDefaultKernelNames(Common::String gameId) { bool Kernel::loadKernelNames(Common::String gameId) { _kernelNames.clear(); - + #ifdef ENABLE_SCI32 if (getSciVersion() >= SCI_VERSION_2_1) setKernelNamesSci21(gameId); diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 9ba33aff97..aa71dfcdc7 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -102,13 +102,13 @@ private: * Sets the default kernel function names, based on the SCI version used */ void setDefaultKernelNames(Common::String gameId); - + #ifdef ENABLE_SCI32 /** * Sets the default kernel function names to the SCI2 kernel functions */ void setKernelNamesSci2(); - + /** * Sets the default kernel function names to the SCI2.1 kernel functions */ @@ -119,7 +119,7 @@ private: * Loads the kernel selector names. */ void loadSelectorNames(); - + /** * Check for any hardcoded selector table we might have that can be used * if a game is missing the selector names. @@ -229,7 +229,7 @@ int _find_view_priority(EngineState *s, int y); * Determines the now-seen rectangle of a view object * @param s The state to use * @param object The object to check - * @param clip Flag to determine wheter priority band clipping + * @param clip Flag to determine wheter priority band clipping * should be performed * @return The absolute rectangle describing the now-seen area. */ @@ -240,7 +240,7 @@ extern Common::Rect get_nsrect(EngineState *s, reg_t object, byte clip); /******************** Misc functions ********************/ /** - * Get all sound events, apply their changes to the heap + * Get all sound events, apply their changes to the heap */ void process_sound_events(EngineState *s); diff --git a/engines/sci/engine/kernel32.cpp b/engines/sci/engine/kernel32.cpp index e3cc938b1b..5bbf0db814 100644 --- a/engines/sci/engine/kernel32.cpp +++ b/engines/sci/engine/kernel32.cpp @@ -77,7 +77,7 @@ static const char *sci2_default_knames[] = { /*0x27*/ "TextColors", /*0x28*/ "TextFonts", /*0x29*/ "Dummy", - /*0x2a*/ "SetQuitStr", + /*0x2a*/ "SetQuitStr", /*0x2b*/ "EditText", /*0x2c*/ "InputText", /*0x2d*/ "CreateTextBitmap", @@ -174,7 +174,7 @@ static const char *sci2_default_knames[] = { /*0x88*/ "MarkMemory", /*0x89*/ "TextWidth", /*0x8a*/ "PointSize", - + // GK2 Demo only kernel functions /*0x8b*/ "AddLine", /*0x8c*/ "DeleteLine", @@ -491,16 +491,16 @@ reg_t kArray(EngineState *s, int argc, reg_t *argv) { case 9: // Getdata if (!s->_segMan->isHeapObject(argv[1])) return argv[1]; - + return GET_SEL32(s->_segMan, argv[1], data); default: error("Unknown kArray subop %d", argv[0].toUint16()); } - + return NULL_REG; } -reg_t kString(EngineState *s, int argc, reg_t *argv) { +reg_t kString(EngineState *s, int argc, reg_t *argv) { switch (argv[0].toUint16()) { case 0: { // New reg_t stringHandle; @@ -580,7 +580,7 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) { case 7: { // Cmp Common::String string1 = argv[1].isNull() ? "" : s->_segMan->getString(argv[1]); Common::String string2 = argv[2].isNull() ? "" : s->_segMan->getString(argv[2]); - + if (argc == 4) // Strncmp return make_reg(0, strncmp(string1.c_str(), string2.c_str(), argv[3].toUint16())); else // Strcmp @@ -591,10 +591,10 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) { reg_t stringHandle; SciString *dupString = s->_segMan->allocateString(&stringHandle); dupString->setSize(string.size() + 1); - + for (uint32 i = 0; i < string.size(); i++) dupString->setValue(i, string.c_str()[i]); - + dupString->setValue(dupString->getSize() - 1, 0); return stringHandle; @@ -602,7 +602,7 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) { case 9: // Getdata if (!s->_segMan->isHeapObject(argv[1])) return argv[1]; - + return GET_SEL32(s->_segMan, argv[1], data); case 10: // Stringlen return make_reg(0, s->_segMan->strlen(argv[1])); @@ -655,7 +655,7 @@ reg_t kDeleteScreenItem(EngineState *s, int argc, reg_t *argv) { reg_t viewObj = argv[0]; s->_gui->deleteScreenItem(viewObj); - + /* reg_t viewObj = argv[0]; uint16 viewId = GET_SEL32V(s->_segMan, viewObj, view); @@ -706,7 +706,7 @@ reg_t kRepaintPlane(EngineState *s, int argc, reg_t *argv) { } reg_t kFrameOut(EngineState *s, int argc, reg_t *argv) { - // This kernel call likely seems to be doing the screen updates, + // This kernel call likely seems to be doing the screen updates, // as its called right after a view is updated // TODO diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp index 5bc0f1105f..3bf30681d4 100644 --- a/engines/sci/engine/kevent.cpp +++ b/engines/sci/engine/kevent.cpp @@ -88,7 +88,7 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) { // track left buttton clicks, if requested if (curEvent.type == SCI_EVENT_MOUSE_PRESS && curEvent.data == 1 && g_debug_track_mouse_clicks) { - ((SciEngine *)g_engine)->getSciDebugger()->DebugPrintf("Mouse clicked at %d, %d\n", + ((SciEngine *)g_engine)->getSciDebugger()->DebugPrintf("Mouse clicked at %d, %d\n", mousePos.x, mousePos.y); } diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 21674cc94f..2cd6a75575 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -409,7 +409,7 @@ reg_t kDeviceInfo(EngineState *s, int argc, reg_t *argv) { reg_t kGetSaveDir(EngineState *s, int argc, reg_t *argv) { #ifdef ENABLE_SCI32 // TODO: SCI32 uses a parameter here. - if (argc > 0) + if (argc > 0) warning("kGetSaveDir called with %d parameter(s): %04x:%04x", argc, PRINT_REG(argv[0])); #endif @@ -891,7 +891,7 @@ reg_t kFileIO(EngineState *s, int argc, reg_t *argv) { // We just return -1 for all versions. if (g_engine->getSaveFileManager()->renameSavefile(oldName, newName)) return NULL_REG; - else + else return SIGNAL_REG; } #ifdef ENABLE_SCI32 diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index 7cc0d88ab6..b982628bc0 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -71,7 +71,7 @@ reg_t kGameIsRestarting(EngineState *s, int argc, reg_t *argv) { // s->_throttleCounter++; // return s->r_acc; //} - + uint32 curTime = g_system->getMillis(); uint32 duration = curTime - s->_throttleLastTime; uint32 neededSleep = 30; @@ -268,7 +268,7 @@ reg_t kPlatform(EngineState *s, int argc, reg_t *argv) { if (argc == 0 && getSciVersion() < SCI_VERSION_2) { // This is called in KQ5CD with no parameters, where it seems to do some graphics // driver check. This kernel function didn't have subfunctions then. If 0 is - // returned, the game functions normally, otherwise all the animations show up + // returned, the game functions normally, otherwise all the animations show up // like a slideshow (e.g. in the intro). So we return 0. However, the behavior // changed for kPlatform with no parameters in SCI32. return NULL_REG; diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index d9758e259e..cfe3cb38a3 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -1806,7 +1806,7 @@ reg_t kAvoidPath(EngineState *s, int argc, reg_t *argv) { return retval; } case 6 : - case 7 : + case 7 : case 8 : { Common::Point end = Common::Point(argv[2].toSint16(), argv[3].toSint16()); reg_t poly_list, output; diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index 16ef002e66..18a677c67f 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -167,7 +167,7 @@ reg_t kDisposeClone(EngineState *s, int argc, reg_t *argv) { #endif victim_obj->markAsFreed(); - + return s->r_acc; } diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 3881e234ba..e4efc4d1f9 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -55,10 +55,10 @@ reg_t kDoCdAudio(EngineState *s, int argc, reg_t *argv) { } case kSciAudioStop: s->_audio->audioCdStop(); - + if (getSciVersion() == SCI_VERSION_1_1) return make_reg(0, 1); - + break; case kSciAudioPause: warning("Can't pause CD Audio"); @@ -178,7 +178,7 @@ reg_t kDoSync(EngineState *s, int argc, reg_t *argv) { s->_audio->setSoundSync(id, argv[1], segMan); break; } - case kSciAudioSyncNext: + case kSciAudioSyncNext: s->_audio->doSoundSync(argv[1], segMan); break; case kSciAudioSyncStop: diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index 5e124e84e0..ee1e39047f 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -389,7 +389,7 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) { *target = 0; /* Terminate string */ - s->_segMan->strcpy(dest, targetbuf); + s->_segMan->strcpy(dest, targetbuf); return dest; /* Return target addr */ } @@ -448,7 +448,7 @@ reg_t kGetMessage(EngineState *s, int argc, reg_t *argv) { reg_t kMessage(EngineState *s, int argc, reg_t *argv) { uint func = argv[0].toUint16(); - + #ifdef ENABLE_SCI32 if (getSciVersion() >= SCI_VERSION_2) { // In complete weirdness, SCI32 bumps up subops 3-8 to 4-9 and stubs off subop 3. diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index 70b638a43f..6b411c687f 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -120,7 +120,7 @@ void script_adjust_opcode_formats(EngineState *s) { // a vocab.997 resource, by dumping the selector table from other similar versions or games #define FIND_SELECTOR(_slc_) _selectorCache._slc_ = findSelector(#_slc_); \ printf("\t{ \"%s\", %d },\n", #_slc_, _selectorCache._slc_) - + #define FIND_SELECTOR2(_slc_, _slcstr_) _selectorCache._slc_ = findSelector(_slcstr_); \ printf("\t{ \"%s\", %d },\n", _slcstr_, _selectorCache._slc_) diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index d68853a593..f995991aa2 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -53,7 +53,7 @@ SegManager::SegManager(ResourceManager *resMan) { Lists_seg_id = 0; Nodes_seg_id = 0; Hunks_seg_id = 0; - + #ifdef ENABLE_SCI32 Arrays_seg_id = 0; String_seg_id = 0; diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h index 4d385e0d32..12fb323646 100644 --- a/engines/sci/engine/seg_manager.h +++ b/engines/sci/engine/seg_manager.h @@ -87,12 +87,12 @@ public: void reconstructScripts(EngineState *s); /** - * Validate whether the specified public function is exported by + * Validate whether the specified public function is exported by * the script in the specified segment. * @param pubfunct Index of the function to validate - * @param seg Segment ID of the script the check is to + * @param seg Segment ID of the script the check is to * be performed for - * @return NULL if the public function is invalid, its + * @return NULL if the public function is invalid, its * offset into the script's segment otherwise */ uint16 validateExportFunc(int pubfunct, SegmentId seg); @@ -124,7 +124,7 @@ public: /** * Return a pointer to the specified script. - * If the id is invalid, does not refer to a script or the script is + * If the id is invalid, does not refer to a script or the script is * not loaded, this will invoke error(). * @param seg ID of the script segment to check for * @return A pointer to the Script object @@ -134,7 +134,7 @@ public: /** * Return a pointer to the specified script. - * If the id is invalid, does not refer to a script, or + * If the id is invalid, does not refer to a script, or * the script is not loaded, this will return NULL * @param seg ID of the script segment to check for * @return A pointer to the Script object, or NULL @@ -200,7 +200,7 @@ public: * See also sys_string_acquire(); * @param[in] segid Segment ID of the stack * @returns The physical stack - */ + */ SystemStrings *allocateSysStrings(SegmentId *segid); @@ -242,7 +242,7 @@ public: /** * Allocate a fresh chunk of the hunk * @param[in] size Number of bytes to allocate for the hunk entry - * @param[in] hunk_type A descriptive string for the hunk entry, for + * @param[in] hunk_type A descriptive string for the hunk entry, for * debugging purposes * @param[out] addr The offset of the freshly allocated hunk entry * @return Reference to the memory allocated for the hunk @@ -264,7 +264,7 @@ public: * @param[in] size Number of bytes to allocate * @param[in] description A descriptive string for debugging purposes * @param[out] addr The offset of the freshly allocated X - * @return Raw pointer into the allocated dynamic + * @return Raw pointer into the allocated dynamic * memory */ byte *allocDynmem(int size, const char *description, reg_t *addr); @@ -440,7 +440,7 @@ public: public: // TODO: make private Common::Array<SegmentObj *> _heap; Common::Array<Class> _classtable; /**< Table of all classes */ - + #ifdef ENABLE_SCI32 SciArray<reg_t> *allocateArray(reg_t *addr); SciArray<reg_t> *lookupArray(reg_t addr); diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index 6df4e1bac7..a76644c718 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -507,7 +507,7 @@ void SciString::fromString(Common::String string) { if (string.size() > _size) setSize(string.size()); - + for (uint32 i = 0; i < string.size(); i++) _data[i] = string[i]; } diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h index a1967f6bb8..4d9d07c302 100644 --- a/engines/sci/engine/segment.h +++ b/engines/sci/engine/segment.h @@ -63,7 +63,7 @@ enum SegmentType { SEG_TYPE_HUNK = 8, SEG_TYPE_DYNMEM = 9, SEG_TYPE_STRING_FRAG = 10, // obsolete, we keep it to be able to load old saves - + #ifdef ENABLE_SCI32 SEG_TYPE_ARRAY = 11, SEG_TYPE_STRING = 12, @@ -681,7 +681,7 @@ public: _size = 0; _actualSize = 0; } - + SciArray(const SciArray<T> &array) { _type = array._type; _size = array._size; @@ -689,8 +689,8 @@ public: _data = new T[_actualSize]; assert(_data); memcpy(_data, array._data, _size * sizeof(T)); - } - + } + SciArray<T>& operator=(const SciArray<T> &array) { if (this == &array) return *this; @@ -709,7 +709,7 @@ public: virtual ~SciArray() { destroy(); } - + virtual void destroy() { delete[] _data; _data = NULL; @@ -723,7 +723,7 @@ public: _type = type; } - + void setSize(uint32 size) { if (_type < 0) error("SciArray::setSize(): No type set"); @@ -757,21 +757,21 @@ public: _data = newArray; _size = _actualSize = size; } - + T getValue(uint16 index) { if (index >= _size) error("SciArray::getValue(): %d is out of bounds (%d)", index, _size); return _data[index]; } - + void setValue(uint16 index, T value) { if (index >= _size) error("SciArray::setValue(): %d is out of bounds (%d)", index, _size); _data[index] = value; } - + byte getType() { return _type; } uint32 getSize() { return _size; } T *getRawData() { return _data; } @@ -786,10 +786,10 @@ protected: class SciString : public SciArray<char> { public: SciString() : SciArray<char>() { setType(3); } - + // We overload destroy to ensure the string type is 3 after destroying void destroy() { _type = 3; } - + Common::String toString(); void fromString(Common::String string); }; diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp index 78d1d3eeb1..5893d3c295 100644 --- a/engines/sci/engine/selector.cpp +++ b/engines/sci/engine/selector.cpp @@ -53,7 +53,7 @@ void write_selector(SegManager *segMan, reg_t object, Selector selector_id, reg_ *address.getPointer(segMan) = value; } -int invoke_selector(EngineState *s, reg_t object, int selector_id, SelectorInvocation noinvalid, +int invoke_selector(EngineState *s, reg_t object, int selector_id, SelectorInvocation noinvalid, StackPtr k_argp, int k_argc, int argc, ...) { va_list argp; int i; @@ -75,7 +75,7 @@ int invoke_selector(EngineState *s, reg_t object, int selector_id, SelectorInvoc return 1; } if (slc_type == kSelectorVariable) { - warning("Attempting to invoke variable selector %s of object %04x:%04x", + warning("Attempting to invoke variable selector %s of object %04x:%04x", s->_kernel->getSelectorName(selector_id).c_str(), PRINT_REG(object)); return 0; } @@ -136,7 +136,7 @@ SelectorType lookup_selector(SegManager *segMan, reg_t obj_location, Selector se selector_id &= ~1; if (!obj) { - error("lookup_selector(): Attempt to send to non-object or invalid script. Address was %04x:%04x", + error("lookup_selector(): Attempt to send to non-object or invalid script. Address was %04x:%04x", PRINT_REG(obj_location)); } diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 2e85bd3356..d21109c57d 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -78,7 +78,7 @@ EngineState::EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc, _lofsType = SCI_VERSION_NONE; _gfxFunctionsType = SCI_VERSION_NONE; _moveCountType = kMoveCountUninitialized; - + _usesCdTrack = Common::File::exists("cdaudio.map"); _soundCmd = 0; @@ -221,7 +221,7 @@ bool EngineState::autoDetectFeature(FeatureDetection featureDetection, int metho objName = "Rm"; objAddr = _segMan->findObjectByName(objName); slc = _kernel->_selectorCache.overlay; - break; + break; case kDetectMoveCountType: objName = "Motion"; objAddr = _segMan->findObjectByName(objName); @@ -580,7 +580,7 @@ SciVersion EngineState::detectGfxFunctionsType() { if (_kernel->_selectorCache.overlay == -1) { // No overlay selector found, check if any method of the Rm object // is calling kDrawPic, as the overlay selector might be missing in demos - + Object *obj = _segMan->getObject(_segMan->findObjectByName("Rm")); for (uint m = 0; m < obj->getMethodCount(); m++) { found = autoDetectFeature(kDetectGfxFunctions, m); diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index c006c0e851..6bd6fed78f 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -205,7 +205,7 @@ public: /** * Autodetects the DoSound type - * @return DoSound type, SCI_VERSION_0_EARLY / SCI_VERSION_0_LATE / + * @return DoSound type, SCI_VERSION_0_EARLY / SCI_VERSION_0_LATE / * SCI_VERSION_1_EARLY / SCI_VERSION_1_LATE */ SciVersion detectDoSoundType(); @@ -244,7 +244,7 @@ public: MoveCountType detectMoveCountType(); bool handleMoveCount() { return detectMoveCountType() == kIncrementMoveCount; } - + bool usesCdTrack() { return _usesCdTrack; } /* Debugger data: */ diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp index 4a783a0fa3..d679b04572 100644 --- a/engines/sci/engine/static_selectors.cpp +++ b/engines/sci/engine/static_selectors.cpp @@ -29,7 +29,7 @@ #include "sci/engine/kernel.h" namespace Sci { - + struct SelectorRemap { SciVersion minVersion; SciVersion maxVersion; @@ -113,5 +113,5 @@ Common::StringList Kernel::checkStaticSelectorNames() { return names; } - + } // End of namespace Sci diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 0bddd34eb6..974109237c 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -68,7 +68,7 @@ static reg_t &validate_property(Object *obj, int index) { } if (index < 0 || (uint)index >= obj->getVarCount()) { - debugC(2, kDebugLevelVM, "[VM] Invalid property #%d (out of [0..%d]) requested!\n", + debugC(2, kDebugLevelVM, "[VM] Invalid property #%d (out of [0..%d]) requested!\n", index, obj->getVarCount()); return dummyReg; } @@ -80,7 +80,7 @@ static StackPtr validate_stack_addr(EngineState *s, StackPtr sp) { if (sp >= s->stack_base && sp < s->stack_top) return sp; - error("[VM] Stack index %d out of valid range [%d..%d]", + error("[VM] Stack index %d out of valid range [%d..%d]", (int)(sp - s->stack_base), 0, (int)(s->stack_top - s->stack_base - 1)); return 0; } @@ -111,7 +111,7 @@ static bool validate_variable(reg_t *r, reg_t *stack_base, int type, int max, in if (index < 0 || index >= max) { Common::String txt = Common::String::printf( - "[VM] Attempt to use invalid %s variable %04x ", + "[VM] Attempt to use invalid %s variable %04x ", names[type], index); if (max == 0) txt += "(variable type invalid)"; @@ -398,7 +398,7 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt call.type = EXEC_STACK_TYPE_VARSELECTOR; // Register as a varselector sendCalls.push(call); } - + break; case kSelectorMethod: @@ -941,7 +941,7 @@ void run_vm(EngineState *s, int restoring) { xs_new = add_exec_stack_entry(s, make_reg(scriptState.xs->addr.pc.segment, scriptState.xs->addr.pc.offset + opparams[0]), - scriptState.xs->sp, scriptState.xs->objp, + scriptState.xs->sp, scriptState.xs->objp, (validate_arithmetic(*call_base)) + scriptState.restAdjust, call_base, NULL_SELECTOR, scriptState.xs->objp, s->_executionStack.size()-1, scriptState.xs->local_segment); @@ -1012,9 +1012,9 @@ void run_vm(EngineState *s, int restoring) { // Remove callk stack frame again s->_executionStack.pop_back(); } else { - Common::String warningMsg = "Dummy function " + kfun.orig_name + + Common::String warningMsg = "Dummy function " + kfun.orig_name + Common::String::printf("[0x%x]", opparams[0]) + - " invoked - ignoring. Params: " + + " invoked - ignoring. Params: " + Common::String::printf("%d", argc) + " ("; for (int i = 0; i < argc; i++) { diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h index 2928ff4daa..759d36d825 100644 --- a/engines/sci/engine/vm.h +++ b/engines/sci/engine/vm.h @@ -196,7 +196,7 @@ struct SelectorCache { // Used for auto detection purposes Selector overlay; ///< Used to determine if a game is using old gfx functions or not Selector setCursor; ///< For cursor semantics autodetection - + #ifdef ENABLE_SCI32 Selector data; // Used by Array() Selector picture; // Used to hold the picture ID for SCI32 pictures @@ -295,7 +295,7 @@ struct Breakpoint { }; /** - * Set this to 1 to abort script execution immediately. Aborting will + * Set this to 1 to abort script execution immediately. Aborting will * leave the debug exec stack intact. * Set it to 2 to force a replay afterwards. */ @@ -326,7 +326,7 @@ extern int script_step_counter; * @param[in] argp Pointer to the first supplied argument * @return A pointer to the new exec stack TOS entry */ -ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, +ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackPtr sp, reg_t calling_obj, uint16 argc, StackPtr argp); @@ -336,13 +336,13 @@ ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, * @param[in] send_obj Heap address of the object to send to * @param[in] work_obj Heap address of the object initiating the send * @param[in] sp Stack pointer position - * @param[in] framesize Size of the send as determined by the "send" + * @param[in] framesize Size of the send as determined by the "send" * operation - * @param[in] argp Pointer to the beginning of the heap block - * containing the data to be sent. This area is a - * succession of one or more sequences of + * @param[in] argp Pointer to the beginning of the heap block + * containing the data to be sent. This area is a + * succession of one or more sequences of * [selector_number][argument_counter] and then - * "argument_counter" word entries with the + * "argument_counter" word entries with the * parameter values. * @return A pointer to the new execution stack TOS entry */ @@ -363,17 +363,17 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, * @param[in] argp Heap pointer to the first parameter * @param[in] selector The selector by which it was called or * NULL_SELECTOR if n.a. For debugging. - * @param[in] sendp Pointer to the object which the message was + * @param[in] sendp Pointer to the object which the message was * sent to. Equal to objp for anything but super. * @param[in] origin Number of the execution stack element this - * entry was created by (usually the current TOS + * entry was created by (usually the current TOS * number, except for multiple sends). * @param[in] local_segment The segment to use for local variables, * or SCI_XS_CALLEE_LOCALS to use obj's segment. * @return A pointer to the new exec stack TOS entry */ -ExecStack *add_exec_stack_entry(EngineState *s, reg_t pc, StackPtr sp, - reg_t objp, int argc, StackPtr argp, Selector selector, +ExecStack *add_exec_stack_entry(EngineState *s, reg_t pc, StackPtr sp, + reg_t objp, int argc, StackPtr argp, Selector selector, reg_t sendp, int origin, SegmentId local_segment); @@ -390,12 +390,12 @@ ExecStack *add_exec_stack_entry(EngineState *s, reg_t pc, StackPtr sp, * @return Pointer to the new exec-TOS element */ ExecStack *add_exec_stack_varselector(EngineState *s, reg_t objp, int argc, - StackPtr argp, Selector selector, const ObjVarRef& address, + StackPtr argp, Selector selector, const ObjVarRef& address, int origin); /** * This function executes SCI bytecode - * It executes the code on s->heap[pc] until it hits a 'ret' operation + * It executes the code on s->heap[pc] until it hits a 'ret' operation * while (stack_base == stack_pos). Requires s to be set up correctly. * @param[in] s The state to use * @param[in] restoring 1 if s has just been restored, 0 otherwise @@ -430,7 +430,7 @@ int script_init_engine(EngineState *); * fptr is written to iff it is non-NULL and the * selector indicates a member function of that * object. - * @return kSelectorNone if the selector was not found in + * @return kSelectorNone if the selector was not found in * the object or its superclasses. * kSelectorVariable if the selector represents an * object-relative variable. @@ -442,9 +442,9 @@ SelectorType lookup_selector(SegManager *segMan, reg_t obj, Selector selectorid, /** * Makes sure that a script and its superclasses get loaded to the heap. - * If the script already has been loaded, only the number of lockers is + * If the script already has been loaded, only the number of lockers is * increased. All scripts containing superclasses of this script are loaded - * recursively as well, unless 'recursive' is set to zero. The + * recursively as well, unless 'recursive' is set to zero. The * complementary function is "script_uninstantiate()" below. * @param[in] resMan The resource manager * @param[in] segMan The segment manager @@ -455,8 +455,8 @@ int script_instantiate(ResourceManager *resMan, SegManager *segMan, int script_n /** * Decreases the numer of lockers of a script and unloads it if that number - * reaches zero. - * This function will recursively unload scripts containing its + * reaches zero. + * This function will recursively unload scripts containing its * superclasses, if those aren't locked by other scripts as well. * @param[in] segMan The segment manager * @param[in] version The SCI version to use diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index f6f2697abc..0e6206627e 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -279,7 +279,7 @@ sciEvent SciEvent::getFromScummVM() { case Common::KEYCODE_KP3: // pagedown if (!(_modifierStates & SCI_KEYMOD_NUMLOCK)) input.data = SCI_KEY_PGDOWN; - break; + break; default: input.type = SCI_EVENT_NONE; break; diff --git a/engines/sci/event.h b/engines/sci/event.h index 610fd566fc..a4f8fbaf27 100644 --- a/engines/sci/event.h +++ b/engines/sci/event.h @@ -76,7 +76,7 @@ struct sciEvent { #define SCI_KEY_UP (72 << 8) // 8 #define SCI_KEY_PGUP (73 << 8) // 9 // -#define SCI_KEY_LEFT (75 << 8) // 4 +#define SCI_KEY_LEFT (75 << 8) // 4 #define SCI_KEY_CENTER (76 << 8) // 5 #define SCI_KEY_RIGHT (77 << 8) // 6 // diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index 6c1e350e36..dc008314de 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -211,7 +211,7 @@ void SciGuiAnimate::fill(byte &old_picNotValid) { // Get the corresponding view view = _gfx->getView(listEntry->viewId); - + // adjust loop and cel, if any of those is invalid if (listEntry->loopNo >= view->getLoopCount()) { listEntry->loopNo = 0; @@ -240,7 +240,7 @@ void SciGuiAnimate::fill(byte &old_picNotValid) { listEntry->priority = _gfx->CoordinateToPriority(listEntry->y); PUT_SEL32V(_s->_segMan, curObject, priority, listEntry->priority); } - + if (signal & kSignalNoUpdate) { if (signal & (kSignalForceUpdate | kSignalViewUpdated) || (signal & kSignalHidden && !(signal & kSignalRemoveView)) @@ -311,7 +311,7 @@ void SciGuiAnimate::update() { signal &= 0xFFFF ^ (kSignalStopUpdate | kSignalViewUpdated | kSignalNoUpdate | kSignalForceUpdate); if ((signal & kSignalIgnoreActor) == 0) { rect = listEntry->celRect; - rect.top = CLIP<int16>(_gfx->PriorityToCoordinate(listEntry->priority) - 1, rect.top, rect.bottom - 1); + rect.top = CLIP<int16>(_gfx->PriorityToCoordinate(listEntry->priority) - 1, rect.top, rect.bottom - 1); _gfx->FillRect(rect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15); } listEntry->signal = signal; @@ -356,7 +356,7 @@ void SciGuiAnimate::update() { if ((signal & kSignalIgnoreActor) == 0) { rect = listEntry->celRect; - rect.top = CLIP<int16>(_gfx->PriorityToCoordinate(listEntry->priority) - 1, rect.top, rect.bottom - 1); + rect.top = CLIP<int16>(_gfx->PriorityToCoordinate(listEntry->priority) - 1, rect.top, rect.bottom - 1); _gfx->FillRect(rect, SCI_SCREEN_MASK_CONTROL, 0, 0, 15); } } diff --git a/engines/sci/graphics/controls.cpp b/engines/sci/graphics/controls.cpp index 7b930ba19f..a3c729d84d 100644 --- a/engines/sci/graphics/controls.cpp +++ b/engines/sci/graphics/controls.cpp @@ -192,7 +192,7 @@ void Controls::TexteditChange(reg_t controlObject, reg_t eventObject) { if (eventKey > 31 && eventKey < 256 && textSize < maxChars) { // insert pressed character // we check, if there is space left for this character - + text.insertChar(eventKey, cursorPos++); textChanged = true; } diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index 785c235e42..e0e5a8893e 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -91,7 +91,7 @@ void Cursor::setShape(GuiResourceId resourceId) { delete[] rawBitmap; return; } - + // Load cursor resource... resource = _resMan->findResource(ResourceId(kResourceTypeCursor, resourceId), false); if (!resource) @@ -112,7 +112,7 @@ void Cursor::setShape(GuiResourceId resourceId) { colorMapping[1] = _screen->getColorWhite(); // White is also hardcoded colorMapping[2] = SCI_CURSOR_SCI0_TRANSPARENCYCOLOR; colorMapping[3] = _palette->matchColor(&_palette->_sysPalette, 170, 170, 170); // Grey - + // Seek to actual data resourceData += 4; @@ -190,7 +190,7 @@ void Cursor::setPosition(Common::Point pos) { Common::Point Cursor::getPosition() { Common::Point mousePos = g_system->getEventManager()->getMousePos(); - + if (_upscaledHires) { mousePos.x /= 2; mousePos.y /= 2; diff --git a/engines/sci/graphics/gfx.cpp b/engines/sci/graphics/gfx.cpp index c230371b42..018ec1fad9 100644 --- a/engines/sci/graphics/gfx.cpp +++ b/engines/sci/graphics/gfx.cpp @@ -352,7 +352,7 @@ void Gfx::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredF void Gfx::drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY) { View *view = getView(viewId); Common::Rect celRect; - + if (view) { celRect.left = leftPos; celRect.top = topPos; @@ -400,7 +400,7 @@ void Gfx::drawHiresCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, u Common::Rect celRect, curPortRect, clipRect, clipRectTranslated; Common::Point curPortPos; bool upscaledHiresHack = false; - + if (view) { if ((leftPos == 0) && (topPos == 0)) { // HACK: in kq6, we get leftPos&topPos == 0 SOMETIMES, that's why we need to get coordinates from upscaledHiresHandle @@ -542,7 +542,7 @@ void Gfx::PriorityBandsRecall() { } byte Gfx::CoordinateToPriority(int16 y) { - if (y < _priorityTop) + if (y < _priorityTop) return _priorityBands[_priorityTop]; if (y > _priorityBottom) return _priorityBands[_priorityBottom]; diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp index 38e30ff150..2f8b278534 100644 --- a/engines/sci/graphics/gui.cpp +++ b/engines/sci/graphics/gui.cpp @@ -829,7 +829,7 @@ Common::Point SciGui::getCursorPos() { void SciGui::moveCursor(Common::Point pos) { pos.y += _windowMgr->_picWind->rect.top; pos.x += _windowMgr->_picWind->rect.left; - + pos.y = CLIP<int16>(pos.y, _windowMgr->_picWind->rect.top, _windowMgr->_picWind->rect.bottom - 1); pos.x = CLIP<int16>(pos.x, _windowMgr->_picWind->rect.left, _windowMgr->_picWind->rect.right - 1); @@ -963,7 +963,7 @@ void SciGui::frameOut() { if (priority == -1) continue; - + // FIXME: This code doesn't currently work properly because of the way we set up the // view port. We are starting at 10 pixels from the top automatically. The offset should // be based on the plane's top in SCI32 instead. Here we would be adding 10 to 10 and @@ -989,16 +989,16 @@ void SciGui::frameOut() { //topPos += planeTop; // Theoretically, leftPos and topPos should be sane - // Apparently, sometimes they're not, therefore I'm adding some sanity checks here so that + // Apparently, sometimes they're not, therefore I'm adding some sanity checks here so that // the hack underneath does not try and draw cels outside the screen coordinates if (leftPos >= _screen->getWidth()) { continue; } - + if (topPos >= _screen->getHeight()) { continue; } - + if (viewId != 0xffff) drawCel(viewId, loopNo, celNo, leftPos, topPos, priority, 0); } diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index 0d591c3fa1..81e4dfa15a 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -68,7 +68,7 @@ void Portrait::init() { // height * width bitmap data // another animation count times bitmap header and data int32 fileSize = 0; - Common::SeekableReadStream *file = + Common::SeekableReadStream *file = SearchMan.createReadStreamForMember("actors/" + _resourceName + ".bin"); if (!file) { file = SearchMan.createReadStreamForMember(_resourceName + ".bin"); diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index c1cdf82139..07ee3c4639 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -33,7 +33,7 @@ namespace Sci { -Screen::Screen(ResourceManager *resMan, int16 width, int16 height, bool upscaledHires) : +Screen::Screen(ResourceManager *resMan, int16 width, int16 height, bool upscaledHires) : _resMan(resMan), _width(width), _height(height), _upscaledHires(upscaledHires) { _pixels = _width * _height; diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index 7552b11e96..aab44df0d3 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -86,7 +86,7 @@ void View::initData(GuiResourceId resourceId) { case kViewAmiga: // View-format Amiga (32 colors) case kViewVga: // View-format SCI1 // LoopCount:WORD MirrorMask:WORD Version:WORD PaletteOffset:WORD LoopOffset0:WORD LoopOffset1:WORD... - + _loopCount = _resourceData[0]; // bit 0x8000 of _resourceData[1] means palette is set if (_resourceData[1] & 0x40) diff --git a/engines/sci/graphics/windowmgr.cpp b/engines/sci/graphics/windowmgr.cpp index 08dfdffc39..374efb2b30 100644 --- a/engines/sci/graphics/windowmgr.cpp +++ b/engines/sci/graphics/windowmgr.cpp @@ -143,17 +143,17 @@ Window *WindowMgr::NewWindow(const Common::Rect &dims, const Common::Rect *resto pwnd->rect = dims; if (restoreRect) pwnd->restoreRect = *restoreRect; - + pwnd->wndStyle = style; pwnd->hSaved1 = pwnd->hSaved2 = NULL_REG; pwnd->bDrawn = false; if ((style & SCI_WINDOWMGR_STYLE_TRANSPARENT) == 0) pwnd->saveScreenMask = (priority == -1 ? SCI_SCREEN_MASK_VISUAL : SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY); - + if (title && (style & SCI_WINDOWMGR_STYLE_TITLE)) { pwnd->title = title; } - + r = dims; if ((style != SCI_WINDOWMGR_STYLE_USER) && !(style & SCI_WINDOWMGR_STYLE_NOFRAME)) { r.grow(1); @@ -165,23 +165,23 @@ Window *WindowMgr::NewWindow(const Common::Rect &dims, const Common::Rect *resto // FIXME: it seems as if shadows may result in the window getting moved one upwards // so that the shadow is visible (lsl5) - + pwnd->dims = r; const Common::Rect *wmprect = &_wmgrPort->rect; int16 oldtop = pwnd->dims.top; int16 oldleft = pwnd->dims.left; if (wmprect->top > pwnd->dims.top) pwnd->dims.moveTo(pwnd->dims.left, wmprect->top); - + if (wmprect->bottom < pwnd->dims.bottom) pwnd->dims.moveTo(pwnd->dims.left, wmprect->bottom - pwnd->dims.bottom + pwnd->dims.top); - + if (wmprect->right < pwnd->dims.right) pwnd->dims.moveTo(wmprect->right + pwnd->dims.left - pwnd->dims.right, pwnd->dims.top); - + if (wmprect->left > pwnd->dims.left) pwnd->dims.moveTo(wmprect->left, pwnd->dims.top); - + pwnd->rect.moveTo(pwnd->rect.left + pwnd->dims.left - oldleft, pwnd->rect.top + pwnd->dims.top - oldtop); if (restoreRect == 0) pwnd->restoreRect = pwnd->dims; @@ -192,7 +192,7 @@ Window *WindowMgr::NewWindow(const Common::Rect &dims, const Common::Rect *resto pwnd->restoreRect.bottom++; pwnd->restoreRect.right++; } - + if (draw) DrawWindow(pwnd); _gfx->SetPort((Port *)pwnd); @@ -218,7 +218,7 @@ void WindowMgr::DrawWindow(Window *pWnd) { _gfx->FillRect(pWnd->restoreRect, SCI_SCREEN_MASK_PRIORITY, 0, 15); } } - + // drawing frame,shadow and title if (!(wndStyle & SCI_WINDOWMGR_STYLE_USER)) { r = pWnd->dims; @@ -241,14 +241,14 @@ void WindowMgr::DrawWindow(Window *pWnd) { _text->Box(pWnd->title.c_str(), 1, r, SCI_TEXT_ALIGNMENT_CENTER, 0); _gfx->PenColor(oldcolor); } - + r = pWnd->dims; r.top += 9; } - + r.grow(-1); } - + if (!(wndStyle & SCI_WINDOWMGR_STYLE_TRANSPARENT)) _gfx->FillRect(r, SCI_SCREEN_MASK_VISUAL, pWnd->backClr); diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp index 0e84a34cfd..2cf47f00c3 100644 --- a/engines/sci/parser/vocabulary.cpp +++ b/engines/sci/parser/vocabulary.cpp @@ -126,7 +126,7 @@ bool Vocabulary::loadParserWords() { // First try to load the SCI0 vocab resource. Resource *resource = _resMan->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_MAIN_VOCAB), 0); - + if (!resource) { warning("SCI0: Could not find a main vocabulary, trying SCI01"); resource = _resMan->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_MAIN_VOCAB), 0); @@ -206,7 +206,7 @@ const char *Vocabulary::getAnyWordFromGroup(int group) { bool Vocabulary::loadSuffixes() { // Determine if we can find a SCI1 suffix vocabulary first Resource* resource = NULL; - + if (_vocabVersion == kVocabularySCI0) resource = _resMan->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_SUFFIX_VOCAB), 1); else @@ -245,12 +245,12 @@ bool Vocabulary::loadSuffixes() { void Vocabulary::freeSuffixes() { Resource* resource = NULL; - + if (_vocabVersion == kVocabularySCI0) resource = _resMan->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI0_SUFFIX_VOCAB), 0); else resource = _resMan->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SCI1_SUFFIX_VOCAB), 0); - + if (resource) _resMan->unlockResource(resource); diff --git a/engines/sci/parser/vocabulary.h b/engines/sci/parser/vocabulary.h index d624ccc3fb..5121a684a2 100644 --- a/engines/sci/parser/vocabulary.h +++ b/engines/sci/parser/vocabulary.h @@ -251,13 +251,13 @@ public: * Adds a new synonym to the list */ void addSynonym(synonym_t syn) { _synonyms.push_back(syn); } - + /** * Clears the list of synonyms */ void clearSynonyms() { _synonyms.clear(); } - - /** + + /** * Synonymizes a token list * Parameters: (ResultWordList &) words: The word list to synonymize */ diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index e4cd9b7d70..f67cfc878d 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -240,7 +240,7 @@ bool ResourceManager::loadFromWaveFile(Resource *res, Common::File &file) { error("Read %d bytes from %s but expected %d", really_read, res->id.toString().c_str(), res->size); res->status = kResStatusAllocated; - return true; + return true; } bool ResourceManager::loadFromAudioVolumeSCI11(Resource *res, Common::File &file) { @@ -341,7 +341,7 @@ void ResourceManager::loadResource(Resource *res) { return; } file->seek(res->file_offset, SEEK_SET); - + if (res->source->source_type == kSourceWave && loadFromWaveFile(res, *file)) return; @@ -1061,7 +1061,7 @@ void ResourceManager::readResourcePatches(ResourceSource *source) { } } } - + void ResourceManager::readWaveAudioPatches() { // Here we do check for SCI1.1+ so we can patch wav files in as audio resources Common::ArchiveMemberList files; diff --git a/engines/sci/resource.h b/engines/sci/resource.h index b20279ff3e..8c676c4b5c 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -274,7 +274,7 @@ public: ViewType getViewType() const { return _viewType; } const char *getMapVersionDesc() const { return versionDescription(_mapVersion); } const char *getVolVersionDesc() const { return versionDescription(_volVersion); } - + /** * Adds the appropriate GM patch from the Sierra MIDI utility as 4.pat, without * requiring the user to rename the file to 4.pat. Thus, the original Sierra @@ -326,7 +326,7 @@ protected: ResourceSource *addSource(ResourceSource *map, ResSourceType type, const char *filename, int number); - ResourceSource *addSource(ResourceSource *map, ResSourceType type, + ResourceSource *addSource(ResourceSource *map, ResSourceType type, const Common::FSNode *resFile, int number); /** @@ -418,7 +418,7 @@ protected: */ void readResourcePatches(ResourceSource *source); void processPatch(ResourceSource *source, ResourceType restype, int resnumber); - + /** * Process wave files as patches for Audio resources */ diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 37cb20acd3..7b6147c28c 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -109,7 +109,7 @@ Common::Error SciEngine::run() { } // Scale the screen, if needed - bool upscaledHires = (!strcmp(getGameID(), "kq6") + bool upscaledHires = (!strcmp(getGameID(), "kq6") #ifdef ENABLE_SCI32 || getSciVersion() == SCI_VERSION_2 #endif @@ -121,7 +121,7 @@ Common::Error SciEngine::run() { // Initialize graphics-related parts Screen *screen = 0; - + #ifdef ENABLE_SCI32 if (getSciVersion() >= SCI_VERSION_2_1) screen = new Screen(_resMan, 640, 480, false); // invokes initGraphics() diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index e350e3dba2..306cb0df46 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -296,7 +296,7 @@ int AudioPlayer::audioCdPlay(int track, int start, int duration) { if (getSciVersion() == SCI_VERSION_1_1) { // King's Quest VI CD Audio format _audioCdStart = g_system->getMillis(); - + // Subtract one from track. KQ6 starts at track 1, while ScummVM // ignores the data track and considers track 2 to be track 1. AudioCD.play(track - 1, 1, start, duration); @@ -306,11 +306,11 @@ int AudioPlayer::audioCdPlay(int track, int start, int duration) { uint32 length = 0; audioCdStop(); - + Common::File audioMap; if(!audioMap.open("cdaudio.map")) error("Could not open cdaudio.map"); - + while (audioMap.pos() < audioMap.size()) { uint16 res = audioMap.readUint16LE(); uint32 startFrame = audioMap.readUint16LE(); @@ -327,7 +327,7 @@ int AudioPlayer::audioCdPlay(int track, int start, int duration) { break; } } - + audioMap.close(); return length * 60 / 75; // return sample length in ticks @@ -347,7 +347,7 @@ int AudioPlayer::audioCdPosition() { // Return -1 if the sample is done playing. Converting to frames to compare. if (((g_system->getMillis() - _audioCdStart) * 75 / 1000) >= (uint32)AudioCD.getStatus().duration) return -1; - + // Return the position otherwise (in ticks). return (g_system->getMillis() - _audioCdStart) * 60 / 1000; } diff --git a/engines/sci/sound/audio.h b/engines/sci/sound/audio.h index bfd268e30f..bab7dbb969 100644 --- a/engines/sci/sound/audio.h +++ b/engines/sci/sound/audio.h @@ -62,7 +62,7 @@ class AudioPlayer { public: AudioPlayer(ResourceManager *resMan); ~AudioPlayer(); - + void setAudioRate(uint16 rate) { _audioRate = rate; } Audio::SoundHandle *getAudioHandle() { return &_audioHandle; } Audio::RewindableAudioStream *getAudioStream(uint32 number, uint32 volume, int *sampleLen); diff --git a/engines/sci/sound/iterator/core.cpp b/engines/sci/sound/iterator/core.cpp index c2c110a121..95fc713ba1 100644 --- a/engines/sci/sound/iterator/core.cpp +++ b/engines/sci/sound/iterator/core.cpp @@ -529,7 +529,7 @@ void SfxState::updateSingleSong() { } debugC(2, kDebugLevelSound, "%s", debugMessage.c_str()); - + _song = newsong; thawTime(); /* Recover song delay time */ @@ -556,7 +556,7 @@ void SfxState::updateMultiSong() { // WORKAROUND: sometimes, newsong can be NULL (e.g. in SQ4). // Handle this here, so that we avoid a crash - if (!newsong) { + if (!newsong) { // Iterators should get freed when there's only one song left playing if(oldfirst && oldfirst->_status == SOUND_STATUS_STOPPED) { debugC(2, kDebugLevelSound, "[SFX] Stopping song %lx\n", oldfirst->_handle); @@ -579,7 +579,7 @@ void SfxState::updateMultiSong() { oldseeker->_nextStopping = oldseeker->_nextPlaying; oldseeker->_nextPlaying = ¬_playing_anymore; - if (oldseeker == oldseeker->_nextPlaying) { + if (oldseeker == oldseeker->_nextPlaying) { error("updateMultiSong() failed. Breakpoint in %s, line %d", __FILE__, __LINE__); } } @@ -588,7 +588,7 @@ void SfxState::updateMultiSong() { for (newseeker = newsong; newseeker; newseeker = newseeker->_nextPlaying) { newseeker->_nextPlaying = _songlib.findNextActive(newseeker); - if (newseeker == newseeker->_nextPlaying) { + if (newseeker == newseeker->_nextPlaying) { error("updateMultiSong() failed. Breakpoint in %s, line %d", __FILE__, __LINE__); } } diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index 6af0597027..3e806f06b1 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -229,7 +229,7 @@ void SciMusic::soundPlay(MusicEntry *pSnd) { _playList.push_back(pSnd); sortPlayList(); } - + _mutex.unlock(); // unlock to perform mixer-related calls if (pSnd->pStreamAud && !_pMixer->isSoundHandleActive(pSnd->hCurrentAud)) { @@ -371,7 +371,7 @@ void SciMusic::printPlayList(Console *con) { for (uint32 i = 0; i < _playList.size(); i++) { MusicEntry *song = _playList[i]; - con->DebugPrintf("%d: %04x:%04x, resource id: %d, status: %s, %s type\n", i, + con->DebugPrintf("%d: %04x:%04x, resource id: %d, status: %s, %s type\n", i, PRINT_REG(song->soundObj), song->resnum, musicStatus[song->status], song->pMidiParser ? "MIDI" : "digital audio"); } @@ -405,7 +405,7 @@ void SciMusic::printSongInfo(reg_t obj, Console *con) { con->DebugPrintf("Sound resource information:\n"); SoundResource::Track *track = song->soundRes->getTrackByType(_pMidiDrv->getPlayId(_soundVersion)); if (track && track->digitalChannelNr != -1) { - con->DebugPrintf("Sample size: %d, sample rate: %d, channels: %d, digital channel number: %d\n", + con->DebugPrintf("Sample size: %d, sample rate: %d, channels: %d, digital channel number: %d\n", track->digitalSampleSize, track->digitalSampleRate, track->channelCount, track->digitalChannelNr); } } diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h index 39b6ad0d74..79eb72fc81 100644 --- a/engines/sci/sound/music.h +++ b/engines/sci/sound/music.h @@ -126,7 +126,7 @@ public: typedef Common::Array<MusicEntry *> MusicList; -class SciMusic +class SciMusic #ifndef USE_OLD_MUSIC_FUNCTIONS : public Common::Serializable #endif diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index dcf4b33553..74b44953fb 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -126,7 +126,7 @@ void process_sound_events(EngineState *s) { /* Get all sound events, apply their } #endif -SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, AudioPlayer *audio, SciVersion soundVersion) : +SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, AudioPlayer *audio, SciVersion soundVersion) : _resMan(resMan), _segMan(segMan), _kernel(kernel), _audio(audio), _soundVersion(soundVersion) { #ifdef USE_OLD_MUSIC_FUNCTIONS @@ -223,7 +223,7 @@ reg_t SoundCommandParser::parseCommand(int argc, reg_t *argv, reg_t acc) { if (argc == 6) { // cmdSendMidi byte channel = argv[2].toUint16() & 0xf; byte midiCmd = argv[3].toUint16() & 0xff; - + uint16 controller = argv[4].toUint16(); uint16 param = argv[5].toUint16(); @@ -531,7 +531,7 @@ void SoundCommandParser::cmdPauseSound(reg_t obj, int16 value) { #else if (!obj.segment) { // pause the whole playlist - // Pausing/Resuming the whole playlist was introduced + // Pausing/Resuming the whole playlist was introduced // in the SCI1 late sound scheme if (_soundVersion <= SCI_VERSION_1_EARLY) return; @@ -659,7 +659,7 @@ void SoundCommandParser::cmdFadeSound(reg_t obj, int16 value) { break; case 5: // SCI01+ - case 6: // SCI1+ (SCI1 late sound scheme), with fade and continue + case 6: // SCI1+ (SCI1 late sound scheme), with fade and continue musicSlot->fadeTo = CLIP<uint16>(_argv[2].toUint16(), 0, MUSIC_VOLUME_MAX); musicSlot->fadeStep = volume > _argv[2].toUint16() ? -_argv[4].toUint16() : _argv[4].toUint16(); musicSlot->fadeTickerStep = _argv[3].toUint16() * 16667 / _music->soundGetTempo(); @@ -917,7 +917,7 @@ void SoundCommandParser::cmdSetSoundVolume(reg_t obj, int16 value) { #ifndef USE_OLD_MUSIC_FUNCTIONS MusicEntry *musicSlot = _music->getSlot(obj); if (!musicSlot) { - // Do not throw a warning if the sound can't be found, as in some games + // Do not throw a warning if the sound can't be found, as in some games // this is called before the actual sound is loaded (e.g. SQ4CD, with the // drum sounds of the energizer bunny at the beginning), so this is normal // behavior diff --git a/engines/sci/video/seq_decoder.cpp b/engines/sci/video/seq_decoder.cpp index 9a14a6b408..ef2622704d 100644 --- a/engines/sci/video/seq_decoder.cpp +++ b/engines/sci/video/seq_decoder.cpp @@ -134,7 +134,7 @@ bool SeqDecoder::decodeNextFrame() { if (frameType == kSeqFrameFull) { byte *dst = _videoFrameBuffer + frameTop * SCREEN_WIDTH + frameLeft; - + byte *linebuf = new byte[frameWidth]; do { |