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_AREA_X 20
63 #define MANSION_SCROLL_AREA_Y 20
64 #define MANSION_SCROLL_INC_X 4
65 #define MANSION_SCROLL_INC_Y 4
66 
67 enum VoyeurDebugChannels {
68  kDebugScripts = 1 << 0
69 };
70 
71 enum VoyeurArea { AREA_NONE, AREA_APARTMENT, AREA_INTERFACE, AREA_ROOM, AREA_EVIDENCE };
72 
73 struct VoyeurGameDescription;
74 
75 class VoyeurEngine : public Engine {
76 private:
77  const VoyeurGameDescription *_gameDescription;
78  Common::RandomSource _randomSource;
79  FontInfoResource _defaultFontInfo;
80 
81  void ESP_Init();
82  void globalInitBolt();
83  void initBolt();
84  void vInitInterrupts();
85  void initInput();
86 
87  bool doHeadTitle();
88  void showConversionScreen();
89  bool doLock();
90  void showTitleScreen();
91  void doOpening();
92 
93  void playStamp();
94  void initStamp();
95  void closeStamp();
96 
97  void showLogo8Intro();
98 
102  void doTailTitle();
103 
107  void doClosingCredits();
108 
112  void doPiracy();
113 
117  void reviewTape();
118 
122  void doGossip();
123 
127  void doTapePlaying();
128 
132  bool checkForMurder();
133 
137  bool checkForIncriminate();
138 
142  void playAVideoEvent(int eventIndex);
143 
148  int getChooseButton();
149 
153  void synchronize(Common::Serializer &s);
154 
158  void centerMansionView();
159 protected:
160  // Engine APIs
161  Common::Error run() override;
162  bool hasFeature(EngineFeature f) const override;
163 public:
164  BoltFile *_bVoy;
165  Debugger *_debugger;
166  EventsManager *_eventsManager;
167  FilesManager *_filesManager;
168  Screen *_screen;
169  SoundManager *_soundManager;
170  SVoy *_voy;
171 
172  BoltFile *_stampLibPtr;
173  BoltGroup *_controlGroupPtr;
174  ControlResource *_controlPtr;
175  byte *_stampData;
176  BoltGroup *_stackGroupPtr;
177  int _glGoState;
178  int _glGoStack;
179  int _stampFlags;
180  int _playStampGroupId;
181  int _currentVocId;
182 
183  int _audioVideoId;
184  const int *_resolvePtr;
185  int _iForceDeath;
186  int _checkTransitionId;
187  int _gameHour;
188  int _gameMinute;
189  int _flashTimeVal;
190  bool _flashTimeFlag;
191  int _timeBarVal;
192  int _checkPhoneVal;
193  Common::Point _mansionViewPos;
194  ThreadResource *_mainThread;
195  VoyeurArea _voyeurArea;
196  int _loadGameSlot;
197 public:
198  VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc);
199  ~VoyeurEngine() override;
200  void GUIError(const Common::String &msg);
201 
202  uint32 getFeatures() const;
203  Common::Language getLanguage() const;
204  Common::Platform getPlatform() const;
205  uint16 getVersion() const;
206  bool getIsDemo() const;
207 
208  int getRandomNumber(int maxNumber);
209  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
210  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
211  Common::Error loadGameState(int slot) override;
212  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
213  void loadGame(int slot);
214 
215  void playRL2Video(const Common::Path &filename);
216  void doTransitionCard(const Common::String &time, const Common::String &location);
217 
221  void playAVideo(int videoId);
222 
228  void playAVideoDuration(int videoId, int duration);
229 
233  void playAudio(int audioId);
234 
235  void makeViewFinder();
236  void makeViewFinderP();
237  void initIFace();
238  void checkTransition();
239  int doComputerText(int maxLen);
240  void getComputerBrush();
241 
245  void doTimeBar();
246 
250  void flashTimeBar();
251 
255  void doScroll(const Common::Point &pt);
256 
260  void checkPhoneCall();
261 
267  void doEvidDisplay(int evidId, int eventId);
268 
272  void flipPageAndWait();
273 
277  void flipPageAndWaitForFade();
278 
283 
288 
292  void showEndingNews();
293 };
294 
295 #define VOYEUR_SAVEGAME_VERSION 3
296 
301  uint8 _version;
302  Common::String _saveName;
303  Graphics::Surface *_thumbnail;
304  int _saveYear, _saveMonth, _saveDay;
305  int _saveHour, _saveMinutes;
306  int _totalFrames;
307 
311  bool read(Common::InSaveFile *f, bool skipThumbnail = true);
312 
316  void write(Common::OutSaveFile *f, VoyeurEngine *vm, const Common::String &saveName);
317 };
318 
319 } // End of namespace Voyeur
320 
321 #endif /* VOYEUR_VOYEUR_H */
Definition: voyeur.h:75
Common::String getDayName()
Definition: str.h:59
Definition: screen.h:59
Definition: surface.h:67
void playAudio(int audioId)
EngineFeature
Definition: engine.h:253
Definition: savefile.h:54
Definition: error.h:84
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:79
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:45
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:300
Definition: animation.h:38
bool hasFeature(EngineFeature f) const override
Definition: system.h:161
void playAVideoDuration(int videoId, int duration)
Definition: events.h:66
Definition: files.h:204
Definition: engine.h:144
Common::Error loadGameState(int slot) override
Platform
Definition: platform.h:46
Language
Definition: language.h:45