ScummVM API documentation
made.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 MADE_MADE_H
23 #define MADE_MADE_H
24 
25 #include "made/sound.h"
26 #include "made/detection.h"
27 
28 #include "engines/engine.h"
29 
30 #include "common/random.h"
31 #include "common/text-to-speech.h"
32 
44 namespace Made {
45 
46 const uint32 kTimerResolution = 40;
47 
48 class ResourceReader;
49 class PmvPlayer;
50 class Screen;
51 class ScriptInterpreter;
52 class GameDatabase;
53 class MusicPlayer;
54 class MadeConsole;
55 
56 enum MADEAction {
57  kActionNone,
58  kActionCursorUp,
59  kActionCursorDown,
60  kActionCursorLeft,
61  kActionCursorRight,
62  kActionMenu,
63  kActionSaveGame,
64  kActionLoadGame,
65  kActionRepeatMessage
66 };
67 
68 
69 class MadeEngine : public ::Engine {
70 protected:
71 
72  // Engine APIs
73  Common::Error run() override;
74 
75 public:
76  MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc);
77  ~MadeEngine() override;
78 
79  bool hasFeature(EngineFeature f) const override;
80  void syncSoundSettings() override;
81 
83  const MadeGameDescription *_gameDescription;
84  uint32 getGameID() const;
85  uint32 getFeatures() const;
86  uint16 getVersion() const;
87  Common::Platform getPlatform() const;
88  Common::Language getLanguage() const;
89 
90 public:
91  PmvPlayer *_pmvPlayer;
92  ResourceReader *_res;
93  Screen *_screen;
94  GameDatabase *_dat;
95  ScriptInterpreter *_script;
96  MusicPlayer *_music;
97 
98  bool _useWinCursors;
99 
100  uint16 _eventNum;
101  int _eventMouseX, _eventMouseY;
102  uint16 _eventKey;
103 
104  int _soundRate;
105  bool _autoStopSound;
106  uint _soundEnergyIndex;
107  SoundEnergyArray *_soundEnergyArray;
108 
109  uint32 _musicBeatStart;
110  uint32 _cdTimeStart;
111  bool _introMusicDigital;
112 
113  Common::CodePage _ttsTextEncoding;
114  int _previousRect;
115  int _previousTextBox;
116  bool _saveLoadScreenOpen;
117  bool _openingCreditsOpen;
118  bool _tapeRecorderOpen;
119 
120  bool _voiceText;
121  bool _forceVoiceText;
122  bool _forceQueueText;
123 
124 #ifdef USE_TTS
125  Common::String _rtzSaveLoadButtonText[2];
126  uint8 _rtzFirstSaveSlot;
127  uint8 _rtzSaveLoadIndex;
128 
129  Common::String _tapeRecorderText[4];
130  uint8 _tapeRecorderIndex;
131 
132  Common::String _playOMaticButtonText[4];
133  uint8 _playOMaticButtonIndex;
134 #endif
135 
136  int32 _timers[50];
137  int16 getTicks();
138  int16 getTimer(int16 timerNum);
139  void setTimer(int16 timerNum, int16 value);
140  void resetTimer(int16 timerNum);
141  int16 allocTimer();
142  void freeTimer(int16 timerNum);
143  void resetAllTimers();
144 
145  void sayText(const Common::String &text, Common::TextToSpeechManager::Action action = Common::TextToSpeechManager::INTERRUPT) const;
146  void stopTextToSpeech() const;
147 #ifdef USE_TTS
148  void checkHoveringSaveLoadScreen();
149  void checkHoveringPlayOMatic(int16 spriteY = -1);
150 #endif
151 
152  const Common::String getTargetName() { return _targetName; }
153  Common::String getSavegameFilename(int16 saveNum);
154 
155  void handleEvents();
156 
157 protected:
158  void pauseEngineIntern(bool pause) override;
159 };
160 
161 } // End of namespace Made
162 
163 #endif /* MADE_H */
Definition: str.h:59
EngineFeature
Definition: engine.h:258
Definition: error.h:81
void syncSoundSettings() override
Common::Error run() override
Definition: array.h:52
Definition: screen.h:76
Definition: random.h:44
Definition: detection.h:43
Definition: made.h:69
Definition: music.h:39
Definition: atari-screen.h:58
Definition: script.h:72
Definition: database.h:112
bool hasFeature(EngineFeature f) const override
Definition: pmvplayer.h:43
const Common::String _targetName
Definition: engine.h:181
Definition: resource.h:188
Definition: console.h:27
Definition: system.h:163
Definition: engine.h:144
Platform
Definition: platform.h:93
void pauseEngineIntern(bool pause) override
Language
Definition: language.h:45