ScummVM API documentation
queen.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef QUEEN_QUEEN_H
23#define QUEEN_QUEEN_H
24
25#include "engines/engine.h"
26#include "common/random.h"
27
28namespace Common {
29class SeekableReadStream;
30}
31
40namespace Queen {
41
42enum QUEENActions {
43 kActionNone,
44 kActionFastMode,
45 kActionSkipText,
46 kActionScrollUp,
47 kActionScrollDown,
48 kActionInvSlot1,
49 kActionInvSlot2,
50 kActionInvSlot3,
51 kActionInvSlot4,
52 kActionSkipCutaway,
53 kActionJournal,
54 kActionSave,
55 kActionLoad,
56 kActionOpen,
57 kActionClose,
58 kActionMove,
59 kActionGive,
60 kActionLook,
61 kActionPickUp,
62 kActionTalk,
63 kActionUse,
64 kActionCloseJournal,
65};
66
68 uint32 version;
69 uint32 flags;
70 uint32 dataSize;
71 char description[32];
72};
73
74class BamScene;
75class BankManager;
76class Command;
77class Debugger;
78class Display;
79class Graphics;
80class Grid;
81class Input;
82class Logic;
83class Resource;
84class Sound;
85class Walk;
86
87class QueenEngine : public Engine {
88public:
89
90 QueenEngine(OSystem *syst);
91 ~QueenEngine() override;
92
93 BamScene *bam() const { return _bam; }
94 BankManager *bankMan() const { return _bankMan; }
95 Command *command() const { return _command; }
96 Debugger *debugger() const { return _debugger; }
97 Display *display() const { return _display; }
98 Graphics *graphics() const { return _graphics; }
99 Grid *grid() const { return _grid; }
100 Input *input() const { return _input; }
101 Logic *logic() const { return _logic; }
102 Resource *resource() const { return _resource; }
103 Sound *sound() const { return _sound; }
104 Walk *walk() const { return _walk; }
105
106 Common::RandomSource randomizer;
107
108 void registerDefaultSettings();
109 void checkOptionSettings();
110 void readOptionSettings();
111 void writeOptionSettings();
112
113 int talkSpeed() const { return _talkSpeed; }
114 void talkSpeed(int speed) { _talkSpeed = speed; }
115 bool subtitles() const { return _subtitles; }
116 void subtitles(bool enable) { _subtitles = enable; }
117
118 void update(bool checkPlayerInput = false);
119
120 bool canLoadOrSave() const;
121 bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
122 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
123 Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
124 Common::Error loadGameState(int slot) override;
125 int getAutosaveSlot() const override { return 99; }
126 Common::String getSaveStateName(int slot) const override;
127 void makeGameStateName(int slot, char *buf) const;
128 int getGameStateSlot(const char *filename) const;
129 void findGameStateDescriptions(char descriptions[100][32]);
130 Common::SeekableReadStream *readGameStateHeader(int slot, GameStateHeader *gsh);
131
132 enum {
133 SAVESTATE_CUR_VER = 1,
134 SAVESTATE_MAX_NUM = 100,
135 SAVESTATE_MAX_SIZE = 30000,
136
137 SLOT_LISTPREFIX = -2,
138 SLOT_AUTOSAVE = -1,
139 SLOT_QUICKSAVE = 0,
140
141 MIN_TEXT_SPEED = 4,
142 MAX_TEXT_SPEED = 100
143 };
144
145protected:
146
147 // Engine APIs
148 Common::Error run() override;
149 bool hasFeature(EngineFeature f) const override;
150 void syncSoundSettings() override;
151
152
153 int _talkSpeed;
154 bool _subtitles;
155 uint32 _lastUpdateTime;
156 bool _gameStarted;
157
158 BamScene *_bam;
159 BankManager *_bankMan;
160 Command *_command;
161 Debugger *_debugger;
162 Display *_display;
163 Graphics *_graphics;
164 Grid *_grid;
165 Input *_input;
166 Logic *_logic;
167 Resource *_resource;
168 Sound *_sound;
169 Walk *_walk;
170};
171
172} // End of namespace Queen
173
174#endif
Definition: error.h:81
Definition: random.h:44
Definition: stream.h:745
Definition: str.h:59
Definition: ustr.h:57
Definition: engine.h:149
EngineFeature
Definition: engine.h:282
Definition: system.h:166
Definition: graphics.h:224
Definition: bankman.h:32
Definition: command.h:93
Definition: debug.h:31
Definition: display.h:40
Definition: grid.h:38
Definition: input.h:39
Definition: logic.h:61
Definition: queen.h:87
void syncSoundSettings() override
Common::Error loadGameState(int slot) override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Common::Error run() override
Common::String getSaveStateName(int slot) const override
int getAutosaveSlot() const override
Definition: queen.h:125
bool hasFeature(EngineFeature f) const override
Definition: resource.h:41
Definition: sound.h:56
Definition: walk.h:63
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: bankman.h:28
Definition: queen.h:67