ScummVM API documentation
sludge.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 SLUDGE_SLUDGE_H
23#define SLUDGE_SLUDGE_H
24
25#include "common/hash-str.h"
26
27#include "engines/engine.h"
28
29namespace Common {
30class RandomSource;
31}
32
33namespace Graphics {
34struct PixelFormat;
35}
36
37namespace Sludge {
38
39class CursorManager;
40class EventManager;
41class FatalMsgManager;
42class FloorManager;
43class GraphicsManager;
44class LanguageManager;
45class ObjectManager;
46class PeopleManager;
47class ResourceManager;
48class RegionManager;
49class SoundManager;
50class SpeechManager;
51class StatusBarManager;
52class TextManager;
53class Timer;
54
55struct SludgeGameDescription;
56
57#define IN_THE_CENTRE 65535
58
59// debug channels
60enum {
61 kSludgeDebugFatal = 1,
62 kSludgeDebugDataLoad,
63 kSludgeDebugStackMachine,
64 kSludgeDebugBuiltin,
65 kSludgeDebugGraphics,
66 kSludgeDebugZBuffer,
67 kSludgeDebugSound,
68};
69
70class SludgeEngine: public Engine {
71protected:
72 // Engine APIs
73 Common::Error run() override;
74
75public:
76 // global String variables
77 Common::String launchNext;
78 Common::String loadNow;
79 Common::String gamePath;
80
81 // timer
82 Timer *_timer;
83
84 // managers
85 ResourceManager *_resMan;
86 LanguageManager *_languageMan;
87 ObjectManager *_objMan;
88 GraphicsManager *_gfxMan;
89 EventManager *_evtMan;
90 SoundManager *_soundMan;
91 TextManager *_txtMan;
92 CursorManager *_cursorMan;
93 SpeechManager *_speechMan;
94 RegionManager *_regionMan;
95 PeopleManager *_peopleMan;
96 FloorManager *_floorMan;
97 FatalMsgManager *_fatalMan;
98 StatusBarManager *_statusBar;
99
100 bool _dumpScripts;
101
102 SludgeEngine(OSystem *syst, const SludgeGameDescription *gameDesc);
103 ~SludgeEngine() override;
104
105 uint getLanguageID() const;
106 const char *getGameId() const;
107 uint32 getFeatures() const;
108 Common::String getTargetName() const { return _targetName; }
109 Common::Language getLanguage() const;
110 Graphics::PixelFormat *getScreenPixelFormat() const;
111 Graphics::PixelFormat *getOrigPixelFormat() const;
112 Common::RandomSource *getRandomSource() const { return _rnd; };
113
114 const char *getGameFile() const;
115
116 bool hasFeature(EngineFeature f) const override;
117
118 bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
119 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
120
121 Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave) override;
122 Common::Error loadGameState(int slot) override;
123
124 const SludgeGameDescription *_gameDescription;
125
127
128private:
130 Graphics::PixelFormat *_pixelFormat;
131 Graphics::PixelFormat *_origFormat;
132};
133
134extern SludgeEngine *g_sludge;
135
136} // End of namespace Sludge
137
138#endif
Definition: error.h:81
Definition: random.h:44
Definition: str.h:59
Definition: ustr.h:57
Definition: engine.h:149
const Common::String _targetName
Definition: engine.h:186
EngineFeature
Definition: engine.h:282
Definition: graphics.h:38
Definition: system.h:166
Definition: cursors.h:36
Definition: event.h:56
Definition: newfatal.h:29
Definition: floor.h:48
Definition: graphics.h:64
Definition: language.h:28
Definition: objtypes.h:44
Definition: people.h:100
Definition: region.h:34
Definition: fileset.h:28
Definition: sludge.h:70
Common::Error loadGameState(int slot) override
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave) override
bool hasFeature(EngineFeature f) const override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Common::Error run() override
Definition: sound.h:49
Definition: speech.h:44
Definition: statusba.h:40
Definition: fonttext.h:39
Definition: timing.h:26
Language
Definition: language.h:45
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: pixelformat.h:138
Definition: detection.h:27