scummvm/engines/queen/queen.h

169 lines
3.9 KiB
C
Raw Normal View History

/* 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2003-09-28 15:50:47 +00:00
*
* $URL$
* $Id$
2003-09-28 15:50:47 +00:00
*
*/
#ifndef QUEEN_H
#define QUEEN_H
#include "engines/engine.h"
#include "common/random.h"
2003-09-28 15:50:47 +00:00
namespace Common {
class SeekableReadStream;
}
#if defined(_WIN32_WCE) && (_WIN32_WCE <= 300)
2006-06-10 22:26:46 +00:00
#include "common/endian.h"
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
/**
* This is the namespace of the Queen engine.
*
* Status of this engine: ???
*
* Supported games:
* - ???
*/
2003-10-03 19:47:41 +00:00
namespace Queen {
struct GameStateHeader {
uint32 version;
uint32 flags;
uint32 dataSize;
char description[32];
};
class BamScene;
class BankManager;
2003-12-11 22:16:35 +00:00
class Command;
class Debugger;
2003-12-11 22:16:35 +00:00
class Display;
class Graphics;
class Grid;
class Input;
class Logic;
2003-12-11 22:16:35 +00:00
class Resource;
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
QueenEngine(OSystem *syst);
2003-09-28 15:50:47 +00:00
virtual ~QueenEngine();
BamScene *bam() const { return _bam; }
BankManager *bankMan() const { return _bankMan; }
2003-12-11 22:16:35 +00:00
Command *command() const { return _command; }
Debugger *debugger() const { return _debugger; }
2003-12-11 22:16:35 +00:00
Display *display() const { return _display; }
Graphics *graphics() const { return _graphics; }
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;
void registerDefaultSettings();
void checkOptionSettings();
void readOptionSettings();
void writeOptionSettings();
int talkSpeed() const { return _talkSpeed; }
void talkSpeed(int speed) { _talkSpeed = speed; }
bool subtitles() const { return _subtitles; }
void subtitles(bool enable) { _subtitles = enable; }
void update(bool checkPlayerInput = false);
2005-08-11 18:07:47 +00:00
bool canLoadOrSave() const;
Common::Error saveGameState(int slot, const char *desc);
Common::Error loadGameState(int slot);
void makeGameStateName(int slot, char *buf) const;
int getGameStateSlot(const char *filename) const;
void findGameStateDescriptions(char descriptions[100][32]);
Common::SeekableReadStream *readGameStateHeader(int slot, GameStateHeader *gsh);
enum {
2005-08-11 18:07:47 +00:00
SAVESTATE_CUR_VER = 1,
SAVESTATE_MAX_NUM = 100,
SAVESTATE_MAX_SIZE = 30000,
SLOT_LISTPREFIX = -2,
SLOT_AUTOSAVE = -1,
SLOT_QUICKSAVE = 0,
2005-08-11 18:07:47 +00:00
MIN_TEXT_SPEED = 4,
MAX_TEXT_SPEED = 100
};
2003-09-28 15:50:47 +00:00
protected:
// Engine APIs
virtual Common::Error run();
virtual GUI::Debugger *getDebugger();
virtual bool hasFeature(EngineFeature f) const;
virtual void syncSoundSettings();
2003-09-28 15:50:47 +00:00
int _talkSpeed;
bool _subtitles;
2004-12-02 21:24:27 +00:00
uint32 _lastSaveTime;
uint32 _lastUpdateTime;
BamScene *_bam;
BankManager *_bankMan;
2003-12-11 22:16:35 +00:00
Command *_command;
Debugger *_debugger;
2003-12-11 22:16:35 +00:00
Display *_display;
2003-12-03 10:33:01 +00:00
Graphics *_graphics;
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