diff options
author | Paul Gilbert | 2014-08-05 20:04:41 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-08-05 20:04:41 -0400 |
commit | c4fb766811d523a28630c98ca535cb9c6000acf5 (patch) | |
tree | 6a5a1476ea95710f687d327e7dc7925ed6f077ef /engines | |
parent | e6b1d148ce184a53598fbf9cefa28689678b47a9 (diff) | |
download | scummvm-rg350-c4fb766811d523a28630c98ca535cb9c6000acf5.tar.gz scummvm-rg350-c4fb766811d523a28630c98ca535cb9c6000acf5.tar.bz2 scummvm-rg350-c4fb766811d523a28630c98ca535cb9c6000acf5.zip |
ACCESS: Moved globals into the main engine classes
Diffstat (limited to 'engines')
-rw-r--r-- | engines/access/access.cpp | 45 | ||||
-rw-r--r-- | engines/access/access.h | 48 | ||||
-rw-r--r-- | engines/access/amazon/amazon_game.cpp | 17 | ||||
-rw-r--r-- | engines/access/amazon/amazon_game.h | 22 | ||||
-rw-r--r-- | engines/access/amazon/amazon_globals.cpp | 48 | ||||
-rw-r--r-- | engines/access/amazon/amazon_globals.h | 58 | ||||
-rw-r--r-- | engines/access/globals.cpp | 75 | ||||
-rw-r--r-- | engines/access/globals.h | 84 | ||||
-rw-r--r-- | engines/access/module.mk | 4 |
9 files changed, 120 insertions, 281 deletions
diff --git a/engines/access/access.cpp b/engines/access/access.cpp index 3639115455..fdf6cd03b0 100644 --- a/engines/access/access.cpp +++ b/engines/access/access.cpp @@ -34,7 +34,6 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc) _debugger = nullptr; _events = nullptr; _files = nullptr; - _globals = nullptr; _screen = nullptr; _sound = nullptr; @@ -58,6 +57,50 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc) _startAboutBox = 0; _startTravelBox = 0; + _startData = 0; + _rawPlayerXLow = 0; + _rawPlayerX = 0; + _rawPlayerYLow = 0; + _rawPlayerY = 0; + _conversation = 0; + _currentMan = 0; + _newTime = 0; + _newDate = 0; + _intTim[3] = 0; + _timer[3] = 0; + _timerFlag = false; + Common::fill(&_flags[0], &_flags[99], 0); + Common::fill(&_useItem[0], &_useItem[23], 0); + _guardLoc = 0; + _guardFind = 0; + _helpLevel = 0; + _jasMayaFlag = 0; + _moreHelp = 0; + _startup = 0; + _flashbackFlag = false; + _manScaleOff = 0; + _riverFlag = false; + _antOutFlag = false; + _badEnd = 0; + _noHints = false; + _antFlag = false; + _allenFlag = false; + _noSound = false; + Common::fill(&inv[0], &inv[85], 0); + Common::fill(&_help1[0], &_help1[366], 0); + Common::fill(&_help2[0], &_help2[366], 0); + Common::fill(&_help1[0], &_help3[366], 0); + _travel = 0; + _ask = 0; + _rScrollRow = 0; + _rScrollCol = 0; + _rSrcollX = 0; + _rScrollY = 0; + _rOldRectCount = 0; + _rNewRectCount = 0; + _rKeyFlag = 0; + _mapOffset = 0; + _screenVirtX = 0; } AccessEngine::~AccessEngine() { diff --git a/engines/access/access.h b/engines/access/access.h index 34287116ba..fd95c912bc 100644 --- a/engines/access/access.h +++ b/engines/access/access.h @@ -33,7 +33,6 @@ #include "access/debugger.h" #include "access/events.h" #include "access/files.h" -#include "access/globals.h" #include "access/screen.h" #include "access/sound.h" @@ -94,7 +93,6 @@ public: Debugger *_debugger; EventsManager *_events; FileManager *_files; - Globals *_globals; Screen *_screen; SoundManager *_sound; @@ -104,7 +102,6 @@ public: byte *_objectsTable; int _pCount; - int _currentMan; int _currentManOld; byte *_man1; byte *_manPal1; @@ -121,6 +118,51 @@ public: int _startAboutBox; int _startTravelBox; + // Fields that are included in savegames + int _startData; + int _rawPlayerXLow; + int _rawPlayerX; + int _rawPlayerYLow; + int _rawPlayerY; + int _conversation; + int _currentMan; + uint32 _newTime; + uint32 _newDate; + int _intTim[3]; + int _timer[3]; + bool _timerFlag; + byte _flags[99]; + byte _useItem[23]; + int _guardLoc; + int _guardFind; + int _helpLevel; + int _jasMayaFlag; + int _moreHelp; + int _startup; + bool _flashbackFlag; + int _manScaleOff; + bool _riverFlag; + bool _antOutFlag; + int _badEnd; + bool _noHints; + bool _antFlag; + bool _allenFlag; + bool _noSound; + int inv[85]; + byte _help1[366]; + byte _help2[366]; + byte _help3[366]; + int _travel; + int _ask; + int _rScrollRow; + int _rScrollCol; + int _rSrcollX; + int _rScrollY; + int _rOldRectCount; + int _rNewRectCount; + int _rKeyFlag; + int _mapOffset; + int _screenVirtX; public: AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc); virtual ~AccessEngine(); diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp index af7b77e743..068d3bf6f8 100644 --- a/engines/access/amazon/amazon_game.cpp +++ b/engines/access/amazon/amazon_game.cpp @@ -21,7 +21,6 @@ */ #include "access/amazon/amazon_game.h" -#include "access/amazon/amazon_globals.h" namespace Access { @@ -29,12 +28,24 @@ namespace Amazon { AmazonEngine::AmazonEngine(OSystem *syst, const AccessGameDescription *gameDesc) : AccessEngine(syst, gameDesc) { - _globals = new AmazonGlobals(); _skipStart = false; + + _canoeLane = 0; + _canoeYPos = 0; + _hitCount = 0; + _saveRiver = 0; + _hitSafe = 0; + _chapter = 0; + _topList = 0; + _botList = 0; + _riverIndex = 0; + _rawInactiveX = 0; + _rawInactiveY = 0; + _inactiveYOff = 0; + Common::fill(&_esTabTable[0], &_esTabTable[100], 0); } AmazonEngine::~AmazonEngine() { - delete _globals; } void AmazonEngine::playGame() { diff --git a/engines/access/amazon/amazon_game.h b/engines/access/amazon/amazon_game.h index 42fc31d724..1b5397b033 100644 --- a/engines/access/amazon/amazon_game.h +++ b/engines/access/amazon/amazon_game.h @@ -24,7 +24,6 @@ #define ACCESS_AMAZON_GAME_H #include "access/access.h" -#include "access/amazon/amazon_globals.h" namespace Access { @@ -34,6 +33,22 @@ class AmazonEngine : public AccessEngine { private: bool _skipStart; + // Fields that are included in savegames + int _canoeLane; + int _canoeYPos; + int _hitCount; + int _saveRiver; + int _hitSafe; + int _chapter; + int _topList; + int _botList; + int _riverIndex; + int _rawInactiveX; + int _rawInactiveY; + int _inactiveYOff; + int _esTabTable[100]; + + /** * Do title sequence */ @@ -48,11 +63,6 @@ private: * Do tent scene of introduction */ void doTent(); - - /** - * Get globals reference - */ - AmazonGlobals &globals() { return *(AmazonGlobals *)_globals; } protected: /** * Play the game diff --git a/engines/access/amazon/amazon_globals.cpp b/engines/access/amazon/amazon_globals.cpp deleted file mode 100644 index 7982233730..0000000000 --- a/engines/access/amazon/amazon_globals.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software = 0; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation = 0; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY = 0; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program = 0; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "common/algorithm.h" -#include "access/amazon/amazon_globals.h" - -namespace Access { - -namespace Amazon { - -AmazonGlobals::AmazonGlobals() : Globals() { - _canoeLane = 0; - _canoeYPos = 0; - _hitCount = 0; - _saveRiver = 0; - _hitSafe = 0; - _chapter = 0; - _topList = 0; - _botList = 0; - _riverIndex = 0; - _rawInactiveX = 0; - _rawInactiveY = 0; - _inactiveYOff = 0; - Common::fill(&_esTabTable[0], &_esTabTable[100], 0); -} - -} // End of namespace Amazon - -} // End of namespace Access diff --git a/engines/access/amazon/amazon_globals.h b/engines/access/amazon/amazon_globals.h deleted file mode 100644 index d9631f7450..0000000000 --- a/engines/access/amazon/amazon_globals.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef ACCESS_AMAZON_GLOBALS_H -#define ACCESS_AMAZON_GLOBALS_H - -#include "common/scummsys.h" -#include "access/globals.h" - -namespace Access { - -namespace Amazon { - -class AmazonGlobals: public Globals { -public: - int _canoeLane; - int _canoeYPos; - int _hitCount; - int _saveRiver; - int _hitSafe; - int _chapter; - int _topList; - int _botList; - int _riverIndex; - int _rawInactiveX; - int _rawInactiveY; - int _inactiveYOff; - int _esTabTable[100]; -public: - AmazonGlobals(); - - virtual ~AmazonGlobals() {} -}; - -} // End of namespace Amazon - -} // End of namespace Access - -#endif /* ACCESS_AMAZON_GLOBALS_H */ diff --git a/engines/access/globals.cpp b/engines/access/globals.cpp deleted file mode 100644 index ab0c37b168..0000000000 --- a/engines/access/globals.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software = 0; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation = 0; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY = 0; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program = 0; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "common/algorithm.h" -#include "access/globals.h" - -namespace Access { - -Globals::Globals() { - _startData = 0; - _rawPlayerXLow = 0; - _rawPlayerX = 0; - _rawPlayerYLow = 0; - _rawPlayerY = 0; - _conversation = 0; - _currentMan = 0; - _newTime = 0; - _newDate = 0; - _intTim[3] = 0; - _timer[3] = 0; - _timerFlag = false; - Common::fill(&_flags[0], &_flags[99], 0); - Common::fill(&_useItem[0], &_useItem[23], 0); - _guardLoc = 0; - _guardFind = 0; - _helpLevel = 0; - _jasMayaFlag = 0; - _moreHelp = 0; - _startup = 0; - _flashbackFlag = false; - _manScaleOff = 0; - _riverFlag = false; - _antOutFlag = false; - _badEnd = 0; - _noHints = false; - _antFlag = false; - _allenFlag = false; - _noSound = false; - Common::fill(&inv[0], &inv[85], 0); - Common::fill(&_help1[0], &_help1[366], 0); - Common::fill(&_help2[0], &_help2[366], 0); - Common::fill(&_help1[0], &_help3[366], 0); - _travel = 0; - _ask = 0; - _rScrollRow = 0; - _rScrollCol = 0; - _rSrcollX = 0; - _rScrollY = 0; - _rOldRectCount = 0; - _rNewRectCount = 0; - _rKeyFlag = 0; - _mapOffset = 0; - _screenVirtX = 0; -} - -} // End of namespace Access diff --git a/engines/access/globals.h b/engines/access/globals.h deleted file mode 100644 index 30dbd46ad8..0000000000 --- a/engines/access/globals.h +++ /dev/null @@ -1,84 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef ACCESS_GLOBALS_H -#define ACCESS_GLOBALS_H - -#include "common/scummsys.h" - -namespace Access { - -class Globals { -public: - int _startData; - int _rawPlayerXLow; - int _rawPlayerX; - int _rawPlayerYLow; - int _rawPlayerY; - int _conversation; - int _currentMan; - uint32 _newTime; - uint32 _newDate; - int _intTim[3]; - int _timer[3]; - bool _timerFlag; - byte _flags[99]; - byte _useItem[23]; - int _guardLoc; - int _guardFind; - int _helpLevel; - int _jasMayaFlag; - int _moreHelp; - int _startup; - bool _flashbackFlag; - int _manScaleOff; - bool _riverFlag; - bool _antOutFlag; - int _badEnd; - bool _noHints; - bool _antFlag; - bool _allenFlag; - bool _noSound; - int inv[85]; - byte _help1[366]; - byte _help2[366]; - byte _help3[366]; - int _travel; - int _ask; - int _rScrollRow; - int _rScrollCol; - int _rSrcollX; - int _rScrollY; - int _rOldRectCount; - int _rNewRectCount; - int _rKeyFlag; - int _mapOffset; - int _screenVirtX; -public: - Globals(); - - virtual ~Globals() {} -}; - -} // End of namespace Access - -#endif /* ACCESS_GLOBALS_H */ diff --git a/engines/access/module.mk b/engines/access/module.mk index e49a11be41..ff4cedbdc6 100644 --- a/engines/access/module.mk +++ b/engines/access/module.mk @@ -8,12 +8,10 @@ MODULE_OBJS := \ detection.o \ events.o \ files.o \ - globals.o \ resources.o \ screen.o \ sound.o \ - amazon\amazon_game.o \ - amazon\amazon_globals.o + amazon\amazon_game.o # This module can be built as a plugin ifeq ($(ENABLE_ACCESS), DYNAMIC_PLUGIN) |