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 #define MAX_SAVES 25
89 
91 
94  uint32 _loops;
95 };
96 
98 public:
100  void setVM(GroovieEngine *vm);
101  void queue(Common::SeekableReadStream *soundfile, uint32 loops);
102  void tick();
103  void stopAll();
104 
105 protected:
106  void deleteFile();
107  VideoPlayer *_player;
108  GroovieEngine *_vm;
111 };
112 
113 class GroovieEngine : public Engine {
114 public:
115  static const int AUTOSAVE_SLOT;
116 
117  GroovieEngine(OSystem *syst, const GroovieGameDescription *gd);
118  ~GroovieEngine() override;
119 
120  Common::Platform getPlatform() const;
121  EngineVersion getEngineVersion() const;
122 
123  int getAutosaveSlot() const override;
124  bool canLaunchLoad() const;
125  bool isDemo() const;
126 
127 protected:
128 
129  // Engine APIs
130  Common::Error run() override;
131  void pauseEngineIntern(bool pause) override;
132 
133  bool hasFeature(EngineFeature f) const override;
134 
135  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
136  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
137  Common::Error loadGameState(int slot) override;
138  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
139  void syncSoundSettings() override;
140 
141 public:
142  void waitForInput();
143  bool isWaitingForInput() { return _waitingForInput; }
144 
145  Graphics::PixelFormat _pixelFormat;
146  bool _spookyMode;
147  Script *_script;
148  ResMan *_resMan;
149  GrvCursorMan *_grvCursorMan;
150  VideoPlayer *_videoPlayer;
151  SoundEffectQueue _soundQueue;
152  MusicPlayer *_musicPlayer;
153  GraphicsMan *_graphicsMan;
154  const Graphics::Font *_font;
155 
156  Common::MacResManager *_macResFork;
157 
158  GameSpeed _modeSpeed;
159 
160 private:
161  const GroovieGameDescription *_gameDescription;
162  bool _waitingForInput;
163  T7GFont _sphinxFont;
164 };
165 
166 } // End of namespace Groovie
167 
168 #endif // GROOVIE_GROOVIE_H
Definition: detection.h:37
Definition: macresman.h:125
Definition: str.h:59
Definition: font.h:82
EngineFeature
Definition: engine.h:250
Definition: resource.h:39
Definition: groovie.h:113
Definition: error.h:84
Definition: pixelformat.h:138
Definition: groovie.h:92
Definition: stream.h:745
Definition: queue.h:42
Definition: music.h:40
Definition: groovie.h:97
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:167
Definition: engine.h:143
Definition: cursor.h:32
Platform
Definition: platform.h:46