Skip to content

Commit

Permalink
ACCESS: Moved globals into the main engine classes
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Aug 6, 2014
1 parent e6b1d14 commit c4fb766
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 281 deletions.
45 changes: 44 additions & 1 deletion engines/access/access.cpp
Expand Up @@ -34,7 +34,6 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
_debugger = nullptr;
_events = nullptr;
_files = nullptr;
_globals = nullptr;
_screen = nullptr;
_sound = nullptr;

Expand All @@ -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() {
Expand Down
48 changes: 45 additions & 3 deletions engines/access/access.h
Expand Up @@ -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"

Expand Down Expand Up @@ -94,7 +93,6 @@ class AccessEngine : public Engine {
Debugger *_debugger;
EventsManager *_events;
FileManager *_files;
Globals *_globals;
Screen *_screen;
SoundManager *_sound;

Expand All @@ -104,7 +102,6 @@ class AccessEngine : public Engine {
byte *_objectsTable;
int _pCount;

int _currentMan;
int _currentManOld;
byte *_man1;
byte *_manPal1;
Expand All @@ -121,6 +118,51 @@ class AccessEngine : public Engine {
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();
Expand Down
17 changes: 14 additions & 3 deletions engines/access/amazon/amazon_game.cpp
Expand Up @@ -21,20 +21,31 @@
*/

#include "access/amazon/amazon_game.h"
#include "access/amazon/amazon_globals.h"

namespace Access {

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() {
Expand Down
22 changes: 16 additions & 6 deletions engines/access/amazon/amazon_game.h
Expand Up @@ -24,7 +24,6 @@
#define ACCESS_AMAZON_GAME_H

#include "access/access.h"
#include "access/amazon/amazon_globals.h"

namespace Access {

Expand All @@ -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
*/
Expand All @@ -48,11 +63,6 @@ class AmazonEngine : public AccessEngine {
* Do tent scene of introduction
*/
void doTent();

/**
* Get globals reference
*/
AmazonGlobals &globals() { return *(AmazonGlobals *)_globals; }
protected:
/**
* Play the game
Expand Down
48 changes: 0 additions & 48 deletions engines/access/amazon/amazon_globals.cpp

This file was deleted.

58 changes: 0 additions & 58 deletions engines/access/amazon/amazon_globals.h

This file was deleted.

75 changes: 0 additions & 75 deletions engines/access/globals.cpp

This file was deleted.

0 comments on commit c4fb766

Please sign in to comment.