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 MADSActions {
59  kActionNone,
60  kActionEscape,
61  kActionGameMenu,
62  kActionSave,
63  kActionRestore,
64  kActionScrollUp,
65  kActionScrollDown,
66  kActionStartGame,
67  kActionResumeGame,
68  kActionShowIntro,
69  kActionCredits,
70  kActionQuotes,
71  kActionRestartAnimation
72 };
73 
74 enum MADSDebugChannels {
75  kDebugPath = 1 << 0,
76  kDebugScripts = 1 << 1,
77  kDebugGraphics = 1 << 2
78 };
79 
80 enum ScreenFade {
81  SCREEN_FADE_SMOOTH = 0,
82  SCREEN_FADE_MEDIUM = 1,
83  SCREEN_FADE_FAST = 2
84 };
85 
86 
87 class MADSEngine : public Engine {
88 private:
89  const MADSGameDescription *_gameDescription;
90  Common::RandomSource _randomSource;
91 
95  void initialize();
96 
97  void loadOptions();
98 protected:
99  // Engine APIs
100  Common::Error run() override;
101  bool hasFeature(EngineFeature f) const override;
102 public:
103  Debugger *_debugger;
104  Dialogs *_dialogs;
105  EventsManager *_events;
106  Font *_font;
107  Game *_game;
108  GameConversations * _gameConv;
109  Palette *_palette;
110  Resources *_resources;
111  Screen *_screen;
112  SoundManager *_sound;
113  AudioPlayer *_audio;
114  bool _easyMouse;
115  bool _invObjectsAnimated;
116  bool _textWindowStill;
117  ScreenFade _screenFade;
118  bool _musicFlag;
119  bool _soundFlag;
120  bool _dithering;
121  bool _disableFastwalk;
122 public:
123  MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc);
124  ~MADSEngine() override;
125 
126  uint32 getFeatures() const;
127  Common::Language getLanguage() const;
128  Common::Platform getPlatform() const;
129  uint16 getVersion() const;
130  uint32 getGameID() const;
131  uint32 getGameFeatures() const;
132  bool isDemo() const;
133 
134  int getRandomNumber(int maxNumber);
135  int getRandomNumber(int minNumber, int maxNumber);
136 
140  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
141 
145  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
146 
150  Common::Error loadGameState(int slot) override;
151 
155  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
156 
160  void syncSoundSettings() override;
161 
162  void saveOptions();
163 };
164 
165 } // End of namespace MADS
166 
167 #endif /* MADS_MADS_H */
Definition: str.h:59
Common::Error run() override
EngineFeature
Definition: engine.h:253
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:87
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:161
Definition: conversations.h:309
Definition: palette.h:247
Definition: engine.h:144
Platform
Definition: platform.h:46
bool hasFeature(EngineFeature f) const override
Language
Definition: language.h:45