ScummVM API documentation
mads.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 MADS_MADS_H
23 #define MADS_MADS_H
24 
25 #include "common/scummsys.h"
26 #include "common/system.h"
27 #include "common/error.h"
28 #include "common/random.h"
29 #include "common/util.h"
30 #include "engines/engine.h"
31 #include "graphics/surface.h"
32 #include "mads/conversations.h"
33 #include "mads/debugger.h"
34 #include "mads/dialogs.h"
35 #include "mads/events.h"
36 #include "mads/font.h"
37 #include "mads/game.h"
38 #include "mads/screen.h"
39 #include "mads/msurface.h"
40 #include "mads/resources.h"
41 #include "mads/sound.h"
42 #include "mads/detection.h"
43 
52 namespace MADS {
53 
54 #define DEBUG_BASIC 1
55 #define DEBUG_INTERMEDIATE 2
56 #define DEBUG_DETAILED 3
57 
58 enum MADSDebugChannels {
59  kDebugPath = 1 << 0,
60  kDebugScripts = 1 << 1,
61  kDebugGraphics = 1 << 2
62 };
63 
64 enum ScreenFade {
65  SCREEN_FADE_SMOOTH = 0,
66  SCREEN_FADE_MEDIUM = 1,
67  SCREEN_FADE_FAST = 2
68 };
69 
70 
71 class MADSEngine : public Engine {
72 private:
73  const MADSGameDescription *_gameDescription;
74  Common::RandomSource _randomSource;
75 
79  void initialize();
80 
81  void loadOptions();
82 protected:
83  // Engine APIs
84  Common::Error run() override;
85  bool hasFeature(EngineFeature f) const override;
86 public:
87  Debugger *_debugger;
88  Dialogs *_dialogs;
89  EventsManager *_events;
90  Font *_font;
91  Game *_game;
92  GameConversations * _gameConv;
93  Palette *_palette;
94  Resources *_resources;
95  Screen *_screen;
96  SoundManager *_sound;
97  AudioPlayer *_audio;
98  bool _easyMouse;
99  bool _invObjectsAnimated;
100  bool _textWindowStill;
101  ScreenFade _screenFade;
102  bool _musicFlag;
103  bool _soundFlag;
104  bool _dithering;
105  bool _disableFastwalk;
106 public:
107  MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc);
108  ~MADSEngine() override;
109 
110  uint32 getFeatures() const;
111  Common::Language getLanguage() const;
112  Common::Platform getPlatform() const;
113  uint16 getVersion() const;
114  uint32 getGameID() const;
115  uint32 getGameFeatures() const;
116  bool isDemo() const;
117 
118  int getRandomNumber(int maxNumber);
119  int getRandomNumber(int minNumber, int maxNumber);
120 
124  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
125 
129  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
130 
134  Common::Error loadGameState(int slot) override;
135 
139  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
140 
144  void syncSoundSettings() override;
145 
146  void saveOptions();
147 };
148 
149 } // End of namespace MADS
150 
151 #endif /* MADS_MADS_H */
Definition: str.h:59
Common::Error run() override
EngineFeature
Definition: engine.h:250
Definition: events.h:47
Definition: error.h:84
Definition: random.h:44
Definition: dialogs.h:236
Definition: resources.h:43
Common::Error loadGameState(int slot) override
Definition: screen.h:208
Definition: debugger.h:32
Definition: ustr.h:57
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
Definition: sound.h:44
Definition: detection.h:41
void syncSoundSettings() override
Definition: mads.h:71
Definition: font.h:47
Definition: audio.h:40
Definition: game.h:63
Definition: action.h:28
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: system.h:167
Definition: conversations.h:309
Definition: palette.h:247
Definition: engine.h:143
Platform
Definition: platform.h:46
bool hasFeature(EngineFeature f) const override
Language
Definition: language.h:45