ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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,
62  kDebugResource,
63  kDebugScript,
64  kDebugUnknown,
65  kDebugHotspots,
66  kDebugCursor,
67  kDebugMIDI,
68  kDebugScriptvars,
69  kDebugLogic,
70  kDebugFast,
71  //kDebugTlcGame,
72 };
73 
81 enum GameSpeed {
82  kGroovieSpeedNormal,
83  kGroovieSpeedFast
84 };
85 
86 enum GROOVIEAction {
87  kActionNone,
88  kActionSkip
89 };
90 
91 #define MAX_SAVES 25
92 
94 
97  uint32 _loops;
98 };
99 
101 public:
103  void setVM(GroovieEngine *vm);
104  void queue(Common::SeekableReadStream *soundfile, uint32 loops);
105  void tick();
106  void stopAll();
107 
108 protected:
109  void deleteFile();
110  VideoPlayer *_player;
111  GroovieEngine *_vm;
114 };
115 
116 class GroovieEngine : public Engine {
117 public:
118  static const int AUTOSAVE_SLOT;
119 
120  GroovieEngine(OSystem *syst, const GroovieGameDescription *gd);
121  ~GroovieEngine() override;
122 
123  Common::Platform getPlatform() const;
124  EngineVersion getEngineVersion() const;
125 
126  int getAutosaveSlot() const override;
127  bool canLaunchLoad() const;
128  bool isDemo() const;
129 
130 protected:
131 
132  // Engine APIs
133  Common::Error run() override;
134  void pauseEngineIntern(bool pause) override;
135 
136  bool hasFeature(EngineFeature f) const override;
137 
138  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
139  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
140  Common::Error loadGameState(int slot) override;
141  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
142  void syncSoundSettings() override;
143 
144 public:
145  void waitForInput();
146  bool isWaitingForInput() { return _waitingForInput; }
147 
148  Graphics::PixelFormat _pixelFormat;
149  bool _spookyMode;
150  Script *_script;
151  ResMan *_resMan;
152  GrvCursorMan *_grvCursorMan;
153  VideoPlayer *_videoPlayer;
154  SoundEffectQueue _soundQueue;
155  MusicPlayer *_musicPlayer;
156  GraphicsMan *_graphicsMan;
157  const Graphics::Font *_font;
158 
159  Common::MacResManager *_macResFork;
160 
161  GameSpeed _modeSpeed;
162 
163 private:
164  const GroovieGameDescription *_gameDescription;
165  bool _waitingForInput;
166  T7GFont _sphinxFont;
167 };
168 
169 } // End of namespace Groovie
170 
171 #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:116
Definition: error.h:84
Definition: pixelformat.h:138
Definition: groovie.h:95
Definition: stream.h:745
Definition: queue.h:42
Definition: music.h:40
Definition: groovie.h:100
Definition: ustr.h:57
GameSpeed
Definition: groovie.h:81
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