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