diff options
-rw-r--r-- | backends/platform/sdl/posix/posix.cpp | 11 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 11 | ||||
-rw-r--r-- | engines/avalanche/animation.cpp | 3 | ||||
-rw-r--r-- | engines/fullpipe/motion.cpp | 114 | ||||
-rw-r--r-- | engines/fullpipe/motion.h | 2 | ||||
-rw-r--r-- | engines/tsage/core.cpp | 15 | ||||
-rw-r--r-- | engines/tsage/ringworld/ringworld_scenes1.cpp | 690 | ||||
-rw-r--r-- | engines/tsage/ringworld/ringworld_scenes1.h | 85 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 20 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.h | 4 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes0.cpp | 234 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes1.cpp | 62 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes2.cpp | 87 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes3.cpp | 122 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.cpp | 22 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_speakers.h | 4 | ||||
-rw-r--r-- | engines/tsage/sound.cpp | 5 | ||||
-rw-r--r-- | graphics/decoders/png.cpp | 10 | ||||
-rw-r--r-- | gui/ThemeEngine.cpp | 10 | ||||
-rw-r--r-- | gui/console.cpp | 23 | ||||
-rw-r--r-- | gui/console.h | 6 |
21 files changed, 788 insertions, 752 deletions
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index 7a8b1e7b70..954f404ac6 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -80,15 +80,16 @@ bool OSystem_POSIX::hasFeature(Feature f) { } Common::String OSystem_POSIX::getDefaultConfigFileName() { - char configFile[MAXPATHLEN]; + Common::String configFile; // On POSIX type systems, by default we store the config file inside // to the HOME directory of the user. const char *home = getenv("HOME"); - if (home != NULL && strlen(home) < MAXPATHLEN) - snprintf(configFile, MAXPATHLEN, "%s/%s", home, _baseConfigName.c_str()); - else - strcpy(configFile, _baseConfigName.c_str()); + if (home != NULL && (strlen(home) + 1 + _baseConfigName.size()) < MAXPATHLEN) { + configFile = Common::String::format("%s/%s", home, _baseConfigName.c_str()); + } else { + configFile = _baseConfigName; + } return configFile; } diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index bc80d8ad6a..178eeb96af 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -369,17 +369,6 @@ Common::String OSystem_SDL::getSystemLanguage() const { const LCID languageIdentifier = GetThreadLocale(); - // GetLocalInfo is only supported starting from Windows 2000, according to this: - // http://msdn.microsoft.com/en-us/library/dd318101%28VS.85%29.aspx - // On the other hand the locale constants used, seem to exist on Windows 98 too, - // check this for that: http://msdn.microsoft.com/en-us/library/dd464799%28v=VS.85%29.aspx - // - // I am not exactly sure what is the truth now, it might be very well that this breaks - // support for systems older than Windows 2000.... - // - // TODO: Check whether this (or ScummVM at all ;-) works on a system with Windows 98 for - // example and if it does not and we still want Windows 9x support, we should definitly - // think of another solution. if (GetLocaleInfo(languageIdentifier, LOCALE_SISO639LANGNAME, langName, sizeof(langName)) != 0 && GetLocaleInfo(languageIdentifier, LOCALE_SISO3166CTRYNAME, ctryName, sizeof(ctryName)) != 0) { Common::String localeName = langName; diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index 6bce59ddc0..927de07236 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -826,7 +826,6 @@ void Animation::callSpecial(uint16 which) { _vm->_magics[4]._operation = kMagicBounce; // Boundary effect is now working again. _vm->_dialogs->displayScrollChain('q', 35); _sprites[0]->remove(); - //tr[1].vanishifstill:=true; AnimationType *spr1 = _sprites[1]; _vm->_background->draw(-1, -1, 1); @@ -1069,7 +1068,7 @@ void Animation::arrowProcs(byte tripnum) { void Animation::grabAvvy(byte tripnum) { // For Friar Tuck, in Nottingham. AnimationType *tripSpr = _sprites[tripnum]; - AnimationType *avvy = _sprites[tripnum]; + AnimationType *avvy = _sprites[0]; int16 tox = avvy->_x + 17; int16 toy = avvy->_y - 1; diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index ffa23cd071..ebb838e2fb 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -670,34 +670,29 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) { mq = new MessageQueue(g_fullpipe->globalMessageQueueList->compact()); for (int i = 0; i < movInfo->_itemsCount - 1; i++) { - v9 = (MovInfo1Sub *)movInfo->items; - v10 = v9[i + 1].subIndex; + v10 = movInfo->items[i + 1].subIndex; if (v10 != 10) { - if (v40 >= movInfo->_itemsCount - 2 || v9[i + 2].subIndex != 10) { - v16 = v9[i].subIndex; - v17 = (char *)this->items[1] + 16 * (v10 + 8); - subidx = 93 * movInfo->field_0; + if (i >= movInfo->itemsCount - 2 || movInfo->items[i + 2].subIndex != 10) { + v17 = (char *)_items[1] + 16 * (v10 + 8); movinfo.flags = 0; - v14 = 8 * subidx; - v15 = (MovGraph2Item *)(&v17[184 * v16] + v14); + subidx = 8 * 93 * movInfo->field_0; + v15 = (MovGraph2Item *)(&v17[184 * movInfo->items[i].subIndex] + subidx); } else { - v11 = v9[i].subIndex; - v12 = (char *)this->items[1] + 16 * (v10 + 4); - v13 = 93 * movInfo->field_0; + v12 = (char *)_items[1] + 16 * (v10 + 4); movinfo.flags = 2; - v14 = 8 * v13; - v15 = (MovGraph2Item *)(&v12[184 * v11] + v14); + subidx = 8 * 93 * movInfo->field_0; + v15 = (MovGraph2Item *)(&v12[184 * movInfo->items[i].subIndex] + subidx); } - if (v40 < movInfo->_itemsCount - 2 - || (v19 = v9[i + 1].x, v20 = (char *)&v9[i].x, v47 = (int *)v20, v21 = *(_DWORD *)v20, v21 == v19) - && v9[i].y == v9[i + 1].y + if (i < movInfo->itemsCount - 2 + || (v19 = movInfo->items[i + 1].x, v20 = (char *)&movInfo->items[i].x, v47 = (int *)v20, v21 = *(_DWORD *)v20, v21 == v19) + && movInfo->items[i].y == movInfo->items[i + 1].y || v21 == -1 - || v9[i].y == -1 + || movInfo->items[i].y == -1 || v19 == -1 - || v9[i + 1].y == -1) { + || movInfo->items[i + 1].y == -1) { - ExCommand *ex = new ExCommand(_items[1][movInfo->field_0].objectId, 1, v15->objectId, 0, 0, 0, 1, 0, 0, 0); + ExCommand *ex = new ExCommand(_items[1][movInfo->field_0].objectId, 1, v15->_objectId, 0, 0, 0, 1, 0, 0, 0); ex->_excFlags |= 2u; ex->_keyCode = _items[1][movInfo->field_0].obj->GameObject.okeyCode; @@ -705,29 +700,29 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) { ex->_field_14 = -1; mq->_exCommands.push_back(ex); - curX += v15->subItems[0].staticsId2; - curY += v15->subItems[0].staticsId1; + curX += v15->_subItems[0].staticsId2; + curY += v15->_subItems[0].staticsId1; } else { memset(mgminfo, 0, sizeof(mgminfo)); - HIWORD(v22) = 0a; - v23 = v15->obj; + HIWORD(v22) = 0; + v23 = (Movement *)v15->obj; mgminfo.ani = *(StaticANIObject **)((char *)&this->items[1]->obj + v14); - LOWORD(v22) = *(_WORD *)(v23->callback1 + 132); + LOWORD(v22) = v23->staticsObj2->staticsId; mgminfo.staticsId2 = v22; - mgminfo.x1 = v9[i + 1].x; - mgminfo.y1 = v9[i + 1].y; - mgminfo.field_1C = v9[i + 1].field_C; - mgminfo.staticsId1 = *(_WORD *)(v23->initialCounter + 132); + mgminfo.x1 = movInfo->items[i + 1].x; + mgminfo.y1 = movInfo->items[i + 1].y; + mgminfo.field_1C = movInfo->items[i + 1].field_C; + mgminfo.staticsId1 = v23->staticsObj1->staticsId; + mgminfo.x2 = *v47; - v24 = v15->objectId; - mgminfo.y2 = v9[i].y; + mgminfo.y2 = movInfo->items[i].y; mgminfo.field_10 = 1; - mgminfo.flags = 127; - mgminfo.movementId = v24; + mgminfo.flags = 0x7f; + mgminfo.movementId = v15->_objectId; v25 = (MessageQueue *)MGM_sub_445330((MGM *)&this->movGraph.mgm, &mgminfo); - MessageQueue_transferExCommands(mq, v25); + mq->transferExCommands(v25); if (v25) (*(void (__thiscall **)(MessageQueue *, signed int))(v25->CObject.vmt + 4))(v25, 1); @@ -737,52 +732,53 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) { curY = v26[i + 1].y; } } else { - movinfo.item1Index = v9[i].subIndex; + movinfo.item1Index = movInfo->items[i].subIndex; movinfo.subIndex = movinfo.item1Index; movinfo.pt1.y = curY; movinfo.pt1.x = curX; + movinfo.distance1 = curDistance; - v29 = v9[i + 2].x; - movinfo.pt2.x = v9[i + 2].x; - movinfo.pt2.y = v9[i + 2].y; - movinfo.distance2 = v9[i + 2].field_C; - - if (v40 >= movInfo->_itemsCount - 4 - || (v30 = v9[i + 2].subIndex, v30 == 10) - || (v31 = v9[i + 3].subIndex, v31 == 10) - || v30 == v31 - || v9[i + 4].subIndex != 10) { - if (v40 >= movInfo->itemsCount - 3 - || (v33 = v9[i + 2].subIndex, v33 == 10) - || (v34 = v9[i + 3].subIndex, v34 == 10) - || v33 == v34) { - movinfo.flags = movinfo.flags & 2 | movInfo->flags & 1; + movinfo.pt2.x = movInfo->items[i + 2].x; + movinfo.pt2.y = movInfo->items[i + 2].y; + movinfo.distance2 = movInfo->items[i + 2].field_C; + + if (i >= movInfo->itemsCount - 4 + || movInfo->items[i + 2].subIndex == 10 + || movInfo->items[i + 3].subIndex == 10 + || movInfo->items[i + 2].subIndex == movInfo->items[i + 3].subIndex + || movInfo->items[i + 4].subIndex != 10) { + if (i >= movInfo->itemsCount - 3 + || movInfo->items[i + 2].subIndex == 10 + || movInfo->items[i + 3].subIndex == 10 + || movInfo->items[i + 2].subIndex == movInfo->items[i + 3].subIndex) { + movinfo.flags &= 3; } else { - v35 = (MovInfo1 *)((char *)&this->items[1][movInfo->field_0] + 184 * v33 + 16 * (v34 + 8)); - movinfo.pt2.x = v29 - v35->pt1.y; + v35 = (MovInfo1 *)((char *)&_items[1][movInfo->field_0] + 184 * movInfo->items[i + 2].subIndex + 16 * (movInfo->items[i + 3].subIndex + 8)); + movinfo.pt2.x -= v35->pt1.y; movinfo.pt2.y -= v35->pt2.x; - movinfo.flags = movinfo.flags & 2 | movInfo->flags & 1; + movinfo.flags &= 3; } } else { - v32 = (MovInfo1 *)((char *)&this->items[1][movInfo->field_0] + 184 * v30 + 16 * (v31 + 4)); + v32 = (MovInfo1 *)((char *)&_items[1][movInfo->field_0] + 184 * movInfo->items[i + 2].subIndex + 16 * (movInfo->items[i + 3].subIndex + 4)); if (movinfo.item1Index && movinfo.item1Index != 1) { movinfo.pt2.y -= v32->pt2.x; - movinfo.flags = movinfo.flags & 2 | 1; + movinfo.flags = (movinfo.flags & 2) | 1; } else { - movinfo.pt2.x = v29 - v32->pt1.y; - movinfo.flags = movinfo.flags & 2 | 1; + movinfo.pt2.x -= v32->pt1.y; + movinfo.flags = (movinfo.flags & 2) | 1; } } - i++; + i++; // intentional - v36 = MovGraph2_sub_454CD0(this, &movinfo); + v36 = sub1(&movinfo); if (!v36) { delete mq; return 0; } - MessageQueue_transferExCommands(mq, v36); + + mq->transferExCommands(v36); delete v36; diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index b79e66decb..0df520ce4a 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -306,7 +306,7 @@ struct MovInfo1 { struct MovGraph2Item { int _objectId; StaticANIObject *_obj; - MovGraph2ItemSub _subItems[4]; + MovGraph2ItemSub _subItems[4]; // 184 }; class MovGraph2 : public MovGraph { diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 877d866c3c..040dbc8c25 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1732,9 +1732,13 @@ void SceneItem::display(int resNum, int lineNum, ...) { font.setFontNumber(g_globals->_sceneText._fontNumber); font.getStringBounds(msg.c_str(), textRect, maxWidth); + Rect screenBounds = g_globals->gfxManager()._bounds; + if (g_vm->getGameID() == GType_Ringworld2) + screenBounds.collapse(20, 15); + // Center the text at the specified position, and then constrain it to be- textRect.center(pos.x, pos.y); - textRect.contain(g_globals->gfxManager()._bounds); + textRect.contain(screenBounds); if (centerText) { g_globals->_sceneText._color1 = g_globals->_sceneText._color2; @@ -2733,15 +2737,16 @@ void SceneObject::reposition() { */ void SceneObject::draw() { Rect destRect = _bounds; - destRect.translate(-g_globals->_sceneManager._scene->_sceneBounds.left, - -g_globals->_sceneManager._scene->_sceneBounds.top); + Scene *scene = g_globals->_sceneManager._scene; + destRect.translate(-scene->_sceneBounds.left, -scene->_sceneBounds.top); GfxSurface frame = getFrame(); - Region *priorityRegion = g_globals->_sceneManager._scene->_priorities.find(_priority); + Region *priorityRegion = scene->_priorities.find(_priority); if (g_vm->getGameID() == GType_Ringworld2) { switch (_effect) { case EFFECT_SHADOW_MAP: { - assert(_shadowMap); + if (!_shadowMap) + _shadowMap = static_cast<Ringworld2::SceneExt *>(scene)->_shadowPaletteMap; GLOBALS.gfxManager().getSurface().copyFrom(frame, frame.getBounds(), destRect, priorityRegion, _shadowMap); diff --git a/engines/tsage/ringworld/ringworld_scenes1.cpp b/engines/tsage/ringworld/ringworld_scenes1.cpp index 89c07273fc..5a42bc530d 100644 --- a/engines/tsage/ringworld/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld/ringworld_scenes1.cpp @@ -52,52 +52,52 @@ void Scene10::Action1::signal() { scene->_stripManager.start(11, this, scene); break; case 3: - scene->_object2.hide(); - scene->_object3.hide(); - scene->_object3.setAction(NULL); - scene->_object4.animate(ANIM_MODE_5, this); + scene->_veeshkaHead.hide(); + scene->_veeshkaRightArm.hide(); + scene->_veeshkaRightArm.setAction(NULL); + scene->_centurion.animate(ANIM_MODE_5, this); break; case 4: case 9: - scene->_object1.animate(ANIM_MODE_5, this); + scene->_veeshkaBody.animate(ANIM_MODE_5, this); break; case 5: - scene->_object2.setStrip(3); - scene->_object2.setFrame(1); - scene->_object2.setPosition(Common::Point(240, 51)); - scene->_object2.show(); + scene->_veeshkaHead.setStrip(3); + scene->_veeshkaHead.setFrame(1); + scene->_veeshkaHead.setPosition(Common::Point(240, 51)); + scene->_veeshkaHead.show(); - scene->_object3.setStrip(6); - scene->_object3.setFrame(1); - scene->_object3.setPosition(Common::Point(200, 76)); - scene->_object3._numFrames = 20; - scene->_object3.show(); + scene->_veeshkaRightArm.setStrip(6); + scene->_veeshkaRightArm.setFrame(1); + scene->_veeshkaRightArm.setPosition(Common::Point(200, 76)); + scene->_veeshkaRightArm._numFrames = 20; + scene->_veeshkaRightArm.show(); scene->_stripManager.start(12, this, scene); break; case 6: - scene->_object2.hide(); - scene->_object3.hide(); - scene->_object1.animate(ANIM_MODE_6, this); + scene->_veeshkaHead.hide(); + scene->_veeshkaRightArm.hide(); + scene->_veeshkaBody.animate(ANIM_MODE_6, this); break; case 7: - scene->_object3.show(); - scene->_object3.setStrip2(5); - scene->_object3._numFrames = 10; - scene->_object3.setPosition(Common::Point(180, 87)); - scene->_object3.setAction(&scene->_action2); + scene->_veeshkaRightArm.show(); + scene->_veeshkaRightArm.setStrip2(5); + scene->_veeshkaRightArm._numFrames = 10; + scene->_veeshkaRightArm.setPosition(Common::Point(180, 87)); + scene->_veeshkaRightArm.setAction(&scene->_action2); - scene->_object2.setStrip(4); - scene->_object2.setFrame(1); - scene->_object2.setPosition(Common::Point(204, 59)); - scene->_object2.show(); + scene->_veeshkaHead.setStrip(4); + scene->_veeshkaHead.setFrame(1); + scene->_veeshkaHead.setPosition(Common::Point(204, 59)); + scene->_veeshkaHead.show(); scene->_stripManager.start(13, this, scene); break; case 8: - scene->_object2.hide(); - scene->_object3.hide(); - scene->_object4.animate(ANIM_MODE_6, this); + scene->_veeshkaHead.hide(); + scene->_veeshkaRightArm.hide(); + scene->_centurion.animate(ANIM_MODE_6, this); break; case 10: g_globals->_soundHandler.fadeOut(this); @@ -109,6 +109,7 @@ void Scene10::Action1::signal() { } } +// Move Veeshka's fingers void Scene10::Action2::signal() { Scene10 *scene = (Scene10 *)g_globals->_sceneManager._scene; @@ -117,8 +118,8 @@ void Scene10::Action2::signal() { setDelay(g_globals->_randomSource.getRandomNumber(179)); break; case 1: - scene->_object3.setFrame(1); - scene->_object3.animate(ANIM_MODE_5, this); + scene->_veeshkaRightArm.setFrame(1); + scene->_veeshkaRightArm.animate(ANIM_MODE_5, this); _actionIndex = 0; break; } @@ -145,43 +146,43 @@ void Scene10::postInit(SceneObjectList *OwnerList) { _stripManager.setCallback(this); - _object1.postInit(); - _object1.setVisage(10); - _object1.setPosition(Common::Point(232, 90)); - _object1.fixPriority(1); - - _object2.postInit(); - _object2.setVisage(10); - _object2.setStrip(4); - _object2.setFrame(1); - _object2.setPosition(Common::Point(204, 59)); - _object2.fixPriority(198); - - _object3.postInit(); - _object3.setVisage(10); - _object3.setStrip2(5); - _object3.setPosition(Common::Point(180, 87)); - _object3.fixPriority(196); - _object3.setAction(&_action2); - - _object4.postInit(); - _object4.setVisage(10); - _object4.setStrip(2); - _object4.setPosition(Common::Point(0, 209)); - _object4.animate(ANIM_MODE_1, NULL); - - _object5.postInit(); - _object5.setVisage(11); - _object5.setPosition(Common::Point(107, 146)); - _object5.animate(ANIM_MODE_2, NULL); - _object5._numFrames = 5; - - _object6.postInit(); - _object6.setVisage(11); - _object6.setStrip(2); - _object6.setPosition(Common::Point(287, 149)); - _object6.animate(ANIM_MODE_2, NULL); - _object6._numFrames = 5; + _veeshkaBody.postInit(); + _veeshkaBody.setVisage(10); + _veeshkaBody.setPosition(Common::Point(232, 90)); + _veeshkaBody.fixPriority(1); + + _veeshkaHead.postInit(); + _veeshkaHead.setVisage(10); + _veeshkaHead.setStrip(4); + _veeshkaHead.setFrame(1); + _veeshkaHead.setPosition(Common::Point(204, 59)); + _veeshkaHead.fixPriority(198); + + _veeshkaRightArm.postInit(); + _veeshkaRightArm.setVisage(10); + _veeshkaRightArm.setStrip2(5); + _veeshkaRightArm.setPosition(Common::Point(180, 87)); + _veeshkaRightArm.fixPriority(196); + _veeshkaRightArm.setAction(&_action2); + + _centurion.postInit(); + _centurion.setVisage(10); + _centurion.setStrip(2); + _centurion.setPosition(Common::Point(0, 209)); + _centurion.animate(ANIM_MODE_1, NULL); + + _leftSmoke.postInit(); + _leftSmoke.setVisage(11); + _leftSmoke.setPosition(Common::Point(107, 146)); + _leftSmoke.animate(ANIM_MODE_2, NULL); + _leftSmoke._numFrames = 5; + + _rightSmoke.postInit(); + _rightSmoke.setVisage(11); + _rightSmoke.setStrip(2); + _rightSmoke.setPosition(Common::Point(287, 149)); + _rightSmoke.animate(ANIM_MODE_2, NULL); + _rightSmoke._numFrames = 5; g_globals->_sceneManager._scene->_sceneBounds.contain(g_globals->_sceneManager._scene->_backgroundBounds); g_globals->_sceneOffset.x = (g_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; @@ -193,14 +194,14 @@ void Scene10::postInit(SceneObjectList *OwnerList) { void Scene10::stripCallback(int v) { switch (v) { case 1: - _object2.animate(ANIM_MODE_7, -1, NULL); + _veeshkaHead.animate(ANIM_MODE_7, -1, NULL); break; case 2: - _object2.animate(ANIM_MODE_NONE); + _veeshkaHead.animate(ANIM_MODE_NONE); break; case 3: - _object2.animate(ANIM_MODE_7, -1, NULL); - _object3.animate(ANIM_MODE_5, NULL); + _veeshkaHead.animate(ANIM_MODE_7, -1, NULL); + _veeshkaRightArm.animate(ANIM_MODE_5, NULL); break; default: break; @@ -227,13 +228,13 @@ void Scene15::Action1::signal() { case 2: { SceneItem::display(15, 1, SET_Y, 20, SET_FONT, 2, SET_BG_COLOR, -1, SET_EXT_BGCOLOR, 7, SET_WIDTH, 320, SET_KEEP_ONSCREEN, 1, LIST_END); - scene->_object1.postInit(); - scene->_object1.setVisage(15); - scene->_object1.setPosition(Common::Point(160, -10)); - scene->_object1.animate(ANIM_MODE_2, NULL); + scene->_ship.postInit(); + scene->_ship.setVisage(15); + scene->_ship.setPosition(Common::Point(160, -10)); + scene->_ship.animate(ANIM_MODE_2, NULL); Common::Point pt(160, 100); NpcMover *mover = new NpcMover(); - scene->_object1.addMover(mover, &pt, this); + scene->_ship.addMover(mover, &pt, this); scene->_soundHandler.play(7); break; } @@ -247,8 +248,8 @@ void Scene15::Action1::signal() { void Scene15::Action1::dispatch() { Scene15 *scene = (Scene15 *)g_globals->_sceneManager._scene; - if (scene->_object1._position.y < 100) - scene->_object1.changeZoom(100 - scene->_object1._position.y); + if (scene->_ship._position.y < 100) + scene->_ship.changeZoom(100 - scene->_ship._position.y); Action::dispatch(); } @@ -307,9 +308,9 @@ void Scene20::Action2::signal() { Common::Point pt(455, 77); g_globals->_player.addMover(mover, &pt, this); ObjectMover2 *mover2 = new ObjectMover2(); - scene->_SceneObjectExt.addMover(mover2, 5, 10, &g_globals->_player); + scene->_assassinShip1.addMover(mover2, 5, 10, &g_globals->_player); ObjectMover2 *mover3 = new ObjectMover2(); - scene->_sceneObject3.addMover(mover3, 10, 15, &g_globals->_player); + scene->_assassinShip2.addMover(mover3, 10, 15, &g_globals->_player); break; } case 3: { @@ -369,9 +370,9 @@ void Scene20::Action3::signal() { Common::Point pt(615, 81); g_globals->_player.addMover(npcMover, &pt, this); ObjectMover2 *mover1 = new ObjectMover2(); - scene->_SceneObjectExt.addMover(mover1, 5, 10, &g_globals->_player); + scene->_assassinShip1.addMover(mover1, 5, 10, &g_globals->_player); ObjectMover2 *mover2 = new ObjectMover2(); - scene->_sceneObject3.addMover(mover2, 20, 25, &g_globals->_player); + scene->_assassinShip2.addMover(mover2, 20, 25, &g_globals->_player); break; } case 2: { @@ -382,8 +383,8 @@ void Scene20::Action3::signal() { } case 3: { g_globals->_player._moveDiff = Common::Point(10, 10); - scene->_SceneObjectExt._moveDiff = Common::Point(10, 10); - scene->_sceneObject3._moveDiff = Common::Point(10, 10); + scene->_assassinShip1._moveDiff = Common::Point(10, 10); + scene->_assassinShip2._moveDiff = Common::Point(10, 10); npcMover = new NpcMover(); Common::Point pt(445, 132); g_globals->_player.addMover(npcMover, &pt, this); @@ -427,73 +428,73 @@ void Scene20::Action4::signal() { Common::Point pt(486, 134); g_globals->_player.addMover(npcMover, &pt, this); ObjectMover2 *mover1 = new ObjectMover2(); - scene->_SceneObjectExt.addMover(mover1, 20, 35, &g_globals->_player); + scene->_assassinShip1.addMover(mover1, 20, 35, &g_globals->_player); break; } case 2: { g_globals->_player._moveDiff = Common::Point(12, 12); - scene->_SceneObjectExt._moveDiff = Common::Point(12, 12); + scene->_assassinShip1._moveDiff = Common::Point(12, 12); NpcMover *mover1 = new NpcMover(); Common::Point pt(486, 134); - scene->_sceneObject3.addMover(mover1, &pt, this); + scene->_assassinShip2.addMover(mover1, &pt, this); NpcMover *mover2 = new NpcMover(); pt = Common::Point(-15, 134); g_globals->_player.addMover(mover2, &pt, NULL); NpcMover *mover3 = new NpcMover(); pt = Common::Point(-15, 134); - scene->_SceneObjectExt.addMover(mover3, &pt, NULL); + scene->_assassinShip1.addMover(mover3, &pt, NULL); break; } case 3: { - scene->_sceneObject3._moveDiff = Common::Point(20, 20); + scene->_assassinShip2._moveDiff = Common::Point(20, 20); npcMover = new NpcMover(); Common::Point pt(320, 134); - scene->_sceneObject3.addMover(npcMover, &pt, this); + scene->_assassinShip2.addMover(npcMover, &pt, this); break; } case 4: { scene->_sound.play(28); - scene->_sceneObject4.postInit(); - scene->_sceneObject4.setVisage(21); - scene->_sceneObject4.setStrip(3); - scene->_sceneObject4.setPosition(Common::Point(scene->_sceneObject3._position.x - 36, - scene->_sceneObject3._position.y - 1)); - scene->_sceneObject4._moveDiff.x = 48; + scene->_laserShot1.postInit(); + scene->_laserShot1.setVisage(21); + scene->_laserShot1.setStrip(3); + Common::Point pt = Common::Point(scene->_assassinShip2._position.x - 36, scene->_assassinShip2._position.y - 1); + scene->_laserShot1.setPosition(pt); + scene->_laserShot1._moveDiff.x = 48; ObjectMover3 *mover = new ObjectMover3(); - scene->_sceneObject4.addMover(mover, &scene->_SceneObjectExt, 4, this); + scene->_laserShot1.addMover(mover, &scene->_assassinShip1, 4, this); break; } case 5: { scene->_sound.play(42); - scene->_sceneObject4.remove(); - scene->_SceneObjectExt.setVisage(21); - scene->_SceneObjectExt.setStrip(1); - scene->_SceneObjectExt.setFrame(1); - scene->_SceneObjectExt.animate(ANIM_MODE_5, NULL); + scene->_laserShot1.remove(); + scene->_assassinShip1.setVisage(21); + scene->_assassinShip1.setStrip(1); + scene->_assassinShip1.setFrame(1); + scene->_assassinShip1.animate(ANIM_MODE_5, NULL); - scene->_SceneObjectExt._moveDiff.x = 4; + scene->_assassinShip1._moveDiff.x = 4; NpcMover *mover1 = new NpcMover(); - Common::Point pt(scene->_SceneObjectExt._position.x - 12, scene->_SceneObjectExt._position.y + 5); - scene->_SceneObjectExt.addMover(mover1, &pt, NULL); + Common::Point pt(scene->_assassinShip1._position.x - 12, scene->_assassinShip1._position.y + 5); + scene->_assassinShip1.addMover(mover1, &pt, NULL); - scene->_sceneObject5.postInit(); - scene->_sceneObject5.setVisage(21); - scene->_sceneObject5.setStrip(3); - scene->_sceneObject5.setPosition(Common::Point(scene->_sceneObject3._position.x - 36, - scene->_sceneObject3._position.y - 1)); - scene->_sceneObject5._moveDiff.x = 48; + scene->_laserShot2.postInit(); + scene->_laserShot2.setVisage(21); + scene->_laserShot2.setStrip(3); + pt = Common::Point(scene->_assassinShip2._position.x - 36, scene->_assassinShip2._position.y - 1); + scene->_laserShot2.setPosition(pt); + scene->_laserShot2._moveDiff.x = 48; ObjectMover3 *mover = new ObjectMover3(); - scene->_sceneObject5.addMover(mover, &g_globals->_player, 4, this); + scene->_laserShot2.addMover(mover, &g_globals->_player, 4, this); break; } case 6: { scene->_sound.play(42); - scene->_SceneObjectExt.setStrip(2); - scene->_SceneObjectExt.animate(ANIM_MODE_2, NULL); + scene->_assassinShip1.setStrip(2); + scene->_assassinShip1.animate(ANIM_MODE_2, NULL); - scene->_sceneObject5.remove(); + scene->_laserShot2.remove(); g_globals->_player.setVisage(21); g_globals->_player.setStrip(1); g_globals->_player.setFrame(1); @@ -539,18 +540,18 @@ void Scene20::postInit(SceneObjectList *OwnerList) { g_globals->_player._moveDiff = Common::Point(10, 10); g_globals->_player.animate(ANIM_MODE_1, NULL); - _SceneObjectExt.postInit(); - _SceneObjectExt.setVisage(20); - _SceneObjectExt.setPosition(Common::Point(400, 69)); - _SceneObjectExt.animate(ANIM_MODE_1, NULL); + _assassinShip1.postInit(); + _assassinShip1.setVisage(20); + _assassinShip1.setPosition(Common::Point(400, 69)); + _assassinShip1.animate(ANIM_MODE_1, NULL); - _sceneObject3.postInit(); - _sceneObject3.setVisage(20); - _sceneObject3.setPosition(Common::Point(395, 69)); - _sceneObject3.animate(ANIM_MODE_1, NULL); + _assassinShip2.postInit(); + _assassinShip2.setVisage(20); + _assassinShip2.setPosition(Common::Point(395, 69)); + _assassinShip2.animate(ANIM_MODE_1, NULL); - _SceneObjectExt._moveDiff = Common::Point(10, 10); - _sceneObject3._moveDiff = Common::Point(10, 10); + _assassinShip1._moveDiff = Common::Point(10, 10); + _assassinShip2._moveDiff = Common::Point(10, 10); g_globals->_soundHandler.play(20); _sound.play(21); _sound.holdAt(true); @@ -567,16 +568,16 @@ void Scene20::postInit(SceneObjectList *OwnerList) { g_globals->_player.fixPriority(50); g_globals->_player.animate(ANIM_MODE_1, NULL); - _SceneObjectExt.postInit(); - _SceneObjectExt.setVisage(20); - _SceneObjectExt.setPosition(Common::Point(583, 79)); - _SceneObjectExt.animate(ANIM_MODE_1, NULL); + _assassinShip1.postInit(); + _assassinShip1.setVisage(20); + _assassinShip1.setPosition(Common::Point(583, 79)); + _assassinShip1.animate(ANIM_MODE_1, NULL); - _sceneObject3.postInit(); - _sceneObject3.setVisage(20); - _sceneObject3.setStrip2(2); - _sceneObject3.setPosition(Common::Point(595, 79)); - _sceneObject3.animate(ANIM_MODE_1, NULL); + _assassinShip2.postInit(); + _assassinShip2.setVisage(20); + _assassinShip2.setStrip2(2); + _assassinShip2.setPosition(Common::Point(595, 79)); + _assassinShip2.animate(ANIM_MODE_1, NULL); if ((g_globals->getFlag(120) && g_globals->getFlag(116)) || (g_globals->getFlag(117) && g_globals->getFlag(119))) { @@ -584,10 +585,10 @@ void Scene20::postInit(SceneObjectList *OwnerList) { setAction(&_action3); } else if (g_globals->getFlag(104)) { _sceneMode = 21; - setAction(&_sequenceManager, this, 21, &g_globals->_player, &_SceneObjectExt, NULL); + setAction(&_sequenceManager, this, 21, &g_globals->_player, &_assassinShip1, NULL); } else { // Failed evasion - _sceneObject3._moveDiff = Common::Point(8, 8); + _assassinShip2._moveDiff = Common::Point(8, 8); setAction(&_action4); } _sceneBounds.center(g_globals->_player._position.x, g_globals->_player._position.y); @@ -626,26 +627,37 @@ void Scene20::signal() { *--------------------------------------------------------------------------*/ void Scene30::BeamObject::doAction(int action) { - if (action == OBJECT_SCANNER) + switch (action) { + case OBJECT_SCANNER: display2(30, 14); - else if (action == CURSOR_LOOK) + break; + case CURSOR_LOOK: display2(30, 2); - else if (action == CURSOR_USE) { + break; + case CURSOR_USE: { Scene30 *parent = (Scene30 *)g_globals->_sceneManager._scene; parent->setAction(&parent->_beamAction); - } else + } + break; + default: SceneObject::doAction(action); + } } void Scene30::DoorObject::doAction(int action) { - if (action == OBJECT_SCANNER) + switch (action) { + case OBJECT_SCANNER: display2(30, 13); - else if (action == CURSOR_LOOK) + break; + case CURSOR_LOOK: display2(30, 1); - else if (action == CURSOR_USE) + break; + case CURSOR_USE: display2(30, 7); - else + break; + default: SceneObject::doAction(action); + } } void Scene30::BeamAction::signal() { @@ -963,16 +975,16 @@ void Scene40::Action1::signal() { scene->_doorway.hide(); scene->_dyingKzin.setPosition(Common::Point(296, 62)); g_globals->_player.animate(ANIM_MODE_5, NULL); - scene->_object1.setVisage(43); - scene->_object1.setStrip(3); - scene->_object1.animate(ANIM_MODE_5, NULL); - scene->_object2.hide(); - scene->_object3.hide(); + scene->_seeker.setVisage(43); + scene->_seeker.setStrip(3); + scene->_seeker.animate(ANIM_MODE_5, NULL); + scene->_seekerTail.hide(); + scene->_seekerHand.hide(); scene->_stripManager.start(45, this); break; case 4: - scene->_object2.remove(); - scene->_object3.remove(); + scene->_seekerTail.remove(); + scene->_seekerHand.remove(); scene->_assassin.setVisage(42); scene->_assassin.setStrip(2); scene->_assassin.setFrame(1); @@ -1049,10 +1061,10 @@ void Scene40::Action1::signal() { break; case 15: g_globals->_player.disableControl(); - scene->_object1.setVisage(40); - scene->_object1.setStrip(4); - scene->_object1.setFrame(1); - scene->_object1.animate(ANIM_MODE_5, NULL); + scene->_seeker.setVisage(40); + scene->_seeker.setStrip(4); + scene->_seeker.setFrame(1); + scene->_seeker.animate(ANIM_MODE_5, NULL); g_globals->_player.setVisage(40); g_globals->_player.setStrip(2); g_globals->_player.setFrame(1); @@ -1122,13 +1134,13 @@ void Scene40::Action2::signal() { } case 6: { g_globals->_player.setStrip(7); - scene->_object1.setVisage(2806); - scene->_object1.animate(ANIM_MODE_1, NULL); + scene->_seeker.setVisage(2806); + scene->_seeker.animate(ANIM_MODE_1, NULL); SceneObjectWrapper *wrapper = new SceneObjectWrapper(); - scene->_object1.setObjectWrapper(wrapper); + scene->_seeker.setObjectWrapper(wrapper); Common::Point pt(200, 190); NpcMover *mover = new NpcMover(); - scene->_object1.addMover(mover, &pt, this); + scene->_seeker.addMover(mover, &pt, this); break; } case 7: @@ -1137,12 +1149,12 @@ void Scene40::Action2::signal() { case 8: { Common::Point pt(170, 260); NpcMover *mover = new NpcMover(); - scene->_object1.addMover(mover, &pt, this); + scene->_seeker.addMover(mover, &pt, this); break; } case 9: scene->_dyingKzin.setAction(&scene->_action7); - scene->_object1.remove(); + scene->_seeker.remove(); g_globals->_stripNum = 88; g_globals->_events.setCursor(CURSOR_WALK); g_globals->_player.enableControl(); @@ -1202,6 +1214,7 @@ void Scene40::Action4::signal() { } } +// Animate the tail of Seeker, with random pauses void Scene40::Action5::signal() { Scene40 *scene = (Scene40 *)g_globals->_sceneManager._scene; @@ -1210,7 +1223,7 @@ void Scene40::Action5::signal() { setDelay(g_globals->_randomSource.getRandomNumber(119) + 120); break; case 1: - scene->_object2.animate(ANIM_MODE_8, 1, this); + scene->_seekerTail.animate(ANIM_MODE_8, 1, this); _actionIndex = 0; } } @@ -1220,17 +1233,17 @@ void Scene40::Action6::signal() { switch (_actionIndex++) { case 0: { - scene->_object1.postInit(); - scene->_object1.setVisage(16); - scene->_object1.setStrip2(6); - scene->_object1._moveDiff = Common::Point(40, 40); - scene->_object1.setPosition(Common::Point(313, 53)); - scene->_object1._moveRate = 60; + scene->_seeker.postInit(); + scene->_seeker.setVisage(16); + scene->_seeker.setStrip2(6); + scene->_seeker._moveDiff = Common::Point(40, 40); + scene->_seeker.setPosition(Common::Point(313, 53)); + scene->_seeker._moveRate = 60; Common::Point pt(141, 194); NpcMover *mover = new NpcMover(); - scene->_object1.addMover(mover, &pt, NULL); - scene->_object1.animate(ANIM_MODE_5, NULL); + scene->_seeker.addMover(mover, &pt, NULL); + scene->_seeker.animate(ANIM_MODE_5, NULL); scene->_doorway.postInit(); scene->_doorway.setVisage(46); @@ -1260,21 +1273,21 @@ void Scene40::Action7::signal() { setDelay(g_globals->_randomSource.getRandomNumber(499) + 500); break; case 1: - scene->_object7.postInit(); - scene->_object7.setVisage(46); + scene->_leftEntrance.postInit(); + scene->_leftEntrance.setVisage(46); if (g_globals->_randomSource.getRandomNumber(32767) >= 16384) { - scene->_object7.setStrip(3); - scene->_object7.setPosition(Common::Point(15, 185)); + scene->_leftEntrance.setStrip(3); + scene->_leftEntrance.setPosition(Common::Point(15, 185)); } else { - scene->_object7.setPosition(Common::Point(305, 61)); - scene->_object7.setFrame(15); + scene->_leftEntrance.setPosition(Common::Point(305, 61)); + scene->_leftEntrance.setFrame(15); } - scene->_object7.animate(ANIM_MODE_5, this); + scene->_leftEntrance.animate(ANIM_MODE_5, this); scene->_soundHandler.play(25); break; case 2: - scene->_object7.remove(); + scene->_leftEntrance.remove(); _actionIndex = 0; setDelay(60); break; @@ -1465,12 +1478,12 @@ void Scene40::Item6::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene40::Scene40() : - _item1(2, OBJECT_SCANNER, 40, 24, OBJECT_STUNNER, 40, 25, CURSOR_LOOK, 40, 7, CURSOR_USE, 40, 16, LIST_END), - _item3(5, OBJECT_SCANNER, 40, 28, OBJECT_STUNNER, 40, 27, CURSOR_LOOK, 40, 2, CURSOR_USE, 40, 30, LIST_END), - _item4(6, OBJECT_SCANNER, 40, 31, OBJECT_STUNNER, 40, 32, CURSOR_LOOK, 40, 5, CURSOR_USE, 40, 33, LIST_END), - _item5(0, CURSOR_LOOK, 40, 11, LIST_END), - _item7(4, OBJECT_SCANNER, 40, 26, OBJECT_STUNNER, 40, 27, CURSOR_LOOK, 40, 9, CURSOR_USE, 40, 17, LIST_END), - _item8(8, OBJECT_SCANNER, 40, 39, OBJECT_STUNNER, 40, 40, CURSOR_LOOK, 40, 3, CURSOR_USE, 40, 41, LIST_END) { + _ball(2, OBJECT_SCANNER, 40, 24, OBJECT_STUNNER, 40, 25, CURSOR_LOOK, 40, 7, CURSOR_USE, 40, 16, LIST_END), + _window(5, OBJECT_SCANNER, 40, 28, OBJECT_STUNNER, 40, 27, CURSOR_LOOK, 40, 2, CURSOR_USE, 40, 30, LIST_END), + _entrance(6, OBJECT_SCANNER, 40, 31, OBJECT_STUNNER, 40, 32, CURSOR_LOOK, 40, 5, CURSOR_USE, 40, 33, LIST_END), + _background(0, CURSOR_LOOK, 40, 11, LIST_END), + _emerald(4, OBJECT_SCANNER, 40, 26, OBJECT_STUNNER, 40, 27, CURSOR_LOOK, 40, 9, CURSOR_USE, 40, 17, LIST_END), + _tree(8, OBJECT_SCANNER, 40, 39, OBJECT_STUNNER, 40, 40, CURSOR_LOOK, 40, 3, CURSOR_USE, 40, 41, LIST_END) { } void Scene40::postInit(SceneObjectList *OwnerList) { @@ -1489,7 +1502,7 @@ void Scene40::postInit(SceneObjectList *OwnerList) { _speakerGameText._color1 = 9; _speakerGameText.setTextPos(Common::Point(160, 30)); _speakerQText._npc = &g_globals->_player; - _speakerSText._npc = &_object1; + _speakerSText._npc = &_seeker; g_globals->_player.postInit(); g_globals->_player.setVisage(0); @@ -1502,23 +1515,24 @@ void Scene40::postInit(SceneObjectList *OwnerList) { g_globals->_soundHandler.play(24); g_globals->_player.setVisage(43); - _object1.postInit(); - _object1.setVisage(41); - _object1.setPosition(Common::Point(105, 220)); - _object2.postInit(); - _object2.setVisage(41); - _object2.setStrip(6); - _object2.fixPriority(200); - _object2.setPosition(Common::Point(94, 189)); - _object2.setAction(&_action5); - - _object3.postInit(); - _object3.setVisage(41); - _object3.setStrip(5); - _object3.fixPriority(205); - _object3.setPosition(Common::Point(110, 186)); - _object3._numFrames = 2; - _object3.animate(ANIM_MODE_8, NULL, NULL); + _seeker.postInit(); + _seeker.setVisage(41); + _seeker.setPosition(Common::Point(105, 220)); + + _seekerTail.postInit(); + _seekerTail.setVisage(41); + _seekerTail.setStrip(6); + _seekerTail.fixPriority(200); + _seekerTail.setPosition(Common::Point(94, 189)); + _seekerTail.setAction(&_action5); + + _seekerHand.postInit(); + _seekerHand.setVisage(41); + _seekerHand.setStrip(5); + _seekerHand.fixPriority(205); + _seekerHand.setPosition(Common::Point(110, 186)); + _seekerHand._numFrames = 2; + _seekerHand.animate(ANIM_MODE_8, NULL, NULL); _assassin.postInit(); _assassin.setPosition(Common::Point(-40, 191)); @@ -1563,12 +1577,12 @@ void Scene40::postInit(SceneObjectList *OwnerList) { setAction(&_action4); } - _item5.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); - _item6._sceneRegionId = 3; - _item2._sceneRegionId = 7; + _background.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); + _pedestal._sceneRegionId = 3; + _statue._sceneRegionId = 7; - g_globals->_sceneItems.addItems(&_dyingKzin, &_item8, &_item1, &_item2, &_item3, &_item4, - &_item6, &_item7, &_item5, NULL); + g_globals->_sceneItems.addItems(&_dyingKzin, &_tree, &_ball, &_statue, &_window, &_entrance, + &_pedestal, &_emerald, &_background, NULL); } void Scene40::signal() { @@ -1691,7 +1705,7 @@ void Scene50::Object1::doAction(int action) { } } -void Scene50::Object2::doAction(int action) { +void Scene50::LeftFlyCycle::doAction(int action) { Scene50 *scene = (Scene50 *)g_globals->_sceneManager._scene; switch (action) { @@ -1715,7 +1729,7 @@ void Scene50::Object2::doAction(int action) { } } -void Scene50::Object3::doAction(int action) { +void Scene50::CenterFlyCycle::doAction(int action) { Scene50 *scene = (Scene50 *)g_globals->_sceneManager._scene; switch (action) { @@ -1743,7 +1757,7 @@ void Scene50::Object3::doAction(int action) { } } -void Scene50::Object4::doAction(int action) { +void Scene50::RightFlyCycle::doAction(int action) { Scene50 *scene = (Scene50 *)g_globals->_sceneManager._scene; switch (action) { @@ -1772,12 +1786,13 @@ void Scene50::Object4::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene50::Scene50() : - _item0(0, CURSOR_LOOK, 50, 3, LIST_END), + _background(0, CURSOR_LOOK, 50, 3, LIST_END), _item1(0, OBJECT_SCANNER, 50, 15, CURSOR_USE, 50, 16, CURSOR_LOOK, 50, 3, LIST_END), - _item2(0, CURSOR_LOOK, 50, 7, LIST_END), - _item3(8, OBJECT_STUNNER, 50, 14, OBJECT_SCANNER, 50, 13, CURSOR_LOOK, 50, 3, LIST_END), - _item4(9, OBJECT_SCANNER, 40, 39, OBJECT_STUNNER, 40, 40, CURSOR_USE, 40, 41, CURSOR_LOOK, 50, 5, LIST_END), - _item5(10, OBJECT_SCANNER, 50, 17, OBJECT_STUNNER, 50, 18, CURSOR_LOOK, 50, 6, CURSOR_USE, 30, 8, LIST_END) { + _entrance(0, CURSOR_LOOK, 50, 7, LIST_END), + // The original was using dialog 50/3 for CURSOR_LOOK, which is too generic. + _bulwark(8, OBJECT_STUNNER, 50, 14, OBJECT_SCANNER, 50, 13, CURSOR_LOOK, 30, 0, LIST_END), + _tree(9, OBJECT_SCANNER, 40, 39, OBJECT_STUNNER, 40, 40, CURSOR_USE, 40, 41, CURSOR_LOOK, 50, 5, LIST_END), + _flagstones(10, OBJECT_SCANNER, 50, 17, OBJECT_STUNNER, 50, 18, CURSOR_LOOK, 50, 6, CURSOR_USE, 30, 8, LIST_END) { _doorwayRect = Rect(80, 108, 160, 112); } @@ -1806,25 +1821,25 @@ void Scene50::postInit(SceneObjectList *OwnerList) { g_globals->_player.setPosition(Common::Point(270, 143)); } - _object2.postInit(); - _object2.setVisage(2331); - _object2.setStrip(6); - _object2.setPosition(Common::Point(136, 192)); - _object2.fixPriority(200); + _leftFlyCycle.postInit(); + _leftFlyCycle.setVisage(2331); + _leftFlyCycle.setStrip(6); + _leftFlyCycle.setPosition(Common::Point(136, 192)); + _leftFlyCycle.fixPriority(200); - _object3.postInit(); - _object3.setVisage(2337); - _object3.setStrip(6); - _object3.setPosition(Common::Point(260, 180)); - _object3.fixPriority(200); + _centerFlyCycle.postInit(); + _centerFlyCycle.setVisage(2337); + _centerFlyCycle.setStrip(6); + _centerFlyCycle.setPosition(Common::Point(260, 180)); + _centerFlyCycle.fixPriority(200); - _object4.postInit(); - _object4.setVisage(2331); - _object4.setStrip(6); - _object4.setPosition(Common::Point(295, 144)); - _object4.fixPriority(178); + _rightFlyCycle.postInit(); + _rightFlyCycle.setVisage(2331); + _rightFlyCycle.setStrip(6); + _rightFlyCycle.setPosition(Common::Point(295, 144)); + _rightFlyCycle.fixPriority(178); - g_globals->_sceneItems.addItems(&_object2, &_object3, &_object4, NULL); + g_globals->_sceneItems.addItems(&_leftFlyCycle, &_centerFlyCycle, &_rightFlyCycle, NULL); if (!g_globals->getFlag(101)) { g_globals->_player.disableControl(); @@ -1840,8 +1855,8 @@ void Scene50::postInit(SceneObjectList *OwnerList) { } } - _item0.setBounds(Rect(200, 0, 320, 200)); - g_globals->_sceneItems.addItems(&_item3, &_item4, &_item5, &_item0, NULL); + _background.setBounds(Rect(0, 0, 320, 200)); + g_globals->_sceneItems.addItems(&_bulwark, &_tree, &_flagstones, &_background, NULL); } void Scene50::signal() { @@ -1928,8 +1943,8 @@ void Scene60::Action1::signal() { scene->_controlButton.remove(); scene->_slaveButton.remove(); scene->_masterButton.remove(); - scene->_item1.remove(); - scene->_item2.remove(); + scene->_diskDrive.remove(); + scene->_dashboard.remove(); scene->_nextButton.postInit(); scene->_nextButton.setVisage(65); @@ -2030,11 +2045,11 @@ void Scene60::Action2::signal() { /*--------------------------------------------------------------------------*/ void Scene60::PrevObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 16); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + animate(ANIM_MODE_8, 1, NULL); if (scene->_action1.getActionIndex() > 5) { @@ -2048,11 +2063,11 @@ void Scene60::PrevObject::doAction(int action) { } void Scene60::NextObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 17); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + animate(ANIM_MODE_8, 1, NULL); if (scene->_action1.getActionIndex() < 8) { @@ -2065,11 +2080,11 @@ void Scene60::NextObject::doAction(int action) { } void Scene60::ExitObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 18); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + scene->_soundHandler3.play(36); animate(ANIM_MODE_8, 1, NULL); scene->_nextButton.remove(); @@ -2111,11 +2126,11 @@ void Scene60::ExitObject::doAction(int action) { if (scene->_masterButton._state) scene->_masterButton.setFrame(2); - g_globals->_sceneItems.push_front(&scene->_item1); + g_globals->_sceneItems.push_front(&scene->_diskDrive); g_globals->_sceneItems.push_front(&scene->_controlButton); g_globals->_sceneItems.push_front(&scene->_slaveButton); g_globals->_sceneItems.push_front(&scene->_masterButton); - g_globals->_sceneItems.push_back(&scene->_item2); + g_globals->_sceneItems.push_back(&scene->_dashboard); g_globals->gfxManager()._font.setFontNumber(2); g_globals->_sceneText._fontNumber = 2; @@ -2130,11 +2145,11 @@ void Scene60::ExitObject::doAction(int action) { } void Scene60::MessageObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 9); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + scene->_action1.setDelay(1); g_globals->setFlag(83); } else { @@ -2143,11 +2158,11 @@ void Scene60::MessageObject::doAction(int action) { } void Scene60::ControlObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 11); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + if (_animateMode == ANIM_MODE_NONE) SceneItem::display2(60, 14); else if (!scene->_slaveButton._state) { @@ -2164,11 +2179,11 @@ void Scene60::ControlObject::doAction(int action) { } void Scene60::SlaveObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 8); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + if (scene->_masterButton._state) scene->_sceneMode = 19; else if (_state) { @@ -2194,11 +2209,11 @@ void Scene60::SlaveObject::doAction(int action) { } void Scene60::MasterObject::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 7); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + if (!scene->_controlButton._animateMode) scene->_sceneMode = 14; else if (scene->_slaveButton._state) @@ -2226,11 +2241,11 @@ void Scene60::MasterObject::doAction(int action) { } void Scene60::FloppyDrive::doAction(int action) { - Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; - if (action == CURSOR_LOOK) { SceneItem::display2(60, 13); } else if (action == CURSOR_USE) { + Scene60 *scene = (Scene60 *)g_globals->_sceneManager._scene; + g_globals->setFlag(!g_globals->_stripNum ? 118 : 121); scene->setAction(&scene->_action1); } else { @@ -2300,11 +2315,11 @@ void Scene60::Item::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene60::Scene60() : - _item2(0, 12, 12), - _item3(8, 22, 23), - _item4(9, 24, 25), - _item5(10, 26, 27), - _item6(11, 28, 29) { + _dashboard(0, 12, 12), + _intercomm(8, 22, 23), + _viewScreen(9, 24, 25), + _speedControl(10, 26, 27), + _speaker(11, 28, 29) { } void Scene60::postInit(SceneObjectList *OwnerList) { @@ -2345,8 +2360,8 @@ void Scene60::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, 61, NULL); } - _item1.setBounds(Rect(130, 55, 174, 70)); - _item2.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); + _diskDrive.setBounds(Rect(130, 55, 174, 70)); + _dashboard.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); if (g_globals->_stripNum == 0) { if (g_globals->getFlag(117)) { @@ -2419,8 +2434,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) { } } - g_globals->_sceneItems.addItems(&_item3, &_item4, &_item5, &_item6, - &_item1, &_item2, NULL); + g_globals->_sceneItems.addItems(&_intercomm, &_viewScreen, &_speedControl, &_speaker, &_diskDrive, &_dashboard, NULL); } void Scene60::signal() { @@ -2474,11 +2488,11 @@ void Scene90::Action1::signal() { case 3: { Common::Point pt(278, 191); NpcMover *mover = new NpcMover(); - scene->_object2.addMover(mover, &pt, this); + scene->_guard.addMover(mover, &pt, this); break; } case 4: - scene->_object2.setStrip(3); + scene->_guard.setStrip(3); setDelay(2); break; case 5: @@ -2492,36 +2506,36 @@ void Scene90::Action1::signal() { } break; case 6: - scene->_object2.animate(ANIM_MODE_NONE); + scene->_guard.animate(ANIM_MODE_NONE); g_globals->_player._uiEnabled = true; break; case 7: - scene->_object2.animate(ANIM_MODE_NONE); + scene->_guard.animate(ANIM_MODE_NONE); g_globals->_soundHandler.play(56); - scene->_object3.animate(ANIM_MODE_5, this); + scene->_headGate.animate(ANIM_MODE_5, this); break; case 8: { Common::Point pt(215, 127); PlayerMover *mover = new PlayerMover(); - scene->_object5.addMover(mover, &pt, this); + scene->_quinnShip.addMover(mover, &pt, this); break; } case 9: { Common::Point pt1(215, 127); PlayerMover *mover1 = new PlayerMover(); - scene->_object1.addMover(mover1, &pt1, this); + scene->_seekerShip.addMover(mover1, &pt1, this); Common::Point pt2(86, 62); PlayerMover *mover2 = new PlayerMover(); - scene->_object5.addMover(mover2, &pt2, this); + scene->_quinnShip.addMover(mover2, &pt2, this); break; } case 10: { PlayerMover2 *mover = new PlayerMover2(); - scene->_object1.addMover(mover, 10, 15, &scene->_object5); + scene->_seekerShip.addMover(mover, 10, 15, &scene->_quinnShip); if (!g_globals->getFlag(104)) { mover = new PlayerMover2(); - scene->_object4.addMover(mover, 10, 15, &scene->_object1); + scene->_emptyShip.addMover(mover, 10, 15, &scene->_seekerShip); } setDelay(60); break; @@ -2529,7 +2543,7 @@ void Scene90::Action1::signal() { case 11: g_globals->_soundHandler.play(57); g_globals->_soundHandler.play(68); - scene->_object3.animate(ANIM_MODE_6, NULL); + scene->_headGate.animate(ANIM_MODE_6, NULL); SceneItem::display(90, g_globals->getFlag(104) ? 15 : 14, SET_EXT_BGCOLOR, 13, SET_KEEP_ONSCREEN, -1, SET_X, 120, SET_Y, 20, LIST_END); @@ -2544,7 +2558,7 @@ void Scene90::Action1::signal() { /*--------------------------------------------------------------------------*/ -void Scene90::Object1::doAction(int action) { +void Scene90::SeekerShip::doAction(int action) { Scene90 *scene = (Scene90 *)g_globals->_sceneManager._scene; switch (action) { @@ -2562,23 +2576,23 @@ void Scene90::Object1::doAction(int action) { } } -void Scene90::Object2::doAction(int action) { +void Scene90::Guard::doAction(int action) { Scene90 *scene = (Scene90 *)g_globals->_sceneManager._scene; switch (action) { case OBJECT_STUNNER: case CURSOR_USE: g_globals->_player.disableControl(); - scene->_object6.postInit(); - scene->_object6.setVisage(90); - scene->_object6.setStrip(6); - scene->_object6.setPosition(Common::Point(184, 210)); - scene->_object6.hide(); + scene->_bubble.postInit(); + scene->_bubble.setVisage(90); + scene->_bubble.setStrip(6); + scene->_bubble.setPosition(Common::Point(184, 210)); + scene->_bubble.hide(); scene->_sceneMode = 91; scene->_soundHandler1.play(59); scene->_soundHandler1.holdAt(true); - scene->setAction(&scene->_sequenceManager, scene, 91, this, &scene->_object6, NULL); + scene->setAction(&scene->_sequenceManager, scene, 91, this, &scene->_bubble, NULL); break; case CURSOR_LOOK: SceneItem::display2(90, 8); @@ -2596,21 +2610,21 @@ void Scene90::Object2::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene90::Scene90() : - _item1(0, CURSOR_LOOK, 90, 9, LIST_END), - _item2(0, CURSOR_LOOK, 90, 10, LIST_END), - _item3(0, CURSOR_LOOK, 90, 11, LIST_END), - _object3(OBJECT_STUNNER, 90, 13, CURSOR_LOOK, 90, 12, CURSOR_USE, 90, 16, LIST_END), - _object4(CURSOR_LOOK, 90, 17, LIST_END), - _object5(CURSOR_LOOK, 90, 18, CURSOR_USE, 90, 19, LIST_END) { + _guardShack(0, CURSOR_LOOK, 90, 9, LIST_END), + _shed(0, CURSOR_LOOK, 90, 10, LIST_END), + _background(0, CURSOR_LOOK, 90, 11, LIST_END), + _headGate(OBJECT_STUNNER, 90, 13, CURSOR_LOOK, 90, 12, CURSOR_USE, 90, 16, LIST_END), + _emptyShip(CURSOR_LOOK, 90, 17, LIST_END), + _quinnShip(CURSOR_LOOK, 90, 18, CURSOR_USE, 90, 19, LIST_END) { } void Scene90::stripCallback(int v) { Scene90 *scene = (Scene90 *)g_globals->_sceneManager._scene; if (v == 1) - scene->_object2.animate(ANIM_MODE_7, 0, NULL); + scene->_guard.animate(ANIM_MODE_7, 0, NULL); else if (v == 2) - scene->_object2.animate(ANIM_MODE_NONE); + scene->_guard.animate(ANIM_MODE_NONE); } void Scene90::postInit(SceneObjectList *OwnerList) { @@ -2624,53 +2638,53 @@ void Scene90::postInit(SceneObjectList *OwnerList) { _stripManager.addSpeaker(&_speakerQL); _stripManager.addSpeaker(&_speakerSR); - _speakerMText._npc = &_object2; + _speakerMText._npc = &_guard; _speakerQText._textWidth = 160; - _speakerQText._npc = &_object5; - _speakerSText._npc = &_object1; - - _object5.postInit(); - _object5.setVisage(2333); - _object5.setObjectWrapper(new SceneObjectWrapper()); - _object5._strip = 7; - _object5._moveDiff = Common::Point(22, 22); - _object5.setPosition(Common::Point(151, 177)); - _object5.changeZoom(-1); - g_globals->_sceneItems.push_back(&_object5); - - _object1.postInit(); - _object1.setVisage(2337); - _object1.setObjectWrapper(new SceneObjectWrapper()); - _object1._strip = 4; - _object1._moveDiff = Common::Point(20, 20); - _object1.setPosition(Common::Point(212, 183)); - _object1.changeZoom(-1); - g_globals->_sceneItems.push_back(&_object1); + _speakerQText._npc = &_quinnShip; + _speakerSText._npc = &_seekerShip; + + _quinnShip.postInit(); + _quinnShip.setVisage(2333); + _quinnShip.setObjectWrapper(new SceneObjectWrapper()); + _quinnShip._strip = 7; + _quinnShip._moveDiff = Common::Point(22, 22); + _quinnShip.setPosition(Common::Point(151, 177)); + _quinnShip.changeZoom(-1); + g_globals->_sceneItems.push_back(&_quinnShip); + + _seekerShip.postInit(); + _seekerShip.setVisage(2337); + _seekerShip.setObjectWrapper(new SceneObjectWrapper()); + _seekerShip._strip = 4; + _seekerShip._moveDiff = Common::Point(20, 20); + _seekerShip.setPosition(Common::Point(212, 183)); + _seekerShip.changeZoom(-1); + g_globals->_sceneItems.push_back(&_seekerShip); if (!g_globals->getFlag(104)) { - _object4.postInit(); - _object4.setVisage(2331); - _object4.setObjectWrapper(new SceneObjectWrapper()); - _object4._strip = 4; - _object4._moveDiff = Common::Point(20, 20); - _object4.setPosition(Common::Point(251, 207)); - _object4.changeZoom(-1); - g_globals->_sceneItems.push_back(&_object4); - } - - _object2.postInit(); - _object2.setVisage(90); - _object2.animate(ANIM_MODE_1, NULL); - _object2.setPosition(Common::Point(315, 185)); - _object2._strip = 2; - g_globals->_sceneItems.push_back(&_object2); - - _object3.postInit(); - _object3.setVisage(90); - _object3.animate(ANIM_MODE_1, NULL); - _object3.setPosition(Common::Point(196, 181)); - _object3.fixPriority(175); - g_globals->_sceneItems.push_back(&_object3); + _emptyShip.postInit(); + _emptyShip.setVisage(2331); + _emptyShip.setObjectWrapper(new SceneObjectWrapper()); + _emptyShip._strip = 4; + _emptyShip._moveDiff = Common::Point(20, 20); + _emptyShip.setPosition(Common::Point(251, 207)); + _emptyShip.changeZoom(-1); + g_globals->_sceneItems.push_back(&_emptyShip); + } + + _guard.postInit(); + _guard.setVisage(90); + _guard.animate(ANIM_MODE_1, NULL); + _guard.setPosition(Common::Point(315, 185)); + _guard._strip = 2; + g_globals->_sceneItems.push_back(&_guard); + + _headGate.postInit(); + _headGate.setVisage(90); + _headGate.animate(ANIM_MODE_1, NULL); + _headGate.setPosition(Common::Point(196, 181)); + _headGate.fixPriority(175); + g_globals->_sceneItems.push_back(&_headGate); g_globals->_player.disableControl(); g_globals->_soundHandler.play(55); @@ -2679,11 +2693,11 @@ void Scene90::postInit(SceneObjectList *OwnerList) { setAction(&_action1); - _item3.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); - _item1.setBounds(Rect(271, 65, 271, 186)); - _item2.setBounds(Rect(0, 17, 124, 77)); + _background.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); + _guardShack.setBounds(Rect(271, 65, 271, 186)); + _shed.setBounds(Rect(0, 17, 124, 77)); - g_globals->_sceneItems.addItems(&_item1, &_item2, &_item3, NULL); + g_globals->_sceneItems.addItems(&_guardShack, &_shed, &_background, NULL); } void Scene90::signal() { diff --git a/engines/tsage/ringworld/ringworld_scenes1.h b/engines/tsage/ringworld/ringworld_scenes1.h index bb98c89a8c..5dd882af93 100644 --- a/engines/tsage/ringworld/ringworld_scenes1.h +++ b/engines/tsage/ringworld/ringworld_scenes1.h @@ -54,8 +54,12 @@ public: Speaker _speakerQText; Action1 _action1; Action2 _action2; - SceneObject _object1, _object2, _object3; - SceneObject _object4, _object5, _object6; + SceneObject _veeshkaBody; + SceneObject _veeshkaHead; + SceneObject _veeshkaRightArm; + SceneObject _centurion; + SceneObject _leftSmoke; + SceneObject _rightSmoke; virtual void stripCallback(int v); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -70,7 +74,7 @@ class Scene15 : public Scene { }; public: Action1 _action1; - SceneObject _object1; + SceneObject _ship; ASound _soundHandler; virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -102,7 +106,10 @@ public: Action2 _action2; Action3 _action3; Action4 _action4; - SceneObject _sceneObject1, _SceneObjectExt, _sceneObject3, _sceneObject4, _sceneObject5; + SceneObject _assassinShip1; + SceneObject _assassinShip2; + SceneObject _laserShot1; + SceneObject _laserShot2; ASound _sound; public: Scene20(); @@ -248,15 +255,21 @@ public: Action6 _action6; Action7 _action7; Action8 _action8; - SceneObject _object1, _object2, _object3; + SceneObject _seeker; + SceneObject _seekerTail; + SceneObject _seekerHand; DyingKzin _dyingKzin; Assassin _assassin; - SceneObject _doorway, _object7, _object8; - DisplayHotspot _item1; - Item2 _item2; - DisplayHotspot _item3, _item4, _item5; - Item6 _item6; - DisplayHotspot _item7, _item8; + SceneObject _doorway; + SceneObject _leftEntrance; + DisplayHotspot _ball; + Item2 _statue; + DisplayHotspot _window; + DisplayHotspot _entrance; + DisplayHotspot _background; + Item6 _pedestal; + DisplayHotspot _emerald; + DisplayHotspot _tree; Scene40(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -284,15 +297,15 @@ class Scene50 : public Scene { public: virtual void doAction(int action); }; - class Object2 : public SceneObject { + class LeftFlyCycle : public SceneObject { public: virtual void doAction(int action); }; - class Object3 : public SceneObject { + class CenterFlyCycle : public SceneObject { public: virtual void doAction(int action); }; - class Object4 : public SceneObject { + class RightFlyCycle : public SceneObject { public: virtual void doAction(int action); }; @@ -302,15 +315,23 @@ public: Action1 _action1; Action2 _action2; Action3 _action3; + // CHECKME: Object1 looks useless Object1 _object1; - Object2 _object2; - Object3 _object3; - Object4 _object4; + LeftFlyCycle _leftFlyCycle; + CenterFlyCycle _centerFlyCycle; + RightFlyCycle _rightFlyCycle; Rect _doorwayRect; SpeakerSText _speakerSText; SpeakerQText _speakerQText; - DisplayHotspot _item0, _item1, _item2; - DisplayHotspot _item3, _item4, _item5; + DisplayHotspot _background; + + //CHECKME: Useless Hotspot, never initialized + DisplayHotspot _item1; + //CHECKME: Useless Hotspot, never initialized + DisplayHotspot _entrance; + DisplayHotspot _bulwark; + DisplayHotspot _tree; + DisplayHotspot _flagstones; Scene50(); virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -392,8 +413,12 @@ public: MasterObject _masterButton; FloppyDrive _floppyDrive; SceneObject _redLights; - Item1 _item1; - Item _item2, _item3, _item4, _item5, _item6; + Item1 _diskDrive; + Item _dashboard; + Item _intercomm; + Item _viewScreen; + Item _speedControl; + Item _speaker; ASound _soundHandler1; ASound _soundHandler2; ASound _soundHandler3; @@ -409,11 +434,11 @@ class Scene90 : public Scene { public: virtual void signal(); }; - class Object1 : public SceneObject { + class SeekerShip : public SceneObject { public: virtual void doAction(int action); }; - class Object2 : public SceneObject { + class Guard : public SceneObject { public: virtual void doAction(int action); }; @@ -425,11 +450,15 @@ public: SpeakerSR _speakerSR; SpeakerMText _speakerMText; Action1 _action1; - Object1 _object1; - Object2 _object2; - DisplayObject _object3, _object4, _object5; - SceneObject _object6; - DisplayHotspot _item1, _item2, _item3; + SeekerShip _seekerShip; + Guard _guard; + DisplayObject _headGate; + DisplayObject _emptyShip; + DisplayObject _quinnShip; + SceneObject _bubble; + DisplayHotspot _guardShack; + DisplayHotspot _shed; + DisplayHotspot _background; ASound _soundHandler1, _soundHandler2; Scene90(); diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 8f01a34cc4..57d8afb57f 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -131,7 +131,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Cutscene - Ship return new Scene1525(); case 1530: - // Cutscene - Elevator + // Cutscene - Crashing on Rimwall return new Scene1530(); case 1550: // Spaceport @@ -1775,13 +1775,13 @@ AnimationPlayer::AnimationPlayer(): EventHandler() { _screenBounds = R2_GLOBALS._gfxManagerInstance._bounds; _rect1 = R2_GLOBALS._gfxManagerInstance._bounds; _paletteMode = ANIMPALMODE_REPLACE_PALETTE; - _field3A = true; + _canSkip = true; _sliceHeight = 1; _endAction = NULL; _sliceCurrent = nullptr; _sliceNext = nullptr; - _field38 = false; + _animLoaded = false; _objectMode = ANIMOBJMODE_1; _dataNeeded = 0; _playbackTick = 0; @@ -1812,7 +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) && _canSkip) { // Move the current position to the end _position = _subData._duration; } @@ -1858,9 +1858,7 @@ bool AnimationPlayer::load(int animId, Action *endAction) { _playbackTickPrior = -1; _playbackTick = 0; - // The final multiplication is used to deliberately slow down playback, since the original - // was slowed down by the amount of time spent to decode and display the frames - _frameDelay = (60 / _subData._frameRate) * 8; + _frameDelay = (60 / _subData._frameRate); _gameFrame = R2_GLOBALS._events.getFrameNumber(); if (_subData._totalSize) { @@ -1931,7 +1929,7 @@ bool AnimationPlayer::load(int animId, Action *endAction) { } ++R2_GLOBALS._animationCtr; - _field38 = true; + _animLoaded = true; return true; } @@ -2078,7 +2076,7 @@ bool AnimationPlayer::isCompleted() { } void AnimationPlayer::close() { - if (_field38) { + if (_animLoaded) { switch (_paletteMode) { case 0: R2_GLOBALS._scenePalette.replace(&_palette); @@ -2107,7 +2105,7 @@ void AnimationPlayer::close() { _animData1 = NULL; _animData2 = NULL; - _field38 = false; + _animLoaded = false; if (g_globals != NULL) R2_GLOBALS._animationCtr = MAX(R2_GLOBALS._animationCtr - 1, 0); } @@ -2156,7 +2154,7 @@ void AnimationPlayer::getSlices() { AnimationPlayerExt::AnimationPlayerExt(): AnimationPlayer() { _isActive = false; - _field3A = false; + _canSkip = false; } void AnimationPlayerExt::synchronize(Serializer &s) { diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index 133cdee6b2..41ddb277de 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -407,8 +407,8 @@ public: AnimationData *_sliceNext; Common::File _resourceFile; Rect _rect1, _screenBounds; - bool _field38; - bool _field3A; + bool _animLoaded; + bool _canSkip; AnimationPaletteMode _paletteMode; AnimationObjectMode _objectMode; int _sliceHeight; diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index bd4ad73ddc..f483b1e47c 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -167,22 +167,21 @@ bool Scene100::Table::startAction(CursorType action, Event &event) { } bool Scene100::StasisNegator::startAction(CursorType action, Event &event) { - Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 107; scene->setAction(&scene->_sequenceManager1, scene, 107, &R2_GLOBALS._player, &scene->_stasisNegator, NULL); return true; + } default: return SceneActor::startAction(action, event); } } bool Scene100::DoorDisplay::startAction(CursorType action, Event &event) { - Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_LOOK: SceneItem::display2(100, _state ? 24 : 25); @@ -190,25 +189,29 @@ bool Scene100::DoorDisplay::startAction(CursorType action, Event &event) { case CURSOR_TALK: SceneItem::display2(100, _state ? 26 : 27); return true; - case CURSOR_USE: + case CURSOR_USE: { + Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 110; scene->setAction(&scene->_sequenceManager1, scene, 110, &R2_GLOBALS._player, NULL); return true; + } default: return SceneActor::startAction(action, event); } } bool Scene100::SteppingDisks::startAction(CursorType action, Event &event) { - Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 111; scene->setAction(&scene->_sequenceManager1, scene, 111, &R2_GLOBALS._player, this, NULL); return true; + } default: return SceneActor::startAction(action, event); } @@ -217,14 +220,15 @@ bool Scene100::SteppingDisks::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ bool Scene100::Terminal::startAction(CursorType action, Event &event) { - Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene100 *scene = (Scene100 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 105; scene->setAction(&scene->_sequenceManager1, scene, 105, &R2_GLOBALS._player, this, NULL); return true; + } default: return NamedHotspot::startAction(action, event); } @@ -510,8 +514,6 @@ void Scene125::Icon::process(Event &event) { } void Scene125::Icon::setIcon(int id) { - Scene125 *scene = (Scene125 *)R2_GLOBALS._sceneManager._scene; - _lookLineNum = _iconId = id; SceneActor::_lookLineNum = id; @@ -519,6 +521,8 @@ void Scene125::Icon::setIcon(int id) { _sceneText2.remove(); if (_lookLineNum) { + Scene125 *scene = (Scene125 *)R2_GLOBALS._sceneManager._scene; + showIcon(); _glyph.setup(161, ((id - 1) / 10) * 2 + 1, ((id - 1) % 10) + 1); _glyph.setPosition(_position); @@ -781,7 +785,7 @@ void Scene125::signal() { case 12: if (_soundCount > 0) --_soundCount; - if (!_soundCount || (R2_GLOBALS._speechSubtitles & SPEECH_VOICE)) { + if (!_soundCount || !(R2_GLOBALS._speechSubtitles & SPEECH_VOICE)) { _soundIndex = 0; R2_GLOBALS._playStream.stop(); } else { @@ -1168,7 +1172,7 @@ void Scene125::setDetails(int resNum, int lineNum) { if ((_soundCount > 0) && (R2_GLOBALS._speechSubtitles & SPEECH_VOICE)) { _sceneMode = 12; - R2_GLOBALS._playStream.play(_soundIndexes[_soundIndex], this); + R2_GLOBALS._playStream.play(_soundIndexes[_soundIndex++], this); } } else { // Passed the start or end of the message set, so return to the menu @@ -1777,7 +1781,7 @@ void Scene180::signal() { case 34: _teal.hide(); - _webbster.hide(); + _webbster.remove(); _dutyOfficer.postInit(); _dutyOfficer.setup(76, 2, 1); @@ -2012,9 +2016,9 @@ void Scene180::restore() { *--------------------------------------------------------------------------*/ bool Scene200::NorthDoor::startAction(CursorType action, Event &event) { - Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 202; scene->setAction(&scene->_sequenceManager, scene, 202, &R2_GLOBALS._player, this, NULL); @@ -2025,9 +2029,9 @@ bool Scene200::NorthDoor::startAction(CursorType action, Event &event) { } bool Scene200::EastDoor::startAction(CursorType action, Event &event) { - Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 200; scene->setAction(&scene->_sequenceManager, scene, 200, &R2_GLOBALS._player, this, NULL); @@ -2038,9 +2042,9 @@ bool Scene200::EastDoor::startAction(CursorType action, Event &event) { } bool Scene200::WestDoor::startAction(CursorType action, Event &event) { - Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 204; scene->setAction(&scene->_sequenceManager, scene, 204, &R2_GLOBALS._player, this, NULL); @@ -2530,10 +2534,10 @@ void Scene250::Button::synchronize(Serializer &s) { } bool Scene250::Button::startAction(CursorType action, Event &event) { - Scene250 *scene = (Scene250 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene250 *scene = (Scene250 *)R2_GLOBALS._sceneManager._scene; + if (scene->_destButtonY) { SceneItem::display2(250, 15); } else { @@ -2556,6 +2560,7 @@ bool Scene250::Button::startAction(CursorType action, Event &event) { } } return true; + } case CURSOR_LOOK: switch (_floorNumber) { @@ -2904,9 +2909,9 @@ void Scene300::Action3::signal() { void Scene300::Action4::signal() { - Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; - if (!R2_GLOBALS._playStream.isPlaying()) { + Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; + scene->_mirandaScreen.setStrip2(R2_GLOBALS._randomSource.getRandomNumber(2)); scene->_mirandaScreen.setFrame(1); @@ -2920,8 +2925,6 @@ void Scene300::Action4::signal() { /*--------------------------------------------------------------------------*/ bool Scene300::QuinnWorkstation::startAction(CursorType action, Event &event) { - Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_USE: if (R2_GLOBALS._player._characterIndex != 1) @@ -2930,6 +2933,8 @@ bool Scene300::QuinnWorkstation::startAction(CursorType action, Event &event) { R2_GLOBALS._player.setAction(NULL); R2_GLOBALS._sceneManager.changeScene(325); } else { + Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 306; scene->setAction(&scene->_sequenceManager1, scene, 306, &R2_GLOBALS._player, NULL); @@ -3150,10 +3155,10 @@ bool Scene300::Seeker::startAction(CursorType action, Event &event) { } bool Scene300::Quinn::startAction(CursorType action, Event &event) { - Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_TALK: + case CURSOR_TALK: { + Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); R2_GLOBALS._events.setCursor(CURSOR_ARROW); scene->_sceneMode = 10; @@ -3175,18 +3180,18 @@ bool Scene300::Quinn::startAction(CursorType action, Event &event) { scene->_stripManager.start3(scene->_stripId, scene, R2_GLOBALS._stripManager_lookupList); return true; - + } default: return SceneActor::startAction(action, event); } } bool Scene300::Doorway::startAction(CursorType action, Event &event) { - Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { if ((R2_GLOBALS._player._characterIndex == R2_QUINN) && (!R2_GLOBALS.getFlag(44) || R2_GLOBALS._player._characterScene[R2_SEEKER] == 500)) { + Scene300 *scene = (Scene300 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 301; scene->setAction(&scene->_sequenceManager1, scene, 301, &R2_GLOBALS._player, this, NULL); @@ -3692,7 +3697,7 @@ void Scene300::signal() { case 316: R2_GLOBALS._player._characterScene[R2_SEEKER] = 500; _seeker.remove(); - R2_GLOBALS._player.enableControl(CURSOR_CROSSHAIRS); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; case 317: @@ -3864,8 +3869,6 @@ void Scene325::Icon::process(Event &event) { } void Scene325::Icon::setIcon(int id) { - Scene325 *scene = (Scene325 *)R2_GLOBALS._sceneManager._scene; - _lookLineNum = _iconId = id; SceneActor::_lookLineNum = id; @@ -3873,6 +3876,8 @@ void Scene325::Icon::setIcon(int id) { _sceneText2.remove(); if (_lookLineNum) { + Scene325 *scene = (Scene325 *)R2_GLOBALS._sceneManager._scene; + showIcon(); _glyph.setup(325, ((id - 1) / 10) * 2 + 1, ((id - 1) % 10) + 1); _glyph.setPosition(_position); @@ -4431,7 +4436,9 @@ void Scene325::consoleAction(int id) { return; case 14: if (R2_GLOBALS.getFlag(55)) { - SceneItem::display2(329, 17); + consoleAction(4); + // Empty message crashing the game. It should be a warning message forbidding to switch to active scan + // SceneItem::display2(329, 17); } else { R2_GLOBALS.setFlag(50); consoleAction(4); @@ -4651,9 +4658,9 @@ Common::String Scene325::parseMessage(const Common::String &msg) { *--------------------------------------------------------------------------*/ bool Scene400::Terminal::startAction(CursorType action, Event &event) { - Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 402; scene->setAction(&scene->_sequenceManager1, scene, 402, &R2_GLOBALS._player, this, NULL); @@ -4667,9 +4674,9 @@ bool Scene400::Terminal::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ bool Scene400::Door::startAction(CursorType action, Event &event) { - Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 401; scene->setAction(&scene->_sequenceManager1, scene, 401, &R2_GLOBALS._player, this, NULL); @@ -4681,9 +4688,9 @@ bool Scene400::Door::startAction(CursorType action, Event &event) { } bool Scene400::Reader::startAction(CursorType action, Event &event) { - Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 405; scene->setAction(&scene->_sequenceManager1, scene, 405, &R2_GLOBALS._player, this, NULL); @@ -4695,9 +4702,9 @@ bool Scene400::Reader::startAction(CursorType action, Event &event) { } bool Scene400::SensorProbe::startAction(CursorType action, Event &event) { - Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 404; scene->setAction(&scene->_sequenceManager1, scene, 404, &R2_GLOBALS._player, this, NULL); @@ -4709,9 +4716,9 @@ bool Scene400::SensorProbe::startAction(CursorType action, Event &event) { } bool Scene400::AttractorUnit::startAction(CursorType action, Event &event) { - Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene400 *scene = (Scene400 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 406; scene->setAction(&scene->_sequenceManager1, scene, 406, &R2_GLOBALS._player, this, NULL); @@ -4891,9 +4898,9 @@ Scene500::PanelDialog::Button::Button() { } bool Scene500::ControlPanel::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(26)) { @@ -4913,9 +4920,9 @@ bool Scene500::ControlPanel::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ bool Scene500::Seeker::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_TALK) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { scene->_stripNumber = R2_GLOBALS.getFlag(26) ? 1101 : 1103; @@ -4986,9 +4993,9 @@ bool Scene500::Suit::startAction(CursorType action, Event &event) { } bool Scene500::Doorway::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(26)) { @@ -5007,8 +5014,6 @@ bool Scene500::Doorway::startAction(CursorType action, Event &event) { } bool Scene500::OxygenTanks::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_LOOK: SceneItem::display2(500, R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) ? 50 : 49); @@ -5020,6 +5025,8 @@ bool Scene500::OxygenTanks::startAction(CursorType action, Event &event) { return true; } else if ((R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) != 1) && (R2_GLOBALS._player._characterIndex != R2_SEEKER) && !R2_GLOBALS.getFlag(28)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (_position.y == 120) { @@ -5043,9 +5050,9 @@ bool Scene500::OxygenTanks::startAction(CursorType action, Event &event) { } bool Scene500::AirLock::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && R2_GLOBALS.getFlag(26)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = (R2_GLOBALS._player._characterIndex == R2_QUINN) ? 521 : 522; scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, @@ -5090,9 +5097,9 @@ void Scene500::TransparentDoor::draw() { } bool Scene500::Aerosol::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 503; scene->setAction(&scene->_sequenceManager1, scene, 503, &R2_GLOBALS._player, this, NULL); @@ -5103,9 +5110,9 @@ bool Scene500::Aerosol::startAction(CursorType action, Event &event) { } bool Scene500::SonicStunner::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = R2_GLOBALS.getFlag(26) ? 520 : 502; scene->setAction(&scene->_sequenceManager1, scene, scene->_sceneMode, &R2_GLOBALS._player, this, NULL); @@ -5116,9 +5123,9 @@ bool Scene500::SonicStunner::startAction(CursorType action, Event &event) { } bool Scene500::Locker1::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(11)) @@ -5134,9 +5141,9 @@ bool Scene500::Locker1::startAction(CursorType action, Event &event) { } bool Scene500::Locker2::startAction(CursorType action, Event &event) { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(12)) @@ -5239,11 +5246,11 @@ void Scene500::PanelDialog::Button::process(Event &event) { } void Scene500::PanelDialog::Button::doButtonPress() { - Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; - if (R2_GLOBALS.getFlag(28)) { SceneItem::display2(500, 48); } else { + Scene500 *scene = (Scene500 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = _buttonId; @@ -5804,13 +5811,13 @@ bool Scene600::Laser::startAction(CursorType action, Event &event) { } bool Scene600::Aerosol::startAction(CursorType action, Event &event) { - Scene600 *scene = (Scene600 *)R2_GLOBALS._sceneManager._scene; - // Only action cursors if (action < CURSOR_WALK) return false; if (action == CURSOR_USE) { + Scene600 *scene = (Scene600 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 614; scene->setAction(&scene->_sequenceManager1, scene, 614, &R2_GLOBALS._player, &scene->_aerosol, NULL); @@ -6044,6 +6051,7 @@ void Scene600::signal() { R2_GLOBALS._sceneItems.remove(&_engineCompartment); _computer.setDetails(600, 21, -1, 23, 4, &_engineCompartment); _engineCompartment.setDetails(600, 7, -1, -1, 3, (SceneItem *) NULL); + _quantumDrive._lookLineNum = 7; R2_GLOBALS._player.enableControl(CURSOR_USE); break; case 614: @@ -6174,14 +6182,14 @@ bool Scene700::HandGrip::startAction(CursorType action, Event &event) { } bool Scene700::LiftDoor::startAction(CursorType action, Event &event) { - Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._position.y <= 100) return false; + Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 701; scene->setAction(&scene->_sequenceManager, scene, 701, &R2_GLOBALS._player, this, NULL); @@ -6190,14 +6198,14 @@ bool Scene700::LiftDoor::startAction(CursorType action, Event &event) { } bool Scene700::SuitRoomDoor::startAction(CursorType action, Event &event) { - Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._position.y <= 100) return false; + Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 702; scene->setAction(&scene->_sequenceManager, scene, 702, &R2_GLOBALS._player, this, NULL); @@ -6206,14 +6214,14 @@ bool Scene700::SuitRoomDoor::startAction(CursorType action, Event &event) { } bool Scene700::ControlPanel::startAction(CursorType action, Event &event) { - Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._position.y <= 100) return false; + Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 704; scene->setAction(&scene->_sequenceManager, scene, 704, &R2_GLOBALS._player, this, NULL); @@ -6274,11 +6282,11 @@ bool Scene700::Cable::startAction(CursorType action, Event &event) { } bool Scene700::LoftDoor::startAction(CursorType action, Event &event) { - Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || (R2_GLOBALS._player._position.y >= 100)) return SceneActor::startAction(action, event); + Scene700 *scene = (Scene700 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1; Common::Point pt(_position.x, 69); @@ -6589,11 +6597,11 @@ void Scene700::signal() { *--------------------------------------------------------------------------*/ bool Scene800::Button::startAction(CursorType action, Event &event) { - Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) { return NamedHotspot::startAction(action, event); } else { + Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 802; scene->setAction(&scene->_sequenceManager1, scene, 802, &R2_GLOBALS._player, &scene->_autodocCover, NULL); @@ -6602,11 +6610,11 @@ bool Scene800::Button::startAction(CursorType action, Event &event) { } bool Scene800::CableJunction::startAction(CursorType action, Event &event) { - Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; - if (action != R2_OPTICAL_FIBRE) { return NamedHotspot::startAction(action, event); } else { + Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_opticalFibre.postInit(); scene->_sceneMode = 803; @@ -6660,24 +6668,25 @@ bool Scene800::DeviceSlot::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ bool Scene800::Door::startAction(CursorType action, Event &event) { - Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 801; scene->setAction(&scene->_sequenceManager1, scene, 801, &R2_GLOBALS._player, &scene->_door, NULL); return true; + } default: return SceneActor::startAction(action, event); } } bool Scene800::Tray::startAction(CursorType action, Event &event) { - Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; + if (!R2_GLOBALS.getFlag(10)) { R2_GLOBALS._player.disableControl(); scene->_sceneMode = 806; @@ -6692,16 +6701,17 @@ bool Scene800::Tray::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager1, scene, 807, &R2_GLOBALS._player, &scene->_tray, NULL); } return true; + } default: return SceneActor::startAction(action, event); } } bool Scene800::ComScanner::startAction(CursorType action, Event &event) { - Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; + if (scene->_cabinet._frame == 1) return false; @@ -6709,6 +6719,7 @@ bool Scene800::ComScanner::startAction(CursorType action, Event &event) { scene->_sceneMode = 811; scene->setAction(&scene->_sequenceManager1, scene, 811, &R2_GLOBALS._player, &scene->_comScanner, NULL); return true; + } case CURSOR_TALK: SceneItem::display2(800, 35); return true; @@ -6718,10 +6729,10 @@ bool Scene800::ComScanner::startAction(CursorType action, Event &event) { } bool Scene800::Cabinet::startAction(CursorType action, Event &event) { - Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene800 *scene = (Scene800 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (scene->_cabinet._frame == 1) { @@ -6734,6 +6745,7 @@ bool Scene800::Cabinet::startAction(CursorType action, Event &event) { R2_GLOBALS.clearFlag(56); } return true; + } default: return SceneActor::startAction(action, event); } @@ -6897,9 +6909,9 @@ void Scene825::Button::synchronize(Serializer &s) { } void Scene825::Button::process(Event &event) { - Scene825 *scene = (Scene825 *)R2_GLOBALS._sceneManager._scene; - if (!event.handled) { + Scene825 *scene = (Scene825 *)R2_GLOBALS._sceneManager._scene; + if ((event.eventType == EVENT_BUTTON_DOWN) && _bounds.contains(event.mousePos) && !_buttonDown) { scene->_sound1.play(14); setFrame(2); @@ -6963,14 +6975,14 @@ void Scene825::Button::setButton(int buttonId) { } void Scene825::Button::setText(int textId) { - Scene825 *scene = (Scene825 *)R2_GLOBALS._sceneManager._scene; - _buttonId = textId; _lookLineNum = textId; _sceneText.remove(); - if (_buttonId != 0) + if (_buttonId != 0) { + Scene825 *scene = (Scene825 *)R2_GLOBALS._sceneManager._scene; _sceneText.setup(scene->_autodocItems[textId - 1]); + } } /*--------------------------------------------------------------------------*/ @@ -7259,11 +7271,11 @@ void Scene825::doButtonPress(int buttonId) { *--------------------------------------------------------------------------*/ bool Scene850::Indicator::startAction(CursorType action, Event &event) { - Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || (R2_INVENTORY.getObjectScene(R2_OPTICAL_FIBRE) != 850)) return NamedHotspot::startAction(action, event); else { + Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 851; scene->setAction(&scene->_sequenceManager1, scene, 851, &R2_GLOBALS._player, &scene->_fibre, NULL); @@ -7274,11 +7286,11 @@ bool Scene850::Indicator::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ bool Scene850::LiftDoor::startAction(CursorType action, Event &event) { - Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); else { + Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 202; scene->setAction(&scene->_sequenceManager1, scene, 202, &R2_GLOBALS._player, this, NULL); @@ -7287,11 +7299,11 @@ bool Scene850::LiftDoor::startAction(CursorType action, Event &event) { } bool Scene850::SickBayDoor::startAction(CursorType action, Event &event) { - Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); else { + Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 204; scene->setAction(&scene->_sequenceManager1, scene, 204, &R2_GLOBALS._player, this, NULL); @@ -7300,13 +7312,13 @@ bool Scene850::SickBayDoor::startAction(CursorType action, Event &event) { } bool Scene850::Clamp::startAction(CursorType action, Event &event) { - Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; - if (!R2_GLOBALS.getFlag(7)) return false; else if (action != CURSOR_USE) return SceneActor::startAction(action, event); else { + Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_spark.postInit(); scene->_sceneMode = 850; @@ -7317,11 +7329,11 @@ bool Scene850::Clamp::startAction(CursorType action, Event &event) { } bool Scene850::Panel::startAction(CursorType action, Event &event) { - Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || R2_GLOBALS.getFlag(7)) return SceneActor::startAction(action, event); else { + Scene850 *scene = (Scene850 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 852; scene->setAction(&scene->_sequenceManager1, scene, 852, &R2_GLOBALS._player, diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 36d48ca27a..08b2783b8b 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -677,11 +677,11 @@ void Scene1100::synchronize(Serializer &s) { } bool Scene1100::Seeker::startAction(CursorType action, Event &event) { - Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; + if (R2_GLOBALS.getFlag(52)) { R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._player._characterIndex == R2_QUINN) @@ -757,9 +757,9 @@ bool Scene1100::Trooper::startAction(CursorType action, Event &event) { } bool Scene1100::Chief::startAction(CursorType action, Event &event) { - Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_TALK) && (!R2_GLOBALS.getFlag(54)) && (R2_GLOBALS.getFlag(52))) { + Scene1100 *scene = (Scene1100 *)R2_GLOBALS._sceneManager._scene; + scene->_nextStripNum = 0; R2_GLOBALS._player.disableControl(); scene->_sceneMode = 53; @@ -6887,6 +6887,8 @@ void Scene1500::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._uiElements._active = false; setZoomPercents(170, 13, 240, 100); SceneExt::postInit(); + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; + scalePalette(65, 65, 65); R2_GLOBALS._player.postInit(); @@ -6944,6 +6946,7 @@ void Scene1500::postInit(SceneObjectList *OwnerList) { void Scene1500::remove() { R2_GLOBALS._uiElements._active = true; + R2_GLOBALS._uiElements._visible = true; SceneExt::remove(); } @@ -7076,7 +7079,7 @@ void Scene1525::signal() { } /*-------------------------------------------------------------------------- - * Scene 1530 - Cutscene - Elevator + * Scene 1530 - Cutscene - Crashing on Rimwall * *--------------------------------------------------------------------------*/ @@ -7090,6 +7093,7 @@ void Scene1530::postInit(SceneObjectList *OwnerList) { R2_GLOBALS._uiElements._active = false; SceneExt::postInit(); + R2_GLOBALS._interfaceY = SCREEN_HEIGHT; _stripManager.addSpeaker(&_quinnSpeaker); _stripManager.addSpeaker(&_seekerSpeaker); @@ -7450,10 +7454,11 @@ void Scene1550::DishControlsWindow::DishControl::synchronize(Serializer &s) { } bool Scene1550::DishControlsWindow::DishControl::startAction(CursorType action, Event &event) { - Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + + Scene1550 *scene = (Scene1550 *)R2_GLOBALS._sceneManager._scene; + switch (_controlId) { case 1: // Button control @@ -8160,7 +8165,7 @@ void Scene1550::signal() { // No break on purpose case 1587: R2_INVENTORY.setObjectScene(R2_DIAGNOSTICS_DISPLAY, R2_GLOBALS._player._characterIndex); - _wreckage2.remove(); + _diagnosticsDisplay.remove(); _dontExit = false; R2_GLOBALS._player.enableControl(); break; @@ -8172,7 +8177,7 @@ void Scene1550::signal() { } else { R2_GLOBALS._s1550PlayerArea[R2_QUINN] = R2_GLOBALS._s1550PlayerArea[R2_SEEKER]; } - R2_GLOBALS._player.enableControl(); + R2_GLOBALS._player.enableControl(CURSOR_WALK); break; default: _sceneMode = 62; @@ -8658,6 +8663,8 @@ void Scene1550::enterArea() { int varA = 0; + // This section handles checks if the ARM spacecraft have not yet seized + // control of Lance of Truth. if (!R2_GLOBALS.getFlag(16)) { switch (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y - 2) { case 0: @@ -8750,7 +8757,11 @@ void Scene1550::enterArea() { default: break; } - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y > 0) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x <= 29) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x >= 20) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y > 7)) { + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y > 0) && + (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x <= 29) && + ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x < 20) || + (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y > 7))) { + // In an area where the cutscene can be triggered, so start it R2_GLOBALS.setFlag(16); R2_GLOBALS._sceneManager.changeScene(1500); } @@ -8772,7 +8783,7 @@ void Scene1550::enterArea() { } } - if (R2_GLOBALS._sceneManager._sceneNumber == 1234) + if (_screenNumber == 1234) _walkRegionsId = 1576; if (_wallType == 0) { @@ -8785,6 +8796,7 @@ void Scene1550::enterArea() { } if (R2_GLOBALS._sceneManager._sceneNumber == 1550){ +#if 0 warning("Mouse_hideIfNeeded()"); warning("gfx_set_pane_p"); for (int i = 3; i != 168; ++i) { @@ -8794,6 +8806,7 @@ void Scene1550::enterArea() { } warning("Missing sub2957D()"); warning("gfx_set_pane_p()"); +#endif R2_GLOBALS._sceneManager._fadeMode = FADEMODE_IMMEDIATE; if (varA == 0) { @@ -8809,7 +8822,7 @@ void Scene1550::enterArea() { if (R2_GLOBALS._sceneManager._hasPalette) _sceneResourceId = varA; - warning("sub_2C429()"); +// warning("sub_2C429()"); } } @@ -9566,7 +9579,6 @@ void Scene1575::process(Event &event) { Scene::process(event); g_globals->_sceneObjects->recurse(SceneHandler::dispatchObject); - warning("TODO: check Scene1575::process"); } void Scene1575::dispatch() { @@ -9665,9 +9677,9 @@ void Scene1580::synchronize(Serializer &s) { } bool Scene1580::JoystickPlug::startAction(CursorType action, Event &event) { - Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; - if (action == R2_JOYSTICK) { + Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; + R2_INVENTORY.setObjectScene(R2_JOYSTICK, 1580); R2_GLOBALS._sceneItems.remove(&scene->_joystickPlug); scene->_joystick.postInit(); @@ -9684,9 +9696,9 @@ bool Scene1580::JoystickPlug::startAction(CursorType action, Event &event) { } bool Scene1580::ScreenSlot::startAction(CursorType action, Event &event) { - Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; - if (action == R2_DIAGNOSTICS_DISPLAY) { + Scene1580 *scene = (Scene1580 *)R2_GLOBALS._sceneManager._scene; + R2_INVENTORY.setObjectScene(R2_DIAGNOSTICS_DISPLAY, 1580); R2_GLOBALS._player.disableControl(); R2_GLOBALS._sceneItems.remove(&scene->_screenSlot); @@ -11757,13 +11769,13 @@ bool Scene1850::Door::startAction(CursorType action, Event &event) { if (action != CURSOR_USE) return SceneHotspot::startAction(action, event); - Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene; - if (R2_GLOBALS.getFlag(32)) { SceneItem::display(3240, 4, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); return true; } + Scene1850 *scene = (Scene1850 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (scene->_sceneMode == 1851) R2_GLOBALS._player._effect = EFFECT_SHADED; @@ -12644,8 +12656,6 @@ void Scene1875::process(Event &event) { *--------------------------------------------------------------------------*/ bool Scene1900::LiftDoor::startAction(CursorType action, Event &event) { - Scene1900 *scene = (Scene1900 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); @@ -12656,6 +12666,8 @@ bool Scene1900::LiftDoor::startAction(CursorType action, Event &event) { return true; } + Scene1900 *scene = (Scene1900 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.enableControl(CURSOR_USE); if (_position.x >= 160) { @@ -12912,14 +12924,14 @@ void Scene1925::synchronize(Serializer &s) { } bool Scene1925::Button::startAction(CursorType action, Event &event) { - Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneHotspot::startAction(action, event); if ((R2_GLOBALS._player._position.x == 110) && (R2_GLOBALS._player._position.y == 100)) return SceneHotspot::startAction(action, event); + Scene1925 *scene = (Scene1925 *)R2_GLOBALS._sceneManager._scene; + if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 20)) scene->_sceneMode = 1928; else if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 200)) @@ -13278,11 +13290,11 @@ bool Scene1945::Ice::startAction(CursorType action, Event &event) { } bool Scene1945::Ladder::startAction(CursorType action, Event &event) { - Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneHotspot::startAction(action, event); + Scene1945 *scene = (Scene1945 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(CURSOR_USE); scene->_sceneMode = 0; diff --git a/engines/tsage/ringworld2/ringworld2_scenes2.cpp b/engines/tsage/ringworld2/ringworld2_scenes2.cpp index e5ae6c4acd..7785fe6aec 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes2.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes2.cpp @@ -1046,9 +1046,9 @@ bool Scene2350::Companion::startAction(CursorType action, Event &event) { } bool Scene2350::Balloon::startAction(CursorType action, Event &event) { - Scene2350 *scene = (Scene2350 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_REBREATHER_TANK) && (R2_GLOBALS.getFlag(74))) { + Scene2350 *scene = (Scene2350 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_person.postInit(); scene->_sceneMode = 2355; @@ -1281,9 +1281,9 @@ void Scene2400::signal() { *--------------------------------------------------------------------------*/ bool Scene2425::RopeDest1::startAction(CursorType action, Event &event) { - Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_CURSOR_ROPE) && (!R2_GLOBALS.getFlag(84))) { + Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2426; scene->setAction(&scene->_sequenceManager, scene, 2426, &R2_GLOBALS._player, &scene->_rope, NULL); @@ -1298,9 +1298,9 @@ bool Scene2425::RopeDest1::startAction(CursorType action, Event &event) { } bool Scene2425::RopeDest2::startAction(CursorType action, Event &event) { - Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_CURSOR_ROPE) && (R2_GLOBALS.getFlag(84))) { + Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2427; scene->setAction(&scene->_sequenceManager, scene, 2427, &R2_GLOBALS._player, &scene->_rope, NULL); @@ -1315,11 +1315,11 @@ bool Scene2425::RopeDest2::startAction(CursorType action, Event &event) { } bool Scene2425::Crevasse::startAction(CursorType action, Event &event) { - Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; - if (action != R2_CURSOR_ROPE) return NamedHotspot::startAction(action, event); else { + Scene2425 *scene = (Scene2425 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); if (R2_GLOBALS.getFlag(84)) { scene->_sceneMode = 20; @@ -1498,11 +1498,11 @@ bool Scene2430::Companion::startAction(CursorType action, Event &event) { } bool Scene2430::GunPowder::startAction(CursorType action, Event &event) { - Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || (R2_GLOBALS._player._characterIndex != 2)) return SceneActor::startAction(action, event); + Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2430; scene->setAction(&scene->_sequenceManager, scene, 2430, &R2_GLOBALS._player, &scene->_gunPowder, NULL); @@ -1510,11 +1510,11 @@ bool Scene2430::GunPowder::startAction(CursorType action, Event &event) { } bool Scene2430::OilLamp::startAction(CursorType action, Event &event) { - Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || (R2_GLOBALS._player._characterIndex != 2)) return SceneActor::startAction(action, event); + Scene2430 *scene = (Scene2430 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2435; scene->setAction(&scene->_sequenceManager, scene, 2435, &R2_GLOBALS._player, &scene->_oilLamp, NULL); @@ -1797,9 +1797,9 @@ bool Scene2440::Companion::startAction(CursorType action, Event &event) { } bool Scene2440::OilLamp::startAction(CursorType action, Event &event) { - Scene2440 *scene = (Scene2440 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_SEEKER)) { + Scene2440 *scene = (Scene2440 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2440; scene->setAction(&scene->_sequenceManager, scene, 2440, &R2_GLOBALS._player, &scene->_oilLamp, NULL); @@ -1925,9 +1925,9 @@ void Scene2445::signal() { *--------------------------------------------------------------------------*/ bool Scene2450::Parker::startAction(CursorType action, Event &event) { - Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS._player._characterIndex == R2_QUINN)) { + Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2452; scene->setAction(&scene->_sequenceManager, scene, 2452, &R2_GLOBALS._player, &scene->_parker, NULL); @@ -1937,11 +1937,11 @@ bool Scene2450::Parker::startAction(CursorType action, Event &event) { } bool Scene2450::CareTaker::startAction(CursorType action, Event &event) { - Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_TALK) { R2_GLOBALS._player.disableControl(); if (R2_GLOBALS._stripModifier < 3) { + Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; + ++R2_GLOBALS._stripModifier; scene->_sceneMode = 20; R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS); @@ -1957,9 +1957,9 @@ bool Scene2450::CareTaker::startAction(CursorType action, Event &event) { } void Scene2450::SouthWestExit::changeScene() { - Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; - if ((R2_GLOBALS._player._characterIndex == R2_SEEKER) || (R2_GLOBALS.getFlag(61))) { + Scene2450 *scene = (Scene2450 *)R2_GLOBALS._sceneManager._scene; + _enabled = false; R2_GLOBALS._events.setCursor(CURSOR_ARROW); R2_GLOBALS._player.disableControl(); @@ -2218,10 +2218,10 @@ void Scene2450::signal() { *--------------------------------------------------------------------------*/ bool Scene2455::Lamp::startAction(CursorType action, Event &event) { - Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; - if (action == R2_GLASS_DOME) { if ((R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_2) == 2455) || (R2_INVENTORY.getObjectScene(R2_ALCOHOL_LAMP_3) == 2455)) { + Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2458; scene->_pool._lookLineNum = 9; @@ -2272,9 +2272,9 @@ bool Scene2455::Pool::startAction(CursorType action, Event &event) { } bool Scene2455::ScrithKey::startAction(CursorType action, Event &event) { - Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene2455 *scene = (Scene2455 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2459; scene->setAction(&scene->_sequenceManager, scene, 2459, &R2_GLOBALS._player, &scene->_scrithKey, NULL); @@ -2502,9 +2502,9 @@ void Scene2500::signal() { *--------------------------------------------------------------------------*/ bool Scene2525::StopCock::startAction(CursorType action, Event &event) { - Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_REBREATHER_TANK) && (!R2_GLOBALS.getFlag(74))) { + Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2526; scene->setAction(&scene->_sequenceManager, scene, 2526, &R2_GLOBALS._player, NULL); @@ -2515,12 +2515,12 @@ bool Scene2525::StopCock::startAction(CursorType action, Event &event) { } bool Scene2525::GlassDome::startAction(CursorType action, Event &event) { - Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + Scene2525 *scene = (Scene2525 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2525; scene->setAction(&scene->_sequenceManager, scene, 2525, &R2_GLOBALS._player, &scene->_glassDome, NULL); @@ -2643,12 +2643,12 @@ void Scene2525::signal() { *--------------------------------------------------------------------------*/ bool Scene2530::Flask::startAction(CursorType action, Event &event) { - Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2530; scene->setAction(&scene->_sequenceManager, scene, 2530, &R2_GLOBALS._player, &scene->_flask, NULL); @@ -2660,11 +2660,11 @@ bool Scene2530::Flask::startAction(CursorType action, Event &event) { } bool Scene2530::Crank::startAction(CursorType action, Event &event) { - Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + Scene2530 *scene = (Scene2530 *)R2_GLOBALS._sceneManager._scene; + if (R2_GLOBALS._player._characterIndex == R2_QUINN) { if (R2_GLOBALS.getFlag(73)) SceneItem::display(2530, 35, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); @@ -2802,12 +2802,12 @@ void Scene2530::signal() { *--------------------------------------------------------------------------*/ bool Scene2535::RebreatherTank::startAction(CursorType action, Event &event) { - Scene2535 *scene = (Scene2535 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + Scene2535 *scene = (Scene2535 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = (R2_INVENTORY.getObjectScene(R2_REBREATHER_TANK) == 2535) ? 2536 : 2537; @@ -2821,12 +2821,12 @@ bool Scene2535::RebreatherTank::startAction(CursorType action, Event &event) { } bool Scene2535::TannerMask::startAction(CursorType action, Event &event) { - Scene2535 *scene = (Scene2535 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + Scene2535 *scene = (Scene2535 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2535; scene->setAction(&scene->_sequenceManager, scene, 2535, &R2_GLOBALS._player, &scene->_tannerMask, NULL); @@ -4178,9 +4178,9 @@ void Scene2800::synchronize(Serializer &s) { } bool Scene2800::Outpost::startAction(CursorType action, Event &event) { - Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; - if ((action == CURSOR_USE) && (R2_GLOBALS.getFlag(47))) { + Scene2800 *scene = (Scene2800 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 2805; scene->setAction(&scene->_sequenceManager, scene, 2805, &R2_GLOBALS._player, NULL); @@ -4648,10 +4648,10 @@ bool Scene2900::KnobLeft::startAction(CursorType action, Event &event) { } bool Scene2900::KnobRight::startAction(CursorType action, Event &event) { - Scene2900 *scene = (Scene2900 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene2900 *scene = (Scene2900 *)R2_GLOBALS._sceneManager._scene; + if (scene->_majorMinorFlag || scene->_altitudeChanging || scene->_xAmount != scene->_xComparison) { // Let your altitude stablize first @@ -4667,6 +4667,7 @@ bool Scene2900::KnobRight::startAction(CursorType action, Event &event) { scene->_xComparison = 100 - ((R2_GLOBALS._balloonAltitude / 48) + 1) * 25; } break; + } case CURSOR_LOOK: SceneItem::display2(2900, 12); @@ -4685,9 +4686,9 @@ bool Scene2900::KnobRight::startAction(CursorType action, Event &event) { } bool Scene2900::Skip::startAction(CursorType action, Event &event) { - Scene2900 *scene = (Scene2900 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene2900 *scene = (Scene2900 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 12; scene->signal(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index ab6da047ce..eab3178368 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -220,8 +220,6 @@ void Scene3125::synchronize(Serializer &s) { } bool Scene3125::Background::startAction(CursorType action, Event &event) { - Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_USE: if (_useLineNum != -1) @@ -235,8 +233,10 @@ bool Scene3125::Background::startAction(CursorType action, Event &event) { if (_talkLineNum != -1) SceneItem::display(_resNum, _talkLineNum, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); break; - default: + default: { + Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; return scene->display(action, event); + } break; } @@ -244,13 +244,14 @@ bool Scene3125::Background::startAction(CursorType action, Event &event) { } bool Scene3125::Table::startAction(CursorType action, Event &event) { - Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3125; scene->setAction(&scene->_sequenceManager, scene, 3125, &R2_GLOBALS._player, NULL); + } break; case CURSOR_LOOK: SceneItem::display(3125, 15, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); @@ -267,16 +268,17 @@ bool Scene3125::Table::startAction(CursorType action, Event &event) { } bool Scene3125::Computer::startAction(CursorType action, Event &event) { - Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; + 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->_ghoul4, NULL); + } break; case CURSOR_LOOK: SceneItem::display(3125, 9, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); @@ -293,11 +295,11 @@ bool Scene3125::Computer::startAction(CursorType action, Event &event) { } bool Scene3125::Door::startAction(CursorType action, Event &event) { - Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + Scene3125 *scene = (Scene3125 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3176; scene->setAction(&scene->_sequenceManager, scene, 3176, &R2_GLOBALS._player, &scene->_door, NULL); @@ -446,17 +448,18 @@ bool Scene3150::Toilet::startAction(CursorType action, Event &event) { } bool Scene3150::Water::startAction(CursorType action, Event &event) { - Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { if (R2_GLOBALS.getFlag(75)) return SceneActor::startAction(action, event); + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3151; scene->setAction(&scene->_sequenceManager, scene, 3151, &R2_GLOBALS._player, &scene->_water, NULL); return true; + } case R2_FOOD_TRAY: return false; default: @@ -466,11 +469,11 @@ bool Scene3150::Water::startAction(CursorType action, Event &event) { } bool Scene3150::FoodTray::startAction(CursorType action, Event &event) { - Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; - if ((action != CURSOR_USE) || (R2_GLOBALS.getFlag(77))) return SceneActor::startAction(action, event); + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3157; scene->setAction(&scene->_sequenceManager, scene, 3157, &R2_GLOBALS._player, &scene->_foodTray, NULL); @@ -478,9 +481,9 @@ bool Scene3150::FoodTray::startAction(CursorType action, Event &event) { } bool Scene3150::ToiletFlush::startAction(CursorType action, Event &event) { - Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; - if (action == CURSOR_USE) { + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + if (R2_GLOBALS.getFlag(75)) { if (R2_GLOBALS.getFlag(77)) { R2_GLOBALS._player.disableControl(); @@ -506,9 +509,9 @@ bool Scene3150::ToiletFlush::startAction(CursorType action, Event &event) { } bool Scene3150::AirVent::startAction(CursorType action, Event &event) { - Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; - if ((action == R2_LASER_HACKSAW) && (!R2_GLOBALS.getFlag(80))) { + Scene3150 *scene = (Scene3150 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3160; scene->setAction(&scene->_sequenceManager, scene, 3160, &R2_GLOBALS._player, &scene->_airVent, NULL); @@ -809,8 +812,6 @@ void Scene3150::dispatch() { *--------------------------------------------------------------------------*/ bool Scene3175::RoomItem::startAction(CursorType action, Event &event) { - Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_USE: if (_useLineNum != -1) { @@ -834,12 +835,11 @@ bool Scene3175::RoomItem::startAction(CursorType action, Event &event) { break; } + Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; return scene->display(action, event); } bool Scene3175::Corpse::startAction(CursorType action, Event &event) { - Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_USE: if (_useLineNum != -1) { @@ -863,18 +863,20 @@ bool Scene3175::Corpse::startAction(CursorType action, Event &event) { break; } + Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; return scene->display(action, event); } bool Scene3175::Door::startAction(CursorType action, Event &event) { - Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; - switch (action) { - case CURSOR_USE: + case CURSOR_USE: { + Scene3175 *scene = (Scene3175 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3176; scene->setAction(&scene->_sequenceManager, scene, 3176, &R2_GLOBALS._player, &scene->_door, NULL); return true; + } break; case CURSOR_LOOK: SceneItem::display(3175, 9, 0, 280, 1, 160, 9, 1, 2, 20, 7, 154, LIST_END); @@ -1120,8 +1122,6 @@ void Scene3245::signal() { *--------------------------------------------------------------------------*/ bool Scene3250::Item::startAction(CursorType action, Event &event) { - Scene3250 *scene = (Scene3250 *)R2_GLOBALS._sceneManager._scene; - switch (action) { case CURSOR_USE: if (_useLineNum != -1) { @@ -1145,15 +1145,15 @@ bool Scene3250::Item::startAction(CursorType action, Event &event) { break; } + Scene3250 *scene = (Scene3250 *)R2_GLOBALS._sceneManager._scene; return scene->display(action, event); } bool Scene3250::Door::startAction(CursorType action, Event &event) { - Scene3250 *scene = (Scene3250 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + Scene3250 *scene = (Scene3250 *)R2_GLOBALS._sceneManager._scene; R2_GLOBALS._player.disableControl(); switch(_position.x) { @@ -1396,11 +1396,11 @@ void Scene3255::dispatch() { *--------------------------------------------------------------------------*/ bool Scene3260::Door::startAction(CursorType action, Event &event) { - Scene3260 *scene = (Scene3260 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + Scene3260 *scene = (Scene3260 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3271; scene->setAction(&scene->_sequenceManager, scene, 3271, &R2_GLOBALS._player, &scene->_door, NULL); @@ -1408,11 +1408,11 @@ bool Scene3260::Door::startAction(CursorType action, Event &event) { } bool Scene3260::Toolbox::startAction(CursorType action, Event &event) { - Scene3260 *scene = (Scene3260 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + Scene3260 *scene = (Scene3260 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3272; scene->setAction(&scene->_sequenceManager, scene, 3272, &R2_GLOBALS._player, &scene->_toolbox, NULL); @@ -1574,11 +1574,11 @@ void Scene3260::signal() { *--------------------------------------------------------------------------*/ bool Scene3275::Door::startAction(CursorType action, Event &event) { - Scene3275 *scene = (Scene3275 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); + Scene3275 *scene = (Scene3275 *)R2_GLOBALS._sceneManager._scene; + R2_GLOBALS._player.disableControl(); scene->_sceneMode = 3275; scene->setAction(&scene->_sequenceManager, scene, 3275, &R2_GLOBALS._player, &scene->_door, NULL); @@ -1822,11 +1822,11 @@ void Scene3375::enterArea(int sceneMode) { } bool Scene3375::Companion2::startAction(CursorType action, Event &event) { - Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; if (R2_GLOBALS._player._characterIndex == R2_SEEKER) scene->_stripManager.start(3302, scene); @@ -1837,11 +1837,11 @@ bool Scene3375::Companion2::startAction(CursorType action, Event &event) { } bool Scene3375::Companion1::startAction(CursorType action, Event &event) { - Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) scene->_stripManager.start(3302, scene); @@ -1852,11 +1852,11 @@ bool Scene3375::Companion1::startAction(CursorType action, Event &event) { } bool Scene3375::Webbster::startAction(CursorType action, Event &event) { - Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; scene->_stripManager.start(3303, scene); @@ -1864,8 +1864,6 @@ bool Scene3375::Webbster::startAction(CursorType action, Event &event) { } bool Scene3375::Door::startAction(CursorType action, Event &event) { - Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); @@ -1883,6 +1881,8 @@ bool Scene3375::Door::startAction(CursorType action, Event &event) { R2_GLOBALS._player.disableControl(CURSOR_ARROW); + Scene3375 *scene = (Scene3375 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 3375; scene->setAction(&scene->_sequenceManager, scene, 3375, &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, NULL); @@ -2252,11 +2252,11 @@ void Scene3385::synchronize(Serializer &s) { } bool Scene3385::Companion1::startAction(CursorType action, Event &event) { - Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; if (R2_GLOBALS._player._characterIndex == R2_SEEKER) scene->_stripManager.start(3302, scene); @@ -2267,11 +2267,11 @@ bool Scene3385::Companion1::startAction(CursorType action, Event &event) { } bool Scene3385::Companion2::startAction(CursorType action, Event &event) { - Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) scene->_stripManager.start(3302, scene); @@ -2282,11 +2282,11 @@ bool Scene3385::Companion2::startAction(CursorType action, Event &event) { } bool Scene3385::Webbster::startAction(CursorType action, Event &event) { - Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; scene->_stripManager.start(3303, scene); @@ -2294,8 +2294,6 @@ bool Scene3385::Webbster::startAction(CursorType action, Event &event) { } bool Scene3385::Door::startAction(CursorType action, Event &event) { - Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); @@ -2303,6 +2301,8 @@ bool Scene3385::Door::startAction(CursorType action, Event &event) { if (R2_GLOBALS._sceneManager._previousScene == 3375) R2_GLOBALS._sound2.play(314); + Scene3385 *scene = (Scene3385 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 3386; scene->setAction(&scene->_sequenceManager, scene, 3386, &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, @@ -2489,11 +2489,11 @@ void Scene3395::synchronize(Serializer &s) { } bool Scene3395::Companion1::startAction(CursorType action, Event &event) { - Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; if (R2_GLOBALS._player._characterIndex == R2_SEEKER) scene->_stripManager.start(3302, scene); @@ -2504,11 +2504,11 @@ bool Scene3395::Companion1::startAction(CursorType action, Event &event) { } bool Scene3395::Companion2::startAction(CursorType action, Event &event) { - Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) scene->_stripManager.start(3302, scene); @@ -2519,11 +2519,11 @@ bool Scene3395::Companion2::startAction(CursorType action, Event &event) { } bool Scene3395::Webbster::startAction(CursorType action, Event &event) { - Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_TALK) return SceneActor::startAction(action, event); + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 9999; scene->_stripManager.start(3303, scene); @@ -2531,8 +2531,6 @@ bool Scene3395::Webbster::startAction(CursorType action, Event &event) { } bool Scene3395::Door::startAction(CursorType action, Event &event) { - Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; - if (action != CURSOR_USE) return SceneActor::startAction(action, event); @@ -2540,6 +2538,8 @@ bool Scene3395::Door::startAction(CursorType action, Event &event) { if (R2_GLOBALS._sceneManager._previousScene == 3385) R2_GLOBALS._sound2.play(314); + Scene3395 *scene = (Scene3395 *)R2_GLOBALS._sceneManager._scene; + scene->_sceneMode = 3396; scene->setAction(&scene->_sequenceManager, scene, 3396, &R2_GLOBALS._player, &scene->_companion1, &scene->_companion2, &scene->_webbster, &scene->_door, diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index 49359bb351..61a4840fa5 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -1844,17 +1844,8 @@ void SpeakerQuinn3700::animateSpeaker() { // Classes related to QUINNL //---------------------------------------------------------------------------- -SpeakerQuinnL::SpeakerQuinnL(): VisualSpeaker() { +SpeakerQuinnL::SpeakerQuinnL(): SpeakerQuinn() { _speakerName = "QUINNL"; - _color1 = 35; - _color2 = 0; - _speakerMode = 0; - _textWidth = 300; - _hideObjects = false; - _object2 = NULL; - _displayMode = 1; - _numFrames = 0; - _fontNumber = 10; } //---------------------------------------------------------------------------- @@ -2544,17 +2535,8 @@ void SpeakerSeeker3700::animateSpeaker() { // Classes related to SEEKERL //---------------------------------------------------------------------------- -SpeakerSeekerL::SpeakerSeekerL(): VisualSpeaker() { +SpeakerSeekerL::SpeakerSeekerL(): SpeakerSeeker() { _speakerName = "SEEKERL"; - _color1 = 35; - _color2 = 0; - _speakerMode = 0; - _textWidth = 300; - _hideObjects = false; - _object2 = NULL; - _displayMode = 1; - _numFrames = 0; - _fontNumber = 10; } //---------------------------------------------------------------------------- diff --git a/engines/tsage/ringworld2/ringworld2_speakers.h b/engines/tsage/ringworld2/ringworld2_speakers.h index 33e34ce8f6..d70652ff97 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.h +++ b/engines/tsage/ringworld2/ringworld2_speakers.h @@ -369,7 +369,7 @@ public: // Classes related to QuinnL -class SpeakerQuinnL : public VisualSpeaker { +class SpeakerQuinnL : public SpeakerQuinn { public: SpeakerQuinnL(); @@ -495,7 +495,7 @@ public: // Classes related to SeekerL -class SpeakerSeekerL : public VisualSpeaker { +class SpeakerSeekerL : public SpeakerSeeker { public: SpeakerSeekerL(); diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 88bc7f2c66..c8ad8c1281 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -2411,7 +2411,7 @@ int Sound::soFindSound(VoiceTypeStruct *vtStruct, int channelNum) { /*--------------------------------------------------------------------------*/ ASound::ASound(): EventHandler() { - _action = NULL; + _endAction = NULL; _cueValue = -1; if (g_globals) g_globals->_sounds.push_back(this); @@ -2606,7 +2606,8 @@ bool PlayStream::play(int voiceNum, EventHandler *endAction) { // Reached start of next voice sample, so stop break; if (strncmp(header, "MORE", 4)) - error("Invalid stream data"); + // Not more remaining, so break + break; // Get the size of the chunk chunkSize = _file.readUint16LE() - 16; diff --git a/graphics/decoders/png.cpp b/graphics/decoders/png.cpp index 5acb7b36f7..c4fee46fec 100644 --- a/graphics/decoders/png.cpp +++ b/graphics/decoders/png.cpp @@ -163,7 +163,13 @@ bool PNGDecoder::loadStream(Common::SeekableReadStream &stream) { _outputSurface->create(width, height, Graphics::PixelFormat::createFormatCLUT8()); png_set_packing(pngPtr); } else { - _outputSurface->create(width, height, Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)); + bool isAlpha = (colorType & PNG_COLOR_MASK_ALPHA); + if (png_get_valid(pngPtr, infoPtr, PNG_INFO_tRNS)) { + isAlpha = true; + png_set_expand(pngPtr); + } + _outputSurface->create(width, height, Graphics::PixelFormat(4, + 8, 8, 8, isAlpha ? 8 : 0, 24, 16, 8, 0)); if (!_outputSurface->getPixels()) { error("Could not allocate memory for output image."); } @@ -171,8 +177,6 @@ bool PNGDecoder::loadStream(Common::SeekableReadStream &stream) { png_set_strip_16(pngPtr); if (bitDepth < 8) png_set_expand(pngPtr); - if (png_get_valid(pngPtr, infoPtr, PNG_INFO_tRNS)) - png_set_expand(pngPtr); if (colorType == PNG_COLOR_TYPE_GRAY || colorType == PNG_COLOR_TYPE_GRAY_ALPHA) png_set_gray_to_rgb(pngPtr); diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 688654d208..9fe482ddcc 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -1360,17 +1360,17 @@ bool ThemeEngine::createCursor(const Common::String &filename, int hotspotX, int // If there is no entry yet for this color in the palette: Add one if (!colorToIndex.contains(col)) { + if (colorsFound >= MAX_CURS_COLORS) { + warning("Cursor contains too many colors (%d, but only %d are allowed)", colorsFound, MAX_CURS_COLORS); + return false; + } + const int index = colorsFound++; colorToIndex[col] = index; _cursorPal[index * 3 + 0] = r; _cursorPal[index * 3 + 1] = g; _cursorPal[index * 3 + 2] = b; - - if (colorsFound > MAX_CURS_COLORS) { - warning("Cursor contains too many colors (%d, but only %d are allowed)", colorsFound, MAX_CURS_COLORS); - return false; - } } // Copy pixel from the 16 bit source surface to the 8bit target surface diff --git a/gui/console.cpp b/gui/console.cpp index 49e2fccd98..7e88b6dfb5 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -82,8 +82,6 @@ ConsoleDialog::ConsoleDialog(float widthPercent, float heightPercent) _historyIndex = 0; _historyLine = 0; _historySize = 0; - for (int i = 0; i < kHistorySize; i++) - _history[i][0] = '\0'; // Display greetings & prompt print(gScummVMFullVersion); @@ -274,24 +272,19 @@ void ConsoleDialog::handleKeyDown(Common::KeyState state) { if (len > 0) { - // We have to allocate the string buffer with new, since VC++ sadly does not - // comply to the C++ standard, so we can't use a dynamic sized stack array. - char *str = new char[len + 1]; + Common::String str; // Copy the user input to str for (i = 0; i < len; i++) - str[i] = buffer(_promptStartPos + i); - str[len] = '\0'; + str.insertChar(buffer(_promptStartPos + i), i); // Add the input to the history addToHistory(str); // Pass it to the input callback, if any if (_callbackProc) - keepRunning = (*_callbackProc)(this, str, _callbackRefCon); + keepRunning = (*_callbackProc)(this, str.c_str(), _callbackRefCon); - // Get rid of the string buffer - delete[] str; } print(PROMPT); @@ -575,8 +568,8 @@ void ConsoleDialog::killLastWord() { } } -void ConsoleDialog::addToHistory(const char *str) { - strcpy(_history[_historyIndex], str); +void ConsoleDialog::addToHistory(const Common::String &str) { + _history[_historyIndex] = str; _historyIndex = (_historyIndex + 1) % kHistorySize; _historyLine = 0; if (_historySize < kHistorySize) @@ -590,8 +583,7 @@ void ConsoleDialog::historyScroll(int direction) { if (_historyLine == 0 && direction > 0) { int i; for (i = 0; i < _promptEndPos - _promptStartPos; i++) - _history[_historyIndex][i] = buffer(_promptStartPos + i); - _history[_historyIndex][i] = '\0'; + _history[_historyIndex].insertChar(buffer(_promptStartPos + i), i); } // Advance to the next line in the history @@ -617,7 +609,8 @@ void ConsoleDialog::historyScroll(int direction) { idx = (_historyIndex - _historyLine + _historySize) % _historySize; else idx = _historyIndex; - for (int i = 0; i < kLineBufferSize && _history[idx][i] != '\0'; i++) + int length = _history[idx].size(); + for (int i = 0; i < length; i++) printCharIntern(_history[idx][i]); _promptEndPos = _currentPos; diff --git a/gui/console.h b/gui/console.h index 50a00a1ad1..194bfd6fc0 100644 --- a/gui/console.h +++ b/gui/console.h @@ -23,6 +23,7 @@ #define CONSOLE_DIALOG_H #include "gui/dialog.h" +#include "common/str.h" namespace GUI { @@ -69,7 +70,6 @@ protected: enum { kBufferSize = 32768, kCharsPerLine = 128, - kLineBufferSize = 256, kHistorySize = 20 }; @@ -112,7 +112,7 @@ protected: CompletionCallbackProc _completionCallbackProc; void *_completionCallbackRefCon; - char _history[kHistorySize][kLineBufferSize]; + Common::String _history[kHistorySize]; int _historySize; int _historyIndex; int _historyLine; @@ -184,7 +184,7 @@ protected: void killLastWord(); // History - void addToHistory(const char *str); + void addToHistory(const Common::String &str); void historyScroll(int direction); }; |