diff options
Diffstat (limited to 'engines/tsage/globals.cpp')
-rw-r--r-- | engines/tsage/globals.cpp | 84 |
1 files changed, 47 insertions, 37 deletions
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 5c4fa967e5..3ca54d67a9 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 { @@ -380,6 +381,9 @@ void Ringworld2Globals::reset() { if (!_scannerDialog) _scannerDialog = new ScannerDialog(); + // Default to Quinn as the active character + T2_GLOBALS._player._characterIndex = R2_QUINN; + // Reset the inventory R2_INVENTORY.reset(); T2_GLOBALS._uiElements.updateInventory(); @@ -389,7 +393,7 @@ void Ringworld2Globals::reset() { _scrollFollower = &_player; // Reset fields - Common::fill(&_fadePaletteMap[0][0], &_fadePaletteMap[10][256], 0); + Common::fill(&_fadePaletteMap[0][0], &_fadePaletteMap[9][256], 0); Common::fill(&_paletteMap[0], &_paletteMap[4096], 0); _fadePaletteFlag = false; @@ -404,25 +408,24 @@ void Ringworld2Globals::reset() { _v565E7 = 0; _v565E9 = -5; _v565EB = 26; - _v565F5 = 0; - _v565F6 = 0; - _v565F8 = 0; - _v565FA = 0; + _foodCount = 0; + _rimLocation = 0; + _rimTransportLocation = 0; _v565AE = 0; - _v56605[0] = 0; - _v56605[1] = 3; - _v56605[2] = 5; - _v56605[3] = 1; - _v56605[4] = 2; - _v56605[5] = 5; - _v56605[6] = 9; - _v56605[7] = 14; - _v56605[8] = 15; - _v56605[9] = 18; - _v56605[10] = 20; - _v56605[11] = 25; - _v56605[12] = 27; - _v56605[13] = 31; + _spillLocation[0] = 0; + _spillLocation[1] = 3; + _spillLocation[R2_SEEKER] = 5; + _spillLocation[3] = 1; + _spillLocation[4] = 2; + _spillLocation[5] = 5; + _spillLocation[6] = 9; + _spillLocation[7] = 14; + _spillLocation[8] = 15; + _spillLocation[9] = 18; + _spillLocation[10] = 20; + _spillLocation[11] = 25; + _spillLocation[12] = 27; + _spillLocation[13] = 31; for (int i = 0; i < 18; i++) { _v56613[(i * 4) ] = 1; @@ -449,7 +452,7 @@ void Ringworld2Globals::reset() { _v56613[(17 * 4) + 1] = 1; _v566A6 = 3800; - _v566A3 = 2; + _landerSuitNumber = 2; _v566A4 = 1; _v566A5 = 0; _v566A8 = 5; @@ -475,15 +478,12 @@ void Ringworld2Globals::reset() { _v5780E = 0; _v57810 = 0; _v57C2C = 0; - _v565EC[0] = 0; - _v565EC[1] = 27; - _v565EC[2] = 27; - _v565EC[3] = 4; - _v565EC[4] = 4; + _s1550PlayerArea[R2_QUINN] = Common::Point(27, 4); + _s1550PlayerArea[R2_SEEKER] = Common::Point(27, 4); Common::fill(&_scannerFrequencies[0], &_scannerFrequencies[MAX_CHARACTERS], 1); _speechSubtitles = SPEECH_VOICE | SPEECH_TEXT; _insetUp = 0; - _frameEdgeColour = 2; + _frameEdgeColor = 2; Common::fill(&_stripManager_lookupList[0], &_stripManager_lookupList[12], 0); _stripManager_lookupList[0] = 1; _stripManager_lookupList[1] = 1; @@ -496,10 +496,14 @@ 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; - _player._characterScene[2] = 300; + _player._characterScene[R2_QUINN] = 100; + _player._characterScene[R2_SEEKER] = 300; _player._characterScene[3] = 300; } @@ -519,11 +523,10 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsSint16LE(_v565E7); s.syncAsSint16LE(_v565E9); s.syncAsSint16LE(_v565EB); - s.syncAsSint16LE(_v565F5); - s.syncAsSint16LE(_v565F6); - s.syncAsSint16LE(_v565F8); - s.syncAsSint16LE(_v565FA); - s.syncAsSint16LE(_v566A3); + s.syncAsSint16LE(_foodCount); + s.syncAsSint32LE(_rimLocation); + s.syncAsSint16LE(_rimTransportLocation); + s.syncAsSint16LE(_landerSuitNumber); s.syncAsSint16LE(_v566A6); s.syncAsSint16LE(_v56A93); s.syncAsSint16LE(_scene1925CurrLevel); // _v56A9C @@ -539,8 +542,12 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsSint16LE(_v57C2C); s.syncAsSint16LE(_speechSubtitles); - for (i = 0; i < 5; i++) - s.syncAsByte(_v565EC[i]); + byte temp; + s.syncAsByte(temp); + s.syncAsByte(_s1550PlayerArea[R2_QUINN].x); + s.syncAsByte(_s1550PlayerArea[R2_SEEKER].x); + s.syncAsByte(_s1550PlayerArea[R2_QUINN].y); + s.syncAsByte(_s1550PlayerArea[R2_SEEKER].y); for (i = 0; i < MAX_CHARACTERS; ++i) s.syncAsByte(_scannerFrequencies[i]); @@ -558,7 +565,7 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsByte(_v56AA8); for (i = 0; i < 14; ++i) - s.syncAsByte(_v56605[i]); + s.syncAsByte(_spillLocation[i]); for (i = 0; i < 1000; ++i) s.syncAsByte(_v566AB[i]); s.syncAsByte(_v56A99); @@ -566,7 +573,10 @@ void Ringworld2Globals::synchronize(Serializer &s) { s.syncAsByte(_stripManager_lookupList[i]); s.syncAsSint16LE(_insetUp); - s.syncAsByte(_frameEdgeColour); + s.syncAsByte(_frameEdgeColor); + + for (i = 0; i < 508; i += 4) + s.syncAsByte(_scene1550JunkLocations[i + 2]); } } // end of namespace Ringworld2 |