Skip to content

Commit

Permalink
ACCESS: Added Globals classes
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Aug 5, 2014
1 parent bb48a15 commit e6b1d14
Show file tree
Hide file tree
Showing 9 changed files with 320 additions and 1 deletion.
19 changes: 19 additions & 0 deletions engines/access/access.cpp
Expand Up @@ -34,11 +34,30 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
_debugger = nullptr;
_events = nullptr;
_files = nullptr;
_globals = nullptr;
_screen = nullptr;
_sound = nullptr;

_destIn = nullptr;
_objectsTable = nullptr;
_pCount = 0;
_currentMan = 0;
_currentManOld = -1;
_man1 = nullptr;
_manPal1 = nullptr;
_music = nullptr;
_playField = nullptr;
_script = nullptr;
_anim = nullptr;
_title = nullptr;
_converseMode = 0;
_startInvItem = 0;
_startAboutItem = 0;
_startTravelItem = 0;
_startInvBox = 0;
_startAboutBox = 0;
_startTravelBox = 0;

}

AccessEngine::~AccessEngine() {
Expand Down
19 changes: 19 additions & 0 deletions engines/access/access.h
Expand Up @@ -33,6 +33,7 @@
#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 @@ -93,6 +94,7 @@ class AccessEngine : public Engine {
Debugger *_debugger;
EventsManager *_events;
FileManager *_files;
Globals *_globals;
Screen *_screen;
SoundManager *_sound;

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

int _currentMan;
int _currentManOld;
byte *_man1;
byte *_manPal1;
byte *_music;
byte *_playField;
byte *_script;
byte *_anim;
byte *_title;
int _converseMode;
int _startInvItem;
int _startAboutItem;
int _startTravelItem;
int _startInvBox;
int _startAboutBox;
int _startTravelBox;

public:
AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc);
virtual ~AccessEngine();
Expand Down
8 changes: 8 additions & 0 deletions engines/access/amazon/amazon_game.cpp
Expand Up @@ -21,17 +21,20 @@
*/

#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;
}

AmazonEngine::~AmazonEngine() {
delete _globals;
}

void AmazonEngine::playGame() {
Expand Down Expand Up @@ -62,6 +65,10 @@ void AmazonEngine::playGame() {
return;

_screen->clearScreen();
_screen->setPanel(0);
_screen->forceFadeOut();


}

void AmazonEngine::doTitle() {
Expand Down Expand Up @@ -111,6 +118,7 @@ void AmazonEngine::doTent() {
// TODO
}


} // End of namespace Amazon

} // End of namespace Access
6 changes: 6 additions & 0 deletions engines/access/amazon/amazon_game.h
Expand Up @@ -24,6 +24,7 @@
#define ACCESS_AMAZON_GAME_H

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

namespace Access {

Expand All @@ -47,6 +48,11 @@ 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: 48 additions & 0 deletions engines/access/amazon/amazon_globals.cpp
@@ -0,0 +1,48 @@
/* 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
58 changes: 58 additions & 0 deletions engines/access/amazon/amazon_globals.h
@@ -0,0 +1,58 @@
/* 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 */
75 changes: 75 additions & 0 deletions engines/access/globals.cpp
@@ -0,0 +1,75 @@
/* 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
84 changes: 84 additions & 0 deletions engines/access/globals.h
@@ -0,0 +1,84 @@
/* 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 */

0 comments on commit e6b1d14

Please sign in to comment.