diff options
author | Kamil Zbróg | 2013-11-11 12:03:44 +0000 |
---|---|---|
committer | Kamil Zbróg | 2013-11-11 12:03:44 +0000 |
commit | 8cffaaaff303773d1da48c9756e616937f2eb5d0 (patch) | |
tree | 0209ccab77f20fc5d69eefe045b7ef70a7cc1a63 | |
parent | 87e2229df264c36dd2809eb85544b9377e0ddfd5 (diff) | |
parent | a45cc2fb20431768ea408be079ea6964b242ac86 (diff) | |
download | scummvm-rg350-8cffaaaff303773d1da48c9756e616937f2eb5d0.tar.gz scummvm-rg350-8cffaaaff303773d1da48c9756e616937f2eb5d0.tar.bz2 scummvm-rg350-8cffaaaff303773d1da48c9756e616937f2eb5d0.zip |
Merge remote-tracking branch 'sync/master' into prince-malik
37 files changed, 445 insertions, 455 deletions
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp index ae4dee6090..5325558f8b 100644 --- a/engines/cge/cge_main.cpp +++ b/engines/cge/cge_main.cpp @@ -1046,7 +1046,7 @@ void CGEEngine::loadSprite(const char *fname, int ref, int scene, int col = 0, i for (line = sprf.readLine(); !sprf.eos(); line = sprf.readLine()) { len = line.size(); lcnt++; - strcpy(tmpStr, line.c_str()); + Common::strlcpy(tmpStr, line.c_str(), sizeof(tmpStr)); if (len == 0 || *tmpStr == '.') continue; @@ -1132,7 +1132,7 @@ void CGEEngine::loadSprite(const char *fname, int ref, int scene, int col = 0, i _sprite->_flags._bDel = true; // Extract the filename, without the extension - strcpy(_sprite->_file, fname); + Common::strlcpy(_sprite->_file, fname, sizeof(_sprite->_file)); char *p = strchr(_sprite->_file, '.'); if (p) *p = '\0'; @@ -1158,7 +1158,7 @@ void CGEEngine::loadScript(const char *fname) { char *p; lcnt++; - strcpy(tmpStr, line.c_str()); + Common::strlcpy(tmpStr, line.c_str(), sizeof(tmpStr)); if ((line.size() == 0) || (*tmpStr == '.')) continue; diff --git a/engines/cge/text.cpp b/engines/cge/text.cpp index 27bb0608fd..08ff005e1e 100644 --- a/engines/cge/text.cpp +++ b/engines/cge/text.cpp @@ -69,7 +69,7 @@ int16 Text::count() { for (line = tf.readLine(); !tf.eos(); line = tf.readLine()) { char *s; assert(line.size() <= 513); - strcpy(tmpStr, line.c_str()); + Common::strlcpy(tmpStr, line.c_str(), sizeof(tmpStr)); if ((s = strtok(tmpStr, " =,;/\t\n")) == NULL) continue; if (!Common::isDigit(*s)) @@ -101,8 +101,7 @@ void Text::load() { for (idx = 0, line = tf.readLine(); !tf.eos(); line = tf.readLine()) { int n = line.size(); char *s; - assert(n <= 513); - strcpy(tmpStr, line.c_str()); + Common::strlcpy(tmpStr, line.c_str(), sizeof(tmpStr)); if ((s = strtok(tmpStr, " =,;/\t\n")) == NULL) continue; if (!Common::isDigit(*s)) diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp index c0407cab42..4954e638ab 100644 --- a/engines/cge/vga13h.cpp +++ b/engines/cge/vga13h.cpp @@ -214,8 +214,7 @@ Sprite *Sprite::expand() { for (line = sprf.readLine(); !sprf.eos(); line = sprf.readLine()) { len = line.size(); - assert(len <= 513); - strcpy(tmpStr, line.c_str()); + Common::strlcpy(tmpStr, line.c_str(), sizeof(tmpStr)); lcnt++; if (len == 0 || *tmpStr == '.') continue; diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index 5746568e4e..010f3883b0 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -144,8 +144,6 @@ public: bool loadSpeech(const Common::String &filename); - void enableSavingOrLoading(bool enable = true) { _enableSavingOrLoading = enable; } - Common::Language getLanguage() const; uint8 modifyChar(uint8 c) const; Common::String modifyFileName(const char *); @@ -171,7 +169,6 @@ private: uint _speed; bool _turbo; uint _oldMouseState; - bool _enableSavingOrLoading; protected: GameVars _vars; // saved variables diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 2c61330ea1..ffa23cd071 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -1146,7 +1146,7 @@ int MovGraph2::findLink(Common::Array<MovGraphLink *> *linkList, int idx, Common } else if (idx != (int)(linkList->size() - 1)) { MovGraphLink *lnk = (*linkList)[idx + 1]; - if (lnk->_movGraphNode1 == node1 || lnk->_movGraphNode1 == node1) { + if (lnk->_movGraphNode2 == node1 || lnk->_movGraphNode1 == node1) { node3 = node2; node2 = node1; } else if (lnk->_movGraphNode2 == node2 || lnk->_movGraphNode1 == node2) { diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 7da0c47fb2..b79e66decb 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -87,7 +87,7 @@ class MctlCompoundArrayItem : public CObject { int _field_28; public: - MctlCompoundArrayItem() : _movGraphReactObj(0) {} + MctlCompoundArrayItem() : _movGraphReactObj(0), _motionControllerObj(0), _field_20(0), _field_24(0), _field_28(0) {} }; class MctlCompoundArray : public Common::Array<MctlCompoundArrayItem *>, public CObject { diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index e281b9bbfb..445259c8f5 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -1219,6 +1219,9 @@ Movement::Movement(Movement *src, int *oldIdxs, int newSize, StaticANIObject *an _currDynamicPhaseIndex = 0; _field_94 = 0; + _field_24 = 0; + _field_28 = 0; + _field_50 = src->_field_50; _flipFlag = src->_flipFlag; _currMovement = 0; diff --git a/engines/kyra/chargen.cpp b/engines/kyra/chargen.cpp index 80a95da047..80ff42e2c5 100644 --- a/engines/kyra/chargen.cpp +++ b/engines/kyra/chargen.cpp @@ -155,8 +155,10 @@ CharacterGenerator::~CharacterGenerator() { } bool CharacterGenerator::start(EoBCharacter *characters, uint8 ***faceShapes) { - if (!characters && !faceShapes) + if (!characters || !faceShapes) { + warning("CharacterGenerator::start: Called without character data"); return true; + } _characters = characters; _faceShapes = *faceShapes; diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp index cc7d526ffe..23eb94cb53 100644 --- a/engines/kyra/screen_v2.cpp +++ b/engines/kyra/screen_v2.cpp @@ -280,7 +280,7 @@ void Screen_v2::setTextColorMap(const uint8 *cmap) { void Screen_v2::wsaFrameAnimationStep(int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim) { - if (!(w1 || h1 || w2 || h2)) + if (!w1 || !h1 || !w2 || !h2) return; ScreenDim cdm = *getScreenDim(dim); diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index af741a1ebe..e4752f33de 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -225,6 +225,7 @@ void SoundTowns::playSoundEffect(uint8 track, uint8) { _driver->chanPanPos(_sfxChannel, 0x40); _driver->chanPitch(_sfxChannel, 0); _driver->playSoundEffect(_sfxChannel, note, 127, sfxPlaybackBuffer); + delete[] sfxPlaybackBuffer; } void SoundTowns::updateVolumeSettings() { diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp index 9eb4e129c0..480b4381ef 100644 --- a/engines/mortevielle/mouse.cpp +++ b/engines/mortevielle/mouse.cpp @@ -38,9 +38,7 @@ namespace Mortevielle { * @remarks Originally called 'init_mouse' */ void MouseHandler::initMouse() { - _counter = 0; _pos = Common::Point(0, 0); - _vm->setMouseClick(false); } diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h index 594031d816..90d1ef310e 100644 --- a/engines/mortevielle/mouse.h +++ b/engines/mortevielle/mouse.h @@ -36,8 +36,6 @@ class MortevielleEngine; class MouseHandler { private: MortevielleEngine *_vm; - - int _counter; public: Common::Point _pos; diff --git a/engines/tsage/blue_force/blueforce_scenes4.h b/engines/tsage/blue_force/blueforce_scenes4.h index d6d795a44e..895970e4ee 100644 --- a/engines/tsage/blue_force/blueforce_scenes4.h +++ b/engines/tsage/blue_force/blueforce_scenes4.h @@ -119,7 +119,7 @@ public: int _action1Count, _talkCount, _field1FBA; int _cuffedDriverFl, _field1FBE; int _field1FC0; - int _field1FC2, _harrisonMovedFl; + int _field1FC2, _harrisonMovedFl; Scene410(); virtual void postInit(SceneObjectList *OwnerList = NULL); diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index 5a4310228d..2298d28e0d 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -727,10 +727,10 @@ void StripManager::synchronize(Serializer &s) { } void StripManager::remove() { - if (g_vm->getGameID() == GType_Ringworld2) { + if (g_vm->getGameID() == GType_Ringworld2) { for (uint i = 0; i < _speakerList.size(); ++i) { if (_activeSpeaker != _speakerList[i]) - _speakerList[i]->proc16(); + _speakerList[i]->stopSpeaking(); } } @@ -741,7 +741,7 @@ void StripManager::remove() { } if (_activeSpeaker) { - if (g_vm->getGameID() == GType_Ringworld2) + if (g_vm->getGameID() == GType_Ringworld2) static_cast<Ringworld2::VisualSpeaker *>(_activeSpeaker)->_speakerMode = 0xff; _activeSpeaker->remove(); } @@ -822,7 +822,7 @@ void StripManager::signal() { break; } } - + _field2E8 = obj44._id; Common::StringArray choiceList; @@ -836,7 +836,7 @@ void StripManager::signal() { int f16Index = _lookupList[obj44._field16[0] - 1]; int entryId = obj44._field16[f16Index]; - Obj0A &entry = obj44._list[idx]; + Obj0A &entry = obj44._list[idx]; if (entry._id == entryId) { // Get the next one choiceList.push_back((const char *)&_script[0] + entry._scriptOffset); @@ -864,7 +864,7 @@ void StripManager::signal() { // Get the next one const char *choiceStr = (const char *)&_script[0] + obj44._list[idx]._scriptOffset; - + if (!*choiceStr) { // Choice is empty assert(g_vm->getGameID() == GType_Ringworld2); @@ -872,7 +872,7 @@ void StripManager::signal() { if (obj44._list[1]._id) { // it's a reference to another list slot int listId = obj44._list[idx]._id; - + int obj44Idx = 0; while (_obj44List[obj44Idx]._id != listId) ++obj44Idx; @@ -882,7 +882,7 @@ void StripManager::signal() { // seems to be set to the R2_GLOBALS._stripManager_lookupList, so manually set it if (!_lookupList) _lookupList = R2_GLOBALS._stripManager_lookupList; - + int f16Index = _lookupList[_obj44List[obj44Idx]._field16[0] - 1]; listId = _obj44List[obj44Idx]._field16[f16Index]; @@ -948,11 +948,11 @@ void StripManager::signal() { if (g_vm->getGameID() == GType_Ringworld2) { Ringworld2::VisualSpeaker *speaker = static_cast<Ringworld2::VisualSpeaker *>(_activeSpeaker); - + if (speaker) { speaker->_speakerMode = obj44._speakerMode; if (!choiceList[strIndex].empty()) - speaker->proc15(); + speaker->animateSpeaker(); } if (!choiceList[strIndex].empty()) { @@ -962,7 +962,7 @@ void StripManager::signal() { _delayFrames = 1; } else { _delayFrames = 0; - speaker->proc15(); + speaker->animateSpeaker(); } } else { _textShown = true; diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h index 7e57199d2f..e7b8e811ca 100644 --- a/engines/tsage/converse.h +++ b/engines/tsage/converse.h @@ -94,7 +94,7 @@ public: virtual void startSpeaking(Action *action); virtual void setText(const Common::String &msg); virtual void removeText(); - virtual void proc16() {} + virtual void stopSpeaking() {} void setTextPos(const Common::Point &pt) { _textPos = pt; } }; diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index fd36d4fb01..877d866c3c 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1800,7 +1800,7 @@ void SceneItem::display(int resNum, int lineNum, ...) { g_globals->_sceneText.remove(); } - if ((g_vm->getGameID() != GType_Ringworld) && (g_vm->getGameID() != GType_Ringworld2) + if ((g_vm->getGameID() != GType_Ringworld) && (g_vm->getGameID() != GType_Ringworld2) && T2_GLOBALS._uiElements._active) { // Show user interface T2_GLOBALS._uiElements.show(); @@ -2511,7 +2511,7 @@ void SceneObject::postInit(SceneObjectList *OwnerList) { if (!OwnerList) OwnerList = g_globals->_sceneObjects; - bool isExisting = OwnerList->contains(this); + bool isExisting = OwnerList->contains(this); if (!isExisting || ((_flags & OBJFLAG_REMOVE) != 0)) { _percent = 100; _priority = 255; @@ -2708,7 +2708,7 @@ GfxSurface SceneObject::getFrame() { Graphics::Surface s = frame.lockSurface(); byte *p = (byte *)s.getPixels(); byte *endP = p + s.w * s.h; - + while (p < endP) { if (*p != frame._transColor) *p = R2_GLOBALS._fadePaletteMap[_shade - 1][*p]; @@ -2742,8 +2742,8 @@ void SceneObject::draw() { switch (_effect) { case EFFECT_SHADOW_MAP: { assert(_shadowMap); - - GLOBALS.gfxManager().getSurface().copyFrom(frame, frame.getBounds(), + + GLOBALS.gfxManager().getSurface().copyFrom(frame, frame.getBounds(), destRect, priorityRegion, _shadowMap); return; } @@ -2859,7 +2859,7 @@ void BackgroundSceneObject::setup2(int visage, int stripFrameNum, int frameNum, void BackgroundSceneObject::copySceneToBackground() { GLOBALS._sceneManager._scene->_backSurface.copyFrom(g_globals->gfxManager().getSurface(), 0, 0); - // WORKAROUND: Since savegames don't store the active screen data, once we copy the + // WORKAROUND: Since savegames don't store the active screen data, once we copy the // foreground objects to the background, we have to prevent the scene being saved. if (g_vm->getGameID() == GType_Ringworld2) ((Ringworld2::SceneExt *)GLOBALS._sceneManager._scene)->_preventSaving = true; @@ -4346,7 +4346,7 @@ void SceneHandler::process(Event &event) { // Scan the item list to find one the mouse is within SynchronizedList<SceneItem *>::iterator i; for (i = g_globals->_sceneItems.begin(); i != g_globals->_sceneItems.end(); ++i) { - SceneItem *item = *i; + SceneItem *item = *i; if (item->contains(event.mousePos)) { // Pass the action to the item bool handled = item->startAction(g_globals->_events.getCursor(), event); diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index 82645f2d62..c7da5f5d30 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -632,57 +632,57 @@ bool Ringworld2Debugger::Cmd_ListObjects(int argc, const char **argv) { DebugPrintf("Available objects for this game are:\n"); DebugPrintf("1 - R2_OPTO_DISK\n"); - DebugPrintf("2 - R2_2\n"); + DebugPrintf("2 - R2_READER\n"); DebugPrintf("3 - R2_NEGATOR_GUN\n"); DebugPrintf("4 - R2_STEPPING_DISKS\n"); - DebugPrintf("5 - R2_5\n"); - DebugPrintf("6 - R2_6\n"); - DebugPrintf("7 - R2_7\n"); - DebugPrintf("8 - R2_8\n"); - DebugPrintf("9 - R2_9\n"); - DebugPrintf("10 - R2_10\n"); - DebugPrintf("11 - R2_11\n"); - DebugPrintf("12 - R2_12\n"); - DebugPrintf("13 - R2_13\n"); - DebugPrintf("14 - R2_14\n"); - DebugPrintf("15 - R2_15\n"); - DebugPrintf("16 - R2_16\n"); - DebugPrintf("17 - R2_17\n"); - DebugPrintf("18 - R2_18\n"); - DebugPrintf("19 - R2_19\n"); - DebugPrintf("20 - R2_20\n"); - DebugPrintf("21 - R2_21\n"); - DebugPrintf("22 - R2_22\n"); - DebugPrintf("23 - R2_23\n"); - DebugPrintf("24 - R2_24\n"); - DebugPrintf("25 - R2_25\n"); - DebugPrintf("26 - R2_26\n"); - DebugPrintf("27 - R2_27\n"); - DebugPrintf("28 - R2_28\n"); - DebugPrintf("29 - R2_29\n"); - DebugPrintf("30 - R2_30\n"); - DebugPrintf("31 - R2_31\n"); - DebugPrintf("32 - R2_32\n"); - DebugPrintf("33 - R2_33\n"); - DebugPrintf("34 - R2_34\n"); - DebugPrintf("35 - R2_35\n"); - DebugPrintf("36 - R2_36\n"); - DebugPrintf("37 - R2_37\n"); - DebugPrintf("38 - R2_38\n"); - DebugPrintf("39 - R2_39\n"); - DebugPrintf("40 - R2_40\n"); - DebugPrintf("41 - R2_41\n"); - DebugPrintf("42 - R2_42\n"); - DebugPrintf("43 - R2_43\n"); - DebugPrintf("44 - R2_44\n"); - DebugPrintf("45 - R2_45\n"); - DebugPrintf("46 - R2_46\n"); - DebugPrintf("47 - R2_47\n"); - DebugPrintf("48 - R2_48\n"); - DebugPrintf("49 - R2_49\n"); - DebugPrintf("50 - R2_50\n"); - DebugPrintf("51 - R2_51\n"); - DebugPrintf("52 - R2_52\n"); + DebugPrintf("5 - R2_ATTRACTOR_UNIT\n"); + DebugPrintf("6 - R2_SENSOR_PROBE\n"); + DebugPrintf("7 - R2_SONIC_STUNNER\n"); + DebugPrintf("8 - R2_CABLE_HARNESS\n"); + DebugPrintf("9 - R2_COM_SCANNER\n"); + DebugPrintf("10 - R2_SPENT_POWER_CAPSULE\n"); + DebugPrintf("11 - R2_CHARGED_POWER_CAPSULE\n"); + DebugPrintf("12 - R2_AEROSOL\n"); + DebugPrintf("13 - R2_REMOTE_CONTROL\n"); + DebugPrintf("14 - R2_OPTICAL_FIBRE\n"); + DebugPrintf("15 - R2_CLAMP\n"); + DebugPrintf("16 - R2_ATTRACTOR_CABLE_HARNESS\n"); + DebugPrintf("17 - R2_FUEL_CELL\n"); + DebugPrintf("18 - R2_GYROSCOPE\n"); + DebugPrintf("19 - R2_AIRBAG\n"); + DebugPrintf("20 - R2_REBREATHER_TANK\n"); + DebugPrintf("21 - R2_RESERVE_REBREATHER_TANK\n"); + DebugPrintf("22 - R2_GUIDANCE_MODULE\n"); + DebugPrintf("23 - R2_THRUSTER_VALVE\n"); + DebugPrintf("24 - R2_BALLOON_BACKPACK\n"); + DebugPrintf("25 - R2_RADAR_MECHANISM\n"); + DebugPrintf("26 - R2_JOYSTICK\n"); + DebugPrintf("27 - R2_IGNITOR\n"); + DebugPrintf("28 - R2_DIAGNOSTICS_DISPLAY\n"); + DebugPrintf("29 - R2_GLASS_DOME\n"); + DebugPrintf("30 - R2_WICK_LAMP\n"); + DebugPrintf("31 - R2_SCRITH_KEY\n"); + DebugPrintf("32 - R2_TANNER_MASK\n"); + DebugPrintf("33 - R2_PURE_GRAIN_ALCOHOL\n"); + DebugPrintf("34 - R2_SAPPHIRE_BLUE\n"); + DebugPrintf("35 - R2_ANCIENT_SCROLLS\n"); + DebugPrintf("36 - R2_FLUTE\n"); + DebugPrintf("37 - R2_GUNPOWDER\n"); + DebugPrintf("38 - R2_NONAME\n"); + DebugPrintf("39 - R2_COM_SCANNER_2\n"); + DebugPrintf("40 - R2_SUPERCONDUCTOR_WIRE\n"); + DebugPrintf("41 - R2_PILLOW\n"); + DebugPrintf("42 - R2_FOOD_TRAY\n"); + DebugPrintf("43 - R2_LASER_HACKSAW\n"); + DebugPrintf("44 - R2_PHOTON_STUNNER\n"); + DebugPrintf("45 - R2_BATTERY\n"); + DebugPrintf("46 - R2_SOAKED_FACEMASK\n"); + DebugPrintf("47 - R2_LIGHT_BULB\n"); + DebugPrintf("48 - R2_ALCOHOL_LAMP\n"); + DebugPrintf("49 - R2_ALCOHOL_LAMP_2\n"); + DebugPrintf("50 - R2_ALCOHOL_LAMP_3\n"); + DebugPrintf("51 - R2_BROKEN_DISPLAY\n"); + DebugPrintf("52 - R2_TOOLBOX\n"); return true; } diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 6540f4dccc..768c51ca16 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -3,7 +3,7 @@ * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -414,6 +414,15 @@ Ringworld2Globals::Ringworld2Globals() { _scannerDialog = new ScannerDialog(); _speechSubtitles = SPEECH_TEXT; + // Register the inner sound objects for each of the global ASoundExt fields. + // Normally the ASound constructor would do this, but because they're fields + // of the globals, the g_globals reference isn't ready for them to use + _sounds.push_back(&_sound1); + _sounds.push_back(&_sound2); + _sounds.push_back(&_sound3); + _sounds.push_back(&_sound4); + + // Initialize fields _stripModifier = 0; _flubMazeArea = 1; _flubMazeEntryDirection = 0; @@ -500,7 +509,7 @@ void Ringworld2Globals::reset() { _spillLocation[12] = 27; _spillLocation[13] = 31; - // Initialise the vampire data within the Flub maze + // Initialize the vampire data within the Flub maze for (int i = 0; i < 18; i++) { _vampireData[i]._isAlive = true; _vampireData[i]._position = Common::Point(); diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index f00dcf0378..595c43a0bf 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -560,9 +560,9 @@ static GfxSurface ResizeSurface(GfxSurface &src, int xSize, int ySize, int trans /** * Copys an area from one GfxSurface to another. - * + * */ -void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, +void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Region *priorityRegion, const byte *shadowMap) { GfxSurface srcImage; if (srcBounds.isEmpty()) @@ -814,8 +814,8 @@ void GfxElement::drawFrame() { // Draw the edge frame // Outer frame border - surface.hLine(tempRect.left + 2, tempRect.top, tempRect.right - 2, 0); - surface.hLine(tempRect.left + 2, tempRect.bottom, tempRect.right - 2, 0); + surface.hLine(tempRect.left + 2, tempRect.top, tempRect.right - 2, 0); + surface.hLine(tempRect.left + 2, tempRect.bottom, tempRect.right - 2, 0); surface.vLine(tempRect.left, tempRect.top + 2, tempRect.bottom - 2, 0); surface.vLine(tempRect.right, tempRect.top + 2, tempRect.bottom - 2, 0); *((byte *)surface.getBasePtr(tempRect.left + 1, tempRect.top + 1)) = 0; @@ -824,8 +824,8 @@ void GfxElement::drawFrame() { *((byte *)surface.getBasePtr(tempRect.right - 1, tempRect.bottom - 1)) = 0; // Inner frame border - surface.hLine(tempRect.left + 2, tempRect.top + 1, tempRect.right - 2, R2_GLOBALS._frameEdgeColor); - surface.hLine(tempRect.left + 2, tempRect.bottom - 1, tempRect.right - 2, R2_GLOBALS._frameEdgeColor); + surface.hLine(tempRect.left + 2, tempRect.top + 1, tempRect.right - 2, R2_GLOBALS._frameEdgeColor); + surface.hLine(tempRect.left + 2, tempRect.bottom - 1, tempRect.right - 2, R2_GLOBALS._frameEdgeColor); surface.vLine(tempRect.left + 1, tempRect.top + 2, tempRect.bottom - 2, R2_GLOBALS._frameEdgeColor); surface.vLine(tempRect.right - 1, tempRect.top + 2, tempRect.bottom - 2, R2_GLOBALS._frameEdgeColor); *((byte *)surface.getBasePtr(tempRect.left + 2, tempRect.top + 2)) = R2_GLOBALS._frameEdgeColor; @@ -1079,16 +1079,9 @@ bool GfxButton::process(Event &event) { GfxDialog::GfxDialog() { _savedArea = NULL; _defaultButton = NULL; - - // For Return to Ringworld 2, backup palette when showing a dialog - if (g_vm->getGameID() == GType_Ringworld2) - g_system->getPaletteManager()->grabPalette(&_savedPalette[0], 0, 256); } GfxDialog::~GfxDialog() { - if (g_vm->getGameID() == GType_Ringworld2) - g_system->getPaletteManager()->setPalette(&_savedPalette[0], 0, 256); - remove(); } diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h index d31bac0738..858731a1ac 100644 --- a/engines/tsage/graphics.h +++ b/engines/tsage/graphics.h @@ -105,7 +105,7 @@ public: void setBounds(const Rect &bounds) { _bounds = bounds; } const Rect &getBounds() const { return _bounds; } - void copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, + void copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Region *priorityRegion = NULL, const byte *shadowMap = NULL); void copyFrom(GfxSurface &src, Rect destBounds, Region *priorityRegion = NULL) { copyFrom(src, src.getBounds(), destBounds, priorityRegion); @@ -321,7 +321,6 @@ public: GfxElementList _elements; GfxButton *_defaultButton; GfxSurface *_savedArea; - byte _savedPalette[256 * 3]; public: GfxDialog(); virtual ~GfxDialog(); diff --git a/engines/tsage/ringworld/ringworld_scenes5.cpp b/engines/tsage/ringworld/ringworld_scenes5.cpp index 725370c8a4..1b6cd78223 100644 --- a/engines/tsage/ringworld/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld/ringworld_scenes5.cpp @@ -35,7 +35,7 @@ namespace Ringworld { * *--------------------------------------------------------------------------*/ Scene4000::Hotspot8::Hotspot8() : SceneObject() { - _ctr = 0; + _ctr = 0; } void Scene4000::Action1::signal() { diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.cpp b/engines/tsage/ringworld2/ringworld2_dialogs.cpp index 7c97aa041c..12147f7ee5 100644 --- a/engines/tsage/ringworld2/ringworld2_dialogs.cpp +++ b/engines/tsage/ringworld2/ringworld2_dialogs.cpp @@ -234,7 +234,7 @@ void CharacterDialog::show() { SceneExt *scene = (SceneExt *)R2_GLOBALS._sceneManager._scene; scene->saveCharacter(oldCharacter); - // Play the correctfrequency, if any, of the character being switched to's scanner device + // Play the correctfrequency, if any, of the character being switched to's scanner device if (R2_GLOBALS._player._characterScene[R2_NONE] != 300) { switch (R2_GLOBALS._scannerFrequencies[R2_GLOBALS._player._characterIndex] - 1) { case 0: diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index b495a7e052..8f01a34cc4 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -389,7 +389,7 @@ void SceneExt::remove() { Scene::remove(); R2_GLOBALS._uiElements._active = true; - if (R2_GLOBALS._events.getCursor() >= EXITCURSOR_N && + if (R2_GLOBALS._events.getCursor() >= EXITCURSOR_N && R2_GLOBALS._events.getCursor() <= SHADECURSOR_DOWN) R2_GLOBALS._events.setCursor(CURSOR_WALK); } @@ -437,9 +437,9 @@ bool SceneExt::display(CursorType action, Event &event) { SceneItem::display2(5, 0); break; case R2_SONIC_STUNNER: - if ((R2_GLOBALS._scannerFrequencies[R2_QUINN] == 2) + if ((R2_GLOBALS._scannerFrequencies[R2_QUINN] == 2) || ((R2_GLOBALS._scannerFrequencies[R2_QUINN] == 1) && - (R2_GLOBALS._scannerFrequencies[R2_SEEKER] == 2) && + (R2_GLOBALS._scannerFrequencies[R2_SEEKER] == 2) && (R2_GLOBALS._sceneManager._previousScene == 300))) { R2_GLOBALS._sound4.stop(); R2_GLOBALS._sound3.play(46); @@ -1099,7 +1099,7 @@ void Ringworld2InvObjectList::selectDefault(int objectNumber) { Common::String line = Common::String::format("%.5s%.5s%.5s%.5s%s %s %s %s.", msg1.c_str(), msg2.c_str(), msg3.c_str(), msg4.c_str(), msg1.c_str() + 5, msg2.c_str() + 5, msg3.c_str() + 5, msg4.c_str() + 5); - + SceneItem::display(-1, -1, line.c_str(), SET_WIDTH, 280, SET_X, 160, @@ -1465,7 +1465,7 @@ void SceneAreaObject::process(Event &event) { _savedCursorNum = R2_GLOBALS._events.getCursor(); R2_GLOBALS._events.setCursor(CURSOR_INVALID); } - + if (event.eventType == EVENT_BUTTON_DOWN) { event.handled = true; R2_GLOBALS._events.setCursor(_savedCursorNum); @@ -1775,14 +1775,13 @@ AnimationPlayer::AnimationPlayer(): EventHandler() { _screenBounds = R2_GLOBALS._gfxManagerInstance._bounds; _rect1 = R2_GLOBALS._gfxManagerInstance._bounds; _paletteMode = ANIMPALMODE_REPLACE_PALETTE; - _field3A = 1; + _field3A = true; _sliceHeight = 1; - _field58 = 1; _endAction = NULL; _sliceCurrent = nullptr; _sliceNext = nullptr; - _field38 = 0; + _field38 = false; _objectMode = ANIMOBJMODE_1; _dataNeeded = 0; _playbackTick = 0; @@ -1800,9 +1799,9 @@ AnimationPlayer::~AnimationPlayer() { void AnimationPlayer::synchronize(Serializer &s) { EventHandler::synchronize(s); - - // TODO: Implement saving for animation player state. Currently, I disable saving - // when an animation is active, so saving it's state would a "nice to have". + + // TODO: Implement saving for animation player state. Currently, I disable saving + // when an animation is active, so saving it's state would a "nice to have". } void AnimationPlayer::remove() { @@ -1813,8 +1812,7 @@ void AnimationPlayer::remove() { } void AnimationPlayer::process(Event &event) { - if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE) && - (_field3A)) { + if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE) && _field3A) { // Move the current position to the end _position = _subData._duration; } @@ -1933,7 +1931,7 @@ bool AnimationPlayer::load(int animId, Action *endAction) { } ++R2_GLOBALS._animationCtr; - _field38 = 1; + _field38 = true; return true; } @@ -2109,7 +2107,7 @@ void AnimationPlayer::close() { _animData1 = NULL; _animData2 = NULL; - _field38 = 0; + _field38 = false; if (g_globals != NULL) R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr - 1, 0); } @@ -2158,7 +2156,7 @@ void AnimationPlayer::getSlices() { AnimationPlayerExt::AnimationPlayerExt(): AnimationPlayer() { _isActive = false; - _field3A = 0; + _field3A = false; } void AnimationPlayerExt::synchronize(Serializer &s) { @@ -2267,7 +2265,7 @@ void ScannerDialog::Button::process(Event &event) { setFrame(2); _buttonDown = false; event.handled = true; - + reset(); } } diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index 50e506de11..133cdee6b2 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -407,11 +407,11 @@ public: AnimationData *_sliceNext; Common::File _resourceFile; Rect _rect1, _screenBounds; - int _field38; - int _field3A; + bool _field38; + bool _field3A; AnimationPaletteMode _paletteMode; AnimationObjectMode _objectMode; - int _field58, _sliceHeight; + int _sliceHeight; byte _palIndexes[256]; ScenePalette _palette; AnimationPlayerSubData _subData; diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index d673c33c5a..bd4ad73ddc 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -723,7 +723,7 @@ void Scene125::signal() { &_starchart3, &_starchart4, NULL); } else { // Show starchart without Ringworld - setAction(&_sequenceManager, this, 129, &R2_GLOBALS._player, &_starchart1, &_starchart2, + setAction(&_sequenceManager, this, 129, &R2_GLOBALS._player, &_starchart1, &_starchart2, &_starchart3, NULL); } break; @@ -1755,17 +1755,17 @@ void Scene180::signal() { _teal.setPosition(Common::Point(161, 97)); _teal.hide(); - _webbser.postInit(); - _webbser.setPosition(Common::Point(60, 96)); - _webbser.hide(); + _webbster.postInit(); + _webbster.setPosition(Common::Point(60, 96)); + _webbster.hide(); _stripManager.start(11, this); break; case 33: _teal.hide(); - _webbser.setup(76, 4, 1); - _webbser.setFrame(_webbser.getFrameCount()); + _webbster.setup(76, 4, 1); + _webbster.setFrame(_webbster.getFrameCount()); _shipDisplay.postInit(); _shipDisplay.setup(75, 1, 1); @@ -1777,7 +1777,7 @@ void Scene180::signal() { case 34: _teal.hide(); - _webbser.hide(); + _webbster.hide(); _dutyOfficer.postInit(); _dutyOfficer.setup(76, 2, 1); @@ -1810,14 +1810,10 @@ void Scene180::signal() { _shipDisplay.setAction(NULL); _shipDisplay.remove(); - // TODO: Figure out why end action on sounds aren't firing. For now, I'm - // simply setting up a scene delay to ensure the signal() method gets - // called again after a brief delay _backSurface.fillRect(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 0); R2_GLOBALS._screenSurface.fillRect(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 0); - setSceneDelay(10); R2_GLOBALS._sound2.fadeOut2(NULL); - R2_GLOBALS._sound1.fadeOut2(NULL /* this */); + R2_GLOBALS._sound1.fadeOut2(this); break; case 39: @@ -1889,7 +1885,7 @@ void Scene180::signal() { R2_GLOBALS._scene180Mode = 0; _helpEnabled = false; - // WORKAROUND: The original changed to scene 100 here, Quinn's Bedroom, + // WORKAROUND: The original changed to scene 100 here, Quinn's Bedroom, // but instead we're changing to the previously unused scene 50, which shows // a closeup of Quinn in the floatation bed first R2_GLOBALS._sceneManager.changeScene(50); @@ -2354,7 +2350,7 @@ Scene205::Scene205(): SceneExt() { GfxFont font; font.setFontNumber(4); _fontHeight = font.getHeight(); - + for (int i = 0; i < 3; i++) { _starList1[i] = nullptr; _starList2[i] = nullptr; @@ -2706,7 +2702,7 @@ void Scene250::signal() { case 2: if (_destButtonY - 12 == _currButtonY) _sceneMode = 4; - else + else _sceneMode = 3; signal(); @@ -5157,7 +5153,7 @@ bool Scene500::Locker2::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ -void Scene500::PanelDialog::setDetails(int visage, int strip, int frameNumber, +void Scene500::PanelDialog::setDetails(int visage, int strip, int frameNumber, const Common::Point &pt) { SceneAreaObject::setDetails(visage, strip, frameNumber, pt); SceneAreaObject::setDetails(500, 43, 32, 45); @@ -5225,7 +5221,7 @@ void Scene500::PanelDialog::Button::synchronize(Serializer &s) { } void Scene500::PanelDialog::Button::process(Event &event) { - if ((event.eventType == EVENT_BUTTON_DOWN) && + if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && _bounds.contains(event.mousePos) && !_buttonDown) { _buttonDown = true; @@ -5281,7 +5277,7 @@ void Scene500::PanelDialog::Button::doButtonPress() { scene->_suits.animate(ANIM_MODE_6, scene); } break; - + case 3: if (R2_GLOBALS.getFlag(35)) { scene->_sceneMode = 509; @@ -5295,7 +5291,7 @@ void Scene500::PanelDialog::Button::doButtonPress() { scene->_suit.setup(502, R2_GLOBALS._landerSuitNumber + 2, 1); scene->setAction(&scene->_sequenceManager1, scene, 508, - &R2_GLOBALS._player, &scene->_suits, &scene->_suit, + &R2_GLOBALS._player, &scene->_suits, &scene->_suit, &scene->_transparentDoor, NULL); R2_GLOBALS.setFlag(35); } @@ -5616,7 +5612,7 @@ bool Scene600::CompartmentHotspot::startAction(CursorType action, Event &event) if ((action != R2_NEGATOR_GUN) || (!R2_GLOBALS.getFlag(5)) || (R2_GLOBALS.getFlag(8))) return SceneHotspot::startAction(action, event); - SceneItem::display(600, 32, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, + SceneItem::display(600, 32, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); return true; } @@ -5626,13 +5622,13 @@ bool Scene600::EngineCompartment::startAction(CursorType action, Event &event) { return SceneHotspot::startAction(action, event); if ((R2_GLOBALS.getFlag(5)) && (!R2_GLOBALS.getFlag(8))) { - SceneItem::display(600, 32, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, + SceneItem::display(600, 32, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); return true; } if (!R2_GLOBALS.getFlag(5)) { - SceneItem::display(600, 30, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, + SceneItem::display(600, 30, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, ALIGN_CENTER, SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); return true; } @@ -5643,19 +5639,19 @@ bool Scene600::EngineCompartment::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); Scene600 *scene = (Scene600 *)R2_GLOBALS._sceneManager._scene; - + scene->_stasisArea.setup(603, 3, 1, 239, 54, 10); scene->_stasisField.postInit(); scene->_computer.postInit(); scene->_sceneMode = 612; scene->setAction(&scene->_sequenceManager1, scene, 612, &scene->_stasisField, &scene->_computer, &R2_GLOBALS._player, NULL); - + // WORKAROUND: For ScummVM, we use a SceneActor rather than BackgroundSceneObject // for the stasis field since it doesn't work properly. We override the priority for // the stasis field here so that the stasis field dissolve will show up scene->_stasisField.fixPriority(12); - + return true; } @@ -6072,7 +6068,7 @@ void Scene600::signal() { } void Scene600::process(Event &event) { - if (R2_GLOBALS._player._canWalk && (!R2_GLOBALS.getFlag(6)) && (event.eventType == EVENT_BUTTON_DOWN) + if (R2_GLOBALS._player._canWalk && (!R2_GLOBALS.getFlag(6)) && (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_WALK)) { if (!_doorway.contains(event.mousePos) || (_doorway._frame <= 1)) { if (R2_GLOBALS.getFlag(5)) { @@ -6128,7 +6124,7 @@ void Scene600::dispatch() { *--------------------------------------------------------------------------*/ #define CABLE700_X 26 -#define CABLE700_Y -5 +#define CABLE700_Y -5 Scene700::Scene700() { _rotation = NULL; @@ -6647,10 +6643,10 @@ bool Scene800::DeviceSlot::startAction(CursorType action, Event &event) { scene->_sceneMode = 804; if (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBRE) == 800) { - scene->setAction(&scene->_sequenceManager1, scene, 814, &R2_GLOBALS._player, + scene->setAction(&scene->_sequenceManager1, scene, 814, &R2_GLOBALS._player, &scene->_reader, &scene->_opticalFibre, NULL); } else { - scene->setAction(&scene->_sequenceManager1, scene, 804, &R2_GLOBALS._player, + scene->setAction(&scene->_sequenceManager1, scene, 804, &R2_GLOBALS._player, &scene->_reader, NULL); } return true; @@ -7314,7 +7310,7 @@ bool Scene850::Clamp::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_spark.postInit(); scene->_sceneMode = 850; - scene->setAction(&scene->_sequenceManager1, scene, 850, &R2_GLOBALS._player, this, + scene->setAction(&scene->_sequenceManager1, scene, 850, &R2_GLOBALS._player, this, &scene->_spark, NULL); return true; } @@ -7328,7 +7324,7 @@ bool Scene850::Panel::startAction(CursorType action, Event &event) { else { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 852; - scene->setAction(&scene->_sequenceManager1, scene, 852, &R2_GLOBALS._player, + scene->setAction(&scene->_sequenceManager1, scene, 852, &R2_GLOBALS._player, this, &scene->_spark, NULL); return true; } diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h index 2013b041c7..0e68b67ee7 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.h +++ b/engines/tsage/ringworld2/ringworld2_scenes0.h @@ -201,7 +201,7 @@ public: SpeakerDutyOfficer180 _dutyOfficerSpeaker; SpeakerTeal180 _tealSpeaker; SpeakerGameText _gameTextSpeaker; - SceneActor _dutyOfficer, _teal, _webbser, _door, _shipDisplay; + SceneActor _dutyOfficer, _teal, _webbster, _door, _shipDisplay; ScenePalette _palette; SceneText _textList[20]; AnimationPlayerExt _animationPlayer; @@ -529,7 +529,7 @@ class Scene500: public SceneExt { int _buttonId; bool _buttonDown; - void doButtonPress(); + void doButtonPress(); public: Button(); virtual Common::String getClassName() { return "Scene500_Button"; } diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 4bc82c7059..36d48ca27a 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -100,10 +100,10 @@ void Scene1000::remove() { void Scene1000::signal() { ScenePalette scenePalette1, scenePalette2; uint32 black = 0; - + switch (_sceneMode++) { case 0: - // TODO: Sort out values + // TODO: Determine correct colors R2_GLOBALS._gfxColors.foreground = 191; R2_GLOBALS._gfxColors.background = 144; R2_GLOBALS._fontColors.background = 224; @@ -117,7 +117,7 @@ void Scene1000::signal() { _animationPlayer.dispatch(); _forceCheckAnimationFl = true; - + R2_GLOBALS._scenePalette.fade((const byte *)&black, true, 0); for (int percent = 0; percent < 100; percent += 5) R2_GLOBALS._scenePalette.fade((const byte *)&black, true, percent); @@ -128,7 +128,7 @@ void Scene1000::signal() { case 1: R2_GLOBALS._sound1.fadeOut2(NULL); - // TODO: Sort out values + // TODO: Determine correct colors R2_GLOBALS._gfxColors.foreground = 191; R2_GLOBALS._gfxColors.background = 144; R2_GLOBALS._fontColors.background = 224; @@ -157,7 +157,7 @@ void Scene1000::signal() { break; case 3: - // TODO: Sort out values + // TODO: Determine correct colors R2_GLOBALS._gfxColors.foreground = 191; R2_GLOBALS._gfxColors.background = 144; R2_GLOBALS._fontColors.background = 224; @@ -184,7 +184,7 @@ void Scene1000::signal() { break; case 4: - // TODO: Sort out values + // TODO: Determine correct colors R2_GLOBALS._gfxColors.foreground = 191; R2_GLOBALS._gfxColors.background = 144; R2_GLOBALS._fontColors.background = 224; @@ -334,7 +334,7 @@ void Scene1000::signal() { case 60: R2_GLOBALS._sound1.play(333); - + for (int percent = 100; percent >= 0; percent -= 5) R2_GLOBALS._scenePalette.fade((const byte *)&black, true, percent); @@ -443,7 +443,7 @@ void Scene1000::signal() { R2_GLOBALS._scenePalette.fade((const byte *)&black, 1, 0); for (int percent = 0; percent < 100; percent += 5) R2_GLOBALS._scenePalette.fade((const byte *)&black, true, percent); - break; + break; case 101: R2_GLOBALS._sound1.fadeOut2(NULL); @@ -5987,7 +5987,7 @@ void Scene1337::subCF31D() { subC340B(&_arrunkObj1337[1]._arr1[tmpVal], &_arrunkObj1337[1]._arr2[i]); found = true; break; - } + } } } @@ -7513,7 +7513,7 @@ void Scene1550::DishControlsWindow::remove() { } } -void Scene1550::DishControlsWindow::setup2(int visage, int stripFrameNum, int frameNum, +void Scene1550::DishControlsWindow::setup2(int visage, int stripFrameNum, int frameNum, int posX, int posY) { // Call inherited setup ModalWindow::setup2(visage, stripFrameNum, frameNum, posX, posY); @@ -7612,7 +7612,7 @@ bool Scene1550::Gyroscope::startAction(CursorType action, Event &event) { else scene->_sceneMode = 1589; - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_gyroscope, NULL); return true; } @@ -7629,7 +7629,7 @@ bool Scene1550::DiagnosticsDisplay::startAction(CursorType action, Event &event) else scene->_sceneMode = 1587; - scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, + scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_diagnosticsDisplay, NULL); return true; } @@ -7722,7 +7722,7 @@ void Scene1550::synchronize(Serializer &s) { } void Scene1550::postInit(SceneObjectList *OwnerList) { - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 9) && + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 9) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == 11)) // Exiting the intact spaceship loadScene(1234); @@ -7759,7 +7759,7 @@ void Scene1550::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveDiff = Common::Point(5, 3); - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 9) && + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 9) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == 11)) R2_GLOBALS._player.setPosition(Common::Point(157, 135)); else @@ -7949,7 +7949,7 @@ void Scene1550::signal() { R2_GLOBALS._player.enableControl(); break; case 50: - warning("STUB: sub_1D227()"); + // Removed (useless ?) call to sub_1D227 ++_sceneMode; setAction(&_sequenceManager1, this, 1591, &R2_GLOBALS._player, NULL); if (g_globals->_sceneObjects->contains(&_companion)) @@ -7972,10 +7972,10 @@ void Scene1550::signal() { _companion.changeZoom(-1); _sceneMode = 1592; if (R2_GLOBALS._player._characterIndex == R2_QUINN) - setAction(&_sequenceManager1, this, 1592, &R2_GLOBALS._player, &_companion, + setAction(&_sequenceManager1, this, 1592, &R2_GLOBALS._player, &_companion, &_junk[0], &_joystick, NULL); else - setAction(&_sequenceManager1, this, 1593, &R2_GLOBALS._player, &_companion, + setAction(&_sequenceManager1, this, 1593, &R2_GLOBALS._player, &_companion, &_junk[0], &_joystick, NULL); break; case 61: @@ -8208,7 +8208,7 @@ void Scene1550::dispatch() { R2_GLOBALS._player._shade = 0; // NOTE: Original game contains a switch based on an uninitialized variable. - // We're leaving this code here, but ifdef'ed out, in case we can ever figure out + // We're leaving this code here, but ifdef'ed out, in case we can ever figure out // what the original programmers intended the value to come from #if 0 int missingVariable = 0; @@ -8756,7 +8756,7 @@ void Scene1550::enterArea() { } } - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 9) && + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == 9) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == 11)) { if (_screenNumber != 1234) { R2_GLOBALS._sceneManager._fadeMode = FADEMODE_IMMEDIATE; @@ -8814,7 +8814,7 @@ void Scene1550::enterArea() { } // Scene setup dependent on the type of cell specified in the scene map - switch (scene1550AreaMap[(R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y * 30) + + switch (scene1550AreaMap[(R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y * 30) + R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x]) { case 0: // Standard cell @@ -8951,8 +8951,8 @@ void Scene1550::enterArea() { int di = 0; int tmpIdx = 0; for (int i = 0; i < 127 * 4; i += 4) { - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == R2_GLOBALS._scene1550JunkLocations[i]) && - (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == R2_GLOBALS._scene1550JunkLocations[i + 1]) && + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == R2_GLOBALS._scene1550JunkLocations[i]) && + (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == R2_GLOBALS._scene1550JunkLocations[i + 1]) && (R2_GLOBALS._scene1550JunkLocations[i + 2] != 0)) { tmpIdx = R2_GLOBALS._scene1550JunkLocations[i + 3]; _junk[di].postInit(); @@ -8996,7 +8996,7 @@ void Scene1550::enterArea() { // Loop for detecting and setting up certain special areas within the map for (int i = 0; i < 15 * 3; i += 3) { - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == scene1550SpecialAreas[i]) + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == scene1550SpecialAreas[i]) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == scene1550SpecialAreas[i + 1])) { int areaType = scene1550SpecialAreas[i + 2]; switch (areaType) { @@ -9426,9 +9426,8 @@ void Scene1575::synchronize(Serializer &s) { s.syncAsSint16LE(_field41A); } -// TODO: Remove this method stub with proper sub-method call -double unk(double v1, double v2) { - return sqrt(v1 * v1 + v2 * v2); +double hypotenuse(double v1, double v2) { + return sqrt(v1 * v1 + v2 * v2); } void Scene1575::postInit(SceneObjectList *OwnerList) { @@ -9456,8 +9455,8 @@ void Scene1575::postInit(SceneObjectList *OwnerList) { _arrActor[i].postInit(); _arrActor[i].setup(1575, 2, k5A7F6[3 * i + 2]); - double v1 = unk(2.0, 3 - k5A7F6[3 * i]); - v1 += unk(2.0, 3 - k5A7F6[3 * i + 1]); + double v1 = hypotenuse(2.0, 3 - k5A7F6[3 * i]); + v1 += hypotenuse(2.0, 3 - k5A7F6[3 * i + 1]); int yp = (int)(sqrt(v1) * 75.0 / 17.0 - 161.0); int angle = R2_GLOBALS._gfxManagerInstance.getAngle( @@ -9496,7 +9495,7 @@ void Scene1575::postInit(SceneObjectList *OwnerList) { _actor10.setup(1575, 3, 2); _actor10.setPosition(Common::Point(287, 91)); - // Initialise buttons + // Initialize buttons _button1.initButton(1); _button2.initButton(2); _button3.initButton(3); @@ -9908,7 +9907,7 @@ void Scene1580::postInit(SceneObjectList *OwnerList) { _hatchButton.setPosition(Common::Point(291, 147)); _hatchButton.fixPriority(100); _hatchButton.setDetails(1550, 81, -1, -1, 1, (SceneItem *) NULL); - + if (R2_INVENTORY.getObjectScene(R2_THRUSTER_VALVE) == 1580) { _thrusterValve.postInit(); _thrusterValve.setup(1580, 6, 2); @@ -10359,7 +10358,7 @@ void Scene1700::enterArea() { _westPlatform.remove(); _rimTransportDoor.remove(); _rimTransport.remove(); - + if (_sceneMode != 40) { _ledgeHopper.remove(); _hatch.remove(); @@ -10695,7 +10694,7 @@ void Scene1700::signal() { case 40: R2_GLOBALS._player.disableControl(); _sceneMode = 1704; - setAction(&_sequenceManager, this, 1704, &R2_GLOBALS._player, &_companion, + setAction(&_sequenceManager, this, 1704, &R2_GLOBALS._player, &_companion, &_hatch, &_ledgeHopper, &_playerShadow, &_companionShadow, NULL); break; case 50: @@ -10830,7 +10829,7 @@ void Scene1750::SpeedSlider::remove() { } void Scene1750::SpeedSlider::process(Event &event) { - if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && + if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && (_bounds.contains(event.mousePos))) { _mouseDown = true; event.eventType = EVENT_NONE; @@ -11060,7 +11059,7 @@ void Scene1750::dispatch() { _rotation->setDelay(15 - _speedCurrent); _rotation->_idxChange = 2; } - } + } } if (_speedDelta) @@ -11716,10 +11715,10 @@ bool Scene1850::Robot::startAction(CursorType action, Event &event) { scene->_airbag.postInit(); if (R2_GLOBALS.getFlag(32)) - scene->setAction(&scene->_sequenceManager1, scene, 1876, + scene->setAction(&scene->_sequenceManager1, scene, 1876, &R2_GLOBALS._player, &scene->_airbag, NULL); else - scene->setAction(&scene->_sequenceManager1, scene, 1875, + scene->setAction(&scene->_sequenceManager1, scene, 1875, &R2_GLOBALS._player, &scene->_airbag, NULL); return true; @@ -11742,7 +11741,7 @@ bool Scene1850::Robot::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1878; - scene->setAction(&scene->_sequenceManager1, scene, 1878, &R2_GLOBALS._player, + scene->setAction(&scene->_sequenceManager1, scene, 1878, &R2_GLOBALS._player, &scene->_robot, &scene->_airbag, NULL); } @@ -12161,7 +12160,7 @@ void Scene1850::signal() { break; case 16: _sceneMode = 1870; - setAction(&_sequenceManager1, this, 1870, &R2_GLOBALS._player, &_companion, + setAction(&_sequenceManager1, this, 1870, &R2_GLOBALS._player, &_companion, &_screen, &_helmet, NULL); break; case 20: @@ -12170,7 +12169,7 @@ void Scene1850::signal() { case 21: R2_GLOBALS._player.disableControl(); _sceneMode = 1877; - setAction(&_sequenceManager1, this, 1877, &R2_GLOBALS._player, &_companion, + setAction(&_sequenceManager1, this, 1877, &R2_GLOBALS._player, &_companion, &_robot, NULL); break; case 30: @@ -12212,7 +12211,7 @@ void Scene1850::signal() { _sceneMode = 1879; - _displayScreen.setAction(&_sequenceManager2, this, 1879, &_robot, + _displayScreen.setAction(&_sequenceManager2, this, 1879, &_robot, &_displayScreen, &_airbag, NULL); } else { _displayScreen.setAction(&_sequenceManager2, NULL, 1867, &_displayScreen, NULL); @@ -12520,7 +12519,7 @@ void Scene1875::Button::process(Event &event) { Scene1875 *scene = (Scene1875 *)R2_GLOBALS._sceneManager._scene; - if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) + if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && (_bounds.contains(event.mousePos)) && !_buttonDown) { setStrip(2); switch (_buttonId) { @@ -12581,7 +12580,7 @@ void Scene1875::postInit(SceneObjectList *OwnerList) { } else { if (R2_GLOBALS._sceneManager._previousScene == 3150) { R2_GLOBALS._sound1.play(116); - } + } R2_GLOBALS._player.enableControl(); R2_GLOBALS._player._canWalk = false; @@ -12929,7 +12928,7 @@ bool Scene1925::Button::startAction(CursorType action, Event &event) { scene->_sceneMode = 1930; R2_GLOBALS._player.disableControl(CURSOR_WALK); - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_door, NULL); return true; } @@ -12946,7 +12945,7 @@ bool Scene1925::Ladder::startAction(CursorType action, Event &event) { if ((R2_GLOBALS._player._position.x == 110) && (R2_GLOBALS._player._position.y == 100)) { scene->_westExit._enabled = false; scene->_sceneMode = 1925; - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_door, NULL); return true; } @@ -12985,7 +12984,7 @@ void Scene1925::ExitUp::changeScene() { scene->_westExit._enabled = false; scene->_newSceneMode = 1927; scene->_sceneMode = 1925; - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_door, NULL); return; } @@ -13016,7 +13015,7 @@ void Scene1925::ExitDown::changeScene() { scene->_westExit._enabled = false; scene->_newSceneMode = 1926; scene->_sceneMode = 1925; - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_door, NULL); return; } @@ -13576,7 +13575,7 @@ void Scene1950::KeypadWindow::KeypadButton::init(int indx) { } void Scene1950::KeypadWindow::KeypadButton::process(Event &event) { - if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) + if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == CURSOR_USE) && (_bounds.contains(event.mousePos)) && !_pressed) { R2_GLOBALS._sound2.play(227); if (!_toggled) { @@ -13849,7 +13848,7 @@ void Scene1950::Vampire::signal() { bool Scene1950::Vampire::startAction(CursorType action, Event &event) { Scene1950 *scene = (Scene1950 *)R2_GLOBALS._sceneManager._scene; - if (!R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._isAlive || + if (!R2_GLOBALS._vampireData[scene->_vampireIndex - 1]._isAlive || (action != R2_PHOTON_STUNNER)) return SceneActor::startAction(action, event); @@ -14744,7 +14743,7 @@ void Scene1950::enterArea() { _vampireIndex = 1; break; case 13: - _vampireIndex = 2; + _vampireIndex = 2; break; case 16: _vampireIndex = 3; @@ -15165,7 +15164,7 @@ void Scene1950::signal() { enterArea(); break; case 1975: - SceneItem::display(1950, 21, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, 1, + SceneItem::display(1950, 21, SET_WIDTH, 280, SET_X, 160, SET_POS_MODE, 1, SET_Y, 20, SET_EXT_BGCOLOR, 7, LIST_END); // No break on purpose case 13: diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 0a379002f9..98cd172142 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -111,7 +111,7 @@ public: SceneActor _shotImpact4; SceneActor _shotImpact5; SceneActor _laserShot; - SceneActor _animation; // Used for cliff collapse and ship theft + SceneActor _animation; // Used for cliff collapse and ship theft SceneActor _leftImpacts; SceneActor _runningGuy1; SceneActor _runningGuy2; diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index f9e5b096c6..e5ae6c4acd 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -135,7 +135,7 @@ void Scene2000::initPlayer() { _persons[i].show(); } - if ((R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) + if ((R2_GLOBALS._player._characterScene[R2_QUINN] == R2_GLOBALS._player._characterScene[R2_SEEKER]) && (R2_GLOBALS._spillLocation[R2_QUINN] == R2_GLOBALS._spillLocation[R2_SEEKER])) { _companion.postInit(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { @@ -1426,8 +1426,6 @@ void Scene2425::postInit(SceneObjectList *OwnerList) { _ropeDest1.setDetails(Rect(225, 52, 248, 65), 2425, -1, -1, -1, 1, NULL); _ropeDest2.setDetails(Rect(292, 81, 316, 94), 2425, -1, -1, -1, 1, NULL); -// CHECKME: SceneActor using a SceneItem function?? -// _pictographs2.setDetails(11, 2425, 3, -1, 6); _pictographs2._sceneRegionId = 11; _pictographs2._resNum = 2425; _pictographs2._lookLineNum = 3; @@ -2313,7 +2311,7 @@ void Scene2455::postInit(SceneObjectList *OwnerList) { _scrithKey.setup(2456, 3, 1); _scrithKey.setPosition(Common::Point(176, 165)); _scrithKey.setDetails(2455, 16, 1, -1, 1, (SceneItem *)NULL); - } else if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2455) || + } else if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2455) || (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2455)) { _lamp.postInit(); _lamp.setup(2456, 3, 3); @@ -2811,9 +2809,9 @@ bool Scene2535::RebreatherTank::startAction(CursorType action, Event &event) { if (R2_GLOBALS._player._characterIndex == R2_QUINN) { R2_GLOBALS._player.disableControl(); - + scene->_sceneMode = (R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) == 2535) ? 2536 : 2537; - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &R2_GLOBALS._player, &scene->_rebreatherTank, NULL); } else { SceneItem::display(2530, 33, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); @@ -4105,7 +4103,7 @@ void Scene2750::signal() { } void Scene2750::process(Event &event) { - if ((R2_GLOBALS._player._canWalk) && (event.eventType == EVENT_BUTTON_DOWN) + if ((R2_GLOBALS._player._canWalk) && (event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == R2_NEGATOR_GUN)) { if (_walkRect1.contains(event.mousePos)) { if (!_walkRect1.contains(R2_GLOBALS._player._position)) { @@ -4498,7 +4496,7 @@ void Scene2800::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player.enableControl(); } else { _sceneMode = 2801; - R2_GLOBALS._player.setAction(&_sequenceManager, this, 2801, &R2_GLOBALS._player, + R2_GLOBALS._player.setAction(&_sequenceManager, this, 2801, &R2_GLOBALS._player, &_nej, &_guard, NULL); } } @@ -4617,7 +4615,7 @@ bool Scene2900::KnobLeft::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_USE: - if (scene->_majorMinorFlag || scene->_altitudeChanging || + if (scene->_majorMinorFlag || scene->_altitudeChanging || scene->_xAmount != scene->_xComparison) { // Let your altitude stablize first SceneItem::display2(2900, 17); @@ -4654,7 +4652,7 @@ bool Scene2900::KnobRight::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_USE: - if (scene->_majorMinorFlag || scene->_altitudeChanging || + if (scene->_majorMinorFlag || scene->_altitudeChanging || scene->_xAmount != scene->_xComparison) { // Let your altitude stablize first SceneItem::display2(2900, 17); @@ -4848,7 +4846,7 @@ int Scene2900::Map::adjustRect(Common::Rect &r1, const Common::Rect &r2) { return -1; } -void Scene2900::Map::drawBlock(const byte *data, int xp, int yp, +void Scene2900::Map::drawBlock(const byte *data, int xp, int yp, const Rect &bounds, const Rect &updateRect) { Rect blockRect(xp, yp, xp + 160, yp + 100); const byte *src = data; @@ -4969,11 +4967,11 @@ void Scene2900::synchronize(Serializer &s) { void Scene2900::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._uiElements._active = false; - // TODO: Determine correct colours + // TODO: Determine correct colors R2_GLOBALS._gfxColors.foreground = 228; R2_GLOBALS._fontColors.background = 12; R2_GLOBALS._fontColors.foreground = 22; - + _map.load(2950); loadScene(2900); @@ -4983,7 +4981,7 @@ void Scene2900::postInit(SceneObjectList *OwnerList) { _leftEdge.setup(2900, 6, 1, 22, 0, 25); _rightEdge.setup(2900, 6, 1, 280, 0, 25); _knob.setup(2900, 1, 3, 228, 199, 25); - + _altimeterContent.postInit(); _altimeterContent.setVisage(2900); _altimeterContent.setStrip(2); @@ -4996,7 +4994,7 @@ void Scene2900::postInit(SceneObjectList *OwnerList) { _knobLeftContent.setFrame(1); _knobLeftContent.setPosition(Common::Point(209, 199)); _knobLeftContent.fixPriority(200); - + _knobRightContent.postInit(); _knobRightContent.setVisage(2900); _knobRightContent.setStrip(1); @@ -5029,7 +5027,7 @@ void Scene2900::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._moveDiff = Common::Point(2, 2); R2_GLOBALS._player.disableControl(); - if (R2_GLOBALS._sceneManager._previousScene == 2350 && + if (R2_GLOBALS._sceneManager._previousScene == 2350 && R2_GLOBALS._balloonPosition.x == 0 && R2_GLOBALS._balloonPosition.y == 0) { R2_GLOBALS._balloonAltitude = 5; _map.setPosition(Common::Point(_balloonLocation.x - 120, _balloonLocation.y - 100)); @@ -5048,7 +5046,7 @@ void Scene2900::postInit(SceneObjectList *OwnerList) { _balloonLocation.x -= 70; else if ((R2_GLOBALS._balloonAltitude % 8) == 7) _balloonLocation.x += 70; - + if (_balloonLocation.x <= 120) _balloonScreenPos.x = _balloonLocation.x + 40; else if (_balloonLocation.x >= 680) @@ -5075,7 +5073,7 @@ void Scene2900::postInit(SceneObjectList *OwnerList) { } void Scene2900::remove() { - // TODO: Figure out correct colours + // TODO: Figure out correct colors R2_GLOBALS._gfxColors.foreground = 59; R2_GLOBALS._fontColors.background = 4; R2_GLOBALS._fontColors.foreground = 15; @@ -5085,7 +5083,7 @@ void Scene2900::remove() { R2_GLOBALS._sound1.fadeOut2(NULL); R2_GLOBALS._sound2.stop(); - + R2_GLOBALS._interfaceY = UI_INTERFACE_Y; SceneExt::remove(); } diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 1c70f5e6c3..ab6da047ce 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -97,7 +97,7 @@ void Scene3100::postInit(SceneObjectList *OwnerList) { _deadBodies.postInit(); R2_GLOBALS._sound1.play(274); _sound1.fadeSound(130); - setAction(&_sequenceManager, this, 3102, &_hammerHead, &R2_GLOBALS._player, + setAction(&_sequenceManager, this, 3102, &_hammerHead, &R2_GLOBALS._player, &_ghoul, &_technicians, &_deadBodies, NULL); } else { _guard.postInit(); @@ -126,7 +126,7 @@ void Scene3100::postInit(SceneObjectList *OwnerList) { _ghoul.postInit(); _fadeSound = true; - setAction(&_sequenceManager, this, 3101, &R2_GLOBALS._player, &_hammerHead, + setAction(&_sequenceManager, this, 3101, &R2_GLOBALS._player, &_hammerHead, &_miranda, &_ghoul, NULL); } else { _guard.postInit(); @@ -274,8 +274,8 @@ bool Scene3125::Computer::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(); scene->_ghoul4.postInit(); scene->_sceneMode = 3126; - scene->setAction(&scene->_sequenceManager, scene, 3126, &R2_GLOBALS._player, - &scene->_ghoul1, &scene->_ghoul2, &scene->_ghoul3, &scene->_door, + scene->setAction(&scene->_sequenceManager, scene, 3126, &R2_GLOBALS._player, + &scene->_ghoul1, &scene->_ghoul2, &scene->_ghoul3, &scene->_door, &scene->_ghoul4, NULL); break; case CURSOR_LOOK: @@ -424,8 +424,8 @@ bool Scene3150::Toilet::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager, scene, 3158, &R2_GLOBALS._player, &scene->_water, NULL); return true; case R2_FOOD_TRAY: - if ((R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) != 3150) && - (R2_INVENTORY.getObjectScene(R2_SUPERCONDUCTOR_WIRE) == 3150) + if ((R2_INVENTORY.getObjectScene(R2_LIGHT_BULB) != 3150) && + (R2_INVENTORY.getObjectScene(R2_SUPERCONDUCTOR_WIRE) == 3150) && (R2_GLOBALS.getFlag(75))) { scene->_foodTray.postInit(); scene->_foodTray._effect = EFFECT_SHADED2; @@ -685,7 +685,7 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { break; } default: - if ((R2_GLOBALS._mirandaJailState == 1) && (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2000) + if ((R2_GLOBALS._mirandaJailState == 1) && (R2_INVENTORY.getObjectScene(R2_ANCIENT_SCROLLS) == 2000) && (R2_GLOBALS._player._oldCharacterScene[R2_QUINN] == 3100)) { // Moving story on to Miranda getting food delivered ++R2_GLOBALS._mirandaJailState; @@ -1105,7 +1105,7 @@ void Scene3245::postInit(SceneObjectList *OwnerList) { SceneItem::display(1200, 7, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); signal(); } else { - setAction(&_sequenceManager, this, 3244 + R2_GLOBALS._scientistConvIndex, + setAction(&_sequenceManager, this, 3244 + R2_GLOBALS._scientistConvIndex, &_ralf, &_tomko, NULL); } } @@ -1225,7 +1225,7 @@ void Scene3250::postInit(SceneObjectList *OwnerList) { _ghoul2._effect = EFFECT_SHADED; _ghoul3.postInit(); _ghoul3._effect = EFFECT_SHADED; - setAction(&_sequenceManager, this, 3254, &R2_GLOBALS._player, &_rightDoor, + setAction(&_sequenceManager, this, 3254, &R2_GLOBALS._player, &_rightDoor, &_ghoul1, &_ghoul2, &_ghoul3, &_leftDoor, NULL); } else { _sceneMode = 3252; @@ -1329,7 +1329,7 @@ void Scene3255::signal() { _ghoul1.postInit(); _ghoul2.postInit(); _ghoul3.postInit(); - setAction(&_sequenceManager, this, 3258, &R2_GLOBALS._player, &_quinn, + setAction(&_sequenceManager, this, 3258, &R2_GLOBALS._player, &_quinn, &_door, &_ghoul1, &_ghoul2, &_ghoul3, NULL); break; case 3256: @@ -1719,7 +1719,7 @@ void Scene3350::signal() { break; case 3351: _sceneMode = 3352; - setAction(&_sequenceManager, this, 3352, &_seeker, &R2_GLOBALS._player, + setAction(&_sequenceManager, this, 3352, &_seeker, &R2_GLOBALS._player, &_miranda, &_seeker, &_webbster, NULL); break; case 3352: @@ -1884,7 +1884,7 @@ bool Scene3375::Door::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(CURSOR_ARROW); scene->_sceneMode = 3375; - scene->setAction(&scene->_sequenceManager, scene, 3375, &R2_GLOBALS._player, + scene->setAction(&scene->_sequenceManager, scene, 3375, &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, NULL); return true; @@ -2304,8 +2304,8 @@ bool Scene3385::Door::startAction(CursorType action, Event &event) { R2_GLOBALS._sound2.play(314); scene->_sceneMode = 3386; - scene->setAction(&scene->_sequenceManager, scene, 3386, &R2_GLOBALS._player, - &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, + scene->setAction(&scene->_sequenceManager, scene, 3386, &R2_GLOBALS._player, + &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, NULL); return true; @@ -2318,8 +2318,8 @@ void Scene3385::SouthExit::changeScene() { scene->_sceneMode = 3387; if (R2_GLOBALS._sceneManager._previousScene == 3375) - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, - &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, + &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, NULL); else scene->signal(); @@ -2541,8 +2541,8 @@ bool Scene3395::Door::startAction(CursorType action, Event &event) { R2_GLOBALS._sound2.play(314); scene->_sceneMode = 3396; - scene->setAction(&scene->_sequenceManager, scene, 3396, &R2_GLOBALS._player, - &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, + scene->setAction(&scene->_sequenceManager, scene, 3396, &R2_GLOBALS._player, + &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, NULL); return true; @@ -2813,7 +2813,7 @@ void Scene3400::remove() { void Scene3400::signal() { switch (_sceneMode) { case 3305: { - warning("STUB: sub_1D227()"); + // Removed (useless ?) call to sub_1D227 _tealSpeaker._object1.hide(); _teal.show(); _teal.setStrip(1); @@ -2853,7 +2853,7 @@ void Scene3400::signal() { } break; case 3308: - warning("STUB: sub_1D227()"); + // Removed (useless ?) call to sub_1D227 _companion1.setStrip(2); R2_GLOBALS._player.setStrip(6); _companion2.setStrip(6); @@ -2866,7 +2866,7 @@ void Scene3400::signal() { setAction(&_sequenceManager, this, 3403, &_companion1, &_webbster, &_manholeCover, NULL); break; case 3309: - warning("STUB: sub_1D227()"); + // Removed (useless ?) call to sub_1D227 _teal.setStrip(1); _sceneMode = 3405; if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) @@ -2875,7 +2875,7 @@ void Scene3400::signal() { setAction(&_sequenceManager, this, 3405, &_companion2, &_manholeCover, NULL); break; case 3310: - warning("STUB: sub_1D227()"); + // Removed (useless ?) call to sub_1D227 _teal.setStrip(1); _sceneMode = 3406; if (R2_GLOBALS._player._characterIndex == R2_QUINN) @@ -2886,7 +2886,7 @@ void Scene3400::signal() { setAction(&_sequenceManager, this, 3406, &_companion2, &_manholeCover, NULL); break; case 3311: - warning("STUB: sub_1D227()"); + // Removed (useless ?) call to sub_1D227 _tealSpeaker._object1.hide(); _teal.show(); _teal.setStrip(1); @@ -3078,15 +3078,15 @@ void Scene3500::Action1::signal() { } // Get the new direction starting on - int var8 = (scene->_action1._direction * 2 + scene->_mazeDirection); - if (var8 > MAZEDIR_NORTHWEST) - var8 = MAZEDIR_NORTH; - else if (var8 < MAZEDIR_NORTH) - var8 = MAZEDIR_WEST; + int direction = (scene->_action1._direction * 2 + scene->_mazeDirection); + if (direction > MAZEDIR_NORTHWEST) + direction = MAZEDIR_NORTH; + else if (direction < MAZEDIR_NORTH) + direction = MAZEDIR_WEST; // Check whether movement is allowed in that direction. If so, then // movement is started again - switch (var8) { + switch (direction) { case MAZEDIR_NORTH: if ( ((cellId != 2) && (cellId != 3) && (cellId != 6) && (cellId != 1) && (cellId != 23) && (cellId != 24) && (cellId != 4) && (cellId != 11)) || (var6 != 0)) { @@ -3521,7 +3521,7 @@ Scene3500::Scene3500() { _nextMove = 0; _mazePosition.x = 0; _mazePosition.y = 0; - _field1282 = 0; + _field1282 = true; // Set to true in fixup() _field1284 = 0; _directionChangesEnabled = false; } @@ -3557,7 +3557,7 @@ void Scene3500::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._player._characterScene[R2_SEEKER] = 3500; R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3500; _field1284 = 0; - _field1282 = 0; + _field1282 = false; _nextMove = 0; _field1272 = true; _speed = 4; @@ -3880,11 +3880,11 @@ void Scene3500::dispatch() { int tmpCellId = 0; int cellId = 0; - if ((_mazeChangeAmount == 0) && (_field1282 == 0)) { + if ((_mazeChangeAmount == 0) && !_field1282) { if (_field1284 == 2) R2_GLOBALS._sceneManager.changeScene(1000); } else { - _field1282 = 0; + _field1282 = false; tmpRect.set(160, 89, 299, 182); newMazeX = _mazePosition.x; @@ -4623,7 +4623,7 @@ void Scene3600::remove() { void Scene3600::signal() { switch (_sceneMode) { case 3320: - // TODO: warning("STUB: sub_1D227()"); + // Removed (useless ?) call to sub_1D227 R2_GLOBALS._walkRegions.disableRegion(14); R2_GLOBALS._scrollFollower = &_seeker; _tealSpeaker._object1.hide(); @@ -4635,25 +4635,25 @@ void Scene3600::signal() { _sceneMode = 3603; else _sceneMode = 3601; - setAction(&_sequenceManager1, this, _sceneMode, &_seeker, &_quinn, + setAction(&_sequenceManager1, this, _sceneMode, &_seeker, &_quinn, &_miranda, &_webbster, &_teal, NULL); break; case 3321: - warning("STUB: sub_1D227()"); + // Removed (useless ?) call to sub_1D227 R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; - _tealSpeaker.proc16(); + _tealSpeaker.stopSpeaking(); _teal.show(); _teal.setStrip(1); _consoleLights.postInit(); _sceneMode = 3604; - setAction(&_sequenceManager1, this, _sceneMode, &_teal, &_consoleLights, + setAction(&_sequenceManager1, this, _sceneMode, &_teal, &_consoleLights, &_quinn, &_seeker, &_miranda, &_webbster, NULL); break; case 3322: - warning("STUB: sub_1D227()"); - _quinnSpeaker.proc16(); + // Removed (useless ?) call to sub_1D227 + _quinnSpeaker.stopSpeaking(); _quinnSpeaker._displayMode = 1; - _tealSpeaker.proc16(); + _tealSpeaker.stopSpeaking(); _tealSpeaker._displayMode = 7; R2_GLOBALS._scrollFollower = &_teal; _sceneMode = 3605; @@ -4663,15 +4663,15 @@ void Scene3600::signal() { if (!_tealDead) _tealDead = true; else { - warning("STUB: sub_1D227()"); - _protectorSpeaker.proc16(); + // Removed (useless ?) call to sub_1D227 + _protectorSpeaker.stopSpeaking(); _protector.show(); _protector.setup(3258, 6, 1); _sceneMode = 3607; _protector.setAction(&_sequenceManager1, this, _sceneMode, &_protector, NULL); - _protectorSpeaker.proc16(); + _protectorSpeaker.stopSpeaking(); _protectorSpeaker._displayMode = 1; _quinnSpeaker._displayMode = 1; _protector.show(); @@ -4828,7 +4828,7 @@ void Scene3600::signal() { case 3620: // No break on purpose case 3623: - if ((_protector._position.x == 226) && (_protector._position.y == 152) + if ((_protector._position.x == 226) && (_protector._position.y == 152) && _action1._field1E && (_protector._visage == 3127) && (!R2_GLOBALS.getFlag(71))) { R2_GLOBALS._sound2.stop(); R2_GLOBALS._sound2.play(331); @@ -4979,7 +4979,7 @@ void Scene3700::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._sound1.play(332); _sceneMode = 3700; - setAction(&_sequenceManager, this, 3700, &_quinn, &_seeker, &_miranda, + setAction(&_sequenceManager, this, 3700, &_quinn, &_seeker, &_miranda, &_webbster, &_teleportPad, NULL); } @@ -4993,7 +4993,7 @@ void Scene3700::signal() { case 3328: // No break on purpose case 3329: - warning("STUB: sub_1D227()"); + // Removed (useless ?) call to sub_1D227 _sceneMode = 3701; setAction(&_sequenceManager, this, 3701, &_seeker, &_miranda, &_webbster, NULL); break; @@ -5221,7 +5221,7 @@ void Scene3800::enterArea() { _harness.postInit(); _quinnShadow.hide(); _sceneMode = 3800; - setAction(&_sequenceManager1, this, 3800, &R2_GLOBALS._player, + setAction(&_sequenceManager1, this, 3800, &R2_GLOBALS._player, &_balloon, &_harness, NULL); break; case 3900: @@ -5391,7 +5391,7 @@ void Scene3800::signal() { } void Scene3800::process(Event &event) { - if ((R2_GLOBALS._player._uiEnabled) && (event.eventType == EVENT_BUTTON_DOWN) + if ((R2_GLOBALS._player._uiEnabled) && (event.eventType == EVENT_BUTTON_DOWN) && (_skylineRect.contains(event.mousePos))) { event.handled = true; switch (R2_GLOBALS._events.getCursor()) { @@ -5500,7 +5500,7 @@ void Scene3900::Exit5::changeScene() { } void Scene3900::postInit(SceneObjectList *OwnerList) { - if ((R2_GLOBALS._desertPreviousDirection == 2) + if ((R2_GLOBALS._desertPreviousDirection == 2) && (R2_GLOBALS._sceneManager._previousScene != 2700)) loadScene(3825); else diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index 834a601e62..b282900c3a 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -657,7 +657,7 @@ public: int _mazeDirection; int _nextMove; Common::Point _mazePosition; - int _field1282; // TODO: Set to true in Fixup() + bool _field1282; int _field1284; bool _directionChangesEnabled; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index 61236ee504..49359bb351 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -71,9 +71,10 @@ void VisualSpeaker::remove() { } void VisualSpeaker::signal() { - // TODO: _action->_field18 = 1; + // TODO: Handle _field18 if used in Action. It looks only used in the original in remove() + // _action->_field18 = 1; if (_speakerMode == 0xff) - proc16(); + stopSpeaking(); _speakerMode = 0; if (_numFrames) { @@ -221,7 +222,7 @@ void VisualSpeaker::setText(const Common::String &msg) { _sceneText.fixPriority(256); // If subtitles are turned off, don't show the text - if ((R2_GLOBALS._speechSubtitles & SPEECH_VOICE) && + if ((R2_GLOBALS._speechSubtitles & SPEECH_VOICE) && !(R2_GLOBALS._speechSubtitles & SPEECH_TEXT)) { _sceneText.hide(); } @@ -264,7 +265,7 @@ void VisualSpeaker::setText(const Common::String &msg) { } } -void VisualSpeaker::proc16() { +void VisualSpeaker::stopSpeaking() { R2_GLOBALS._playStream.stop(); _speakerMode = 0; _object1.remove(); @@ -317,7 +318,7 @@ SpeakerCaptain3210::SpeakerCaptain3210() { _numFrames = 0; } -void SpeakerCaptain3210::proc15() { +void SpeakerCaptain3210::animateSpeaker() { int v = _speakerMode; Scene3210 *scene = (Scene3210 *)R2_GLOBALS._sceneManager._scene; @@ -372,7 +373,7 @@ SpeakerChief1100::SpeakerChief1100() { _numFrames = 0; } -void SpeakerChief1100::proc15() { +void SpeakerChief1100::animateSpeaker() { int v = _speakerMode; Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; @@ -430,7 +431,7 @@ SpeakerGuard::SpeakerGuard() { _numFrames = 0; } -void SpeakerGuard2800::proc15() { +void SpeakerGuard2800::animateSpeaker() { int v = _speakerMode; Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; @@ -470,7 +471,7 @@ SpeakerJocko::SpeakerJocko() { _numFrames = 0; } -void SpeakerJocko3200::proc15() { +void SpeakerJocko3200::animateSpeaker() { int v = _speakerMode; Scene3200 *scene = (Scene3200 *)R2_GLOBALS._sceneManager._scene; @@ -493,7 +494,7 @@ void SpeakerJocko3200::proc15() { } } -void SpeakerJocko3220::proc15() { +void SpeakerJocko3220::animateSpeaker() { int v = _speakerMode; Scene3220 *scene = (Scene3220 *)R2_GLOBALS._sceneManager._scene; @@ -516,7 +517,7 @@ void SpeakerJocko3220::proc15() { } } -void SpeakerJocko3230::proc15() { +void SpeakerJocko3230::animateSpeaker() { int v = _speakerMode; Scene3230 *scene = (Scene3230 *)R2_GLOBALS._sceneManager._scene; @@ -555,7 +556,7 @@ SpeakerMiranda::SpeakerMiranda(): VisualSpeaker() { _numFrames = 0; } -void SpeakerMiranda300::proc15() { +void SpeakerMiranda300::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -595,7 +596,7 @@ void SpeakerMiranda300::proc15() { } } -void SpeakerMiranda1625::proc15() { +void SpeakerMiranda1625::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -618,7 +619,7 @@ void SpeakerMiranda1625::proc15() { } } -void SpeakerMiranda3255::proc15() { +void SpeakerMiranda3255::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -639,7 +640,7 @@ void SpeakerMiranda3255::proc15() { } } -void SpeakerMiranda3375::proc15() { +void SpeakerMiranda3375::animateSpeaker() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -689,7 +690,7 @@ void SpeakerMiranda3375::proc15() { } } -void SpeakerMiranda3385::proc15() { +void SpeakerMiranda3385::animateSpeaker() { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -738,7 +739,7 @@ void SpeakerMiranda3385::proc15() { } } -void SpeakerMiranda3395::proc15() { +void SpeakerMiranda3395::animateSpeaker() { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -788,7 +789,7 @@ void SpeakerMiranda3395::proc15() { } } -void SpeakerMiranda3400::proc15() { +void SpeakerMiranda3400::animateSpeaker() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -832,7 +833,7 @@ void SpeakerMiranda3400::proc15() { } } -void SpeakerMiranda3600::proc15() { +void SpeakerMiranda3600::animateSpeaker() { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -878,7 +879,7 @@ void SpeakerMiranda3600::proc15() { } } -void SpeakerMiranda3700::proc15() { +void SpeakerMiranda3700::animateSpeaker() { Scene3700 *scene = (Scene3700 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -946,7 +947,7 @@ SpeakerNej::SpeakerNej() { _numFrames = 0; } -void SpeakerNej2700::proc15() { +void SpeakerNej2700::animateSpeaker() { int v = _speakerMode; Scene2700 *scene = (Scene2700 *)R2_GLOBALS._sceneManager._scene; @@ -981,7 +982,7 @@ void SpeakerNej2700::proc15() { } } -void SpeakerNej2750::proc15() { +void SpeakerNej2750::animateSpeaker() { int v = _speakerMode; Scene2750 *scene = (Scene2750 *)R2_GLOBALS._sceneManager._scene; @@ -1013,7 +1014,7 @@ void SpeakerNej2750::proc15() { } } -void SpeakerNej2800::proc15() { +void SpeakerNej2800::animateSpeaker() { int v = _speakerMode; Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; @@ -1054,7 +1055,7 @@ SpeakerPharisha::SpeakerPharisha(): VisualSpeaker() { _numFrames = 0; } -void SpeakerPharisha2435::proc15() { +void SpeakerPharisha2435::animateSpeaker() { int v = _speakerMode; Scene2435 *scene = (Scene2435 *)R2_GLOBALS._sceneManager._scene; @@ -1090,7 +1091,7 @@ SpeakerPrivate3210::SpeakerPrivate3210() { _numFrames = 0; } -void SpeakerPrivate3210::proc15() { +void SpeakerPrivate3210::animateSpeaker() { int v = _speakerMode; Scene3210 *scene = (Scene3210 *)R2_GLOBALS._sceneManager._scene; @@ -1129,7 +1130,7 @@ SpeakerProtector3600::SpeakerProtector3600() { _numFrames = 0; } -void SpeakerProtector3600::proc15() { +void SpeakerProtector3600::animateSpeaker() { int v = _speakerMode; Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; @@ -1190,7 +1191,7 @@ SpeakerQuinn::SpeakerQuinn(): VisualSpeaker() { _numFrames = 0; } -void SpeakerQuinn300::proc15() { +void SpeakerQuinn300::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1220,7 +1221,7 @@ void SpeakerQuinn300::proc15() { ((SceneItem *)_action)->_sceneRegionId = 0; switch (_object2->_visage) { - case 10: + case 10: _object1.setup((v - 1) / 4 + 4010, ((v - ((v - 1) / 4 * 4) - 1) % 8) * 2 + 1, 1); break; case 302: @@ -1237,7 +1238,7 @@ void SpeakerQuinn300::proc15() { } } -void SpeakerQuinn500::proc15() { +void SpeakerQuinn500::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1282,7 +1283,7 @@ void SpeakerQuinn500::proc15() { } } -void SpeakerQuinn1100::proc15() { +void SpeakerQuinn1100::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1331,7 +1332,7 @@ void SpeakerQuinn1100::proc15() { } } -void SpeakerQuinn2435::proc15() { +void SpeakerQuinn2435::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1358,7 +1359,7 @@ void SpeakerQuinn2435::proc15() { } } -void SpeakerQuinn2450::proc15() { +void SpeakerQuinn2450::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1387,7 +1388,7 @@ void SpeakerQuinn2450::proc15() { } } -void SpeakerQuinn2700::proc15() { +void SpeakerQuinn2700::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1418,7 +1419,7 @@ void SpeakerQuinn2700::proc15() { } } -void SpeakerQuinn2750::proc15() { +void SpeakerQuinn2750::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1449,7 +1450,7 @@ void SpeakerQuinn2750::proc15() { } } -void SpeakerQuinn2800::proc15() { +void SpeakerQuinn2800::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -1488,7 +1489,7 @@ void SpeakerQuinn2800::proc15() { } } -void SpeakerQuinn3255::proc15() { +void SpeakerQuinn3255::animateSpeaker() { Scene3255 *scene = (Scene3255 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1511,7 +1512,7 @@ void SpeakerQuinn3255::proc15() { } } -void SpeakerQuinn3375::proc15() { +void SpeakerQuinn3375::animateSpeaker() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1562,7 +1563,7 @@ void SpeakerQuinn3375::proc15() { } } -void SpeakerQuinn3385::proc15() { +void SpeakerQuinn3385::animateSpeaker() { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1617,7 +1618,7 @@ void SpeakerQuinn3385::proc15() { } } -void SpeakerQuinn3395::proc15() { +void SpeakerQuinn3395::animateSpeaker() { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1672,7 +1673,7 @@ void SpeakerQuinn3395::proc15() { } } -void SpeakerQuinn3400::proc15() { +void SpeakerQuinn3400::animateSpeaker() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1721,7 +1722,7 @@ void SpeakerQuinn3400::proc15() { } } -void SpeakerQuinn3600::proc15() { +void SpeakerQuinn3600::animateSpeaker() { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1787,7 +1788,7 @@ void SpeakerQuinn3700::setText(const Common::String &msg) { VisualSpeaker::setText(msg); } -void SpeakerQuinn3700::proc15() { +void SpeakerQuinn3700::animateSpeaker() { Scene3700 *scene = (Scene3700 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -1872,7 +1873,7 @@ SpeakerRalf3245::SpeakerRalf3245() { _numFrames = 0; } -void SpeakerRalf3245::proc15() { +void SpeakerRalf3245::animateSpeaker() { int v = _speakerMode; Scene3245 *scene = (Scene3245 *)R2_GLOBALS._sceneManager._scene; @@ -1924,7 +1925,7 @@ SpeakerRocko::SpeakerRocko() { _numFrames = 0; } -void SpeakerRocko3200::proc15() { +void SpeakerRocko3200::animateSpeaker() { int v = _speakerMode; Scene3200 *scene = (Scene3200 *)R2_GLOBALS._sceneManager._scene; @@ -1947,7 +1948,7 @@ void SpeakerRocko3200::proc15() { } } -void SpeakerRocko3220::proc15() { +void SpeakerRocko3220::animateSpeaker() { int v = _speakerMode; Scene3220 *scene = (Scene3220 *)R2_GLOBALS._sceneManager._scene; @@ -1970,7 +1971,7 @@ void SpeakerRocko3220::proc15() { } } -void SpeakerRocko3230::proc15() { +void SpeakerRocko3230::animateSpeaker() { int v = _speakerMode; Scene3230 *scene = (Scene3230 *)R2_GLOBALS._sceneManager._scene; @@ -2009,7 +2010,7 @@ SpeakerSeeker::SpeakerSeeker(): VisualSpeaker() { _numFrames = 0; } -void SpeakerSeeker300::proc15() { +void SpeakerSeeker300::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2045,7 +2046,7 @@ void SpeakerSeeker300::proc15() { } } -void SpeakerSeeker500::proc15() { +void SpeakerSeeker500::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2082,7 +2083,7 @@ void SpeakerSeeker500::proc15() { } } -void SpeakerSeeker1100::proc15() { +void SpeakerSeeker1100::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2142,7 +2143,7 @@ void SpeakerSeeker1100::proc15() { } } -void SpeakerSeeker1900::proc15() { +void SpeakerSeeker1900::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2173,7 +2174,7 @@ void SpeakerSeeker1900::proc15() { } } -void SpeakerSeeker2435::proc15() { +void SpeakerSeeker2435::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2200,7 +2201,7 @@ void SpeakerSeeker2435::proc15() { } } -void SpeakerSeeker2450::proc15() { +void SpeakerSeeker2450::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2226,7 +2227,7 @@ void SpeakerSeeker2450::proc15() { } } -void SpeakerSeeker3375::proc15() { +void SpeakerSeeker3375::animateSpeaker() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2275,7 +2276,7 @@ void SpeakerSeeker3375::proc15() { } } -void SpeakerSeeker3385::proc15() { +void SpeakerSeeker3385::animateSpeaker() { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2324,7 +2325,7 @@ void SpeakerSeeker3385::proc15() { } } -void SpeakerSeeker3395::proc15() { +void SpeakerSeeker3395::animateSpeaker() { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2373,7 +2374,7 @@ void SpeakerSeeker3395::proc15() { } } -void SpeakerSeeker3400::proc15() { +void SpeakerSeeker3400::animateSpeaker() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2432,7 +2433,7 @@ void SpeakerSeeker3400::proc15() { } } -void SpeakerSeeker3600::proc15() { +void SpeakerSeeker3600::animateSpeaker() { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2492,7 +2493,7 @@ void SpeakerSeeker3700::setText(const Common::String &msg) { VisualSpeaker::setText(msg); } -void SpeakerSeeker3700::proc15() { +void SpeakerSeeker3700::animateSpeaker() { Scene3700 *scene = (Scene3700 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2572,7 +2573,7 @@ SpeakerSocko3200::SpeakerSocko3200() { _numFrames = 0; } -void SpeakerSocko3200::proc15() { +void SpeakerSocko3200::animateSpeaker() { int v = _speakerMode; Scene3200 *scene = (Scene3200 *)R2_GLOBALS._sceneManager._scene; @@ -2611,7 +2612,7 @@ SpeakerSoldier::SpeakerSoldier(int color) { _numFrames = 0; } -void SpeakerSoldier300::proc15() { +void SpeakerSoldier300::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2655,7 +2656,7 @@ SpeakerTealMode7::SpeakerTealMode7(): SpeakerTeal() { _displayMode = 7; } -void SpeakerTeal180::proc15() { +void SpeakerTeal180::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2690,7 +2691,7 @@ void SpeakerTeal180::proc15() { } } -void SpeakerTeal300::proc15() { +void SpeakerTeal300::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2714,7 +2715,7 @@ void SpeakerTeal300::proc15() { } } -void SpeakerTeal1625::proc15() { +void SpeakerTeal1625::animateSpeaker() { int v = _speakerMode; if (!_object2) { @@ -2738,7 +2739,7 @@ void SpeakerTeal1625::proc15() { } } -void SpeakerTeal3240::proc15() { +void SpeakerTeal3240::animateSpeaker() { int v = _speakerMode; Scene3240 *scene = (Scene3240 *)R2_GLOBALS._sceneManager._scene; @@ -2761,7 +2762,7 @@ void SpeakerTeal3240::proc15() { } } -void SpeakerTeal3400::proc15() { +void SpeakerTeal3400::animateSpeaker() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2818,7 +2819,7 @@ void SpeakerTeal3400::proc15() { } } -void SpeakerTeal3600::proc15() { +void SpeakerTeal3600::animateSpeaker() { Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2890,7 +2891,7 @@ SpeakerTomko3245::SpeakerTomko3245() { _numFrames = 0; } -void SpeakerTomko3245::proc15() { +void SpeakerTomko3245::animateSpeaker() { int v = _speakerMode; Scene3245 *scene = (Scene3245 *)R2_GLOBALS._sceneManager._scene; @@ -2942,8 +2943,8 @@ SpeakerWebbster::SpeakerWebbster(int color) { _numFrames = 0; } -void SpeakerWebbster180::proc15() { - Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; +void SpeakerWebbster180::animateSpeaker() { + Scene180 *scene = (Scene180 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -2974,7 +2975,7 @@ void SpeakerWebbster180::proc15() { break; case 3: ((SceneItem *)_action)->_sceneRegionId = 0; - _object1.setup(75, 6, 1); + _object1.setup(76, 6, 1); _object1.animate(ANIM_MODE_5, this); break; default: @@ -2983,7 +2984,7 @@ void SpeakerWebbster180::proc15() { } } -void SpeakerWebbster3240::proc15() { +void SpeakerWebbster3240::animateSpeaker() { int v = _speakerMode; Scene3240 *scene = (Scene3240 *)R2_GLOBALS._sceneManager._scene; @@ -3006,7 +3007,7 @@ void SpeakerWebbster3240::proc15() { } } -void SpeakerWebbster3375::proc15() { +void SpeakerWebbster3375::animateSpeaker() { Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -3050,7 +3051,7 @@ void SpeakerWebbster3375::proc15() { } } -void SpeakerWebbster3385::proc15() { +void SpeakerWebbster3385::animateSpeaker() { Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -3094,7 +3095,7 @@ void SpeakerWebbster3385::proc15() { } } -void SpeakerWebbster3395::proc15() { +void SpeakerWebbster3395::animateSpeaker() { Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -3138,7 +3139,7 @@ void SpeakerWebbster3395::proc15() { } } -void SpeakerWebbster3400::proc15() { +void SpeakerWebbster3400::animateSpeaker() { Scene3400 *scene = (Scene3400 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; @@ -3197,7 +3198,7 @@ SpeakerDutyOfficer180::SpeakerDutyOfficer180(): VisualSpeaker() { _numFrames = 0; } -void SpeakerDutyOfficer180::proc15() { +void SpeakerDutyOfficer180::animateSpeaker() { Scene180 *scene = (Scene180 *)R2_GLOBALS._sceneManager._scene; int v = _speakerMode; diff --git a/engines/tsage/ringworld2/ringworld2_speakers.h b/engines/tsage/ringworld2/ringworld2_speakers.h index a49bb1d3e5..33e34ce8f6 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.h +++ b/engines/tsage/ringworld2/ringworld2_speakers.h @@ -63,8 +63,8 @@ public: virtual void signal(); virtual void dispatch(); virtual void setText(const Common::String &msg); - virtual void proc15() {} - virtual void proc16(); + virtual void animateSpeaker() {} + virtual void stopSpeaking(); void setDelay(int delay); }; @@ -83,7 +83,7 @@ public: SpeakerCaptain3210(); virtual Common::String getClassName() { return "SpeakerCaptain3210"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Caretaker @@ -102,7 +102,7 @@ public: SpeakerChief1100(); virtual Common::String getClassName() { return "SpeakerChief1100"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Guard @@ -116,7 +116,7 @@ public: class SpeakerGuard2800 : public SpeakerGuard { public: virtual Common::String getClassName() { return "SpeakerGuard2800"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Jocko @@ -130,19 +130,19 @@ public: class SpeakerJocko3200 : public SpeakerJocko { public: virtual Common::String getClassName() { return "SpeakerJocko3200"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerJocko3220 : public SpeakerJocko { public: virtual Common::String getClassName() { return "SpeakerJocko3220"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerJocko3230 : public SpeakerJocko { public: virtual Common::String getClassName() { return "SpeakerJocko3230"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Miranda @@ -156,55 +156,55 @@ public: class SpeakerMiranda300 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda300"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda1625 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda1625"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3255 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3255"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3375 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3375"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3385 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3385"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3395 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3395"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3400 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3400"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3600 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3600"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerMiranda3700 : public SpeakerMiranda { public: virtual Common::String getClassName() { return "SpeakerMiranda3700"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Nej @@ -218,19 +218,19 @@ public: class SpeakerNej2700 : public SpeakerNej { public: virtual Common::String getClassName() { return "SpeakerNej2700"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerNej2750 : public SpeakerNej { public: virtual Common::String getClassName() { return "SpeakerNej2750"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerNej2800 : public SpeakerNej { public: virtual Common::String getClassName() { return "SpeakerNej2800"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Pharisha @@ -245,7 +245,7 @@ public: class SpeakerPharisha2435 : public SpeakerPharisha { public: virtual Common::String getClassName() { return "SpeakerPharisha2435"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Private @@ -255,7 +255,7 @@ public: SpeakerPrivate3210(); virtual Common::String getClassName() { return "SpeakerPrivate3210"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Protector @@ -265,7 +265,7 @@ public: SpeakerProtector3600(); virtual Common::String getClassName() { return "SpeakerProtector3600"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Quinn @@ -279,92 +279,92 @@ public: class SpeakerQuinn300 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn300"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn500 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn500"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn1100 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn1100"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn2435 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn2435"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn2450 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn2450"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn2700 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn2700"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn2750 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn2750"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn2800 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn2800"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3255 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3255"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3375 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3375"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3385 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3385"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3395 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3395"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3400 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3400"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3600 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3600"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerQuinn3700 : public SpeakerQuinn { public: virtual Common::String getClassName() { return "SpeakerQuinn3700"; } virtual void setText(const Common::String &msg); - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to QuinnL @@ -383,7 +383,7 @@ public: SpeakerRalf3245(); virtual Common::String getClassName() { return "SpeakerRalf3245"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Rocko @@ -397,19 +397,19 @@ public: class SpeakerRocko3200 : public SpeakerRocko { public: virtual Common::String getClassName() { return "SpeakerRocko3200"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerRocko3220 : public SpeakerRocko { public: virtual Common::String getClassName() { return "SpeakerRocko3220"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerRocko3230 : public SpeakerRocko { public: virtual Common::String getClassName() { return "SpeakerRocko3230"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Seeker @@ -423,74 +423,74 @@ public: class SpeakerSeeker300 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker300"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker500 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker500"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker1100 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker1100"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker1900 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker1900"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker2435 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker2435"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker2450 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker2450"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker3375 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3375"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker3385 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3385"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker3395 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3395"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker3400 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3400"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker3600 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3600"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSeeker3700 : public SpeakerSeeker { public: virtual Common::String getClassName() { return "SpeakerSeeker3700"; } virtual void setText(const Common::String &msg); - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to SeekerL @@ -509,7 +509,7 @@ public: SpeakerSocko3200(); virtual Common::String getClassName() { return "SpeakerSocko3200"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Soldier @@ -524,7 +524,7 @@ class SpeakerSoldier300 : public SpeakerSoldier { public: SpeakerSoldier300() : SpeakerSoldier(60) {} virtual Common::String getClassName() { return "SpeakerSoldier300"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerSoldier1625 : public SpeakerSoldier { @@ -550,37 +550,37 @@ public: class SpeakerTeal180 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal180"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerTeal300 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal300"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerTeal1625 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal1625"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerTeal3240 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal3240"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerTeal3400 : public SpeakerTeal { public: virtual Common::String getClassName() { return "SpeakerTeal3400"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerTeal3600 : public SpeakerTealMode7 { public: virtual Common::String getClassName() { return "SpeakerTeal3600"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Tomko @@ -590,7 +590,7 @@ public: SpeakerTomko3245(); virtual Common::String getClassName() { return "SpeakerTomko3245"; } - virtual void proc15(); + virtual void animateSpeaker(); }; // Classes related to Webbster @@ -605,7 +605,7 @@ class SpeakerWebbster180 : public SpeakerWebbster { public: SpeakerWebbster180() : SpeakerWebbster(27) {} virtual Common::String getClassName() { return "SpeakerWebbster180"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerWebbster2500 : public SpeakerWebbster { @@ -619,7 +619,7 @@ public: SpeakerWebbster3240() : SpeakerWebbster(10) {} virtual Common::String getClassName() { return "SpeakerWebbster3240"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerWebbster3375 : public SpeakerWebbster { @@ -627,7 +627,7 @@ public: SpeakerWebbster3375() : SpeakerWebbster(60) {} virtual Common::String getClassName() { return "SpeakerWebbster3375"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerWebbster3385 : public SpeakerWebbster { @@ -635,7 +635,7 @@ public: SpeakerWebbster3385() : SpeakerWebbster(60) {} virtual Common::String getClassName() { return "SpeakerWebbster3385"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerWebbster3395 : public SpeakerWebbster { @@ -643,7 +643,7 @@ public: SpeakerWebbster3395() : SpeakerWebbster(60) {} virtual Common::String getClassName() { return "SpeakerWebbster3395"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerWebbster3400 : public SpeakerWebbster { @@ -651,7 +651,7 @@ public: SpeakerWebbster3400() : SpeakerWebbster(27) {} virtual Common::String getClassName() { return "SpeakerWebbster3400"; } - virtual void proc15(); + virtual void animateSpeaker(); }; class SpeakerDutyOfficer180: public VisualSpeaker { @@ -659,7 +659,7 @@ public: SpeakerDutyOfficer180(); virtual Common::String getClassName() { return "SpeakerDutyOfficer"; } - virtual void proc15(); + virtual void animateSpeaker(); }; } // End of namespace Ringworld2 diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index f8797fd569..88bc7f2c66 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -141,8 +141,8 @@ void SoundManager::syncSounds() { if (voice_mute) subtitles = true; - R2_GLOBALS._speechSubtitles = - (voice_mute ? 0 : SPEECH_VOICE) | + R2_GLOBALS._speechSubtitles = + (voice_mute ? 0 : SPEECH_VOICE) | (!subtitles ? 0 : SPEECH_TEXT); } } @@ -1736,7 +1736,7 @@ uint32 Sound::getTimeIndex() const { } int Sound::getCueValue() const { - return _cueValue; + return _cueValue == 0xff ? -1 : _cueValue; } void Sound::setCueValue(int cueValue) { @@ -2438,23 +2438,23 @@ void ASound::dispatch() { _cueValue = cueValue; _sound.setCueValue(-1); - if (_action) - _action->signal(); + if (_endAction) + _endAction->signal(); } if (_cueValue != -1) { if (!_sound.isPrimed()) { _cueValue = -1; - if (_action) { - _action->signal(); - _action = NULL; + if (_endAction) { + _endAction->signal(); + _endAction = NULL; } } } } -void ASound::play(int soundNum, EventHandler *action, int volume) { - _action = action; +void ASound::play(int soundNum, EventHandler *endAction, int volume) { + _endAction = endAction; _cueValue = 0; setVol(volume); @@ -2477,9 +2477,9 @@ void ASound::unPrime() { _action = NULL; } -void ASound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, EventHandler *action) { - if (action) - _action = action; +void ASound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, EventHandler *endAction) { + if (endAction) + _endAction = endAction; _sound.fade(fadeDest, fadeSteps, fadeTicks, stopAfterFadeFlag); } @@ -2506,8 +2506,8 @@ void ASoundExt::signal() { } } -void ASoundExt::fadeOut2(EventHandler *action) { - fade(0, 10, 10, true, action); +void ASoundExt::fadeOut2(EventHandler *endAction) { + fade(0, 10, 10, true, endAction); } void ASoundExt::changeSound(int soundNum) { @@ -2560,7 +2560,7 @@ bool PlayStream::setFile(const Common::String &filename) { // Load header _resData.load(_file); - + // Load the index _index = new uint16[_resData._indexSize / 2]; for (uint i = 0; i < (_resData._indexSize / 2); ++i) @@ -2583,7 +2583,7 @@ bool PlayStream::play(int voiceNum, EventHandler *endAction) { _file.read(&header[0], 4); if (strncmp(header, "FEED", 4)) error("Invalid stream data"); - + // Get basic details of first sound chunk uint chunkSize = _file.readUint16LE() - 16; _file.skip(4); @@ -2597,7 +2597,7 @@ bool PlayStream::play(int voiceNum, EventHandler *endAction) { byte *data = (byte *)malloc(chunkSize); _file.read(data, chunkSize); _audioStream->queueBuffer(data, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); - + // If necessary, load further chunks of the voice in while (chunkSize == (_resData._chunkSize - 16)) { // Ensure the next chunk has the 'MORE' header @@ -2617,14 +2617,14 @@ bool PlayStream::play(int voiceNum, EventHandler *endAction) { _file.read(data, chunkSize); _audioStream->queueBuffer(data, chunkSize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); } - - g_vm->_mixer->playStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, + + g_vm->_mixer->playStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, _audioStream, DisposeAfterUse::YES); _voiceNum = voiceNum; _endAction = endAction; return true; } - + // If it reaches this point, no valid voice data found return false; } @@ -2674,7 +2674,7 @@ uint32 PlayStream::getFileOffset(const uint16 *data, int count, int voiceNum) { int byteIndex = voiceNum >> 3; int shiftAmount = bitsIndex * 2; int bitMask = 3 << shiftAmount; - int v = (data[byteIndex] & bitMask) >> shiftAmount; + int v = (data[byteIndex] & bitMask) >> shiftAmount; uint32 offset = 0; if (!v) diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 5d0bc92c1f..3f039ff9e9 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -366,7 +366,7 @@ public: class ASound: public EventHandler { public: Sound _sound; - EventHandler *_action; + EventHandler *_endAction; int _cueValue; ASound(); @@ -374,7 +374,7 @@ public: virtual void synchronize(Serializer &s); virtual void dispatch(); - void play(int soundNum, EventHandler *action = NULL, int volume = 127); + void play(int soundNum, EventHandler *endAction = NULL, int volume = 127); void stop(); void prime(int soundNum, Action *action = NULL); void unPrime(); @@ -386,7 +386,7 @@ public: bool isMuted() const { return _sound.isMuted(); } void pause(bool flag) { _sound.pause(flag); } void mute(bool flag) { _sound.mute(flag); } - void fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, EventHandler *action); + void fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, EventHandler *endAction); void fadeIn() { fade(127, 5, 10, false, NULL); } void fadeOut(Action *action) { fade(0, 5, 10, true, action); } void setTimeIndex(uint32 timeIndex) { _sound.setTimeIndex(timeIndex); } @@ -407,7 +407,7 @@ public: int _soundNum; ASoundExt(); - void fadeOut2(EventHandler *action); + void fadeOut2(EventHandler *endAction); void changeSound(int soundNum); virtual Common::String getClassName() { return "ASoundExt"; } @@ -438,7 +438,7 @@ public: PlayStream(); virtual ~PlayStream(); - bool setFile(const Common::String &filename); + bool setFile(const Common::String &filename); bool play(int voiceNum, EventHandler *endAction); void stop(); bool isPlaying() const; diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 9956d5c7fb..37e96c75e0 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -125,7 +125,7 @@ void TSageEngine::deinitialize() { } Common::Error TSageEngine::run() { - // Basic initialisation + // Basic initialization initialize(); g_globals->_sceneHandler->registerHandler(); diff --git a/engines/tsage/user_interface.cpp b/engines/tsage/user_interface.cpp index c7053a073d..ae34ac0574 100644 --- a/engines/tsage/user_interface.cpp +++ b/engines/tsage/user_interface.cpp @@ -295,7 +295,7 @@ void UICollection::r2rDrawFrame() { GLOBALS._screenSurface.copyFrom(vertLine, SCREEN_WIDTH - 4, 3); // Restrict drawing area to exclude the borders at the edge of the screen - R2_GLOBALS._screenSurface._clipRect = Rect(4, 4, SCREEN_WIDTH - 4, + R2_GLOBALS._screenSurface._clipRect = Rect(4, 4, SCREEN_WIDTH - 4, SCREEN_HEIGHT - 4); } |