ScummVM API documentation
groovie.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 GROOVIE_GROOVIE_H
23 #define GROOVIE_GROOVIE_H
24 
25 #include "groovie/debug.h"
26 #include "groovie/font.h"
27 
28 #include "engines/engine.h"
29 #include "graphics/pixelformat.h"
30 #include "groovie/detection.h"
31 
32 namespace Common {
33 class MacResManager;
34 }
35 
51 namespace Groovie {
52 
53 class GraphicsMan;
54 class GrvCursorMan;
55 class MusicPlayer;
56 class ResMan;
57 class Script;
58 class VideoPlayer;
59 
60 enum DebugLevels {
61  kDebugVideo = 1 << 0,
62  kDebugResource = 1 << 1,
63  kDebugScript = 1 << 2,
64  kDebugUnknown = 1 << 3,
65  kDebugHotspots = 1 << 4,
66  kDebugCursor = 1 << 5,
67  kDebugMIDI = 1 << 6,
68  kDebugScriptvars = 1 << 7,
69  kDebugLogic = 1 << 8,
70  kDebugFast = 1 << 9
71  //kDebugTlcGame = 1 << 10
72  // the current limitation is 32 debug levels (1 << 31 is the last one)
73  // but some are used by system, so avoid high values.
74 };
75 
83 enum GameSpeed {
84  kGroovieSpeedNormal,
85  kGroovieSpeedFast
86 };
87 
88 enum GROOVIEAction {
89  kActionNone,
90  kActionSkip
91 };
92 
93 #define MAX_SAVES 25
94 
96 
99  uint32 _loops;
100 };
101 
103 public:
105  void setVM(GroovieEngine *vm);
106  void queue(Common::SeekableReadStream *soundfile, uint32 loops);
107  void tick();
108  void stopAll();
109 
110 protected:
111  void deleteFile();
112  VideoPlayer *_player;
113  GroovieEngine *_vm;
116 };
117 
118 class GroovieEngine : public Engine {
119 public:
120  static const int AUTOSAVE_SLOT;
121 
122  GroovieEngine(OSystem *syst, const GroovieGameDescription *gd);
123  ~GroovieEngine() override;
124 
125  Common::Platform getPlatform() const;
126  EngineVersion getEngineVersion() const;
127 
128  int getAutosaveSlot() const override;
129  bool canLaunchLoad() const;
130  bool isDemo() const;
131 
132 protected:
133 
134  // Engine APIs
135  Common::Error run() override;
136  void pauseEngineIntern(bool pause) override;
137 
138  bool hasFeature(EngineFeature f) const override;
139 
140  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
141  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
142  Common::Error loadGameState(int slot) override;
143  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
144  void syncSoundSettings() override;
145 
146 public:
147  void waitForInput();
148  bool isWaitingForInput() { return _waitingForInput; }
149 
150  Graphics::PixelFormat _pixelFormat;
151  bool _spookyMode;
152  Script *_script;
153  ResMan *_resMan;
154  GrvCursorMan *_grvCursorMan;
155  VideoPlayer *_videoPlayer;
156  SoundEffectQueue _soundQueue;
157  MusicPlayer *_musicPlayer;
158  GraphicsMan *_graphicsMan;
159  const Graphics::Font *_font;
160 
161  Common::MacResManager *_macResFork;
162 
163  GameSpeed _modeSpeed;
164 
165 private:
166  const GroovieGameDescription *_gameDescription;
167  bool _waitingForInput;
168  T7GFont _sphinxFont;
169 };
170 
171 } // End of namespace Groovie
172 
173 #endif // GROOVIE_GROOVIE_H
Definition: detection.h:37
Definition: macresman.h:125
Definition: str.h:59
Definition: font.h:83
EngineFeature
Definition: engine.h:253
Definition: resource.h:39
Definition: groovie.h:118
Definition: error.h:84
Definition: pixelformat.h:138
Definition: groovie.h:97
Definition: stream.h:745
Definition: queue.h:42
Definition: music.h:40
Definition: groovie.h:102
Definition: ustr.h:57
GameSpeed
Definition: groovie.h:83
Definition: graphics.h:31
Definition: algorithm.h:29
Definition: script.h:55
Definition: player.h:36
Definition: font.h:30
Definition: cursor.h:49
Definition: system.h:161
Definition: engine.h:144
Definition: cursor.h:32
Platform
Definition: platform.h:46