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 
28 namespace Common {
29 class SeekableReadStream;
30 }
31 
40 namespace Queen {
41 
43  uint32 version;
44  uint32 flags;
45  uint32 dataSize;
46  char description[32];
47 };
48 
49 class BamScene;
50 class BankManager;
51 class Command;
52 class Debugger;
53 class Display;
54 class Graphics;
55 class Grid;
56 class Input;
57 class Logic;
58 class Resource;
59 class Sound;
60 class Walk;
61 
62 class QueenEngine : public Engine {
63 public:
64 
65  QueenEngine(OSystem *syst);
66  ~QueenEngine() override;
67 
68  BamScene *bam() const { return _bam; }
69  BankManager *bankMan() const { return _bankMan; }
70  Command *command() const { return _command; }
71  Debugger *debugger() const { return _debugger; }
72  Display *display() const { return _display; }
73  Graphics *graphics() const { return _graphics; }
74  Grid *grid() const { return _grid; }
75  Input *input() const { return _input; }
76  Logic *logic() const { return _logic; }
77  Resource *resource() const { return _resource; }
78  Sound *sound() const { return _sound; }
79  Walk *walk() const { return _walk; }
80 
81  Common::RandomSource randomizer;
82 
83  void registerDefaultSettings();
84  void checkOptionSettings();
85  void readOptionSettings();
86  void writeOptionSettings();
87 
88  int talkSpeed() const { return _talkSpeed; }
89  void talkSpeed(int speed) { _talkSpeed = speed; }
90  bool subtitles() const { return _subtitles; }
91  void subtitles(bool enable) { _subtitles = enable; }
92 
93  void update(bool checkPlayerInput = false);
94 
95  bool canLoadOrSave() const;
96  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
97  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
98  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
99  Common::Error loadGameState(int slot) override;
100  int getAutosaveSlot() const override { return 99; }
101  Common::String getSaveStateName(int slot) const override;
102  void makeGameStateName(int slot, char *buf) const;
103  int getGameStateSlot(const char *filename) const;
104  void findGameStateDescriptions(char descriptions[100][32]);
105  Common::SeekableReadStream *readGameStateHeader(int slot, GameStateHeader *gsh);
106 
107  enum {
108  SAVESTATE_CUR_VER = 1,
109  SAVESTATE_MAX_NUM = 100,
110  SAVESTATE_MAX_SIZE = 30000,
111 
112  SLOT_LISTPREFIX = -2,
113  SLOT_AUTOSAVE = -1,
114  SLOT_QUICKSAVE = 0,
115 
116  MIN_TEXT_SPEED = 4,
117  MAX_TEXT_SPEED = 100
118  };
119 
120 protected:
121 
122  // Engine APIs
123  Common::Error run() override;
124  bool hasFeature(EngineFeature f) const override;
125  void syncSoundSettings() override;
126 
127 
128  int _talkSpeed;
129  bool _subtitles;
130  uint32 _lastUpdateTime;
131  bool _gameStarted;
132 
133  BamScene *_bam;
134  BankManager *_bankMan;
135  Command *_command;
136  Debugger *_debugger;
137  Display *_display;
138  Graphics *_graphics;
139  Grid *_grid;
140  Input *_input;
141  Logic *_logic;
142  Resource *_resource;
143  Sound *_sound;
144  Walk *_walk;
145 };
146 
147 } // End of namespace Queen
148 
149 #endif
Definition: debug.h:31
Definition: str.h:59
EngineFeature
Definition: engine.h:253
Definition: error.h:84
Definition: grid.h:38
Definition: queen.h:62
Definition: random.h:44
Definition: queen.h:42
Definition: bankman.h:32
Definition: walk.h:63
Definition: stream.h:745
Definition: display.h:40
Definition: bankman.h:28
Definition: logic.h:61
Definition: ustr.h:57
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: resource.h:41
Definition: command.h:93
int getAutosaveSlot() const override
Definition: queen.h:100
Definition: system.h:161
Definition: sound.h:56
Definition: engine.h:144
Definition: input.h:34
Definition: graphics.h:224