2007-05-30 21:56:52 +00: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.
|
2005-04-05 15:07:40 +00:00
|
|
|
*
|
|
|
|
* 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.
|
2014-02-18 01:34:20 +00:00
|
|
|
*
|
2005-04-05 15:07:40 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2008-01-05 12:45:14 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2005-04-05 15:07:40 +00:00
|
|
|
* GNU General Public License for more details.
|
2014-02-18 01:34:20 +00:00
|
|
|
*
|
2005-04-05 15:07:40 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2005-04-05 15:07:40 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-04-05 18:08:02 +00:00
|
|
|
#ifndef GOB_GOB_H
|
|
|
|
#define GOB_GOB_H
|
2005-04-05 15:07:40 +00:00
|
|
|
|
2010-03-18 15:07:11 +00:00
|
|
|
#include "common/random.h"
|
2005-04-05 15:07:40 +00:00
|
|
|
#include "common/system.h"
|
2006-11-19 17:52:52 +00:00
|
|
|
#include "common/savefile.h"
|
2005-04-05 15:07:40 +00:00
|
|
|
|
2011-04-24 08:34:27 +00:00
|
|
|
#include "graphics/pixelformat.h"
|
|
|
|
|
2006-09-23 00:42:35 +00:00
|
|
|
#include "engines/engine.h"
|
2006-01-03 23:14:39 +00:00
|
|
|
|
2010-10-13 03:49:54 +00:00
|
|
|
#include "gob/console.h"
|
|
|
|
|
2009-06-06 16:47:21 +00:00
|
|
|
namespace GUI {
|
2011-04-25 19:29:26 +00:00
|
|
|
class StaticTextWidget;
|
2009-06-06 16:47:21 +00:00
|
|
|
}
|
|
|
|
|
2009-11-24 22:10:14 +00:00
|
|
|
/**
|
|
|
|
* This is the namespace of the Gob engine.
|
|
|
|
*
|
|
|
|
* Status of this engine: ???
|
|
|
|
*
|
2010-10-15 12:48:19 +00:00
|
|
|
* Games using this engine:
|
|
|
|
* - Gobliiins
|
|
|
|
* - Gobliins 2
|
|
|
|
* - Goblins 3
|
|
|
|
* - Ween: The Prophecy
|
|
|
|
* - Bargon Attack
|
|
|
|
* - Lost in Time
|
|
|
|
* - The Bizarre Adventures of Woodruff and the Schnibble
|
2012-06-11 13:07:01 +00:00
|
|
|
* - Fascination
|
|
|
|
* - Urban Runner
|
|
|
|
* - Bambou le sauveur de la jungle
|
|
|
|
* - Geisha
|
2012-06-16 02:06:21 +00:00
|
|
|
* - Once Upon A Time: Little Red Riding Hood
|
2014-01-31 11:04:08 +00:00
|
|
|
* - Croustibat
|
2009-11-24 22:10:14 +00:00
|
|
|
*/
|
2006-01-03 23:14:39 +00:00
|
|
|
namespace Gob {
|
|
|
|
|
|
|
|
class Game;
|
2008-05-08 00:47:23 +00:00
|
|
|
class Sound;
|
2006-01-03 23:14:39 +00:00
|
|
|
class Video;
|
|
|
|
class Global;
|
|
|
|
class Draw;
|
|
|
|
class DataIO;
|
|
|
|
class Goblin;
|
2007-07-30 15:53:38 +00:00
|
|
|
class VideoPlayer;
|
2006-01-03 23:14:39 +00:00
|
|
|
class Init;
|
|
|
|
class Inter;
|
|
|
|
class Map;
|
|
|
|
class Mult;
|
|
|
|
class PalAnim;
|
|
|
|
class Scenery;
|
|
|
|
class Util;
|
2007-04-08 00:08:26 +00:00
|
|
|
class SaveLoad;
|
2010-10-13 03:49:54 +00:00
|
|
|
class GobConsole;
|
2012-06-27 22:07:29 +00:00
|
|
|
class PreGob;
|
2006-01-03 23:14:39 +00:00
|
|
|
|
2008-05-28 21:15:11 +00:00
|
|
|
#define WRITE_VAR_UINT32(var, val) _vm->_inter->_variables->writeVar32(var, val)
|
|
|
|
#define WRITE_VAR_UINT16(var, val) _vm->_inter->_variables->writeVar16(var, val)
|
|
|
|
#define WRITE_VAR_UINT8(var, val) _vm->_inter->_variables->writeVar8(var, val)
|
|
|
|
#define WRITE_VAR_STR(var, str) _vm->_inter->_variables->writeVarString(var, str)
|
|
|
|
#define WRITE_VARO_UINT32(off, val) _vm->_inter->_variables->writeOff32(off, val)
|
|
|
|
#define WRITE_VARO_UINT16(off, val) _vm->_inter->_variables->writeOff16(off, val)
|
|
|
|
#define WRITE_VARO_UINT8(off, val) _vm->_inter->_variables->writeOff8(off, val)
|
|
|
|
#define WRITE_VARO_STR(off, str) _vm->_inter->_variables->writeOffString(off, str)
|
|
|
|
#define READ_VAR_UINT32(var) _vm->_inter->_variables->readVar32(var)
|
|
|
|
#define READ_VAR_UINT16(var) _vm->_inter->_variables->readVar16(var)
|
|
|
|
#define READ_VAR_UINT8(var) _vm->_inter->_variables->readVar8(var)
|
|
|
|
#define READ_VARO_UINT32(off) _vm->_inter->_variables->readOff32(off)
|
|
|
|
#define READ_VARO_UINT16(off) _vm->_inter->_variables->readOff16(off)
|
|
|
|
#define READ_VARO_UINT8(off) _vm->_inter->_variables->readOff8(off)
|
2009-05-31 02:15:43 +00:00
|
|
|
#define GET_VAR_STR(var) _vm->_inter->_variables->getAddressVarString(var)
|
|
|
|
#define GET_VARO_STR(off) _vm->_inter->_variables->getAddressOffString(off)
|
2008-05-28 21:15:11 +00:00
|
|
|
#define GET_VAR_FSTR(var) _vm->_inter->_variables->getAddressVarString(var)
|
|
|
|
#define GET_VARO_FSTR(off) _vm->_inter->_variables->getAddressOffString(off)
|
|
|
|
|
|
|
|
#define WRITE_VAR_OFFSET(off, val) WRITE_VARO_UINT32((off), (val))
|
|
|
|
#define WRITE_VAR(var, val) WRITE_VAR_UINT32((var), (val))
|
|
|
|
#define VAR_OFFSET(off) READ_VARO_UINT32(off)
|
|
|
|
#define VAR(var) READ_VAR_UINT32(var)
|
|
|
|
|
2005-04-10 17:13:17 +00:00
|
|
|
|
2009-05-31 02:15:43 +00:00
|
|
|
// WARNING: Reordering these will invalidate save games!
|
2008-07-23 02:41:02 +00:00
|
|
|
enum Endianness {
|
|
|
|
kEndiannessLE,
|
|
|
|
kEndiannessBE
|
|
|
|
};
|
|
|
|
|
2009-05-31 02:15:43 +00:00
|
|
|
// WARNING: Reordering these will invalidate save games!
|
|
|
|
// Add new games to the bottom of the list.
|
2007-07-24 23:24:40 +00:00
|
|
|
enum GameType {
|
|
|
|
kGameTypeNone = 0,
|
|
|
|
kGameTypeGob1,
|
|
|
|
kGameTypeGob2,
|
|
|
|
kGameTypeGob3,
|
|
|
|
kGameTypeWoodruff,
|
|
|
|
kGameTypeBargon,
|
2007-08-02 22:12:20 +00:00
|
|
|
kGameTypeWeen,
|
2008-03-02 23:57:29 +00:00
|
|
|
kGameTypeLostInTime,
|
2008-08-30 23:59:46 +00:00
|
|
|
kGameTypeInca2,
|
2008-09-02 20:15:42 +00:00
|
|
|
kGameTypeDynasty,
|
2009-04-21 21:44:37 +00:00
|
|
|
kGameTypeUrban,
|
2009-08-28 18:14:55 +00:00
|
|
|
kGameTypePlaytoons,
|
2009-05-29 14:42:34 +00:00
|
|
|
kGameTypeBambou,
|
2009-04-21 21:44:37 +00:00
|
|
|
kGameTypeFascination,
|
|
|
|
kGameTypeGeisha,
|
2009-08-24 21:54:16 +00:00
|
|
|
kGameTypeAdi2,
|
2009-11-16 17:21:18 +00:00
|
|
|
kGameTypeAdi4,
|
|
|
|
kGameTypeAdibou2,
|
2012-06-14 22:51:03 +00:00
|
|
|
kGameTypeAdibou1,
|
2012-06-24 19:36:58 +00:00
|
|
|
kGameTypeAbracadabra,
|
|
|
|
kGameTypeBabaYaga,
|
2012-06-16 13:08:10 +00:00
|
|
|
kGameTypeLittleRed,
|
2012-06-24 19:36:58 +00:00
|
|
|
kGameTypeOnceUponATime, // Need more inspection to see if Baba Yaga or Abracadabra
|
2014-01-31 11:04:08 +00:00
|
|
|
kGameTypeAJWorld,
|
|
|
|
kGameTypeCrousti
|
2007-07-24 23:24:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum Features {
|
2010-09-30 12:59:18 +00:00
|
|
|
kFeaturesNone = 0,
|
|
|
|
kFeaturesCD = 1 << 0,
|
|
|
|
kFeaturesEGA = 1 << 1,
|
|
|
|
kFeaturesAdLib = 1 << 2,
|
|
|
|
kFeaturesSCNDemo = 1 << 3,
|
|
|
|
kFeaturesBATDemo = 1 << 4,
|
|
|
|
kFeatures640x480 = 1 << 5,
|
|
|
|
kFeatures800x600 = 1 << 6,
|
|
|
|
kFeaturesTrueColor = 1 << 7
|
2005-05-13 16:56:53 +00:00
|
|
|
};
|
|
|
|
|
2012-06-28 20:54:05 +00:00
|
|
|
enum EndiannessMethod {
|
|
|
|
kEndiannessMethodLE, ///< Always little endian.
|
|
|
|
kEndiannessMethodBE, ///< Always big endian.
|
|
|
|
kEndiannessMethodSystem, ///< Follows system endianness.
|
|
|
|
kEndiannessMethodAltFile ///< Different endianness in alternate file.
|
|
|
|
};
|
|
|
|
|
2006-02-24 23:31:31 +00:00
|
|
|
enum {
|
2009-04-24 18:23:17 +00:00
|
|
|
kDebugFuncOp = 1 << 0,
|
|
|
|
kDebugDrawOp = 1 << 1,
|
|
|
|
kDebugGobOp = 1 << 2,
|
|
|
|
kDebugSound = 1 << 3,
|
2009-06-22 16:30:51 +00:00
|
|
|
kDebugExpression = 1 << 4,
|
2009-04-24 18:23:17 +00:00
|
|
|
kDebugGameFlow = 1 << 5,
|
|
|
|
kDebugFileIO = 1 << 6,
|
|
|
|
kDebugSaveLoad = 1 << 7,
|
|
|
|
kDebugGraphics = 1 << 8,
|
|
|
|
kDebugVideo = 1 << 9,
|
2009-07-05 21:39:55 +00:00
|
|
|
kDebugHotspots = 1 << 10,
|
2009-04-24 22:29:17 +00:00
|
|
|
kDebugDemo = 1 << 11
|
2006-02-24 23:31:31 +00:00
|
|
|
};
|
|
|
|
|
2007-11-03 21:06:58 +00:00
|
|
|
struct GOBGameDescription;
|
|
|
|
|
2005-04-05 15:07:40 +00:00
|
|
|
class GobEngine : public Engine {
|
2008-05-08 00:47:23 +00:00
|
|
|
private:
|
|
|
|
GameType _gameType;
|
|
|
|
int32 _features;
|
|
|
|
Common::Platform _platform;
|
|
|
|
|
2012-06-28 20:54:05 +00:00
|
|
|
EndiannessMethod _endiannessMethod;
|
|
|
|
|
2008-05-23 20:40:28 +00:00
|
|
|
uint32 _pauseStart;
|
|
|
|
|
2008-11-04 16:11:40 +00:00
|
|
|
// Engine APIs
|
2009-03-01 04:42:46 +00:00
|
|
|
virtual Common::Error run();
|
2008-11-04 16:11:40 +00:00
|
|
|
virtual bool hasFeature(EngineFeature f) const;
|
|
|
|
virtual void pauseEngineIntern(bool pause);
|
2009-07-25 16:08:31 +00:00
|
|
|
virtual void syncSoundSettings();
|
2005-04-05 15:07:40 +00:00
|
|
|
|
2012-06-27 17:58:20 +00:00
|
|
|
Common::Error initGameParts();
|
|
|
|
Common::Error initGraphics();
|
2007-07-24 23:24:40 +00:00
|
|
|
|
2012-06-27 17:58:20 +00:00
|
|
|
void deinitGameParts();
|
2010-09-30 12:59:48 +00:00
|
|
|
|
2005-04-05 15:07:40 +00:00
|
|
|
public:
|
2007-03-20 14:51:57 +00:00
|
|
|
static const Common::Language _gobToScummVMLang[];
|
2005-04-05 15:07:40 +00:00
|
|
|
|
2005-04-29 15:01:03 +00:00
|
|
|
Common::RandomSource _rnd;
|
2005-05-13 21:24:30 +00:00
|
|
|
|
2006-04-18 12:39:02 +00:00
|
|
|
Common::Language _language;
|
2007-07-24 23:24:40 +00:00
|
|
|
uint16 _width;
|
|
|
|
uint16 _height;
|
|
|
|
uint8 _mode;
|
|
|
|
|
2010-09-30 12:59:48 +00:00
|
|
|
Graphics::PixelFormat _pixelFormat;
|
|
|
|
|
2009-05-31 16:59:45 +00:00
|
|
|
Common::String _startStk;
|
|
|
|
Common::String _startTot;
|
2009-05-20 23:13:44 +00:00
|
|
|
uint32 _demoIndex;
|
|
|
|
|
2006-01-14 09:57:20 +00:00
|
|
|
bool _copyProtection;
|
2007-01-25 14:18:12 +00:00
|
|
|
bool _noMusic;
|
2006-01-14 09:57:20 +00:00
|
|
|
|
2012-01-28 23:00:04 +00:00
|
|
|
GobConsole *_console;
|
|
|
|
|
2012-06-15 13:09:01 +00:00
|
|
|
bool _resourceSizeWorkaround;
|
|
|
|
|
2007-03-20 14:51:57 +00:00
|
|
|
Global *_global;
|
|
|
|
Util *_util;
|
|
|
|
DataIO *_dataIO;
|
2006-01-03 23:14:39 +00:00
|
|
|
Game *_game;
|
2008-05-08 00:47:23 +00:00
|
|
|
Sound *_sound;
|
2006-01-03 23:14:39 +00:00
|
|
|
Video *_video;
|
|
|
|
Draw *_draw;
|
|
|
|
Goblin *_goblin;
|
|
|
|
Init *_init;
|
|
|
|
Map *_map;
|
|
|
|
Mult *_mult;
|
2007-03-20 14:51:57 +00:00
|
|
|
PalAnim *_palAnim;
|
2006-01-03 23:14:39 +00:00
|
|
|
Scenery *_scenery;
|
2006-01-05 16:06:55 +00:00
|
|
|
Inter *_inter;
|
2007-04-08 00:08:26 +00:00
|
|
|
SaveLoad *_saveLoad;
|
2007-07-30 15:53:38 +00:00
|
|
|
VideoPlayer *_vidPlayer;
|
2012-06-27 22:07:29 +00:00
|
|
|
PreGob *_preGob;
|
2006-08-12 09:16:08 +00:00
|
|
|
|
2008-05-08 00:47:23 +00:00
|
|
|
const char *getLangDesc(int16 language) const;
|
2007-03-20 14:51:57 +00:00
|
|
|
void validateLanguage();
|
|
|
|
void validateVideoMode(int16 videoMode);
|
|
|
|
|
2009-06-06 16:47:21 +00:00
|
|
|
void pauseGame();
|
|
|
|
|
2012-06-28 20:54:05 +00:00
|
|
|
EndiannessMethod getEndiannessMethod() const;
|
2008-07-23 02:41:02 +00:00
|
|
|
Endianness getEndianness() const;
|
2008-05-08 00:47:23 +00:00
|
|
|
Common::Platform getPlatform() const;
|
|
|
|
GameType getGameType() const;
|
|
|
|
bool isCD() const;
|
|
|
|
bool isEGA() const;
|
2010-01-12 21:07:56 +00:00
|
|
|
bool hasAdLib() const;
|
2009-04-24 18:23:17 +00:00
|
|
|
bool isSCNDemo() const;
|
2009-04-24 22:29:17 +00:00
|
|
|
bool isBATDemo() const;
|
2010-09-30 12:58:52 +00:00
|
|
|
bool is640x480() const;
|
2009-07-07 17:11:29 +00:00
|
|
|
bool is800x600() const;
|
2010-09-30 12:59:18 +00:00
|
|
|
bool isTrueColor() const;
|
2009-05-20 23:13:44 +00:00
|
|
|
bool isDemo() const;
|
2007-07-24 23:24:40 +00:00
|
|
|
|
2012-06-15 13:09:01 +00:00
|
|
|
bool hasResourceSizeWorkaround() const;
|
|
|
|
|
2011-01-29 22:45:51 +00:00
|
|
|
bool isCurrentTot(const Common::String &tot) const;
|
|
|
|
|
2011-01-16 16:28:47 +00:00
|
|
|
void setTrueColor(bool trueColor);
|
|
|
|
|
2010-10-13 03:49:54 +00:00
|
|
|
GUI::Debugger *getDebugger() { return _console; }
|
|
|
|
|
2010-09-30 13:00:30 +00:00
|
|
|
const Graphics::PixelFormat &getPixelFormat() const;
|
|
|
|
|
2007-03-20 14:51:57 +00:00
|
|
|
GobEngine(OSystem *syst);
|
|
|
|
virtual ~GobEngine();
|
2007-11-03 21:06:58 +00:00
|
|
|
|
|
|
|
void initGame(const GOBGameDescription *gd);
|
2005-04-05 15:07:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Gob
|
2007-03-20 14:51:57 +00:00
|
|
|
|
|
|
|
#endif // GOB_GOB_H
|