ScummVM API documentation
supernova.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 SUPERNOVA_SUPERNOVA_H
23#define SUPERNOVA_SUPERNOVA_H
24
25#include "common/array.h"
26#include "common/events.h"
27#include "common/random.h"
28#include "common/scummsys.h"
29#include "engines/engine.h"
30#include "common/file.h"
31
32#include "supernova/console.h"
33#include "supernova/graphics.h"
34#include "supernova/msn_def.h"
35#include "supernova/room.h"
36#include "supernova/sound.h"
37#include "supernova/imageid.h"
38#include "supernova/game-manager.h"
39
40namespace Common {
41 class MemoryReadWriteStream;
42}
43
44namespace Supernova {
45
46#define SAVEGAME_HEADER MKTAG('M','S','N','1')
47#define SAVEGAME_HEADER2 MKTAG('M','S','N','2')
48#define SAVEGAME_VERSION 10
49
50#define SUPERNOVA_DAT "supernova.dat"
51#define SUPERNOVA_DAT_VERSION 4
52
53class GuiElement;
54class ResourceManager;
55class Sound;
56class console;
57class GameManager;
58class GameManager1;
59class Screen;
60
61class SupernovaEngine : public Engine {
62public:
63 explicit SupernovaEngine(OSystem *syst);
64 ~SupernovaEngine() override;
65
66 Common::Error run() override;
67 Common::Error loadGameState(int slot) override;
68 bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
69 Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
70 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
71 bool hasFeature(EngineFeature f) const override;
72 void pauseEngineIntern(bool pause) override;
73
74 GameManager *_gm;
75 Sound *_sound;
76 ResourceManager *_resMan;
77 Screen *_screen;
78 bool _allowLoadGame;
79 bool _allowSaveGame;
80 Common::StringArray _gameStrings;
81 Common::String _nullString;
82 int _sleepAuoSaveVersion;
83 Common::MemoryReadWriteStream* _sleepAutoSave;
84
85 uint _delay;
86 int _textSpeed;
87 char _MSPart;
88 bool _improved;
89
90 Common::Error loadGameStrings();
91 void init();
92 Common::String getSaveStateName(int slot) const override;
93 bool loadGame(int slot);
94 bool saveGame(int slot, const Common::String &description);
95 bool serialize(Common::WriteStream *out);
96 bool deserialize(Common::ReadStream *in, int version);
97 bool quitGameDialog();
98 void errorTempSave(bool saving);
99 void setTextSpeed();
100 const Common::String &getGameString(int idx) const;
101 void setGameString(int idx, const Common::String &string);
102 void showHelpScreen1();
103 void showHelpScreen2();
104 Common::SeekableReadStream *getBlockFromDatFile(Common::String name);
105 Common::Error showTextReader(const char *extension);
106
107 // forwarding calls
108 void playSound(AudioId sample);
109 void playSound(MusicId index);
110 void paletteFadeIn();
111 void paletteFadeOut(int minBrightness = 0);
112 void paletteBrightness();
113 void renderImage(int section);
114 void renderImage(ImageId id, bool removeImage = false);
115 bool setCurrentImage(int filenumber);
116 void saveScreen(int x, int y, int width, int height);
117 void saveScreen(const GuiElement &guiElement);
118 void restoreScreen();
119 void renderRoom(Room &room);
120 void renderMessage(const char *text, MessagePosition position = kMessageNormal);
121 void renderMessage(const Common::String &text, MessagePosition position = kMessageNormal);
122 void renderMessage(int stringId, MessagePosition position = kMessageNormal,
123 Common::String var1 = "", Common::String var2 = "");
124 void renderMessage(int stringId, int x, int y);
125 void removeMessage();
126 void renderText(const uint16 character);
127 void renderText(const char *text);
128 void renderText(const Common::String &text);
129 void renderText(int stringId);
130 void renderText(const uint16 character, int x, int y, byte color);
131 void renderText(const char *text, int x, int y, byte color);
132 void renderText(const Common::String &text, int x, int y, byte color);
133 void renderText(int stringId, int x, int y, byte color);
134 void renderText(const GuiElement &guiElement);
135 void renderBox(int x, int y, int width, int height, byte color);
136 void renderBox(const GuiElement &guiElement);
137 void setColor63(byte value);
138 void stopSound();
139};
140
141enum SUPERNOVAAction {
142 kActionNone,
143 kActionPause,
144 kActionQuit,
145 kActionSkip,
146 kActionSkipLine,
147 kActionHelp,
148 kActionInstr,
149 kActionInfo,
150 kActionSpeed,
151 kActionGo,
152 kActionLook,
153 kActionTake,
154 kActionOpen,
155 kActionClose,
156 kActionPush,
157 kActionPull,
158 kActionUse,
159 kActionTalk,
160 kActionGive,
161 kActionUp,
162 kActionDown,
163 kActionPgUp,
164 kActionPgDown,
165 kActionExit,
166 kActionOfficeManager,
167 kActionPhone,
168 kActionProText,
169 kActionCalculata,
170};
171
172}
173
174#endif
Definition: error.h:81
Definition: memstream.h:283
Definition: stream.h:385
Definition: stream.h:745
Definition: str.h:59
Definition: ustr.h:57
Definition: stream.h:77
Definition: engine.h:149
EngineFeature
Definition: engine.h:282
Definition: system.h:166
Definition: game-manager.h:101
Definition: game-manager.h:63
Definition: resman.h:41
Definition: room.h:39
Definition: screen.h:124
Definition: sound.h:85
Definition: supernova.h:61
void pauseEngineIntern(bool pause) override
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Common::String getSaveStateName(int slot) const override
Common::Error run() override
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
bool hasFeature(EngineFeature f) const override
Common::Error loadGameState(int slot) override
Definition: algorithm.h:29
Definition: atari-screen.h:58