diff options
author | Paul Gilbert | 2013-08-24 20:45:18 -0400 |
---|---|---|
committer | Paul Gilbert | 2013-08-24 20:45:18 -0400 |
commit | 19e970e9e0fc85ea927dd604cf99832180fcb3a3 (patch) | |
tree | b936b101c8a0ea9cb155ff000b0d87eb22d02b0c | |
parent | 2ace73d86001a2f222fd1c90e57fc7cfdbb47741 (diff) | |
download | scummvm-rg350-19e970e9e0fc85ea927dd604cf99832180fcb3a3.tar.gz scummvm-rg350-19e970e9e0fc85ea927dd604cf99832180fcb3a3.tar.bz2 scummvm-rg350-19e970e9e0fc85ea927dd604cf99832180fcb3a3.zip |
TSAGE: Further R2R scene 1550 renaming, and fixing tracking junk state
-rw-r--r-- | engines/tsage/globals.cpp | 8 | ||||
-rw-r--r-- | engines/tsage/globals.h | 1 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes1.cpp | 87 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes1.h | 8 | ||||
-rw-r--r-- | engines/tsage/staticres.cpp | 4 | ||||
-rw-r--r-- | engines/tsage/staticres.h | 4 |
6 files changed, 65 insertions, 47 deletions
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index e89855879c..e3aaeb428d 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -26,6 +26,7 @@ #include "tsage/ringworld/ringworld_demo.h" #include "tsage/ringworld/ringworld_logic.h" #include "tsage/ringworld2/ringworld2_logic.h" +#include "tsage/staticres.h" namespace TsAGE { @@ -493,6 +494,10 @@ void Ringworld2Globals::reset() { _stripManager_lookupList[10] = 1; _stripManager_lookupList[11] = 1; + // Reset junk/component data in scene 1550 + Common::copy(&scene1550JunkLocationsDefault[0], &scene1550JunkLocationsDefault[508], + &_scene1550JunkLocations[0]); + // Reset fields stored in the player class _player._characterIndex = R2_QUINN; _player._characterScene[1] = 100; @@ -568,6 +573,9 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsSint16LE(_insetUp); s.syncAsByte(_frameEdgeColor); + + for (int i = 0; i < 508; i += 4) + s.syncAsByte(_scene1550JunkLocations[i + 2]); } } // end of namespace Ringworld2 diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 0c4f84ea16..7dac8aa599 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -307,6 +307,7 @@ public: Common::Point _s1550PlayerArea[3]; // only used for Quinn and Seeker byte _scannerFrequencies[4]; byte _stripManager_lookupList[12]; + byte _scene1550JunkLocations[508]; ScannerDialog *_scannerDialog; Ringworld2Globals(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index 9e03bc1852..c49f5f08cf 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -7015,7 +7015,7 @@ void Scene1500::signal() { } break; case 24: - R2_GLOBALS._sceneManager.changeScene(300); + R2_GLOBALS._sceneManager.changeScene(1550); break; default: break; @@ -7181,14 +7181,14 @@ void Scene1530::dispatch() { *--------------------------------------------------------------------------*/ Scene1550::Junk::Junk() { - _fieldA4 = _fieldA6 = 0; + _fieldA4 = _junkNumber = 0; } void Scene1550::Junk::synchronize(Serializer &s) { SceneActor::synchronize(s); s.syncAsSint16LE(_fieldA4); - s.syncAsSint16LE(_fieldA6); + s.syncAsSint16LE(_junkNumber); } bool Scene1550::Junk::startAction(CursorType action, Event &event) { @@ -7944,36 +7944,41 @@ void Scene1550::signal() { } R2_GLOBALS._player.animate(ANIM_MODE_5, this); break; - case 42: + + case 42: { _sceneMode = 43; - warning("TODO: unknown use of arrUnkObj15501[0]._fieldA6"); - switch (_junk[0]._frame - 1) { - case 0: + int junkRegionIndex = R2_GLOBALS._scene1550JunkLocations[_junk[0]._junkNumber + 3]; + R2_GLOBALS._walkRegions.disableRegion(scene1550JunkRegions[junkRegionIndex]); + + switch (_junk[0]._frame) { + case 1: R2_INVENTORY.setObjectScene(R2_JOYSTICK, R2_GLOBALS._player._characterIndex); break; - case 1: + case 2: R2_INVENTORY.setObjectScene(R2_FUEL_CELL, R2_GLOBALS._player._characterIndex); break; - case 2: + case 3: R2_INVENTORY.setObjectScene(R2_GUIDANCE_MODULE, R2_GLOBALS._player._characterIndex); break; - case 3: + case 4: R2_INVENTORY.setObjectScene(R2_RADAR_MECHANISM, R2_GLOBALS._player._characterIndex); break; - case 4: + case 5: R2_INVENTORY.setObjectScene(R2_BATTERY, R2_GLOBALS._player._characterIndex); break; - case 5: + case 6: R2_INVENTORY.setObjectScene(R2_DIAGNOSTICS_DISPLAY, R2_GLOBALS._player._characterIndex); break; default: break; } + _junk[0].remove(); R2_GLOBALS._player.animate(ANIM_MODE_6, this); break; + } case 43: - warning("TODO: unknown use of arrUnkObj15501[0]._fieldA6"); + R2_GLOBALS._scene1550JunkLocations[_junk[0]._junkNumber + 2] = 0; if (R2_GLOBALS._player._characterIndex == R2_QUINN) R2_GLOBALS._player.setVisage(1500); else { @@ -8584,9 +8589,9 @@ void Scene1550::enterArea() { tmpRect = R2_GLOBALS._v5589E; _actor14.remove(); - _actor17.remove(); + _westWall.remove(); _northWall.remove(); - _actor19.remove(); + _southWall.remove(); _actor16.remove(); _eastWall.remove(); @@ -8870,7 +8875,7 @@ void Scene1550::enterArea() { R2_GLOBALS._walkRegions.load(1561); _field419 = 1561; _actor14.subA4D14(2, 1); - _actor17.subA4D14(2, 2); + _westWall.subA4D14(2, 2); _northWall.subA4D14(1, 3); _actor16.subA4D14(2, 5); break; @@ -8890,31 +8895,31 @@ void Scene1550::enterArea() { case 5: R2_GLOBALS._walkRegions.load(1564); _field419 = 1564; - _actor19.subA4D14(2, 4); + _southWall.subA4D14(2, 4); break; case 6: R2_GLOBALS._walkRegions.load(1565); _field419 = 1565; _actor14.subA4D14(1, 1); - _actor17.subA4D14(1, 2); + _westWall.subA4D14(1, 2); _northWall.subA4D14(3, 3); break; case 7: R2_GLOBALS._walkRegions.load(1566); _field419 = 1566; _actor14.subA4D14(1, 1); - _actor17.subA4D14(1, 2); + _westWall.subA4D14(1, 2); _northWall.subA4D14(2, 4); break; case 8: R2_GLOBALS._walkRegions.load(1567); _field419 = 1567; - _actor17.subA4D14(5, 2); + _westWall.subA4D14(5, 2); break; case 9: R2_GLOBALS._walkRegions.load(1568); _field419 = 1568; - _actor17.subA4D14(4, 2); + _westWall.subA4D14(4, 2); break; case 10: R2_GLOBALS._walkRegions.load(1569); @@ -8925,7 +8930,7 @@ void Scene1550::enterArea() { R2_GLOBALS._walkRegions.load(1570); _field419 = 1570; _actor14.subA4D14(1, 1); - _actor17.subA4D14(1, 2); + _westWall.subA4D14(1, 2); break; case 12: R2_GLOBALS._walkRegions.load(1571); @@ -8937,32 +8942,33 @@ void Scene1550::enterArea() { R2_GLOBALS._walkRegions.load(1572); _field419 = 1572; _actor14.subA4D14(1, 1); - _actor17.subA4D14(1, 2); - _actor19.subA4D14(1, 4); + _westWall.subA4D14(1, 2); + _southWall.subA4D14(1, 4); break; case 14: R2_GLOBALS._walkRegions.load(1573); _field419 = 1573; - _actor19.subA4D14(1, 4); + _southWall.subA4D14(1, 4); _actor16.subA4D14(1, 5); _eastWall.subA4D14(1, 6); break; case 15: + // South wall R2_GLOBALS._walkRegions.load(1574); _field419 = 1574; - _actor19.subA4D14(1, 4); + _southWall.subA4D14(1, 4); break; case 16: R2_GLOBALS._walkRegions.load(1570); _field419 = 1570; _actor14.subA4D14(2, 1); - _actor17.subA4D14(2, 2); + _westWall.subA4D14(2, 2); break; case 17: R2_GLOBALS._walkRegions.load(1570); _field419 = 1570; _actor14.subA4D14(2, 1); - _actor17.subA4D14(3, 2); + _westWall.subA4D14(3, 2); break; case 18: R2_GLOBALS._walkRegions.load(1571); @@ -8982,24 +8988,27 @@ void Scene1550::enterArea() { int di = 0; int tmpIdx = 0; - // Original game was checking "i < 129" but it was clearly a bug as it's out of bounds for (int i = 0; i < 129 * 4; i += 4) { - if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == k562CC[i]) && (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == k562CC[i + 1]) && (k562CC[i + 2] != 0)) { - tmpIdx = k562CC[i + 3]; + if ((R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].x == R2_GLOBALS._scene1550JunkLocations[i]) && + (R2_GLOBALS._s1550PlayerArea[R2_GLOBALS._player._characterIndex].y == R2_GLOBALS._scene1550JunkLocations[i + 1]) && + (R2_GLOBALS._scene1550JunkLocations[i + 2] != 0)) { + tmpIdx = R2_GLOBALS._scene1550JunkLocations[i + 3]; _junk[di].postInit(); _junk[di]._effect = 6; _junk[di]._shade = 0; _junk[di]._fieldA4 = tmpIdx; - _junk[di]._fieldA6 = i; + _junk[di]._junkNumber = i; _junk[di].setDetails(1550, 62, -1, 63, 2, (SceneItem *) NULL); - if (k562CC[i + 2] == 41) { + if (R2_GLOBALS._scene1550JunkLocations[i + 2] == 41) { _junk[di].changeZoom(-1); _junk[di].setPosition(Common::Point(150, 70)); _junk[di].setup(1562, 1, 1); + R2_GLOBALS._walkRegions.enableRegion(k5A78C); R2_GLOBALS._walkRegions.enableRegion(k5A78D); R2_GLOBALS._walkRegions.enableRegion(k5A790); R2_GLOBALS._walkRegions.enableRegion(k5A791); + if (R2_INVENTORY.getObjectScene(R2_JOYSTICK) == 1550) { _actor9.postInit(); _actor9.setup(1562, 3, 1); @@ -9008,16 +9017,16 @@ void Scene1550::enterArea() { _actor9.setDetails(1550, 41, -1, 42, 2, (SceneItem *) NULL); } } else { - if (k562CC[i + 2] > 40) { + if (R2_GLOBALS._scene1550JunkLocations[i + 2] > 40) { _junk[di].changeZoom(100); - _junk[di].setup(1561, 1, k562CC[i + 2] - 40); + _junk[di].setup(1561, 1, R2_GLOBALS._scene1550JunkLocations[i + 2] - 40); } else { _junk[di].changeZoom(-1); - _junk[di].setup(1552, ((k562CC[i + 2] - 1) / 5) + 1, ((k562CC[i + 2] - 1) % 5) + 1); + _junk[di].setup(1552, ((R2_GLOBALS._scene1550JunkLocations[i + 2] - 1) / 5) + 1, ((R2_GLOBALS._scene1550JunkLocations[i + 2] - 1) % 5) + 1); } _junk[di].setPosition(Common::Point(k5A72E[tmpIdx], k5A73F[tmpIdx])); - if (k5A78A[tmpIdx] != 0) - R2_GLOBALS._walkRegions.enableRegion(k5A78A[tmpIdx]); + if (scene1550JunkRegions[tmpIdx] != 0) + R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[tmpIdx]); di++; } } @@ -9076,7 +9085,7 @@ void Scene1550::enterArea() { _actor4.setPosition(Common::Point(172, 48)); _actor4.fixPriority(169); - R2_GLOBALS._walkRegions.enableRegion(k5A78A[15]); + R2_GLOBALS._walkRegions.enableRegion(scene1550JunkRegions[15]); break; case 2: _wreckage.postInit(); diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h index 807b48cb3c..3b0d2c780b 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.h +++ b/engines/tsage/ringworld2/ringworld2_scenes1.h @@ -430,7 +430,7 @@ class Scene1550 : public SceneExt { class Junk : public SceneActor { public: int _fieldA4; - int _fieldA6; + int _junkNumber; Junk(); void synchronize(Serializer &s); @@ -548,11 +548,11 @@ public: Actor13 _actor13; Junk _junk[8]; Wall _actor14; - Wall _northWall; + Wall _northWall; // Is also reused for landing strip Wall _actor16; - Wall _actor17; + Wall _westWall; // Is also reused for left hand space Wall _eastWall; - Wall _actor19; + Wall _southWall; UnkObj15502 _arrUnkObj15502[8]; UnkArea1550 _unkArea1; SequenceManager _sequenceManager1; diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp index dda6fac3e8..db38862365 100644 --- a/engines/tsage/staticres.cpp +++ b/engines/tsage/staticres.cpp @@ -244,7 +244,7 @@ char const *const USE_INTERCEPTOR = "Do you want to use your interceptor card?"; char const *const USE_DOUBLE_AGENT = "Do you want to use your double agent?"; char const *const NEED_INSTRUCTIONS = "Do you want instructions?"; char const *const WRONG_ANSWER_MSG = "Wrong respond value sent."; -const byte k562CC[] = { +const byte scene1550JunkLocationsDefault[] = { 20, 7, 41, 6, 3, 6, 42, 11, 10, 15, 43, 6, @@ -409,7 +409,7 @@ const byte k5A76D[] = { 3, 3, 3, 7, 3, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }; -const byte k5A78A[] = {0, 8, 15, 16, 12, 7, 18, 17, 13, 6, 19, 20, 14, 5, 11, 10, 9}; +const byte scene1550JunkRegions[] = {0, 8, 15, 16, 12, 7, 18, 17, 13, 6, 19, 20, 14, 5, 11, 10, 9}; const byte k5A79B[] = { 23, 3, 1, 23, 4, 1, diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h index 0ccd03be24..8c21147191 100644 --- a/engines/tsage/staticres.h +++ b/engines/tsage/staticres.h @@ -199,13 +199,13 @@ extern char const *const NEED_INSTRUCTIONS; extern char const *const WRONG_ANSWER_MSG; // Scene 1550 arrays of constants -extern const byte k562CC[]; +extern const byte scene1550JunkLocationsDefault[]; extern const byte scene1550AreaMap[]; extern const byte k5A72E[]; extern const byte k5A73F[]; extern const byte k5A750[]; extern const byte k5A76D[]; -extern const byte k5A78A[]; +extern const byte scene1550JunkRegions[]; extern const byte k5A79B[]; extern const byte k5A7F6[]; |