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 
43 namespace Made {
44 
45 const uint32 kTimerResolution = 40;
46 
47 class ResourceReader;
48 class PmvPlayer;
49 class Screen;
50 class ScriptInterpreter;
51 class GameDatabase;
52 class MusicPlayer;
53 class MadeConsole;
54 
55 enum MADEAction {
56  kActionNone,
57  kActionCursorUp,
58  kActionCursorDown,
59  kActionCursorLeft,
60  kActionCursorRight,
61  kActionMenu,
62  kActionSaveGame,
63  kActionLoadGame,
64  kActionRepeatMessage
65 };
66 
67 
68 class MadeEngine : public ::Engine {
69 protected:
70 
71  // Engine APIs
72  Common::Error run() override;
73 
74 public:
75  MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc);
76  ~MadeEngine() override;
77 
78  bool hasFeature(EngineFeature f) const override;
79  void syncSoundSettings() override;
80 
82  const MadeGameDescription *_gameDescription;
83  uint32 getGameID() const;
84  uint32 getFeatures() const;
85  uint16 getVersion() const;
86  Common::Platform getPlatform() const;
87 
88 public:
89  PmvPlayer *_pmvPlayer;
90  ResourceReader *_res;
91  Screen *_screen;
92  GameDatabase *_dat;
93  ScriptInterpreter *_script;
94  MusicPlayer *_music;
95 
96  uint16 _eventNum;
97  int _eventMouseX, _eventMouseY;
98  uint16 _eventKey;
99 
100  int _soundRate;
101  bool _autoStopSound;
102  uint _soundEnergyIndex;
103  SoundEnergyArray *_soundEnergyArray;
104 
105  uint32 _musicBeatStart;
106  uint32 _cdTimeStart;
107  bool _introMusicDigital;
108 
109  int32 _timers[50];
110  int16 getTicks();
111  int16 getTimer(int16 timerNum);
112  void setTimer(int16 timerNum, int16 value);
113  void resetTimer(int16 timerNum);
114  int16 allocTimer();
115  void freeTimer(int16 timerNum);
116  void resetAllTimers();
117 
118  const Common::String getTargetName() { return _targetName; }
119  Common::String getSavegameFilename(int16 saveNum);
120 
121  void handleEvents();
122 
123 protected:
124  void pauseEngineIntern(bool pause) override;
125 };
126 
127 } // End of namespace Made
128 
129 #endif /* MADE_H */
Definition: str.h:59
EngineFeature
Definition: engine.h:253
Definition: error.h:84
void syncSoundSettings() override
Common::Error run() override
Definition: array.h:52
Definition: screen.h:73
Definition: random.h:44
Definition: detection.h:43
Definition: made.h:68
Definition: music.h:39
Definition: atari-screen.h:60
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:161
Definition: engine.h:144
Platform
Definition: platform.h:46
void pauseEngineIntern(bool pause) override