ScummVM API documentation
voyeur.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 VOYEUR_VOYEUR_H
23 #define VOYEUR_VOYEUR_H
24 
25 #include "voyeur/debugger.h"
26 #include "voyeur/data.h"
27 #include "voyeur/events.h"
28 #include "voyeur/files.h"
29 #include "voyeur/screen.h"
30 #include "voyeur/sound.h"
31 #include "common/scummsys.h"
32 #include "common/system.h"
33 #include "common/error.h"
34 #include "common/random.h"
35 #include "common/savefile.h"
36 #include "common/serializer.h"
37 #include "common/util.h"
38 #include "engines/engine.h"
39 #include "graphics/surface.h"
40 
49 namespace Voyeur {
50 
51 #define DEBUG_BASIC 1
52 #define DEBUG_INTERMEDIATE 2
53 #define DEBUG_DETAILED 3
54 
55 // Constants used for doInterface display of the mansion
56 #define MANSION_MAX_X 784
57 #define MANSION_MAX_Y 150
58 #define MANSION_VIEW_X 40
59 #define MANSION_VIEW_Y 27
60 #define MANSION_VIEW_WIDTH 240
61 #define MANSION_VIEW_HEIGHT 148
62 #define MANSION_SCROLL_INC_X 4
63 #define MANSION_SCROLL_INC_Y 4
64 
65 enum VoyeurDebugChannels {
66  kDebugScripts = 1,
67 };
68 
69 enum VoyeurArea { AREA_NONE, AREA_APARTMENT, AREA_INTERFACE, AREA_ROOM, AREA_EVIDENCE };
70 
71 struct VoyeurGameDescription;
72 
73 enum VOYEURAction {
74  kActionNone,
75  kActionSkip,
76 };
77 
78 class VoyeurEngine : public Engine {
79 private:
80  const VoyeurGameDescription *_gameDescription;
81  Common::RandomSource _randomSource;
82  FontInfoResource _defaultFontInfo;
83 
84  void ESP_Init();
85  void globalInitBolt();
86  void initBolt();
87  void vInitInterrupts();
88  void initInput();
89 
90  bool doHeadTitle();
91  void showConversionScreen();
92  bool doLock();
93  void showTitleScreen();
94  void doOpening();
95 
96  void playStamp();
97  void initStamp();
98  void closeStamp();
99 
100  void showLogo8Intro();
101 
105  void doTailTitle();
106 
110  void doClosingCredits();
111 
115  void doPiracy();
116 
120  void reviewTape();
121 
125  void doGossip();
126 
130  void doTapePlaying();
131 
135  bool checkForMurder();
136 
140  bool checkForIncriminate();
141 
145  void playAVideoEvent(int eventIndex);
146 
151  int getChooseButton();
152 
156  void synchronize(Common::Serializer &s);
157 
161  void centerMansionView();
162 protected:
163  // Engine APIs
164  Common::Error run() override;
165  bool hasFeature(EngineFeature f) const override;
166 public:
167  BoltFile *_bVoy;
168  Debugger *_debugger;
169  EventsManager *_eventsManager;
170  FilesManager *_filesManager;
171  Screen *_screen;
172  SoundManager *_soundManager;
173  SVoy *_voy;
174 
175  BoltFile *_stampLibPtr;
176  BoltGroup *_controlGroupPtr;
177  ControlResource *_controlPtr;
178  byte *_stampData;
179  BoltGroup *_stackGroupPtr;
180  int _glGoState;
181  int _glGoStack;
182  int _stampFlags;
183  int _playStampGroupId;
184  int _currentVocId;
185 
186  int _audioVideoId;
187  const int *_resolvePtr;
188  int _iForceDeath;
189  int _checkTransitionId;
190  int _gameHour;
191  int _gameMinute;
192  int _flashTimeVal;
193  bool _flashTimeFlag;
194  int _timeBarVal;
195  int _checkPhoneVal;
196  Common::Point _mansionViewPos;
197  ThreadResource *_mainThread;
198  VoyeurArea _voyeurArea;
199  int _loadGameSlot;
200 public:
201  VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc);
202  ~VoyeurEngine() override;
203  void GUIError(const Common::String &msg);
204 
205  uint32 getFeatures() const;
206  Common::Language getLanguage() const;
207  Common::Platform getPlatform() const;
208  uint16 getVersion() const;
209  bool getIsDemo() const;
210 
211  int getRandomNumber(int maxNumber);
212  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
213  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
214  Common::Error loadGameState(int slot) override;
215  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
216  void loadGame(int slot);
217 
218  void playRL2Video(const Common::Path &filename);
219  void doTransitionCard(const Common::String &time, const Common::String &location);
220 
224  void playAVideo(int videoId);
225 
231  void playAVideoDuration(int videoId, int duration);
232 
236  void playAudio(int audioId);
237 
238  void makeViewFinder();
239  void makeViewFinderP();
240  void initIFace();
241  void checkTransition();
242  int doComputerText(int maxLen);
243  void getComputerBrush();
244 
248  void doTimeBar();
249 
253  void flashTimeBar();
254 
258  void doScroll(const Common::Point &pt);
259 
263  void checkPhoneCall();
264 
270  void doEvidDisplay(int evidId, int eventId);
271 
275  void flipPageAndWait();
276 
280  void flipPageAndWaitForFade();
281 
286 
291 
295  void showEndingNews();
296 };
297 
298 #define VOYEUR_SAVEGAME_VERSION 3
299 
304  uint8 _version;
305  Common::String _saveName;
306  Graphics::Surface *_thumbnail;
307  int _saveYear, _saveMonth, _saveDay;
308  int _saveHour, _saveMinutes;
309  int _totalFrames;
310 
314  bool read(Common::InSaveFile *f, bool skipThumbnail = true);
315 
319  void write(Common::OutSaveFile *f, VoyeurEngine *vm, const Common::String &saveName);
320 };
321 
322 } // End of namespace Voyeur
323 
324 #endif /* VOYEUR_VOYEUR_H */
Definition: voyeur.h:78
Common::String getDayName()
Definition: str.h:59
Definition: screen.h:59
Definition: surface.h:67
void playAudio(int audioId)
EngineFeature
Definition: engine.h:282
Definition: savefile.h:54
Definition: error.h:81
Common::Error run() override
Definition: random.h:44
Definition: path.h:52
Definition: files.h:395
Definition: stream.h:745
Common::String getTimeOfDay()
Definition: debugger.h:32
Definition: files.h:90
Definition: serializer.h:80
void doScroll(const Common::Point &pt)
void playAVideo(int videoId)
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: ustr.h:57
Definition: data.h:107
Definition: rect.h:144
bool skipThumbnail(Common::SeekableReadStream &in)
Definition: files.h:152
void doEvidDisplay(int evidId, int eventId)
Definition: detection.h:27
Definition: files.h:491
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: files.h:461
Definition: sound.h:31
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
Definition: voyeur.h:303
Definition: animation.h:38
bool hasFeature(EngineFeature f) const override
Definition: system.h:166
void playAVideoDuration(int videoId, int duration)
Definition: events.h:66
Definition: files.h:204
Definition: engine.h:149
Common::Error loadGameState(int slot) override
Platform
Definition: platform.h:93
Language
Definition: language.h:45