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 
44 namespace MADS {
45 
46 #define DEBUG_BASIC 1
47 #define DEBUG_INTERMEDIATE 2
48 #define DEBUG_DETAILED 3
49 
50 enum MADSActions {
51  kActionNone,
52  kActionEscape,
53  kActionGameMenu,
54  kActionSave,
55  kActionRestore,
56  kActionScrollUp,
57  kActionScrollDown,
58  kActionStartGame,
59  kActionResumeGame,
60  kActionShowIntro,
61  kActionCredits,
62  kActionQuotes,
63  kActionRestartAnimation
64 };
65 
66 enum MADSDebugChannels {
67  kDebugPath = 1,
68  kDebugScripts,
69  kDebugGraphics,
70 };
71 
72 enum ScreenFade {
73  SCREEN_FADE_SMOOTH = 0,
74  SCREEN_FADE_MEDIUM = 1,
75  SCREEN_FADE_FAST = 2
76 };
77 
78 
79 class MADSEngine : public Engine {
80 private:
81  const MADSGameDescription *_gameDescription;
82  Common::RandomSource _randomSource;
83 
87  void initialize();
88 
89  void loadOptions();
90 protected:
91  // Engine APIs
92  Common::Error run() override;
93  bool hasFeature(EngineFeature f) const override;
94 public:
95  Debugger *_debugger;
96  Dialogs *_dialogs;
97  EventsManager *_events;
98  Font *_font;
99  Game *_game;
100  GameConversations * _gameConv;
101  Palette *_palette;
102  Resources *_resources;
103  Screen *_screen;
104  SoundManager *_sound;
105  AudioPlayer *_audio;
106  bool _easyMouse;
107  bool _invObjectsAnimated;
108  bool _textWindowStill;
109  ScreenFade _screenFade;
110  bool _musicFlag;
111  bool _soundFlag;
112  bool _dithering;
113  bool _disableFastwalk;
114 public:
115  MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc);
116  ~MADSEngine() override;
117 
118  uint32 getFeatures() const;
119  Common::Language getLanguage() const;
120  Common::Platform getPlatform() const;
121  uint16 getVersion() const;
122  uint32 getGameID() const;
123  uint32 getGameFeatures() const;
124  bool isDemo() const;
125 
126  int getRandomNumber(int maxNumber);
127  int getRandomNumber(int minNumber, int maxNumber);
128 
132  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
133 
137  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
138 
142  Common::Error loadGameState(int slot) override;
143 
147  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
148 
152  void syncSoundSettings() override;
153 
154  void saveOptions();
155 };
156 
157 } // End of namespace MADS
158 
159 #endif /* MADS_MADS_H */
Definition: str.h:59
Common::Error run() override
EngineFeature
Definition: engine.h:258
Definition: events.h:47
Definition: error.h:81
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:79
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:164
Definition: conversations.h:309
Definition: palette.h:247
Definition: engine.h:144
Platform
Definition: platform.h:93
bool hasFeature(EngineFeature f) const override
Language
Definition: language.h:45