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  uint16 _eventNum;
99  int _eventMouseX, _eventMouseY;
100  uint16 _eventKey;
101 
102  int _soundRate;
103  bool _autoStopSound;
104  uint _soundEnergyIndex;
105  SoundEnergyArray *_soundEnergyArray;
106 
107  uint32 _musicBeatStart;
108  uint32 _cdTimeStart;
109  bool _introMusicDigital;
110 
111  Common::CodePage _ttsTextEncoding;
112  int _previousRect;
113  int _previousTextBox;
114  bool _saveLoadScreenOpen;
115  bool _openingCreditsOpen;
116  bool _tapeRecorderOpen;
117 
118  bool _voiceText;
119  bool _forceVoiceText;
120  bool _forceQueueText;
121 
122 #ifdef USE_TTS
123  Common::String _rtzSaveLoadButtonText[2];
124  uint8 _rtzFirstSaveSlot;
125  uint8 _rtzSaveLoadIndex;
126 
127  Common::String _tapeRecorderText[4];
128  uint8 _tapeRecorderIndex;
129 
130  Common::String _playOMaticButtonText[4];
131  uint8 _playOMaticButtonIndex;
132 #endif
133 
134  int32 _timers[50];
135  int16 getTicks();
136  int16 getTimer(int16 timerNum);
137  void setTimer(int16 timerNum, int16 value);
138  void resetTimer(int16 timerNum);
139  int16 allocTimer();
140  void freeTimer(int16 timerNum);
141  void resetAllTimers();
142 
143  void sayText(const Common::String &text, Common::TextToSpeechManager::Action action = Common::TextToSpeechManager::INTERRUPT) const;
144  void stopTextToSpeech() const;
145 #ifdef USE_TTS
146  void checkHoveringSaveLoadScreen();
147  void checkHoveringPlayOMatic(int16 spriteY = -1);
148 #endif
149 
150  const Common::String getTargetName() { return _targetName; }
151  Common::String getSavegameFilename(int16 saveNum);
152 
153  void handleEvents();
154 
155 protected:
156  void pauseEngineIntern(bool pause) override;
157 };
158 
159 } // End of namespace Made
160 
161 #endif /* MADE_H */
Definition: str.h:59
EngineFeature
Definition: engine.h:260
Definition: error.h:81
void syncSoundSettings() override
Common::Error run() override
Definition: array.h:52
Definition: screen.h:74
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:183
Definition: resource.h:188
Definition: console.h:27
Definition: system.h:163
Definition: engine.h:146
Platform
Definition: platform.h:46
void pauseEngineIntern(bool pause) override
Language
Definition: language.h:45