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 class MadeEngine : public ::Engine {
56 protected:
57 
58  // Engine APIs
59  Common::Error run() override;
60 
61 public:
62  MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc);
63  ~MadeEngine() override;
64 
65  bool hasFeature(EngineFeature f) const override;
66  void syncSoundSettings() override;
67 
69  const MadeGameDescription *_gameDescription;
70  uint32 getGameID() const;
71  uint32 getFeatures() const;
72  uint16 getVersion() const;
73  Common::Platform getPlatform() const;
74 
75 public:
76  PmvPlayer *_pmvPlayer;
77  ResourceReader *_res;
78  Screen *_screen;
79  GameDatabase *_dat;
80  ScriptInterpreter *_script;
81  MusicPlayer *_music;
82 
83  uint16 _eventNum;
84  int _eventMouseX, _eventMouseY;
85  uint16 _eventKey;
86 
87  int _soundRate;
88  bool _autoStopSound;
89  uint _soundEnergyIndex;
90  SoundEnergyArray *_soundEnergyArray;
91 
92  uint32 _musicBeatStart;
93  uint32 _cdTimeStart;
94  bool _introMusicDigital;
95 
96  int32 _timers[50];
97  int16 getTicks();
98  int16 getTimer(int16 timerNum);
99  void setTimer(int16 timerNum, int16 value);
100  void resetTimer(int16 timerNum);
101  int16 allocTimer();
102  void freeTimer(int16 timerNum);
103  void resetAllTimers();
104 
105  const Common::String getTargetName() { return _targetName; }
106  Common::String getSavegameFilename(int16 saveNum);
107 
108  void handleEvents();
109 
110 protected:
111  void pauseEngineIntern(bool pause) override;
112 };
113 
114 } // End of namespace Made
115 
116 #endif /* MADE_H */
Definition: str.h:59
EngineFeature
Definition: engine.h:250
Definition: error.h:84
void syncSoundSettings() override
Common::Error run() override
Definition: array.h:52
Definition: screen.h:73
Definition: random.h:44
Definition: default_display_client.h:78
Definition: detection.h:43
Definition: made.h:55
Definition: music.h:39
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:180
Definition: resource.h:188
Definition: console.h:27
Definition: system.h:167
Definition: engine.h:143
Platform
Definition: platform.h:46
void pauseEngineIntern(bool pause) override