257 lines
5.3 KiB
C
Raw Normal View History

2014-07-29 21:02:28 -04:00
/* 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_ACCESS_H
#define ACCESS_ACCESS_H
#include "common/scummsys.h"
#include "common/system.h"
#include "common/error.h"
#include "common/random.h"
#include "common/util.h"
#include "engines/engine.h"
#include "graphics/surface.h"
#include "access/animation.h"
#include "access/bubble_box.h"
#include "access/char.h"
#include "access/data.h"
2014-07-29 21:02:28 -04:00
#include "access/debugger.h"
#include "access/events.h"
2014-08-02 15:14:42 -04:00
#include "access/files.h"
#include "access/font.h"
#include "access/inventory.h"
2014-08-05 22:17:30 -04:00
#include "access/player.h"
#include "access/room.h"
2014-08-02 10:07:54 -04:00
#include "access/screen.h"
#include "access/scripts.h"
2014-08-02 15:14:42 -04:00
#include "access/sound.h"
#include "access/video.h"
2014-07-29 21:02:28 -04:00
/**
* This is the namespace of the Access engine.
*
* Status of this engine: In Development
*
* Games using this engine:
* - Amazon: Guardians of Eden
*/
namespace Access {
#define DEBUG_BASIC 1
#define DEBUG_INTERMEDIATE 2
#define DEBUG_DETAILED 3
2014-08-02 15:14:42 -04:00
enum {
GType_Amazon = 1,
GType_MartianMemorandum = 2,
GType_Noctropolis = 3
2014-08-02 15:14:42 -04:00
};
2014-07-29 21:02:28 -04:00
enum AccessDebugChannels {
kDebugPath = 1 << 0,
kDebugScripts = 1 << 1,
kDebugGraphics = 1 << 2
};
struct AccessGameDescription;
extern const char *const _estTable[];
2014-07-29 21:02:28 -04:00
class AccessEngine : public Engine {
private:
uint32 _lastTime, _curTime;
2014-07-29 21:02:28 -04:00
/**
* Handles basic initialisation
*/
void initialize();
/**
* Set VGA mode
*/
void setVGA();
void dummyLoop();
2014-08-06 22:43:40 -04:00
void speakText(Common::Array<Common::String>msgArr);
2014-08-24 18:49:34 +02:00
void doEstablish(int esatabIndex, int sub);
2014-07-29 21:02:28 -04:00
protected:
const AccessGameDescription *_gameDescription;
Common::RandomSource _randomSource;
/**
* Main handler for showing game rooms
*/
void doRoom();
2014-07-29 21:02:28 -04:00
// Engine APIs
virtual Common::Error run();
virtual bool hasFeature(EngineFeature f) const;
2014-08-02 10:07:54 -04:00
protected:
/**
* Play the game
2014-08-02 10:07:54 -04:00
*/
virtual void playGame() = 0;
2014-07-29 21:02:28 -04:00
public:
AnimationManager *_animation;
BubbleBox *_bubbleBox;
CharManager *_char;
2014-07-29 21:02:28 -04:00
Debugger *_debugger;
EventsManager *_events;
2014-08-02 15:14:42 -04:00
FileManager *_files;
InventoryManager *_inventory;
2014-08-05 22:17:30 -04:00
Player *_player;
Room *_room;
2014-08-02 10:07:54 -04:00
Screen *_screen;
Scripts *_scripts;
2014-08-02 15:14:42 -04:00
SoundManager *_sound;
VideoPlayer *_video;
2014-08-09 22:24:35 -04:00
ASurface *_destIn;
2014-08-10 17:49:44 +02:00
ASurface *_current;
2014-08-06 22:43:40 -04:00
ASurface _buffer1;
ASurface _buffer2;
Common::Array<CharEntry *> _charTable;
SpriteResource *_objectsTable[100];
bool _establishTable[100];
2014-08-06 22:43:40 -04:00
bool _establishFlag;
int _establishMode;
int _establishGroup;
int _establishCtrlTblOfs;
2014-08-05 22:17:30 -04:00
int _numAnimTimers;
TimerList _timers;
FontManager _fonts;
2014-08-12 08:38:12 -04:00
Common::Array<Common::Rect> _newRects;
Common::Array<Common::Rect> _oldRects;
2014-08-06 22:43:40 -04:00
Common::Array<ExtraCell> _extraCells;
ImageEntryList _images;
int _pCount;
bool _normalMouse;
int _mouseMode;
2014-08-04 22:38:50 -04:00
int _currentManOld;
byte *_inactive;
2014-08-04 22:38:50 -04:00
byte *_music;
byte *_title;
int _converseMode;
int _startAboutBox;
int _startTravelBox;
bool _currentCharFlag;
bool _boxSelect;
2014-08-07 09:23:31 -04:00
int _scale;
2014-08-06 22:43:40 -04:00
int _scaleH1, _scaleH2;
int _scaleN1;
int _scaleT1;
int _scaleMaxY;
int _scaleI;
2014-08-11 23:12:53 -04:00
bool _scaleFlag;
2014-08-04 22:38:50 -04:00
byte *_eseg;
int _et;
int _printEnd;
int _txtPages;
int _narateFile;
int _sndSubFile;
int _countTbl[6];
// Fields that are included in savegames
int _conversation;
int _currentMan;
uint32 _newTime;
uint32 _newDate;
int _intTim[3];
int _timer[3];
2014-08-09 18:28:33 -04:00
int _flags[256];
byte _help1[366];
byte _help2[366];
byte _help3[366];
2014-08-17 11:16:31 +02:00
byte *_helpTbl[3];
int _travel;
int _ask;
int _rScrollRow;
int _rScrollCol;
2014-08-10 17:52:34 +02:00
int _rScrollX;
int _rScrollY;
int _rOldRectCount;
int _rNewRectCount;
int _rKeyFlag;
int _mapOffset;
int _screenVirtX;
2014-08-09 18:28:33 -04:00
// Fields mapped into the flags array
int &_useItem;
int &_startup;
int &_manScaleOff;
2014-07-29 21:02:28 -04:00
public:
AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc);
virtual ~AccessEngine();
uint32 getFeatures() const;
bool isCD() const;
2014-07-29 21:02:28 -04:00
Common::Language getLanguage() const;
Common::Platform getPlatform() const;
uint16 getVersion() const;
uint32 getGameID() const;
uint32 getGameFeatures() const;
int getRandomNumber(int maxNumber);
2014-08-06 08:28:20 -04:00
void loadCells(Common::Array<CellIdent> &cells);
2014-08-06 22:43:40 -04:00
2014-08-06 08:28:20 -04:00
/**
* Free the sprites list
2014-08-06 08:28:20 -04:00
*/
void freeCells();
/**
* Free the inactive data
*/
void freeInactiveData();
void AccessEngine::loadEstablish(int sub);
void establish(int esatabIndex, int sub);
2014-08-06 22:43:40 -04:00
void establishCenter(int esatabIndex, int sub);
2014-08-11 23:12:53 -04:00
void plotList();
void plotList1();
2014-08-12 08:38:12 -04:00
void copyBlocks();
void copyRects();
void copyBF1BF2();
void copyBF2Vid();
2014-08-16 09:35:38 -04:00
void doLoadSave();
2014-08-19 20:43:32 -04:00
void freeChar();
2014-07-29 21:02:28 -04:00
};
} // End of namespace Access
#endif /* ACCESS_ACCESS_H */