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.
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
|
|
* 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
|
|
|
*
|
2006-02-11 10:11:37 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
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
|
|
|
|
|
|
|
#include "common/system.h"
|
2006-11-19 17:52:52 +00:00
|
|
|
#include "common/savefile.h"
|
2005-04-05 15:07:40 +00:00
|
|
|
|
2009-06-06 16:47:21 +00:00
|
|
|
#include "gui/dialog.h"
|
|
|
|
|
2006-09-23 00:42:35 +00:00
|
|
|
#include "engines/engine.h"
|
2006-01-03 23:14:39 +00:00
|
|
|
|
2009-06-06 16:47:21 +00:00
|
|
|
namespace GUI {
|
|
|
|
class StaticTextWidget;
|
|
|
|
}
|
|
|
|
|
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;
|
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,
|
2009-04-29 16:36:08 +00:00
|
|
|
kGameTypeAdibouUnknown
|
2007-07-24 23:24:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum Features {
|
2009-04-24 18:23:17 +00:00
|
|
|
kFeaturesNone = 0,
|
|
|
|
kFeaturesCD = 1 << 0,
|
|
|
|
kFeaturesEGA = 1 << 1,
|
|
|
|
kFeaturesAdlib = 1 << 2,
|
|
|
|
kFeatures640 = 1 << 3,
|
2009-04-24 22:29:17 +00:00
|
|
|
kFeaturesSCNDemo = 1 << 4,
|
2009-07-07 12:03:27 +00:00
|
|
|
kFeaturesBATDemo = 1 << 5,
|
2009-08-24 21:54:16 +00:00
|
|
|
kFeatures800x600 = 1 << 6
|
2005-05-13 16:56:53 +00:00
|
|
|
};
|
|
|
|
|
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;
|
|
|
|
|
2009-06-06 16:47:21 +00:00
|
|
|
class PauseDialog : public GUI::Dialog {
|
|
|
|
public:
|
|
|
|
PauseDialog();
|
|
|
|
|
|
|
|
virtual void reflowLayout();
|
|
|
|
virtual void handleKeyDown(Common::KeyState state);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Common::String _message;
|
|
|
|
GUI::StaticTextWidget *_text;
|
|
|
|
};
|
|
|
|
|
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;
|
|
|
|
|
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
|
|
|
|
2007-07-24 23:24:40 +00:00
|
|
|
bool initGameParts();
|
|
|
|
void deinitGameParts();
|
|
|
|
|
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;
|
|
|
|
|
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
|
|
|
|
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;
|
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();
|
|
|
|
|
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;
|
|
|
|
bool is640() const;
|
|
|
|
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;
|
2009-07-07 17:11:29 +00:00
|
|
|
bool is800x600() const;
|
2009-05-20 23:13:44 +00:00
|
|
|
bool isDemo() const;
|
2007-07-24 23:24:40 +00:00
|
|
|
|
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
|