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 
29 namespace Common {
30 class RandomSource;
31 }
32 
33 namespace Graphics {
34 struct PixelFormat;
35 }
36 
37 namespace Sludge {
38 
39 class CursorManager;
40 class EventManager;
41 class FatalMsgManager;
42 class FloorManager;
43 class GraphicsManager;
44 class LanguageManager;
45 class ObjectManager;
46 class PeopleManager;
47 class ResourceManager;
48 class RegionManager;
49 class SoundManager;
50 class SpeechManager;
51 class StatusBarManager;
52 class TextManager;
53 class Timer;
54 
55 struct SludgeGameDescription;
56 
57 #define IN_THE_CENTRE 65535
58 
59 // debug channels
60 enum {
61  kSludgeDebugFatal = 1,
62  kSludgeDebugDataLoad,
63  kSludgeDebugStackMachine,
64  kSludgeDebugBuiltin,
65  kSludgeDebugGraphics,
66  kSludgeDebugZBuffer,
67  kSludgeDebugSound,
68 };
69 
70 class SludgeEngine: public Engine {
71 protected:
72  // Engine APIs
73  Common::Error run() override;
74 
75 public:
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 
126  Common::HashMap<Common::String, int> _saveNameToSlot;
127 
128 private:
129  Common::RandomSource *_rnd;
130  Graphics::PixelFormat *_pixelFormat;
131  Graphics::PixelFormat *_origFormat;
132 };
133 
134 extern SludgeEngine *g_sludge;
135 
136 } // End of namespace Sludge
137 
138 #endif
Definition: statusba.h:40
Definition: str.h:59
Definition: people.h:100
EngineFeature
Definition: engine.h:260
Definition: error.h:81
Definition: pixelformat.h:138
Definition: detection.h:27
Definition: region.h:34
Definition: newfatal.h:29
Definition: random.h:44
Definition: graphics.h:64
Definition: fileset.h:28
Definition: speech.h:44
Definition: sludge.h:70
Definition: event.h:56
Definition: fonttext.h:39
Definition: ustr.h:57
Definition: timing.h:26
Definition: builtin.h:27
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: language.h:28
Definition: graphics.h:38
Definition: floor.h:48
Definition: objtypes.h:44
Definition: system.h:163
Definition: engine.h:146
Definition: cursors.h:36
Definition: sound.h:49
Language
Definition: language.h:45