From 01124c3378f03f9fa0c7c7618879caff5926f735 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 28 Nov 2014 22:26:07 -0500 Subject: ACCESS: Moved help table data from AccessEngine to AmazonEngine --- engines/access/access.cpp | 11 ----------- engines/access/access.h | 4 ---- engines/access/amazon/amazon_game.cpp | 14 +++++++++++++- engines/access/amazon/amazon_game.h | 4 ++++ engines/access/amazon/amazon_scripts.cpp | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) (limited to 'engines') diff --git a/engines/access/access.cpp b/engines/access/access.cpp index 1ab40a2de7..2d25ae9d00 100644 --- a/engines/access/access.cpp +++ b/engines/access/access.cpp @@ -84,12 +84,6 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc) _establishMode = 0; _establishGroup = 0; _establishCtrlTblOfs = 0; - Common::fill(&_help1[0], &_help1[366], 0); - Common::fill(&_help2[0], &_help2[366], 0); - Common::fill(&_help1[0], &_help3[366], 0); - _helpTbl[0] = _help1; - _helpTbl[1] = _help2; - _helpTbl[2] = _help3; _travel = 0; _ask = 0; _lastTime = g_system->getMillis(); @@ -507,11 +501,6 @@ void AccessEngine::synchronize(Common::Serializer &s) { for (int i = 0; i < 256; ++i) s.syncAsUint16LE(_flags[i]); - for (int i = 0; i < 366; ++i) { - s.syncAsByte(_help1[i]); - s.syncAsByte(_help2[i]); - s.syncAsByte(_help3[i]); - } s.syncAsUint16LE(_travel); s.syncAsUint16LE(_ask); diff --git a/engines/access/access.h b/engines/access/access.h index 0942c9eb8e..165ae83b28 100644 --- a/engines/access/access.h +++ b/engines/access/access.h @@ -207,10 +207,6 @@ public: uint32 _newTime; uint32 _newDate; int _flags[256]; - byte _help1[366]; - byte _help2[366]; - byte _help3[366]; - byte *_helpTbl[3]; int _travel; int _ask; diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp index fb884897df..8958239a15 100644 --- a/engines/access/amazon/amazon_game.cpp +++ b/engines/access/amazon/amazon_game.cpp @@ -53,7 +53,13 @@ AccessEngine(syst, gameDesc), Common::fill(&_esTabTable[0], &_esTabTable[100], 0); memset(_tileData, 0, sizeof(_tileData)); - + Common::fill(&_help1[0], &_help1[366], 0); + Common::fill(&_help2[0], &_help2[366], 0); + Common::fill(&_help1[0], &_help3[366], 0); + _helpTbl[0] = _help1; + _helpTbl[1] = _help2; + _helpTbl[2] = _help3; + _chapterCells.push_back(CellIdent(0, 96, 17)); _inactive._spritesPtr = nullptr; _inactive._altSpritesPtr = nullptr; @@ -973,8 +979,14 @@ void AmazonEngine::synchronize(Common::Serializer &s) { s.syncAsSint16LE(_rawInactiveX); s.syncAsSint16LE(_rawInactiveY); s.syncAsSint16LE(_inactiveYOff); + for (int i = 0; i < 100; ++i) s.syncAsSint16LE(_esTabTable[i]); + for (int i = 0; i < 366; ++i) { + s.syncAsByte(_help1[i]); + s.syncAsByte(_help2[i]); + s.syncAsByte(_help3[i]); + } _river.synchronize(s); } diff --git a/engines/access/amazon/amazon_game.h b/engines/access/amazon/amazon_game.h index d697b16c93..016ddf40f0 100644 --- a/engines/access/amazon/amazon_game.h +++ b/engines/access/amazon/amazon_game.h @@ -86,6 +86,10 @@ public: InactivePlayer _inactive; bool _charSegSwitch; bool _skipStart; + byte _help1[366]; + byte _help2[366]; + byte _help3[366]; + byte *_helpTbl[3]; // Fields that are mapped to flags int &_guardLocation; diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp index d6a57d7919..4c3b83869c 100644 --- a/engines/access/amazon/amazon_scripts.cpp +++ b/engines/access/amazon/amazon_scripts.cpp @@ -448,7 +448,7 @@ void AmazonScripts::cmdSetHelp() { int arrayId = (_data->readUint16LE() && 0xFF) - 1; int helpId = _data->readUint16LE() && 0xFF; - byte *help = _vm->_helpTbl[arrayId]; + byte *help = _game->_helpTbl[arrayId]; help[helpId] = 1; if (_vm->_useItem == 0) { -- cgit v1.2.3