From 0d6b80adb7748e61f79a8a632d9c98b2aeb20d95 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 18 Nov 2013 22:35:48 +0200 Subject: TSAGE: Don't assert in PlayStream::getFileOffset() when no data exists This function returns 0 when no valid voice data is found, at the place where it's used. This prevents the game asserting during the intro, when no speech file is present, in platforms with limited disk space --- engines/tsage/sound.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/tsage') diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index c8ad8c1281..e2fe21c6d7 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -2670,7 +2670,9 @@ void PlayStream::dispatch() { } uint32 PlayStream::getFileOffset(const uint16 *data, int count, int voiceNum) { - assert(data); + if (!data) + return 0; // no valid voice data found + int bitsIndex = voiceNum & 7; int byteIndex = voiceNum >> 3; int shiftAmount = bitsIndex * 2; -- cgit v1.2.3 From 40a936dd112eb8ddd80bc08ffe2c89af23248153 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 19 Nov 2013 09:01:52 -0500 Subject: TSAGE: R2R fix for using ladder at bottom of lift shaft --- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index eaa60cadd7..03a4d1d9d1 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -13350,7 +13350,8 @@ bool Scene1945::Ladder::startAction(CursorType action, Event &event) { } else if ( ((R2_GLOBALS._player._position.x == 197) && (R2_GLOBALS._player._position.y == 158)) || ((R2_GLOBALS._player._position.x == 191) && (R2_GLOBALS._player._position.y == 142)) ) { scene->_sceneMode = 1947; - } else if ((R2_GLOBALS._player._position.x == 221) && (R2_GLOBALS._player._position.y == 142) && (event.mousePos.y >= 30)) { + } else if ((R2_GLOBALS._player._position.x == 154) && (R2_GLOBALS._player._position.y == 50) + && (event.mousePos.y >= 30)) { scene->_sceneMode = 1940; } else { R2_GLOBALS._player.enableControl(CURSOR_USE); @@ -13551,6 +13552,7 @@ void Scene1945::signal() { setAction(&_sequenceManager1, this, _sceneMode, &R2_GLOBALS._player, &_gunpowder, NULL); return; } + _sceneMode = 0; break; case 1947: if (_nextSceneMode1 == 1943) { -- cgit v1.2.3 From 03e7fd3941204b10b74d92d3724899e8529775f1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 19 Nov 2013 09:02:41 -0500 Subject: TSAGE: Graphic fix for image flags affecting frame centroid location --- engines/tsage/graphics.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 595c43a0bf..446c56662a 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -68,11 +68,21 @@ GfxSurface surfaceFromRes(const byte *imgData) { Rect r(0, 0, READ_LE_UINT16(imgData), READ_LE_UINT16(imgData + 2)); GfxSurface s; s.create(r.width(), r.height()); + s._transColor = *(imgData + 8); + + byte flags = imgData[9]; + bool rleEncoded = (flags & 2) != 0; + + // Figure out the centroid s._centroid.x = READ_LE_UINT16(imgData + 4); s._centroid.y = READ_LE_UINT16(imgData + 6); - s._transColor = *(imgData + 8); - bool rleEncoded = (imgData[9] & 2) != 0; + if (g_vm->getGameID() != GType_Ringworld) { + if (flags & 4) + s._centroid.x = r.width() - (s._centroid.x + 1); + if (flags & 8) + s._centroid.y = r.height() - (s._centroid.y + 1); + } const byte *srcP = imgData + 10; Graphics::Surface destSurface = s.lockSurface(); -- cgit v1.2.3 From c15a9c1b7be999264430c3e6068ec86c95261371 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 19 Nov 2013 23:19:22 +0100 Subject: TSAGE: R2R - Add a workaround for the pathfinding issue in vampire maze, remove some useless braces --- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 39 +++++++++++-------------- 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 03a4d1d9d1..1a794269a7 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -146,9 +146,9 @@ void Scene1000::signal() { break; case 2: - if (R2_GLOBALS._speechSubtitles & SPEECH_TEXT) { + if (R2_GLOBALS._speechSubtitles & SPEECH_TEXT) setAction(&_sequenceManager1, this, 1, &R2_GLOBALS._player, NULL); - } else { + else { if (++_animCounter < 3) _sceneMode = 2; @@ -463,9 +463,8 @@ void Scene1000::dispatch() { if (_sceneMode == 52) _animationPlayer._endAction = this; - } else { + } else _animationPlayer.dispatch(); - } } Scene::dispatch(); @@ -723,9 +722,8 @@ bool Scene1100::Trooper::startAction(CursorType action, Event &event) { scene->_sceneMode = 1114; scene->setAction(&scene->_sequenceManager1, scene, 1114, &R2_GLOBALS._player, &scene->_trooper, NULL); return true; - } else { + } else return SceneActor::startAction(action, event); - } break; case R2_SONIC_STUNNER: // No break on purpose @@ -745,15 +743,13 @@ bool Scene1100::Trooper::startAction(CursorType action, Event &event) { // Trooper wears his black uniform R2_GLOBALS._player.disableControl(); scene->_sceneMode = 1113; - if (R2_GLOBALS._player._characterIndex == R2_QUINN) { + if (R2_GLOBALS._player._characterIndex == R2_QUINN) scene->setAction(&scene->_sequenceManager1, scene, 1113, &R2_GLOBALS._player, &scene->_trooper, NULL); - } else { + else scene->setAction(&scene->_sequenceManager1, scene, 1118, &R2_GLOBALS._player, &scene->_trooper, NULL); - } return true; - } else { + } else return SceneActor::startAction(action, event); - } break; default: return SceneActor::startAction(action, event); @@ -783,16 +779,14 @@ void Scene1100::postInit(SceneObjectList *OwnerList) { else loadScene(1100); - if ((R2_GLOBALS._sceneManager._previousScene == 1000) && (!R2_GLOBALS.getFlag(44))) { + if ((R2_GLOBALS._sceneManager._previousScene == 1000) && (!R2_GLOBALS.getFlag(44))) R2_GLOBALS._uiElements._active = false; - } if (R2_GLOBALS._player._characterScene[R2_QUINN] == 1100) R2_GLOBALS._sceneManager._previousScene = 1100; - if (R2_GLOBALS._sceneManager._previousScene == -1) { + if (R2_GLOBALS._sceneManager._previousScene == -1) R2_GLOBALS._uiElements._active = false; - } SceneExt::postInit(); @@ -1218,9 +1212,9 @@ void Scene1100::signal() { else _stripManager.start(322, this); } - } else { + } else _stripManager.start3(_nextStripNum, this, _stripManager._lookupList); - } + break; case 54: if (_stripManager._exitMode == 1) { @@ -1958,9 +1952,8 @@ void Scene1200::process(Event &event) { return; break; } - } else { + } else return; - } } void Scene1200::dispatch() { @@ -15313,9 +15306,9 @@ void Scene1950::signal() { case 1964: // No break on purpose case 1965: - if (!R2_GLOBALS.getFlag(37)) { + if (!R2_GLOBALS.getFlag(37)) SceneItem::display(1950, 26, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); - } + R2_GLOBALS._player.enableControl(); break; case 1966: @@ -15339,7 +15332,9 @@ void Scene1950::signal() { R2_GLOBALS._player.setVisage(22); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - Common::Point pt(218, 165); + warning("%d %d", R2_GLOBALS._player._position.x, R2_GLOBALS._player._position.y); + // This is a hack to work around a pathfinding issue. original destination is (218, 165) + Common::Point pt(128, 165); NpcMover *mover = new NpcMover(); R2_GLOBALS._player.addMover(mover, &pt, this); } -- cgit v1.2.3 From e13692c0929d5dfa7a4bb6a15aa764ae541737e1 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 20 Nov 2013 07:51:35 +0100 Subject: TSAGE: R2R - Fix bug in Scene 1950 --- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 1a794269a7..e3ba5c1ba6 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -14959,6 +14959,8 @@ void Scene1950::enterArea() { R2_GLOBALS._sceneItems.remove(&_background); _background.setDetails(Rect(0, 0, 320, 200), 1950, 0, 1, 2, 2, NULL); + + _removeFlag = false; } switch (R2_GLOBALS._flubMazeEntryDirection) { -- cgit v1.2.3 From 82ddda825dd85580c200d71bd464a5aaf18d3f1b Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 20 Nov 2013 08:14:02 +0100 Subject: TSAGE: R2R - Fix missing variable initialization --- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index e3ba5c1ba6..a7a00f66c8 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -13765,6 +13765,7 @@ bool Scene1950::Gem::startAction(CursorType action, Event &event) { /*--------------------------------------------------------------------------*/ Scene1950::Vampire::Vampire() { + _deadPosition = Common::Point(0, 0); _deltaX = 0; _deltaY = 0; _vampireMode = 0; -- cgit v1.2.3 From 82e0045a30174d44bba0329ed51fb6540b0b8a14 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 20 Nov 2013 23:04:33 +0100 Subject: TSAGE: R2R - Document a fix, remove useless braces --- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index a7a00f66c8..2d957990b9 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -14967,11 +14967,12 @@ void Scene1950::enterArea() { switch (R2_GLOBALS._flubMazeEntryDirection) { case 0: _sceneMode = 1950; - if (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0) { + if (R2_INVENTORY.getObjectScene(R2_SCRITH_KEY) == 0) + // The original uses CURSOR_ARROW. CURSOR_WALK is much more coherent R2_GLOBALS._player.enableControl(CURSOR_WALK); - } else { + else setAction(&_sequenceManager, this, 1950, &R2_GLOBALS._player, NULL); - } + break; case 1: { _sceneMode = R2_GLOBALS._flubMazeEntryDirection; -- cgit v1.2.3 From 86d6b757594ba821c09cf0d61b836b7b99d18c38 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 22 Nov 2013 00:55:29 +0100 Subject: TSAGE: R2R - Fix Animation issue in scene 3150 --- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index eab3178368..0e42789f3e 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -492,7 +492,7 @@ bool Scene3150::ToiletFlush::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, NULL); } else { scene->_sceneMode = 3153; - scene->setAction(&scene->_sequenceManager, scene, 3152, &R2_GLOBALS._player, &scene->_water, NULL); + scene->setAction(&scene->_sequenceManager, scene, 3153, &R2_GLOBALS._player, &scene->_water, NULL); } } else { SceneItem::display(3150, 42, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, LIST_END); -- cgit v1.2.3 From ce857d77d2ea032b10b15db8d1bab5d1d0c4b1ac Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 22 Nov 2013 01:12:05 +0100 Subject: TSAGE: R2R - Fix bug in the initialization of an actor --- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 0e42789f3e..1119f44d3b 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -629,7 +629,7 @@ void Scene3150::postInit(SceneObjectList *OwnerList) { if (R2_INVENTORY.getObjectScene(R2_SUPERCONDUCTOR_WIRE) == 3150) { _bulbOrWire.postInit(); - _bulbOrWire.setup(3152, 7, 3); + _bulbOrWire.setup(3152, 7, 2); _bulbOrWire.setPosition(Common::Point(70, 55)); _bulbOrWire.fixPriority(111); _bulbOrWire._effect = EFFECT_SHADED2; -- cgit v1.2.3 From 5996cdc56c8f08b770e6e1f89cf04bbc90839846 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 22 Nov 2013 07:52:08 +0100 Subject: TSAGE: R2R - Fix animation bug in scene 3350 --- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 1119f44d3b..b3b512e75d 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -1719,7 +1719,7 @@ void Scene3350::signal() { break; case 3351: _sceneMode = 3352; - setAction(&_sequenceManager, this, 3352, &_seeker, &R2_GLOBALS._player, + setAction(&_sequenceManager, this, 3352, &_seatedPeople, &R2_GLOBALS._player, &_miranda, &_seeker, &_webbster, NULL); break; case 3352: -- cgit v1.2.3 From b76b301d4f4854d143e9e5f6f5c14eaf7e4d3aa7 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 22 Nov 2013 21:19:43 +0100 Subject: TSAGE: R2R - Add a hack to avoid the display of giant character in circular hall (scene 3375) --- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index b3b512e75d..07e3a8afab 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -1996,11 +1996,11 @@ void Scene3375::postInit(SceneObjectList *OwnerList) { setZoomPercents(126, 55, 200, 167); R2_GLOBALS._player.postInit(); - if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { + if (R2_GLOBALS._player._characterIndex == R2_SEEKER) R2_GLOBALS._player._moveDiff = Common::Point(5, 3); - } else { + else R2_GLOBALS._player._moveDiff = Common::Point(3, 2); - } + R2_GLOBALS._player.changeZoom(-1); switch (R2_GLOBALS._player._characterIndex) { @@ -2191,6 +2191,14 @@ void Scene3375::signal() { _companion2._shade = 4; _webbster._effect = EFFECT_SHADED2; _webbster._shade = 4; + + // HACK: Reset zooms in order to avoid giant characters on the upper right of the screen + R2_GLOBALS._player.setZoom(-1); + _companion1.setZoom(-1); + _companion2.setZoom(-1); + _webbster.setZoom(-1); + // + enterArea(_sceneMode); break; case 3379: -- cgit v1.2.3 From 937619c6f7a98de76859887a92fe63d59a4ad9f9 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 23 Nov 2013 10:20:07 +0100 Subject: TSAGE: R2R - Fix spacing errors, add comment about an useless variable --- engines/tsage/ringworld2/ringworld2_scenes0.cpp | 2 +- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 2 +- engines/tsage/ringworld2/ringworld2_scenes3.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index f483b1e47c..2592bde19a 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -712,7 +712,7 @@ void Scene125::signal() { R2_GLOBALS._player._canWalk = false; break; case 10: - switch (_consoleMode) { + switch (_consoleMode) { case 12: _sceneMode = 129; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 07e3a8afab..8bcdcd8e36 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -4246,7 +4246,7 @@ void Scene3500::dispatch() { } if (_mazeChangeAmount != 0) { - R2_GLOBALS._player._uiEnabled = false; + R2_GLOBALS._player._uiEnabled = false; if (_mazeChangeAmount != _speed) _aSound1.play(276); } else { diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index b282900c3a..9e93a61665 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -566,7 +566,7 @@ class Scene3500 : public SceneExt { public: int _direction; bool _field20; - int _field22; + int _field22; // CHECKME: Useless field bool _field24; Action1(); -- cgit v1.2.3 From e854c364a9420cc75a84a0638065469ba50f5f27 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 23 Nov 2013 10:24:36 +0100 Subject: TSAGE: Janitorial - Fix more spacing errors --- engines/tsage/blue_force/blueforce_scenes3.cpp | 2 +- engines/tsage/events.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp index 5dd795cb39..2bf4a82180 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.cpp +++ b/engines/tsage/blue_force/blueforce_scenes3.cpp @@ -4531,7 +4531,7 @@ void Scene360::signal() { BF_GLOBALS._player.enableControl(); break; case 3608: - BF_GLOBALS._sceneManager.changeScene(355); + BF_GLOBALS._sceneManager.changeScene(355); break; case 3610: BF_GLOBALS._sceneManager.changeScene(666); diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp index d2d8464763..6baa654214 100644 --- a/engines/tsage/events.cpp +++ b/engines/tsage/events.cpp @@ -71,7 +71,7 @@ bool EventsClass::pollEvent() { break; default: - break; + break; } return true; -- cgit v1.2.3 From 74bb0a8b3c7f6e3430f4693ead42b9e9a88c5de9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 23 Nov 2013 12:18:52 -0500 Subject: TSAGE: In progress work and bugfixes for R2R centroid handling --- engines/tsage/core.cpp | 18 ++++++++++++++++++ engines/tsage/core.h | 1 + engines/tsage/graphics.cpp | 25 ++++++++++++++----------- engines/tsage/graphics.h | 3 +++ 4 files changed, 36 insertions(+), 11 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 040dbc8c25..a281354f0d 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2707,6 +2707,9 @@ GfxSurface SceneObject::getFrame() { _visageImages.setVisage(_visage, _strip); GfxSurface frame = _visageImages.getFrame(_frame); + // Reset any centroid adjustment flags + _visageImages.getFrameFlags(_frame) &= ~(FRAME_FLIP_CENTROID_X | FRAME_FLIP_CENTROID_Y); + // If shading is needed, post apply the shadiing onto the frame if ((g_vm->getGameID() == GType_Ringworld2) && (_shade >= 1)) { Graphics::Surface s = frame.lockSurface(); @@ -2727,6 +2730,7 @@ GfxSurface SceneObject::getFrame() { void SceneObject::reposition() { GfxSurface frame = getFrame(); + _bounds.resize(frame, _position.x, _position.y - _yDiff, _percent); _xs = _bounds.left; _xe = _bounds.right; @@ -3296,6 +3300,20 @@ GfxSurface Visage::getFrame(int frameNum) { return result; } +byte &Visage::getFrameFlags(int frameNum) { + int numFrames = READ_LE_UINT16(_data); + if (frameNum > numFrames) + frameNum = numFrames; + if (frameNum > 0) + --frameNum; + + int offset = READ_LE_UINT32(_data + 2 + frameNum * 4); + byte *frameData = _data + offset; + + return *(frameData + 9); +} + + int Visage::getFrameCount() const { return READ_LE_UINT16(_data); } diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 05f6f4b3a0..62f4cf2c7e 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -490,6 +490,7 @@ public: void setVisage(int resNum, int rlbNum = 9999); GfxSurface getFrame(int frameNum); + byte &getFrameFlags(int frameNum); int getFrameCount() const; Visage &operator=(const Visage &gfxSurface); }; diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 446c56662a..33ddb8bcec 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -71,19 +71,14 @@ GfxSurface surfaceFromRes(const byte *imgData) { s._transColor = *(imgData + 8); byte flags = imgData[9]; + s._flags = (g_vm->getGameID() != GType_Ringworld) ? flags : 0; + bool rleEncoded = (flags & 2) != 0; // Figure out the centroid s._centroid.x = READ_LE_UINT16(imgData + 4); s._centroid.y = READ_LE_UINT16(imgData + 6); - if (g_vm->getGameID() != GType_Ringworld) { - if (flags & 4) - s._centroid.x = r.width() - (s._centroid.x + 1); - if (flags & 8) - s._centroid.y = r.height() - (s._centroid.y + 1); - } - const byte *srcP = imgData + 10; Graphics::Surface destSurface = s.lockSurface(); byte *destP = (byte *)destSurface.getPixels(); @@ -194,8 +189,9 @@ void Rect::contain(const Rect &r) { * @percent Scaling percentage */ void Rect::resize(const GfxSurface &surface, int xp, int yp, int percent) { - int xe = surface.getBounds().width() * percent / 100; - int ye = surface.getBounds().height() * percent / 100; + const Rect &bounds = surface.getBounds(); + int xe = bounds.width() * percent / 100; + int ye = bounds.height() * percent / 100; this->set(0, 0, xe, ye); if (!right) ++right; @@ -203,8 +199,13 @@ void Rect::resize(const GfxSurface &surface, int xp, int yp, int percent) { this->moveTo(xp, yp); - int xd = surface._centroid.x * percent / 100; - int yd = surface._centroid.y * percent / 100; + int xa = (surface._flags & FRAME_FLIP_CENTROID_X) == 0 ? surface._centroid.x : + bounds.width() - (surface._centroid.x + 1); + int ya = (surface._flags & FRAME_FLIP_CENTROID_Y) == 0 ? surface._centroid.y : + bounds.height() - (surface._centroid.y + 1); + + int xd = xa * percent / 100; + int yd = ya * percent / 100; this->translate(-xd, -yd); } @@ -234,6 +235,7 @@ GfxSurface::GfxSurface() : _bounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) { _customSurface = NULL; _transColor = -1; _trackDirtyRects = false; + _flags = 0; } GfxSurface::GfxSurface(const GfxSurface &s) { @@ -417,6 +419,7 @@ GfxSurface &GfxSurface::operator=(const GfxSurface &s) { _bounds = s._bounds; _centroid = s._centroid; _transColor = s._transColor; + _flags = s._flags; if (_customSurface) { // Surface owns the internal data, so replicate it so new surface owns it's own diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h index 858731a1ac..47961dd02a 100644 --- a/engines/tsage/graphics.h +++ b/engines/tsage/graphics.h @@ -71,6 +71,8 @@ public: LineSlice(int xStart, int xEnd) { xs = xStart; xe = xEnd; } }; +enum FrameFlag { FRAME_FLIP_CENTROID_X = 4, FRAME_FLIP_CENTROID_Y = 8 }; + class GfxSurface { private: Graphics::Surface *_customSurface; @@ -89,6 +91,7 @@ public: Common::Point _centroid; int _transColor; Rect _clipRect; + byte _flags; public: GfxSurface(); GfxSurface(const GfxSurface &s); -- cgit v1.2.3 From 6d46a114d06c712873430a723436b5c0bbb304c1 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 23 Nov 2013 18:50:28 +0100 Subject: TSAGE: R2R - Remove some warnings --- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 5 ++--- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 2d957990b9..d0fe284cc6 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -1568,7 +1568,7 @@ void Scene1200::signal() { // No break on purpose case 1203: R2_GLOBALS._player.enableControl(); - warning("_eventManager.waitEvent()"); + // CHECKME: The original is calling _eventManager.waitEvent(); _sceneMode = 2; break; case 10: @@ -1790,7 +1790,7 @@ void Scene1200::signal() { R2_GLOBALS._player.animate(ANIM_MODE_6, this); break; default: - warning("_eventManager.waitEvent()"); + // CHECKME: The original is walling _eventManager.waitEvent(); _sceneMode = 2; break; } @@ -15336,7 +15336,6 @@ void Scene1950::signal() { R2_GLOBALS._player.setVisage(22); R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); - warning("%d %d", R2_GLOBALS._player._position.x, R2_GLOBALS._player._position.y); // This is a hack to work around a pathfinding issue. original destination is (218, 165) Common::Point pt(128, 165); NpcMover *mover = new NpcMover(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 8bcdcd8e36..cdcc012585 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -3199,10 +3199,9 @@ void Scene3500::Action1::signal() { scene->_shuttle._frameChange = _direction; scene->_shuttle.setFrame(scene->_shuttle.changeFrame()); } - // All the var_8 initialization was missing in the original + // CHECKME: All the var_8 initialization was missing in the original // but it's clearly a cut and paste error from case 4. // The following code allows the switch to work properly. - warning("Checkme: fix for dead code"); int var_8 = (_direction * 2 + scene->_mazeDirection); if (var_8 > 7) var_8 = 1; -- cgit v1.2.3 From d0c2493be50c3c28c57be5317061af413c699062 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 23 Nov 2013 17:09:35 -0500 Subject: TSAGE: Further fixes for object centroid handling --- engines/tsage/core.cpp | 26 ++++++++++---------------- engines/tsage/core.h | 4 ++-- 2 files changed, 12 insertions(+), 18 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index a281354f0d..320d3ddd2c 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2707,8 +2707,16 @@ GfxSurface SceneObject::getFrame() { _visageImages.setVisage(_visage, _strip); GfxSurface frame = _visageImages.getFrame(_frame); - // Reset any centroid adjustment flags - _visageImages.getFrameFlags(_frame) &= ~(FRAME_FLIP_CENTROID_X | FRAME_FLIP_CENTROID_Y); + // Reset any centroid adjustment flags, in + frame._flags &= ~(FRAME_FLIP_CENTROID_X | FRAME_FLIP_CENTROID_Y); + + // For later games, check whether the appropriate object flags are set for flipping + if (g_vm->getGameID() != GType_Ringworld) { + if ((_flags & OBJFLAG_FLIP_CENTROID_X) || _visageImages._flipHoriz) + frame._flags |= FRAME_FLIP_CENTROID_X; + if ((_flags & OBJFLAG_FLIP_CENTROID_Y) || _visageImages._flipVert) + frame._flags |= FRAME_FLIP_CENTROID_Y; + } // If shading is needed, post apply the shadiing onto the frame if ((g_vm->getGameID() == GType_Ringworld2) && (_shade >= 1)) { @@ -3300,20 +3308,6 @@ GfxSurface Visage::getFrame(int frameNum) { return result; } -byte &Visage::getFrameFlags(int frameNum) { - int numFrames = READ_LE_UINT16(_data); - if (frameNum > numFrames) - frameNum = numFrames; - if (frameNum > 0) - --frameNum; - - int offset = READ_LE_UINT32(_data + 2 + frameNum * 4); - byte *frameData = _data + offset; - - return *(frameData + 9); -} - - int Visage::getFrameCount() const { return READ_LE_UINT16(_data); } diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 62f4cf2c7e..f86172f6a1 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -490,7 +490,6 @@ public: void setVisage(int resNum, int rlbNum = 9999); GfxSurface getFrame(int frameNum); - byte &getFrameFlags(int frameNum); int getFrameCount() const; Visage &operator=(const Visage &gfxSurface); }; @@ -516,7 +515,8 @@ public: enum ObjectFlags {OBJFLAG_FIXED_PRIORITY = 1, OBJFLAG_NO_UPDATES = 2, OBJFLAG_ZOOMED = 4, OBJFLAG_SUPPRESS_DISPATCH = 8, OBJFLAG_HIDE = 0x100, OBJFLAG_HIDING = 0x200, OBJFLAG_REMOVE = 0x400, OBJFLAG_CLONED = 0x800, OBJFLAG_CHECK_REGION = 0x1000, OBJFLAG_PANE_0 = 0x4000, OBJFLAG_PANE_1 = 0x8000, - OBJFLAG_PANES = OBJFLAG_PANE_0 | OBJFLAG_PANE_1 + OBJFLAG_PANES = OBJFLAG_PANE_0 | OBJFLAG_PANE_1, + OBJFLAG_FLIP_CENTROID_X = 0x10000, OBJFLAG_FLIP_CENTROID_Y = 0x20000 }; class SceneObject : public SceneHotspot { -- cgit v1.2.3 From 50d122ed79c38081985f43aed2494a83b2fc1676 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 23 Nov 2013 17:18:34 -0500 Subject: TSAGE: Fix for flub tube maze header comments --- engines/tsage/ringworld2/ringworld2_logic.cpp | 2 +- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 57d8afb57f..67bd84a247 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -290,7 +290,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { // Confrontation return new Scene3400(); case 3500: - // Maze action sequencec + // Flub tube maze return new Scene3500(); case 3600: // Cutscene - walking at gunpoint diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index cdcc012585..167fb72956 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -2953,7 +2953,7 @@ void Scene3400::signal() { } /*-------------------------------------------------------------------------- - * Scene 3500 - Cavern Maze + * Scene 3500 - Flub tube maze * *--------------------------------------------------------------------------*/ -- cgit v1.2.3 From d949a60dd85f0c2d0674910552ff56e690ef9b60 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 24 Nov 2013 01:45:32 +0100 Subject: TSAGE: RINGWORLD - Remove unused object, remove erroneous comments --- engines/tsage/ringworld/ringworld_scenes1.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld/ringworld_scenes1.h b/engines/tsage/ringworld/ringworld_scenes1.h index 5dd882af93..d52d4fb6ec 100644 --- a/engines/tsage/ringworld/ringworld_scenes1.h +++ b/engines/tsage/ringworld/ringworld_scenes1.h @@ -315,8 +315,6 @@ public: Action1 _action1; Action2 _action2; Action3 _action3; - // CHECKME: Object1 looks useless - Object1 _object1; LeftFlyCycle _leftFlyCycle; CenterFlyCycle _centerFlyCycle; RightFlyCycle _rightFlyCycle; @@ -324,10 +322,7 @@ public: SpeakerSText _speakerSText; SpeakerQText _speakerQText; DisplayHotspot _background; - - //CHECKME: Useless Hotspot, never initialized DisplayHotspot _item1; - //CHECKME: Useless Hotspot, never initialized DisplayHotspot _entrance; DisplayHotspot _bulwark; DisplayHotspot _tree; -- cgit v1.2.3 From aa947c9474ad83aa9315bc585d1f0b79060fee61 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:33 +0100 Subject: BUILD: Split configure.engines down to a single file per engine. This is the first part of allowing engines to be added dynamically. They are placed into a folder in engines/ which must contain a file named "configure.engine" to add the engine, which is pulled into the top level configure script automatically. --- engines/tsage/configure.engine | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 engines/tsage/configure.engine (limited to 'engines/tsage') diff --git a/engines/tsage/configure.engine b/engines/tsage/configure.engine new file mode 100644 index 0000000000..2b8edf8266 --- /dev/null +++ b/engines/tsage/configure.engine @@ -0,0 +1,3 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine tsage "TsAGE" yes -- cgit v1.2.3 From d77cf95a185a6c8f201f417d08f246727784f728 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:34 +0100 Subject: BUILD: Split engines.mk down to a single file per engine. This is the second part of allowing engines to be added dynamically. Each folder in engines/ which must contain a file named "engine.mk" containing the make definitions for that engine. --- engines/tsage/engine.mk | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 engines/tsage/engine.mk (limited to 'engines/tsage') diff --git a/engines/tsage/engine.mk b/engines/tsage/engine.mk new file mode 100644 index 0000000000..d734665560 --- /dev/null +++ b/engines/tsage/engine.mk @@ -0,0 +1,4 @@ +ifdef ENABLE_TSAGE +DEFINES += -DENABLE_TSAGE=$(ENABLE_TSAGE) +MODULES += engines/tsage +endif -- cgit v1.2.3 From 00c27a28f91cc2bbf512461e69c86be998462728 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:34 +0100 Subject: BUILD: Split engines/plugins_table header down to a file per engine. This is the third and final commit enabling fully pluggable engines. Now providing an engine folder contains a configure.engine, engine.mk and engine-plugin.h file, it will be picked up automatically by the configure script. --- engines/tsage/engine-plugin.h | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 engines/tsage/engine-plugin.h (limited to 'engines/tsage') diff --git a/engines/tsage/engine-plugin.h b/engines/tsage/engine-plugin.h new file mode 100644 index 0000000000..73711aa4a0 --- /dev/null +++ b/engines/tsage/engine-plugin.h @@ -0,0 +1,3 @@ +#if PLUGIN_ENABLED_STATIC(TSAGE) +LINK_PLUGIN(TSAGE) +#endif -- cgit v1.2.3 From 1ac01d2333af11d403ef84dd5192abb18814e5b3 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:34 +0100 Subject: BUILD: Remove need for engine-plugin.h in engines. This is now generated automatically by the configure script from the engine directory names. --- engines/tsage/engine-plugin.h | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 engines/tsage/engine-plugin.h (limited to 'engines/tsage') diff --git a/engines/tsage/engine-plugin.h b/engines/tsage/engine-plugin.h deleted file mode 100644 index 73711aa4a0..0000000000 --- a/engines/tsage/engine-plugin.h +++ /dev/null @@ -1,3 +0,0 @@ -#if PLUGIN_ENABLED_STATIC(TSAGE) -LINK_PLUGIN(TSAGE) -#endif -- cgit v1.2.3 From ef85456859e466adc8913041e4f31809485c45ab Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:34 +0100 Subject: BUILD: Remove need for engine.mk in each engine directory. Each engine now only has to provide a single configure.engine file adding the engine into the configure script, which then produces the required other files automatically. --- engines/tsage/engine.mk | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 engines/tsage/engine.mk (limited to 'engines/tsage') diff --git a/engines/tsage/engine.mk b/engines/tsage/engine.mk deleted file mode 100644 index d734665560..0000000000 --- a/engines/tsage/engine.mk +++ /dev/null @@ -1,4 +0,0 @@ -ifdef ENABLE_TSAGE -DEFINES += -DENABLE_TSAGE=$(ENABLE_TSAGE) -MODULES += engines/tsage -endif -- cgit v1.2.3 From 17fa43eabc80b92427f6a42b47b304cd90b3ff72 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 24 Nov 2013 02:04:47 +0100 Subject: TSAGE: BF - Remove an unused parameter in Scene570::Icon::setDetails() --- engines/tsage/blue_force/blueforce_scenes5.cpp | 30 +++++++++++++------------- engines/tsage/blue_force/blueforce_scenes5.h | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/blue_force/blueforce_scenes5.cpp b/engines/tsage/blue_force/blueforce_scenes5.cpp index ebaa3e372e..101a39c4b7 100644 --- a/engines/tsage/blue_force/blueforce_scenes5.cpp +++ b/engines/tsage/blue_force/blueforce_scenes5.cpp @@ -1909,7 +1909,7 @@ bool Scene570::Icon::startAction(CursorType action, Event &event) { } } -void Scene570::Icon::setDetails(int iconId, int folderId, int parentFolderId, int unused, const Common::String &msg) { +void Scene570::Icon::setDetails(int iconId, int folderId, int parentFolderId, const Common::String &msg) { Scene570 *scene = (Scene570 *)BF_GLOBALS._sceneManager._scene; NamedObject::postInit(); @@ -2076,23 +2076,23 @@ void Scene570::signal() { _printerIcon.setDetails(570, 14, 15, -1, 2, (SceneItem *)NULL); _iconManager.setup(2); - _folder1.setDetails(1, 1, 0, 2, SCENE570_C_DRIVE); - _folder2.setDetails(1, 2, 1, 2, SCENE570_RING); - _folder3.setDetails(1, 3, 1, 2, SCENE570_PROTO); - _folder4.setDetails(1, 4, 1, 2, SCENE570_WACKY); + _folder1.setDetails(1, 1, 0, SCENE570_C_DRIVE); + _folder2.setDetails(1, 2, 1, SCENE570_RING); + _folder3.setDetails(1, 3, 1, SCENE570_PROTO); + _folder4.setDetails(1, 4, 1, SCENE570_WACKY); if (!BF_GLOBALS.getFlag(fDecryptedBluePrints)) - _icon1.setDetails(3, 5, 0, 2, SCENE570_COBB); - _icon2.setDetails(2, 7, 0, 2, SCENE570_LETTER); + _icon1.setDetails(3, 5, 0, SCENE570_COBB); + _icon2.setDetails(2, 7, 0, SCENE570_LETTER); if (BF_GLOBALS.getFlag(fDecryptedBluePrints)) - _icon3.setDetails(7, 6, 0, 2, SCENE570_COBB); + _icon3.setDetails(7, 6, 0, SCENE570_COBB); - _icon4.setDetails(6, 8, 1, 2, SCENE570_RINGEXE); - _icon5.setDetails(5, 9, 1, 2, SCENE570_RINGDATA); - _icon6.setDetails(6, 10, 2, 2, SCENE570_PROTOEXE); - _icon7.setDetails(5, 11, 2, 2, SCENE570_PROTODATA); - _icon8.setDetails(6, 12, 3, 2, SCENE570_WACKYEXE); - _icon9.setDetails(5, 13, 3, 2, SCENE570_WACKYDATA); + _icon4.setDetails(6, 8, 1, SCENE570_RINGEXE); + _icon5.setDetails(5, 9, 1, SCENE570_RINGDATA); + _icon6.setDetails(6, 10, 2, SCENE570_PROTOEXE); + _icon7.setDetails(5, 11, 2, SCENE570_PROTODATA); + _icon8.setDetails(6, 12, 3, SCENE570_WACKYEXE); + _icon9.setDetails(5, 13, 3, SCENE570_WACKYDATA); _iconManager.refreshList(); BF_GLOBALS._player.enableControl(); @@ -2107,7 +2107,7 @@ void Scene570::signal() { _object3.setFrame(1); _object3.fixPriority(1); - _icon3.setDetails(7, 6, 0, 2, SCENE570_COBB); + _icon3.setDetails(7, 6, 0, SCENE570_COBB); _iconManager.refreshList(); T2_GLOBALS._uiElements._active = true; T2_GLOBALS._uiElements.show(); diff --git a/engines/tsage/blue_force/blueforce_scenes5.h b/engines/tsage/blue_force/blueforce_scenes5.h index 5337b6426b..71c7f3d8f1 100644 --- a/engines/tsage/blue_force/blueforce_scenes5.h +++ b/engines/tsage/blue_force/blueforce_scenes5.h @@ -266,7 +266,7 @@ class Scene570: public SceneExt { virtual void remove(); virtual bool startAction(CursorType action, Event &event); - void setDetails(int iconId, int folderId, int parentFolderId, int unused, const Common::String &msg); + void setDetails(int iconId, int folderId, int parentFolderId, const Common::String &msg); }; class IconManager: public EventHandler { public: -- cgit v1.2.3 From 250d15c5a0348f5d4b91f6f922f802c19b372408 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 24 Nov 2013 02:08:55 +0100 Subject: TSAGE: R2R - Remove an unused variable in maze UI --- engines/tsage/ringworld2/ringworld2_logic.cpp | 6 ++++-- engines/tsage/ringworld2/ringworld2_logic.h | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 67bd84a247..c88b0cf527 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -1502,7 +1502,7 @@ MazeUI::MazeUI() { _cellSize.x = _cellSize.y = 0; _mapOffset.x = _mapOffset.y = 0; _resNum = _cellsResNum = 0; - _frameCount = _resCount = _mapImagePitch = _unused = 0; + _frameCount = _resCount = _mapImagePitch = 0; } MazeUI::~MazeUI() { @@ -1518,7 +1518,9 @@ void MazeUI::synchronize(Serializer &s) { s.syncAsSint16LE(_mapOffset.x); s.syncAsSint16LE(_mapOffset.y); - s.syncAsSint16LE(_unused); + + int dummy = 0; + s.syncAsSint16LE(dummy); } void MazeUI::load(int resNum) { diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h index 41ddb277de..c9695c921d 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.h +++ b/engines/tsage/ringworld2/ringworld2_logic.h @@ -307,7 +307,6 @@ public: int _frameCount; int _resCount; int _mapImagePitch; - int _unused; public: MazeUI(); virtual ~MazeUI(); -- cgit v1.2.3 From 793f2c4e05f46846821260b57db5302cd649a5af Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 24 Nov 2013 02:13:48 +0100 Subject: TSAGE: Remove a couple of useless/obsolete warnings --- engines/tsage/blue_force/blueforce_scenes3.cpp | 5 ----- engines/tsage/ringworld/ringworld_scenes10.cpp | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp index 2bf4a82180..a5cc17a3df 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.cpp +++ b/engines/tsage/blue_force/blueforce_scenes3.cpp @@ -1978,12 +1978,7 @@ void Scene340::Action8::signal() { setDelay(6); break; - case 4: - remove(); - break; default: - // This is present in the original game - warning("Bugs"); remove(); break; } diff --git a/engines/tsage/ringworld/ringworld_scenes10.cpp b/engines/tsage/ringworld/ringworld_scenes10.cpp index f9a8e7996a..eac181e350 100644 --- a/engines/tsage/ringworld/ringworld_scenes10.cpp +++ b/engines/tsage/ringworld/ringworld_scenes10.cpp @@ -1870,7 +1870,7 @@ void Scene9900::signal() { setAction(&_sequenceManager, this, 9908, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6); break; case 162: - warning("TBC: shutdown();"); + // shutdown(); g_globals->_game->quitGame(); break; case 9901: -- cgit v1.2.3 From 1aa0d0bd9b78ac008961730644efdd5d3f8a2a12 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 23 Nov 2013 23:23:43 -0500 Subject: TSAGE: Added new palette rotation code, to fix R2R rimwall vechile scene --- engines/tsage/core.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/tsage') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 320d3ddd2c..a519ffbd10 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1153,6 +1153,13 @@ void PaletteRotation::signal() { if (flag) _currIndex = _start; } + + // Added in Return to Ringworld + if (_currIndex < _start) { + flag = decDuration(); + if (flag) + _currIndex = _end; + } break; case 2: _currIndex += _idxChange; -- cgit v1.2.3 From 22e2187859a0ceca84415de4a009f6e1aa493d3b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 Nov 2013 09:53:04 -0500 Subject: TSAGE: Slow down title sequence animations to better match original --- engines/tsage/ringworld2/ringworld2_logic.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index c88b0cf527..4e0ca915fb 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -1863,6 +1863,10 @@ bool AnimationPlayer::load(int animId, Action *endAction) { _frameDelay = (60 / _subData._frameRate); _gameFrame = R2_GLOBALS._events.getFrameNumber(); + // WORKAROUND: Slow down the title sequences to better match the original + if (animId <= 4 || animId == 15) + _frameDelay *= 8; + if (_subData._totalSize) { _dataNeeded = _subData._totalSize; } else { -- cgit v1.2.3 From 831b68d986ce37665cc4ae6653ba1d44d3e1b1f8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 Nov 2013 10:55:37 -0500 Subject: TSAGE: Fix R2R palette corruption when showing dialogs on the title screen --- engines/tsage/graphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tsage') diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 33ddb8bcec..cdb1cfd59f 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -1245,7 +1245,7 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) { } void GfxDialog::setPalette() { - if (g_vm->getGameID() == GType_BlueForce) { + if (g_vm->getGameID() != GType_Ringworld) { g_globals->_scenePalette.loadPalette(2); g_globals->_scenePalette.setPalette(0, 1); g_globals->_scenePalette.setPalette(g_globals->_gfxColors.background, 1); -- cgit v1.2.3 From 552f2a52bddbaacdf67929414b796e8f5f093d49 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 Nov 2013 10:58:32 -0500 Subject: TSAGE: Fix R2R shading map not being setup if you restarted game whilst in-game --- engines/tsage/ringworld2/ringworld2_logic.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 4e0ca915fb..e735f4ffb1 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -371,12 +371,13 @@ void SceneExt::postInit(SceneObjectList *OwnerList) { _field12 = 0; _sceneMode = 0; + static_cast(R2_GLOBALS._sceneHandler)->setupPaletteMaps(); + int prevScene = R2_GLOBALS._sceneManager._previousScene; int sceneNumber = R2_GLOBALS._sceneManager._sceneNumber; if (((prevScene == -1) && (sceneNumber != 180) && (sceneNumber != 205) && (sceneNumber != 50)) || (sceneNumber == 50) || ((sceneNumber == 100) && (prevScene == 0 || prevScene == 180 || prevScene == 205))) { - static_cast(R2_GLOBALS._sceneHandler)->setupPaletteMaps(); R2_GLOBALS._uiElements._active = true; R2_GLOBALS._uiElements.show(); } else { -- cgit v1.2.3 From 819ab3189f1e95eb544a920671e2bf0204e318f1 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 24 Nov 2013 19:07:35 +0100 Subject: TSAGE: R2R - Fix palette glitch in intro (courtesy of Dreammaster) --- engines/tsage/graphics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/tsage') diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index cdb1cfd59f..fa3ed33302 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -1246,7 +1246,8 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) { void GfxDialog::setPalette() { if (g_vm->getGameID() != GType_Ringworld) { - g_globals->_scenePalette.loadPalette(2); + if (g_vm->getGameID() == GType_BlueForce) + g_globals->_scenePalette.loadPalette(2); g_globals->_scenePalette.setPalette(0, 1); g_globals->_scenePalette.setPalette(g_globals->_gfxColors.background, 1); g_globals->_scenePalette.setPalette(g_globals->_gfxColors.foreground, 1); -- cgit v1.2.3 From a559e64ca629a2e488c13d72bc4435daf4ebb5c5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 Nov 2013 14:10:33 -0500 Subject: TSAGE: Fix to prevent saving or loading when conversation dialogs are active --- engines/tsage/converse.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/tsage') diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index 2298d28e0d..f7c1dd24e6 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -451,6 +451,13 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) { draw(); g_globals->_events.showCursor(); + // WORKAROUND: On-screen dialogs are really meant to use a GfxManager instance + // for their lifetime, which prevents saving or loading. Since I don't want to spend a lot + // of time refactoring this already working dialog, fake it by putting a dummy gfxmanager at + // the end of the gfx manager list so as to prevent saving or loading + GfxManager gfxManager; + GLOBALS._gfxManagers.push_back(&gfxManager); + // Event handling loop Event event; while (!g_vm->shouldQuit()) { @@ -502,6 +509,7 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) { // Remove the dialog remove(); + GLOBALS._gfxManagers.remove(&gfxManager); return _selectedIndex; } -- cgit v1.2.3 From 59c0603bf7fbab574eca1ba460a4d53dec00b87b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 Nov 2013 15:12:16 -0500 Subject: TSAGE: Fix for UI appearing during ending R2R cutscene --- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 167fb72956..8e4967fd26 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -4954,6 +4954,7 @@ void Scene3600::dispatch() { void Scene3700::postInit(SceneObjectList *OwnerList) { loadScene(3700); R2_GLOBALS._uiElements._active = false; + R2_GLOBALS._uiElements._visible = false; SceneExt::postInit(); R2_GLOBALS._interfaceY = SCREEN_HEIGHT; -- cgit v1.2.3 From f4d582f6406bbce2c2c19103944bf2fbac14da72 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 24 Nov 2013 22:29:49 +0100 Subject: TSAGE: R2R - rename _actorDestPos --- engines/tsage/core.cpp | 6 +++--- engines/tsage/core.h | 2 +- engines/tsage/ringworld2/ringworld2_scenes1.cpp | 2 +- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 13 ++++++++++--- 4 files changed, 15 insertions(+), 8 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index a519ffbd10..6c47cac1ef 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2110,7 +2110,7 @@ SceneObject::SceneObject() : SceneHotspot() { _shade = _oldShade = 0; _linkedActor = NULL; - _field8A = Common::Point(0, 0); + _actorDestPos = Common::Point(0, 0); _angle = 0; _xs = 0; _xe = 0; @@ -2504,8 +2504,8 @@ void SceneObject::synchronize(Serializer &s) { s.syncAsSint16LE(_moveDiff.x); s.syncAsSint16LE(_moveDiff.y); s.syncAsSint32LE(_moveRate); if (g_vm->getGameID() == GType_Ringworld2) { - s.syncAsSint16LE(_field8A.x); - s.syncAsSint16LE(_field8A.y); + s.syncAsSint16LE(_actorDestPos.x); + s.syncAsSint16LE(_actorDestPos.y); } SYNC_POINTER(_endAction); s.syncAsUint32LE(_regionBitList); diff --git a/engines/tsage/core.h b/engines/tsage/core.h index f86172f6a1..3286ee1448 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -549,7 +549,7 @@ public: EventHandler *_mover; Common::Point _moveDiff; int _moveRate; - Common::Point _field8A; + Common::Point _actorDestPos; Action *_endAction; uint32 _regionBitList; diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index d0fe284cc6..ef4136a343 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -6435,7 +6435,7 @@ void Scene1337::subD02CA() { _item6._object1._mover = _arrunkObj1337[2]._arr1[di]._object1._mover; _item6._object1._moveDiff = _arrunkObj1337[2]._arr1[di]._object1._moveDiff; _item6._object1._moveRate = _arrunkObj1337[2]._arr1[di]._object1._moveRate; - _item6._object1._field8A = _arrunkObj1337[2]._arr1[di]._object1._field8A; + _item6._object1._actorDestPos = _arrunkObj1337[2]._arr1[di]._object1._actorDestPos; _item6._object1._endAction = _arrunkObj1337[2]._arr1[di]._object1._endAction; _item6._object1._regionBitList = _arrunkObj1337[2]._arr1[di]._object1._regionBitList; // _item6._object1._actorName = _arrunkObj1337[2]._arr1[di]._object1._actorName; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 8e4967fd26..0780b09fc5 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -4335,7 +4335,7 @@ void Scene3600::Action2::signal() { scene->_protector.setup(3127, 2, 1); scene->_protector.animate(ANIM_MODE_1, NULL); NpcMover *mover = new NpcMover(); - scene->_protector.addMover(mover, &scene->_protector._field8A, scene); + scene->_protector.addMover(mover, &scene->_protector._actorDestPos, scene); } break; default: @@ -4554,7 +4554,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) { if (!R2_GLOBALS.getFlag(71)) { _protector.postInit(); _protector._state = 0; - _protector._field8A = Common::Point(226, 152); + _protector._actorDestPos = Common::Point(226, 152); _protector._moveDiff = Common::Point(3, 2); _protector.setPosition(Common::Point(284, 152)); _protector.setup(3127, 2, 1); @@ -4630,6 +4630,8 @@ void Scene3600::remove() { void Scene3600::signal() { switch (_sceneMode) { case 3320: + // Move to the console + // Removed (useless ?) call to sub_1D227 R2_GLOBALS._walkRegions.disableRegion(14); R2_GLOBALS._scrollFollower = &_seeker; @@ -4646,6 +4648,8 @@ void Scene3600::signal() { &_miranda, &_webbster, &_teal, NULL); break; case 3321: + // Teal activates console + // Removed (useless ?) call to sub_1D227 R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; _tealSpeaker.stopSpeaking(); @@ -4731,7 +4735,7 @@ void Scene3600::signal() { _protector.postInit(); _protector._state = 0; - _protector._field8A = Common::Point(226, 152); + _protector._actorDestPos = Common::Point(226, 152); _protector._moveDiff = Common::Point(5, 3); _protector.setup(3403, 7, 1); _protector.setPosition(Common::Point(405, 155)); @@ -4773,6 +4777,7 @@ void Scene3600::signal() { R2_GLOBALS._sound2.play(329); break; case 3600: + // First speech by Teal _sceneMode = 3320; _stripManager.start(3320, this); break; @@ -4781,6 +4786,7 @@ void Scene3600::signal() { case 3602: // No break on purpose case 3603: + // Teal speech near the console R2_GLOBALS._walkRegions.disableRegion(2); R2_GLOBALS._walkRegions.disableRegion(7); _tealSpeaker._displayMode = 1; @@ -4788,6 +4794,7 @@ void Scene3600::signal() { _stripManager.start(3321, this); break; case 3604: + // Goule Protector forces the door R2_GLOBALS._sound2.fadeOut2(NULL); R2_GLOBALS._sound1.stop(); R2_GLOBALS._walkRegions.enableRegion(2); -- cgit v1.2.3 From ef8fefd233fd93c1e9625929ffc831c740cf6492 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 24 Nov 2013 22:43:33 +0100 Subject: TSAGE: R2R - Add comments in Scene3600::signal() --- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 0780b09fc5..321026461b 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -4661,6 +4661,8 @@ void Scene3600::signal() { &_quinn, &_seeker, &_miranda, &_webbster, NULL); break; case 3322: + // Teal walks toward the teleport pod, the goule protector appears + // Removed (useless ?) call to sub_1D227 _quinnSpeaker.stopSpeaking(); _quinnSpeaker._displayMode = 1; @@ -4671,6 +4673,8 @@ void Scene3600::signal() { setAction(&_sequenceManager1, this, _sceneMode, &_teal, &_protector, &_steppingDisk, NULL); break; case 3323: + // Goule protector eats Teal guts then moves + if (!_tealDead) _tealDead = true; else { @@ -4713,6 +4717,7 @@ void Scene3600::signal() { _sceneMode = 3623; break; case 3450: + // Speech of Teal and Quinn R2_GLOBALS._sound1.stop(); _protector3400.hide(); _door3400.hide(); @@ -4832,6 +4837,7 @@ void Scene3600::signal() { setAction(&_sequenceManager1, this, 3450, &_protector3400, &_door3400, NULL); break; case 3605: + // Goule protector jumps on Teal _protector.setup(3258, 4, 1); _protector.setAction(&_sequenceManager1, this, 3606, &_teal, &_protector, &_steppingDisk, NULL); -- cgit v1.2.3 From bd8f260d9b128ba03131c7002d8dcf750765f208 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 24 Nov 2013 22:45:36 +0100 Subject: TSAGE: R2R - Remove obsolete comments about sub_1D227() --- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 321026461b..6f6bbbf96a 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -2821,7 +2821,6 @@ void Scene3400::remove() { void Scene3400::signal() { switch (_sceneMode) { case 3305: { - // Removed (useless ?) call to sub_1D227 _tealSpeaker._object1.hide(); _teal.show(); _teal.setStrip(1); @@ -2861,7 +2860,6 @@ void Scene3400::signal() { } break; case 3308: - // Removed (useless ?) call to sub_1D227 _companion1.setStrip(2); R2_GLOBALS._player.setStrip(6); _companion2.setStrip(6); @@ -2874,7 +2872,6 @@ void Scene3400::signal() { setAction(&_sequenceManager, this, 3403, &_companion1, &_webbster, &_manholeCover, NULL); break; case 3309: - // Removed (useless ?) call to sub_1D227 _teal.setStrip(1); _sceneMode = 3405; if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) @@ -2883,7 +2880,6 @@ void Scene3400::signal() { setAction(&_sequenceManager, this, 3405, &_companion2, &_manholeCover, NULL); break; case 3310: - // Removed (useless ?) call to sub_1D227 _teal.setStrip(1); _sceneMode = 3406; if (R2_GLOBALS._player._characterIndex == R2_QUINN) @@ -2894,7 +2890,6 @@ void Scene3400::signal() { setAction(&_sequenceManager, this, 3406, &_companion2, &_manholeCover, NULL); break; case 3311: - // Removed (useless ?) call to sub_1D227 _tealSpeaker._object1.hide(); _teal.show(); _teal.setStrip(1); @@ -4631,8 +4626,6 @@ void Scene3600::signal() { switch (_sceneMode) { case 3320: // Move to the console - - // Removed (useless ?) call to sub_1D227 R2_GLOBALS._walkRegions.disableRegion(14); R2_GLOBALS._scrollFollower = &_seeker; _tealSpeaker._object1.hide(); @@ -4649,8 +4642,6 @@ void Scene3600::signal() { break; case 3321: // Teal activates console - - // Removed (useless ?) call to sub_1D227 R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; _tealSpeaker.stopSpeaking(); _teal.show(); @@ -4662,8 +4653,6 @@ void Scene3600::signal() { break; case 3322: // Teal walks toward the teleport pod, the goule protector appears - - // Removed (useless ?) call to sub_1D227 _quinnSpeaker.stopSpeaking(); _quinnSpeaker._displayMode = 1; _tealSpeaker.stopSpeaking(); @@ -4678,7 +4667,6 @@ void Scene3600::signal() { if (!_tealDead) _tealDead = true; else { - // Removed (useless ?) call to sub_1D227 _protectorSpeaker.stopSpeaking(); _protector.show(); _protector.setup(3258, 6, 1); @@ -5014,7 +5002,6 @@ void Scene3700::signal() { case 3328: // No break on purpose case 3329: - // Removed (useless ?) call to sub_1D227 _sceneMode = 3701; setAction(&_sequenceManager, this, 3701, &_seeker, &_miranda, &_webbster, NULL); break; -- cgit v1.2.3 From c26ed6505f4a3c12c082473a1ebaaabd32d40a88 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 Nov 2013 16:59:44 -0500 Subject: TSAGE: Fixes for R2R right click dialog choosing cursor or help/player dialog --- engines/tsage/ringworld2/ringworld2_dialogs.cpp | 15 +++++++++------ engines/tsage/ringworld2/ringworld2_dialogs.h | 3 ++- engines/tsage/ringworld2/ringworld2_logic.cpp | 7 ++++++- 3 files changed, 17 insertions(+), 8 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.cpp b/engines/tsage/ringworld2/ringworld2_dialogs.cpp index 12147f7ee5..a0675bc292 100644 --- a/engines/tsage/ringworld2/ringworld2_dialogs.cpp +++ b/engines/tsage/ringworld2/ringworld2_dialogs.cpp @@ -50,6 +50,7 @@ RightClickDialog::RightClickDialog() : GfxDialog() { _btnList[5] = Common::Point(83, 47); // Set the palette and change the cursor + _previousCursor = R2_GLOBALS._events.getCursor(); R2_GLOBALS._events.setCursor(CURSOR_ARROW); setPalette(); @@ -136,7 +137,7 @@ bool RightClickDialog::process(Event &event) { return false; } -void RightClickDialog::execute() { +int RightClickDialog::execute() { // Draw the dialog draw(); @@ -157,7 +158,8 @@ void RightClickDialog::execute() { } // Execute the specified action - CursorType cursorNum = CURSOR_NONE; + CursorType cursorNum = _previousCursor; + int result = -1; switch (_selectedAction) { case 0: // Look action @@ -177,17 +179,18 @@ void RightClickDialog::execute() { break; case 4: // Change player - CharacterDialog::show(); + result = 0; break; case 5: // Options dialog + result = 1; break; } - if (cursorNum != CURSOR_NONE) - R2_GLOBALS._events.setCursor(cursorNum); - + R2_GLOBALS._events.setCursor(cursorNum); _gfxManager.deactivate(); + + return result; } /*--------------------------------------------------------------------------*/ diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.h b/engines/tsage/ringworld2/ringworld2_dialogs.h index 02a1aed81c..0c19ae4371 100644 --- a/engines/tsage/ringworld2/ringworld2_dialogs.h +++ b/engines/tsage/ringworld2/ringworld2_dialogs.h @@ -50,13 +50,14 @@ private: int _highlightedAction; int _selectedAction; + CursorType _previousCursor; public: RightClickDialog(); ~RightClickDialog(); virtual void draw(); virtual bool process(Event &event); - void execute(); + int execute(); }; class CharacterDialog: public GfxDialog { diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index e735f4ffb1..92d4770930 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -1238,8 +1238,13 @@ void Ringworld2Game::processEvent(Event &event) { void Ringworld2Game::rightClick() { RightClickDialog *dlg = new RightClickDialog(); - dlg->execute(); + int option = dlg->execute(); delete dlg; + + if (option == 0) + CharacterDialog::show(); + else if (option == 1) + HelpDialog::show(); } /*--------------------------------------------------------------------------*/ -- cgit v1.2.3 From cf230795670114dbf3b236a400734a9ad230ddce Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 25 Nov 2013 08:16:51 +0100 Subject: TSAGE: R2R - Some renaming in scene 3400, add comments about scene modes --- engines/tsage/ringworld2/ringworld2_scenes3.cpp | 23 +++++++++++++++++++---- engines/tsage/ringworld2/ringworld2_scenes3.h | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index 6f6bbbf96a..732add03ec 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -2821,6 +2821,7 @@ void Scene3400::remove() { void Scene3400::signal() { switch (_sceneMode) { case 3305: { + // First part of discussion _tealSpeaker._object1.hide(); _teal.show(); _teal.setStrip(1); @@ -2832,6 +2833,7 @@ void Scene3400::signal() { } break; case 3306: + // Teal picks up the sapphire R2_GLOBALS._sound2.play(318); _companion1.setStrip(2); R2_GLOBALS._player.setStrip(6); @@ -2842,15 +2844,16 @@ void Scene3400::signal() { _stripManager.start(3307, this); if (R2_GLOBALS._player._characterIndex == R2_SEEKER) { _sceneMode = 3400; - R2_GLOBALS._player.setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_teal, &_actor8, NULL); + R2_GLOBALS._player.setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_teal, &_sapphire, NULL); } else { _sceneMode = 3408; - _companion1.setAction(&_sequenceManager, this, 3408, &_companion1, &_teal, &_actor8, NULL); + _companion1.setAction(&_sequenceManager, this, 3408, &_companion1, &_teal, &_sapphire, NULL); } break; case 3307: case 3404: case 3408: + // A tasp! if (!_soundFaded) { R2_GLOBALS._sound2.fadeOut2(NULL); _soundFaded = true; @@ -2860,6 +2863,7 @@ void Scene3400::signal() { } break; case 3308: + // Characters teleport one after the other _companion1.setStrip(2); R2_GLOBALS._player.setStrip(6); _companion2.setStrip(6); @@ -2872,6 +2876,7 @@ void Scene3400::signal() { setAction(&_sequenceManager, this, 3403, &_companion1, &_webbster, &_manholeCover, NULL); break; case 3309: + // Miranda teleports away _teal.setStrip(1); _sceneMode = 3405; if (R2_GLOBALS._player._characterIndex == R2_MIRANDA) @@ -2880,6 +2885,7 @@ void Scene3400::signal() { setAction(&_sequenceManager, this, 3405, &_companion2, &_manholeCover, NULL); break; case 3310: + // Quinn teleports away _teal.setStrip(1); _sceneMode = 3406; if (R2_GLOBALS._player._characterIndex == R2_QUINN) @@ -2890,6 +2896,7 @@ void Scene3400::signal() { setAction(&_sequenceManager, this, 3406, &_companion2, &_manholeCover, NULL); break; case 3311: + // Teal teleports away _tealSpeaker._object1.hide(); _teal.show(); _teal.setStrip(1); @@ -2897,8 +2904,9 @@ void Scene3400::signal() { setAction(&_sequenceManager, this, 3407, &_teal, &_manholeCover, NULL); break; case 3400: { - _actor8.postInit(); - _actor8.hide(); + // Teal enters the room + _sapphire.postInit(); + _sapphire.hide(); _teal.postInit(); _teal._numFrames = 7; _teal._moveDiff = Common::Point(3, 2); @@ -2918,30 +2926,37 @@ void Scene3400::signal() { } break; case 3401: + // Teal first speech _sceneMode = 3305; _stripManager.start(3305, this); break; case 3402: + // Betrayal of Webbster _sceneMode = 3306; _stripManager.start(3306, this); break; case 3403: + // Teal: "Miranda..." R2_GLOBALS._scrollFollower = &R2_GLOBALS._player; _sceneMode = 3309; _stripManager.start(3309, this); break; case 3405: + // Teal: "And Quinn..." _sceneMode = 3310; _stripManager.start(3310, this); break; case 3406: + // Teal final sentence before teleporting _sceneMode = 3311; _stripManager.start(3311, this); break; case 3407: + // End of scene R2_GLOBALS._sceneManager.changeScene(3600); break; default: + // Unexpected scene mode R2_GLOBALS._player.enableControl(); break; } diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index 9e93a61665..398d09a01e 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -550,7 +550,7 @@ public: SceneActor _teal; SceneActor _door; SceneActor _manholeCover; - SceneActor _actor8; + SceneActor _sapphire; SequenceManager _sequenceManager; bool _soundFaded; -- cgit v1.2.3 From f0ebc8fb29ee484929f732dbb24b74d380d092fb Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 26 Nov 2013 07:42:49 +0100 Subject: TSAGE: R2R - Remove dead code --- engines/tsage/ringworld2/ringworld2_logic.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 92d4770930..3f1cecc301 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -401,19 +401,6 @@ void SceneExt::process(Event &event) { } void SceneExt::dispatch() { -/* - _timerList.dispatch(); - - if (_field37A) { - if ((--_field37A == 0) && R2_GLOBALS._dayNumber) { - if (R2_GLOBALS._uiElements._active && R2_GLOBALS._player._enabled) { - R2_GLOBALS._uiElements.show(); - } - - _field37A = 0; - } - } -*/ Scene::dispatch(); } -- cgit v1.2.3 From b64371f8b822146160bf6e799be2398cd7278b2e Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 26 Nov 2013 07:43:39 +0100 Subject: TSAGE: BF - Remove a couple of useless variables --- engines/tsage/blue_force/blueforce_logic.cpp | 5 ++--- engines/tsage/blue_force/blueforce_logic.h | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index 5674773177..c0f518f075 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -705,7 +705,6 @@ SceneExt::SceneExt(): Scene() { _stripManager._onBegin = SceneExt::startStrip; _stripManager._onEnd = SceneExt::endStrip; - _field372 = _field37A = 0; _savedPlayerEnabled = false; _savedUiEnabled = false; _savedCanWalk = false; @@ -748,6 +747,7 @@ void SceneExt::process(Event &event) { void SceneExt::dispatch() { _timerList.dispatch(); + /* if (_field37A) { if ((--_field37A == 0) && BF_GLOBALS._dayNumber) { if (T2_GLOBALS._uiElements._active && BF_GLOBALS._player._enabled) { @@ -757,6 +757,7 @@ void SceneExt::dispatch() { _field37A = 0; } } + */ Scene::dispatch(); } @@ -833,7 +834,6 @@ void SceneExt::gunDisplay() { void SceneExt::startStrip() { SceneExt *scene = (SceneExt *)BF_GLOBALS._sceneManager._scene; - scene->_field372 = 1; scene->_savedPlayerEnabled = BF_GLOBALS._player._enabled; if (scene->_savedPlayerEnabled) { @@ -848,7 +848,6 @@ void SceneExt::startStrip() { void SceneExt::endStrip() { SceneExt *scene = (SceneExt *)BF_GLOBALS._sceneManager._scene; - scene->_field372 = 0; if (scene->_savedPlayerEnabled) { BF_GLOBALS._player.enableControl(); diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h index 59bc2b7a51..857609177a 100644 --- a/engines/tsage/blue_force/blueforce_logic.h +++ b/engines/tsage/blue_force/blueforce_logic.h @@ -196,11 +196,9 @@ private: static void endStrip(); public: AObjectArray _timerList, _objArray2; - int _field372; bool _savedPlayerEnabled; bool _savedUiEnabled; bool _savedCanWalk; - int _field37A; EventHandler *_focusObject; Visage _cursorVisage; -- cgit v1.2.3 From af510118e89406683eba1acaba19c56dd4d5437d Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 26 Nov 2013 07:48:51 +0100 Subject: TSAGE: BF - Some renaming --- engines/tsage/blue_force/blueforce_logic.cpp | 10 +++++----- engines/tsage/blue_force/blueforce_logic.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index c0f518f075..b8af8dd808 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -866,23 +866,23 @@ void SceneExt::clearScreen() { /*--------------------------------------------------------------------------*/ PalettedScene::PalettedScene(): SceneExt() { - _field794 = 0; + _hasFader = false; } void PalettedScene::synchronize(Serializer &s) { SceneExt::synchronize(s); - s.syncAsSint16LE(_field794); + s.syncAsSint16LE(_hasFader); } void PalettedScene::postInit(SceneObjectList *OwnerList) { - _field794 = 0; + _hasFader = false; _palette._field412 = 1; SceneExt::postInit(OwnerList); } void PalettedScene::remove() { SceneExt::remove(); - if (_field794 == 1) { + if (_hasFader) { for (SynchronizedList::iterator i = BF_GLOBALS._sceneObjects->begin(); i != BF_GLOBALS._sceneObjects->end(); ++i) (*i)->remove(); @@ -896,7 +896,7 @@ void PalettedScene::remove() { } PaletteFader *PalettedScene::addFader(const byte *arrBufferRGB, int step, Action *action) { - _field794 = 1; + _hasFader = true; return BF_GLOBALS._scenePalette.addFader(arrBufferRGB, 1, step, action); } diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h index 857609177a..d7ea4e2546 100644 --- a/engines/tsage/blue_force/blueforce_logic.h +++ b/engines/tsage/blue_force/blueforce_logic.h @@ -226,7 +226,7 @@ public: class PalettedScene: public SceneExt { public: ScenePalette _palette; - int _field794; + bool _hasFader; public: PalettedScene(); -- cgit v1.2.3 From c211cede06224a2d7fab1f94ce94f723a3022ebb Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 26 Nov 2013 07:59:12 +0100 Subject: TSAGE: BF - Remove some useless variables, some renaming --- engines/tsage/blue_force/blueforce_logic.cpp | 11 +++++------ engines/tsage/blue_force/blueforce_logic.h | 14 +++++++------- engines/tsage/blue_force/blueforce_scenes3.cpp | 16 ++++++++-------- engines/tsage/blue_force/blueforce_scenes7.cpp | 2 +- engines/tsage/core.cpp | 6 +++++- engines/tsage/saveload.h | 2 +- 6 files changed, 27 insertions(+), 24 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index b8af8dd808..be5fb4c7b7 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -648,8 +648,6 @@ void FocusObject::postInit(SceneObjectList *OwnerList) { _lookLineNum = 43; _talkLineNum = 44; _useLineNum = -1; - _v90 = 0; - _v92 = 1; SceneExt *scene = (SceneExt *)BF_GLOBALS._sceneManager._scene; scene->_focusObject = this; @@ -658,8 +656,11 @@ void FocusObject::postInit(SceneObjectList *OwnerList) { void FocusObject::synchronize(Serializer &s) { NamedObject::synchronize(s); - s.syncAsSint16LE(_v90); - s.syncAsSint16LE(_v92); + if (s.getVersion() < 12) { + int useless = 0; + s.syncAsSint16LE(useless); + s.syncAsSint16LE(useless); + } } void FocusObject::remove() { @@ -765,8 +766,6 @@ void SceneExt::dispatch() { void SceneExt::loadScene(int sceneNum) { Scene::loadScene(sceneNum); - _v51C34.top = 0; - _v51C34.bottom = 300; BF_GLOBALS._sceneHandler->_delayTicks = 1; } diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h index d7ea4e2546..c6c6dc6315 100644 --- a/engines/tsage/blue_force/blueforce_logic.h +++ b/engines/tsage/blue_force/blueforce_logic.h @@ -139,14 +139,17 @@ public: class NamedObject2: public NamedObject { public: - int _v1, _v2; + int _talkCount; - NamedObject2() { _v1 = _v2 = 0; } + NamedObject2() { _talkCount = 0; } virtual Common::String getClassName() { return "NamedObject2"; } virtual void synchronize(Serializer &s) { NamedObject::synchronize(s); - s.syncAsSint16LE(_v1); - s.syncAsSint16LE(_v2); + if (s.getVersion() < 11) { + int useless = 0; + s.syncAsSint16LE(useless); + } + s.syncAsSint16LE(_talkCount); } }; @@ -177,7 +180,6 @@ public: class FocusObject: public NamedObject { public: - int _v90, _v92; GfxSurface _img; FocusObject(); @@ -202,8 +204,6 @@ public: EventHandler *_focusObject; Visage _cursorVisage; - - Rect _v51C34; public: SceneExt(); diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp index a5cc17a3df..49c3013ad5 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.cpp +++ b/engines/tsage/blue_force/blueforce_scenes3.cpp @@ -4651,10 +4651,10 @@ bool Scene370::Green::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_LOOK: - SceneItem::display2(370, (_v2 < 3) ? 10 : 0); + SceneItem::display2(370, (_talkCount < 3) ? 10 : 0); return true; case CURSOR_USE: - if (_v2 != 3) + if (_talkCount != 3) SceneItem::display2(370, 1); else if (BF_INVENTORY.getObjectScene(INV_HANDCUFFS) == 1) SceneItem::display2(370, 26); @@ -4670,14 +4670,14 @@ bool Scene370::Green::startAction(CursorType action, Event &event) { return true; case CURSOR_TALK: BF_GLOBALS._player.disableControl(); - switch (_v2) { + switch (_talkCount) { case 0: - ++_v2; + ++_talkCount; scene->_sceneMode = 3706; scene->setAction(&scene->_sequenceManager, scene, 3706, NULL); break; case 1: - ++_v2; + ++_talkCount; scene->_sceneMode = 3707; scene->_object5.postInit(); @@ -4689,7 +4689,7 @@ bool Scene370::Green::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager, scene, 3707, &scene->_harrison, &scene->_object5, NULL); break; case 2: - ++_v2; + ++_talkCount; scene->_sceneMode = 3708; scene->setAction(&scene->_sequenceManager, scene, 3708, this, &scene->_laura, &scene->_harrison, &scene->_object5, &scene->_greensGun, NULL); @@ -4715,7 +4715,7 @@ bool Scene370::Green::startAction(CursorType action, Event &event) { } return true; case INV_HANDCUFFS: - if (_v2 != 3) + if (_talkCount != 3) SceneItem::display2(370, 2); else { T2_GLOBALS._uiElements.addScore(50); @@ -4752,7 +4752,7 @@ bool Scene370::Harrison::startAction(CursorType action, Event &event) { SceneItem::display2(370, 8); return true; case CURSOR_TALK: - if (scene->_green._v2 != 3) { + if (scene->_green._talkCount != 3) { scene->_sceneMode = 3; scene->_stripManager.start(3714, scene); } else if ((BF_INVENTORY.getObjectScene(INV_GREENS_KNIFE) == 1) || diff --git a/engines/tsage/blue_force/blueforce_scenes7.cpp b/engines/tsage/blue_force/blueforce_scenes7.cpp index 4cdd2f3f15..2f52c4df95 100644 --- a/engines/tsage/blue_force/blueforce_scenes7.cpp +++ b/engines/tsage/blue_force/blueforce_scenes7.cpp @@ -148,7 +148,7 @@ void Scene710::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._sound1.fadeSound(14); _soundExt1.fadeSound(48); - _v51C34.set(40, 0, 280, 240); + BF_GLOBALS._player.postInit(); BF_GLOBALS._player.hide(); BF_GLOBALS._player._moveDiff = Common::Point(4, 2); diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 6c47cac1ef..88f2c85ffd 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1545,7 +1545,11 @@ void ScenePalette::synchronize(Serializer &s) { s.syncAsSint32LE(_colors.foreground); s.syncAsSint32LE(_colors.background); - s.syncAsSint32LE(_field412); + if (s.getVersion() < 12) { + int useless = 0; + s.syncAsSint16LE(useless); + } + s.syncAsByte(_redColor); s.syncAsByte(_greenColor); s.syncAsByte(_blueColor); diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h index 0d0457981f..32da6ee7f4 100644 --- a/engines/tsage/saveload.h +++ b/engines/tsage/saveload.h @@ -33,7 +33,7 @@ namespace TsAGE { typedef void (*SaveNotifierFn)(bool postFlag); -#define TSAGE_SAVEGAME_VERSION 11 +#define TSAGE_SAVEGAME_VERSION 12 class SavedObject; -- cgit v1.2.3 From a8e49412cc03fef52b4f1b18bb199676e11cd2b9 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 26 Nov 2013 08:09:35 +0100 Subject: TSAGE: BF - More renaming --- engines/tsage/blue_force/blueforce_scenes3.cpp | 54 +++++++++++++------------- engines/tsage/blue_force/blueforce_scenes3.h | 5 ++- engines/tsage/blue_force/blueforce_scenes8.cpp | 10 ++--- engines/tsage/blue_force/blueforce_scenes8.h | 2 +- 4 files changed, 36 insertions(+), 35 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp index 49c3013ad5..feaf789392 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.cpp +++ b/engines/tsage/blue_force/blueforce_scenes3.cpp @@ -2868,9 +2868,9 @@ void Scene350::checkGun() { void Scene355::Doorway::synchronize(Serializer &s) { NamedObject::synchronize(s); - s.syncAsSint16LE(_v1); - s.syncAsSint16LE(_v2); - s.syncAsSint16LE(_v3); + s.syncAsSint16LE(_mode1356Count); + s.syncAsSint16LE(_talkCount); + s.syncAsSint16LE(_onDuty); } bool Scene355::Doorway::startAction(CursorType action, Event &event) { @@ -2890,9 +2890,9 @@ bool Scene355::Doorway::startAction(CursorType action, Event &event) { return true; case CURSOR_TALK: if (BF_GLOBALS._dayNumber >= 5) { - switch (_v2) { + switch (_talkCount) { case 0: - ++_v2; + ++_talkCount; BF_GLOBALS._sound1.play(109); BF_GLOBALS._player.disableControl(); scene->_sceneMode = 0; @@ -2920,7 +2920,7 @@ bool Scene355::Doorway::startAction(CursorType action, Event &event) { BF_GLOBALS._player.disableControl(); scene->_sceneMode = 3562; scene->setAction(&scene->_sequenceManager, scene, 3562, &BF_GLOBALS._player, NULL); - _v3 = !_v3 ? 1 : 0; + _onDuty = !_onDuty; return true; default: break; @@ -3355,14 +3355,14 @@ bool Scene355::Item11::startAction(CursorType action, Event &event) { return true; case CURSOR_TALK: if (BF_GLOBALS._dayNumber == 5) { - switch (scene->_doorway._v2) { + switch (scene->_doorway._talkCount) { case 0: BF_GLOBALS._player.disableControl(); scene->_sceneMode = 0; BF_GLOBALS.setFlag(fTookTrailerAmmo); scene->_stripManager.start(3575, scene); scene->_lyle._flag = 1; - scene->_doorway._v2 = 1; + scene->_doorway._talkCount = 1; break; case 1: BF_GLOBALS._player.disableControl(); @@ -3534,28 +3534,28 @@ void Scene355::postInit(SceneObjectList *OwnerList) { _doorway.setVisage(355); _doorway.setPosition(Common::Point(193, 105)); _doorway.fixPriority(18); - _doorway._v1 = 0; - _doorway._v3 = 0; + _doorway._mode1356Count = 0; + _doorway._onDuty = false; BF_GLOBALS._sceneItems.push_back(&_doorway); switch (BF_GLOBALS._dayNumber) { case 1: if (!BF_GLOBALS.getFlag(onDuty)) - _doorway._v3 = 1; + _doorway._onDuty = true; else if (BF_INVENTORY.getObjectScene(INV_GREENS_GUN) == 320) - _doorway._v3 = 1; + _doorway._onDuty = true; break; case 2: case 3: case 4: - _doorway._v3 = 1; + _doorway._onDuty = true; break; default: break; } if (BF_GLOBALS._dayNumber == 5) - _doorway._v2 = BF_GLOBALS.getFlag(fTookTrailerAmmo) ? 1 : 0; + _doorway._talkCount = BF_GLOBALS.getFlag(fTookTrailerAmmo) ? 1 : 0; _object8.postInit(); _object8.setVisage(355); @@ -3614,8 +3614,8 @@ void Scene355::postInit(SceneObjectList *OwnerList) { _object11.animate(ANIM_MODE_2); _doorway.setPosition(Common::Point(146, 107)); - _doorway._v3 = 0; - _doorway._v2 = 2; + _doorway._onDuty = false; + _doorway._talkCount = 2; _lyle._flag = 2; _green.postInit(); @@ -3713,16 +3713,16 @@ void Scene355::signal() { _stripManager.start(BF_GLOBALS.getFlag(fBackupIn350) ? 3559 : 3554, this); break; case 1356: - switch (_doorway._v1) { + switch (_doorway._mode1356Count) { case 0: - ++_doorway._v1; + ++_doorway._mode1356Count; _sceneMode = 9999; _stripManager.start(3550, this); break; case 1: _sceneMode = 9999; _stripManager.start(3551, this); - ++_doorway._v1; + ++_doorway._mode1356Count; break; default: break; @@ -3787,7 +3787,7 @@ void Scene355::signal() { T2_GLOBALS._uiElements.addScore(10); } - SceneItem::display2(355, !_doorway._v3 ? 24 : 25); + SceneItem::display2(355, !_doorway._onDuty ? 24 : 25); BF_GLOBALS._player.enableControl(); break; case 4550: @@ -3796,8 +3796,8 @@ void Scene355::signal() { BF_GLOBALS._sound1.play(90); BF_GLOBALS._player._regionBitList |= 0x10; - _doorway._v3 = 0; - _doorway._v2 = 2; + _doorway._onDuty = false; + _doorway._talkCount = 2; _lyle._flag = 2; BF_GLOBALS._player.enableControl(); break; @@ -3867,13 +3867,13 @@ void Scene355::signal() { case 9984: if (BF_GLOBALS._dayNumber == 5) { _sceneMode = 0; - switch (_doorway._v2) { + switch (_doorway._talkCount) { case 0: BF_GLOBALS._sound1.play(109); BF_GLOBALS.setFlag(fTookTrailerAmmo); _stripManager.start(3575, this); _lyle._flag = 1; - ++_doorway._v2; + ++_doorway._talkCount; break; case 1: _stripManager.start(3573, this); @@ -3884,7 +3884,7 @@ void Scene355::signal() { break; } } else if (BF_GLOBALS.getFlag(greenTaken) || (BF_GLOBALS._dayNumber > 1)) { - if (_doorway._v3) { + if (_doorway._onDuty) { SceneItem::display2(355, 23); _sceneMode = 0; signal(); @@ -4009,14 +4009,14 @@ void Scene355::signal() { } case 9997: _sceneMode = 9999; - _doorway._v1 = 2; + _doorway._mode1356Count = 2; _stripManager.start(3562, this); break; case 9998: error("Talkdoor state"); break; case 9999: - if (_doorway._v1 != 2) { + if (_doorway._mode1356Count != 2) { BF_GLOBALS._player.enableControl(); BF_GLOBALS._player._canWalk = false; } else if (BF_GLOBALS.getFlag(gunDrawn)) { diff --git a/engines/tsage/blue_force/blueforce_scenes3.h b/engines/tsage/blue_force/blueforce_scenes3.h index d9f0d32edc..894c3e5ffd 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.h +++ b/engines/tsage/blue_force/blueforce_scenes3.h @@ -493,9 +493,10 @@ class Scene355: public PalettedScene { /* Objects */ class Doorway: public NamedObject { public: - int _v1, _v2, _v3; + int _mode1356Count, _talkCount; + bool _onDuty; - Doorway() { _v1 = _v2 = _v3 = 0; } + Doorway() { _mode1356Count = _talkCount = 0; _onDuty = false; } virtual Common::String getClassName() { return "Scene355_Doorway"; } virtual void synchronize(Serializer &s); virtual bool startAction(CursorType action, Event &event); diff --git a/engines/tsage/blue_force/blueforce_scenes8.cpp b/engines/tsage/blue_force/blueforce_scenes8.cpp index 867b6a9f6e..cf48017643 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.cpp +++ b/engines/tsage/blue_force/blueforce_scenes8.cpp @@ -1958,7 +1958,7 @@ void Scene840::BoatKeysInset::postInit(SceneObjectList *OwnerList) { _waveKeys.setDetails(840, 53, 8, -1, 2, (SceneItem *)NULL); } - _v1B4 = _v1B6 = 0; + _usedRentalKeys = _usedWaveKeys = false; } void Scene840::BoatKeysInset::remove() { @@ -2067,7 +2067,7 @@ bool Scene840::BoatKeysInset::RentalKeys::startAction(CursorType action, Event & BF_INVENTORY.setObjectScene(INV_RENTAL_KEYS, 1); T2_GLOBALS._uiElements.addScore(30); - scene->_boatKeysInset._v1B4 = 1; + scene->_boatKeysInset._usedRentalKeys = true; remove(); } return true; @@ -2085,7 +2085,7 @@ bool Scene840::BoatKeysInset::WaveKeys::startAction(CursorType action, Event &ev SceneItem::display2(840, 56); BF_INVENTORY.setObjectScene(INV_WAVE_KEYS, 1); T2_GLOBALS._uiElements.addScore(50); - scene->_boatKeysInset._v1B6 = 1; + scene->_boatKeysInset._usedWaveKeys = true; remove(); } else { SceneItem::display2(840, 9); @@ -2467,10 +2467,10 @@ void Scene840::signal() { _boatKeysInset.setDetails(840, 50, 8, 51); break; case 8412: - if (_boatKeysInset._v1B6) { + if (_boatKeysInset._usedWaveKeys) { _sceneMode = 8409; setAction(&_sequenceManager1, this, 8409, &BF_GLOBALS._player, &_carter, &_doors, NULL); - } else if (!_boatKeysInset._v1B4) { + } else if (!_boatKeysInset._usedRentalKeys) { BF_GLOBALS._player.enableControl(); } else { _sceneMode = 3; diff --git a/engines/tsage/blue_force/blueforce_scenes8.h b/engines/tsage/blue_force/blueforce_scenes8.h index ef5ef81563..4c0c8bf822 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.h +++ b/engines/tsage/blue_force/blueforce_scenes8.h @@ -348,7 +348,7 @@ class Scene840: public PalettedScene { public: RentalKeys _rentalKeys; WaveKeys _waveKeys; - int _v1B4, _v1B6; + bool _usedRentalKeys,_usedWaveKeys; virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); -- cgit v1.2.3 From c981b4f1cd696f56d49ee352292701b28d0ae5ed Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 26 Nov 2013 08:15:33 +0100 Subject: TSAGE: BF - Fix savegame issue in Scene840 --- engines/tsage/blue_force/blueforce_scenes8.cpp | 9 +++++++++ engines/tsage/blue_force/blueforce_scenes8.h | 1 + 2 files changed, 10 insertions(+) (limited to 'engines/tsage') diff --git a/engines/tsage/blue_force/blueforce_scenes8.cpp b/engines/tsage/blue_force/blueforce_scenes8.cpp index cf48017643..f78a332be9 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.cpp +++ b/engines/tsage/blue_force/blueforce_scenes8.cpp @@ -2096,6 +2096,15 @@ bool Scene840::BoatKeysInset::WaveKeys::startAction(CursorType action, Event &ev } } +void Scene840::BoatKeysInset::synchronize(Serializer &s) { + FocusObject::synchronize(s); + + if (s.getVersion() >= 12) { + s.syncAsSint16LE(_usedWaveKeys); + s.syncAsSint16LE(_usedRentalKeys); + } +} + bool Scene840::BoatKeys::startAction(CursorType action, Event &event) { Scene840 *scene = (Scene840 *)BF_GLOBALS._sceneManager._scene; diff --git a/engines/tsage/blue_force/blueforce_scenes8.h b/engines/tsage/blue_force/blueforce_scenes8.h index 4c0c8bf822..b9e6ebd640 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.h +++ b/engines/tsage/blue_force/blueforce_scenes8.h @@ -350,6 +350,7 @@ class Scene840: public PalettedScene { WaveKeys _waveKeys; bool _usedRentalKeys,_usedWaveKeys; + virtual void synchronize(Serializer &s); virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); virtual void process(Event &event); -- cgit v1.2.3 From 01d9200a76805e865efb09c305de0cce0f4244fd Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 26 Nov 2013 08:28:59 +0100 Subject: TSAGE: Remove useless variables in sound code --- engines/tsage/sound.cpp | 4 ---- engines/tsage/sound.h | 2 -- 2 files changed, 6 deletions(-) (limited to 'engines/tsage') diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index e2fe21c6d7..6633d15c26 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -2734,8 +2734,6 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() { _masterVolume = 0; _groupData._groupMask = 9; - _groupData._v1 = 0x46; - _groupData._v2 = 0; _groupData._pData = &adlib_group_data[0]; _mixer = g_vm->_mixer; @@ -3053,8 +3051,6 @@ SoundBlasterDriver::SoundBlasterDriver(): SoundDriver() { _masterVolume = 0; _groupData._groupMask = 1; - _groupData._v1 = 0x3E; - _groupData._v2 = 0; static byte const group_data[] = { 3, 1, 1, 0, 0xff }; _groupData._pData = group_data; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 3f039ff9e9..fefe8ad101 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -63,8 +63,6 @@ public: struct GroupData { uint32 _groupMask; - byte _v1; - byte _v2; const byte *_pData; }; -- cgit v1.2.3