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.
|
2003-09-28 15:50:47 +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
|
|
|
|
* 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
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-09-28 15:50:47 +00:00
|
|
|
*
|
2006-02-11 10:07:12 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2003-09-28 15:50:47 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QUEEN_H
|
|
|
|
#define QUEEN_H
|
|
|
|
|
2006-09-23 00:42:35 +00:00
|
|
|
#include "engines/engine.h"
|
2003-09-28 15:50:47 +00:00
|
|
|
|
2005-05-10 23:17:38 +00:00
|
|
|
namespace Common {
|
|
|
|
class InSaveFile;
|
|
|
|
}
|
2003-11-10 01:04:12 +00:00
|
|
|
|
2004-03-23 20:34:19 +00:00
|
|
|
#if defined(_WIN32_WCE) && (_WIN32_WCE <= 300)
|
|
|
|
|
2006-06-10 22:26:46 +00:00
|
|
|
#include "common/endian.h"
|
|
|
|
|
2004-03-23 20:34:19 +00:00
|
|
|
FORCEINLINE int16 READ_BE_INT16(const void *ptr) {
|
|
|
|
uint16 result;
|
|
|
|
char dummy[2];
|
|
|
|
result = READ_BE_UINT16(ptr);
|
|
|
|
strcpy(dummy, "x"); // Hello, I'm a drunk optimizer. Thanks for helping me.
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define READ_BE_INT16 READ_BE_UINT16
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2003-10-03 19:47:41 +00:00
|
|
|
namespace Queen {
|
|
|
|
|
2004-01-12 13:40:02 +00:00
|
|
|
struct GameStateHeader {
|
|
|
|
uint32 version;
|
|
|
|
uint32 flags;
|
|
|
|
uint32 dataSize;
|
|
|
|
char description[32];
|
2006-07-21 21:25:17 +00:00
|
|
|
};
|
2004-11-10 17:49:25 +00:00
|
|
|
|
2003-12-19 09:22:20 +00:00
|
|
|
class BamScene;
|
2004-01-05 13:40:28 +00:00
|
|
|
class BankManager;
|
2003-12-11 22:16:35 +00:00
|
|
|
class Command;
|
2003-12-26 12:58:27 +00:00
|
|
|
class Debugger;
|
2003-12-11 22:16:35 +00:00
|
|
|
class Display;
|
2003-10-11 10:24:12 +00:00
|
|
|
class Graphics;
|
2004-01-08 14:10:32 +00:00
|
|
|
class Grid;
|
2003-10-23 06:44:35 +00:00
|
|
|
class Input;
|
2003-10-05 16:07:07 +00:00
|
|
|
class Logic;
|
2003-12-11 22:16:35 +00:00
|
|
|
class Resource;
|
2003-10-21 12:29:37 +00:00
|
|
|
class Sound;
|
2003-12-11 22:16:35 +00:00
|
|
|
class Walk;
|
2003-09-28 15:50:47 +00:00
|
|
|
|
|
|
|
class QueenEngine : public Engine {
|
|
|
|
public:
|
2003-12-03 10:33:01 +00:00
|
|
|
|
2006-02-12 01:42:34 +00:00
|
|
|
QueenEngine(OSystem *syst);
|
2003-09-28 15:50:47 +00:00
|
|
|
virtual ~QueenEngine();
|
|
|
|
|
2003-12-19 09:22:20 +00:00
|
|
|
BamScene *bam() const { return _bam; }
|
2004-01-05 13:40:28 +00:00
|
|
|
BankManager *bankMan() const { return _bankMan; }
|
2003-12-11 22:16:35 +00:00
|
|
|
Command *command() const { return _command; }
|
2003-12-26 12:58:27 +00:00
|
|
|
Debugger *debugger() const { return _debugger; }
|
2003-12-11 22:16:35 +00:00
|
|
|
Display *display() const { return _display; }
|
|
|
|
Graphics *graphics() const { return _graphics; }
|
2004-01-08 14:10:32 +00:00
|
|
|
Grid *grid() const { return _grid; }
|
2003-12-11 22:16:35 +00:00
|
|
|
Input *input() const { return _input; }
|
|
|
|
Logic *logic() const { return _logic; }
|
|
|
|
Resource *resource() const { return _resource; }
|
|
|
|
Sound *sound() const { return _sound; }
|
|
|
|
Walk *walk() const { return _walk; }
|
|
|
|
|
|
|
|
Common::RandomSource randomizer;
|
|
|
|
|
2004-01-06 16:53:35 +00:00
|
|
|
void registerDefaultSettings();
|
|
|
|
void checkOptionSettings();
|
|
|
|
void readOptionSettings();
|
|
|
|
void writeOptionSettings();
|
|
|
|
|
2004-01-08 10:25:18 +00:00
|
|
|
int talkSpeed() const { return _talkSpeed; }
|
|
|
|
void talkSpeed(int speed) { _talkSpeed = speed; }
|
|
|
|
bool subtitles() const { return _subtitles; }
|
|
|
|
void subtitles(bool enable) { _subtitles = enable; }
|
2004-10-10 17:12:50 +00:00
|
|
|
void quitGame() { _quit = true; }
|
2004-01-08 10:25:18 +00:00
|
|
|
|
|
|
|
void update(bool checkPlayerInput = false);
|
|
|
|
|
2005-08-11 18:07:47 +00:00
|
|
|
bool canLoadOrSave() const;
|
2004-01-12 13:40:02 +00:00
|
|
|
void saveGameState(uint16 slot, const char *desc);
|
|
|
|
void loadGameState(uint16 slot);
|
|
|
|
void makeGameStateName(uint16 slot, char *buf);
|
|
|
|
void findGameStateDescriptions(char descriptions[100][32]);
|
2005-05-10 23:17:38 +00:00
|
|
|
Common::InSaveFile *readGameStateHeader(uint16 slot, GameStateHeader *gsh);
|
2004-01-12 13:40:02 +00:00
|
|
|
|
|
|
|
enum {
|
2005-08-11 18:07:47 +00:00
|
|
|
SAVESTATE_CUR_VER = 1,
|
|
|
|
SAVESTATE_MAX_NUM = 100,
|
|
|
|
SAVESTATE_MAX_SIZE = 30000,
|
|
|
|
|
|
|
|
AUTOSAVE_SLOT = 0xFF,
|
|
|
|
|
|
|
|
MIN_TEXT_SPEED = 4,
|
2007-03-20 23:24:54 +00:00
|
|
|
MAX_TEXT_SPEED = 100
|
2004-01-12 13:40:02 +00:00
|
|
|
};
|
|
|
|
|
2003-09-28 15:50:47 +00:00
|
|
|
protected:
|
|
|
|
|
2006-09-16 19:31:23 +00:00
|
|
|
GUI::Debugger *getDebugger();
|
2003-09-28 15:50:47 +00:00
|
|
|
|
2004-11-23 00:03:25 +00:00
|
|
|
int go();
|
2006-04-15 20:36:41 +00:00
|
|
|
int init();
|
2003-09-28 15:50:47 +00:00
|
|
|
|
2004-01-08 10:25:18 +00:00
|
|
|
|
|
|
|
int _talkSpeed;
|
|
|
|
bool _subtitles;
|
2004-10-10 17:12:50 +00:00
|
|
|
bool _quit;
|
2004-12-02 21:24:27 +00:00
|
|
|
uint32 _lastSaveTime;
|
2007-04-02 18:59:00 +00:00
|
|
|
uint32 _lastUpdateTime;
|
2004-01-08 10:25:18 +00:00
|
|
|
|
2003-12-19 09:22:20 +00:00
|
|
|
BamScene *_bam;
|
2004-01-05 13:40:28 +00:00
|
|
|
BankManager *_bankMan;
|
2003-12-11 22:16:35 +00:00
|
|
|
Command *_command;
|
2003-12-26 12:58:27 +00:00
|
|
|
Debugger *_debugger;
|
2003-12-11 22:16:35 +00:00
|
|
|
Display *_display;
|
2003-12-03 10:33:01 +00:00
|
|
|
Graphics *_graphics;
|
2004-01-08 14:10:32 +00:00
|
|
|
Grid *_grid;
|
2003-12-03 10:33:01 +00:00
|
|
|
Input *_input;
|
|
|
|
Logic *_logic;
|
2003-12-11 22:16:35 +00:00
|
|
|
Resource *_resource;
|
2003-12-03 10:33:01 +00:00
|
|
|
Sound *_sound;
|
2003-12-11 22:16:35 +00:00
|
|
|
Walk *_walk;
|
2003-09-28 15:50:47 +00:00
|
|
|
};
|
|
|
|
|
2003-10-03 19:47:41 +00:00
|
|
|
} // End of namespace Queen
|
|
|
|
|
2003-09-28 15:50:47 +00:00
|
|
|
#endif
|