ScummVM API documentation
hypno.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 HYPNO_H
23 #define HYPNO_H
24 
25 #include "common/array.h"
26 #include "common/compression/installshieldv3_archive.h"
27 #include "common/random.h"
28 #include "common/serializer.h"
29 #include "common/str-array.h"
30 #include "common/stream.h"
31 #include "engines/engine.h"
32 #include "graphics/font.h"
33 #include "graphics/fontman.h"
34 #include "graphics/surface.h"
35 #include "video/subtitles.h"
36 
37 #include "hypno/grammar.h"
38 #include "hypno/libfile.h"
39 
40 namespace Audio {
41 class SeekableAudioStream;
42 }
43 
44 namespace Image {
45 class ImageDecoder;
46 }
47 
48 struct ADGameDescription;
49 
50 namespace Hypno {
51 
52 // debug channels
53 enum {
54  kHypnoDebugMedia = 1,
55  kHypnoDebugParser,
56  kHypnoDebugArcade,
57  kHypnoDebugScene,
58 };
59 
60 // Player positions
61 
62 enum PlayerPosition {
63  kPlayerTop = 'T',
64  kPlayerBottom = 'B',
65  kPlayerLeft = 'L',
66  kPlayerRight = 'R'
67 };
68 
69 // Common colors
70 enum HypnoColors {
71  kHypnoNoColor = -1,
72  kHypnoColorRed = 250,
73  kHypnoColorGreen = 251,
74  kHypnoColorWhiteOrBlue = 252,
75  kHypnoColorYellow = 253,
76  kHypnoColorBlack = 254,
77  kHypnoColorCyan = 255
78 };
79 
80 // Spider colors
81 enum SpiderColors {
82  kSpiderColorWhite = 248,
83  kSpiderColorBlue = 252,
84 };
85 
86 enum HYPNOActions {
87  kActionNone,
88  kActionSkipIntro,
89  kActionSkipCutscene,
90  kActionPrimaryShoot,
91  kActionSkipLevel,
92  kActionKillPlayer,
93  kActionPause,
94  kActionLeft,
95  kActionDown,
96  kActionRight,
97  kActionUp,
98  kActionYes,
99  kActionNo,
100  kActionDifficultyChump,
101  kActionDifficultyPunk,
102  kActionDifficultyBadass,
103  kActionDifficultExit,
104  kActionRetry,
105  kActionRestart,
106  kActionNewMission,
107  kActionQuit,
108  kActionCredits,
109  kActionSelect,
110 };
111 
112 class HypnoEngine;
113 
114 class CursorCache {
115 private:
116  HypnoEngine *_vm;
117  Common::String _filename;
118  uint32 _frame;
119  byte *_palette;
120  Graphics::Surface *_surface;
121 
122 public:
123  CursorCache(HypnoEngine *vm) : _vm(vm), _filename(""), _frame(0), _palette(nullptr), _surface(nullptr) {}
124 
125  ~CursorCache() {
126  if (_surface) {
127  _surface->free();
128  delete _surface;
129  }
130  free(_palette);
131  }
132 
133  Graphics::Surface *getCursor(const Common::String &cursor, uint32 n, byte **palette);
134 };
135 
136 class HypnoEngine : public Engine {
137 private:
138  Image::ImageDecoder *_image;
139 
140 public:
141  HypnoEngine(OSystem *syst, const ADGameDescription *gd);
142  ~HypnoEngine();
143 
144  const ADGameDescription *_gameDescription;
145  bool isDemo() const;
146  Common::Language _language;
147  Common::Platform _platform;
148  Common::String _variant;
149  bool _cheatsEnabled;
150  bool _infiniteHealthCheat;
151  bool _infiniteAmmoCheat;
152  bool _unlockAllLevels;
153  bool _restoredContentEnabled;
154 
155  Audio::SoundHandle _soundHandle, _musicHandle;
156  Common::InstallShieldV3 _installerArchive;
157  Common::List<LibFile*> _archive;
158 
159  Common::Error run() override;
160  Levels _levels;
162  virtual void resetSceneState();
163  bool checkSceneCompleted();
164  bool checkLevelWon();
165  void runLevel(Common::String &name);
166  void runScene(Scene *scene);
167  virtual void runBeforeArcade(ArcadeShooting *arc);
168  virtual void runAfterArcade(ArcadeShooting *arc);
169  void runArcade(ArcadeShooting *arc);
170  // For some menus and hardcoded puzzles
171  virtual void runCode(Code *code);
172  // Level transitions
173  void runTransition(Transition *trans);
174 
175  void restartGame();
176  void clearAreas();
177  void initializePath(const Common::FSNode &gamePath) override;
178  virtual void loadAssets();
179 
180  // Parsing
181  void splitArcadeFile(const Common::String &filename, Common::String &arc, Common::String &list);
182  void parseArcadeShooting(const Common::String &prefix, const Common::String &name, const Common::String &data);
183  SegmentShootsSequence parseShootList(const Common::String &name, const Common::String &data);
184  void loadArcadeLevel(const Common::String &current, const Common::String &nextWin, const Common::String &nextLose, const Common::String &prefix);
185  void loadSceneLevel(const Common::String &current, const Common::String &next, const Common::String &prefix);
186  void loadSceneLevel(const char *buf, const Common::String &name, const Common::String &next, const Common::String &prefix);
187 
188  LibFile *loadLib(const Common::Path &prefix, const Common::Path &filename, bool encrypted);
189 
190  // User input
191  void clickedHotspot(Common::Point);
192  virtual bool hoverHotspot(Common::Point);
193 
194  // Cursors
195  bool cursorPauseMovie(Common::Point);
196  bool cursorExit(Common::Point);
197  bool cursorMask(Common::Point);
198 
199  virtual void loadGame(const Common::String &nextLevel, int score, int puzzleDifficulty, int combatDifficulty);
200  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override { return (isDemo() ? false : true); }
201  bool canSaveAutosaveCurrently() override { return false; }
202  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override { return (isDemo() ? false : true); }
203  Common::String _checkpoint;
204 
205  bool _useSubtitles;
206  Video::Subtitles *_subtitles;
207  void adjustSubtitleSize();
208  void loadSubtitles(const Common::Path &path);
209 
210  Common::Path _prefixDir;
211  Common::Path convertPath(const Common::String &);
212  void playVideo(MVideo &video);
213  void skipVideo(MVideo &video);
214 
215  Graphics::Surface *decodeFrame(const Common::String &name, int frame, byte **palette = nullptr);
216  Frames decodeFrames(const Common::String &name);
217  void loadImage(const Common::String &file, int x, int y, bool transparent, bool palette = false, int frameNumber = 0);
218  void drawImage(Graphics::Surface &image, int x, int y, bool transparent);
219  void loadPalette(const Common::String &fname);
220  void loadPalette(const byte *palette, uint32 offset, uint32 size);
221  byte *getPalette(uint32 idx);
222 
223  // Cursors
224  Common::String _defaultCursor;
225  uint32 _defaultCursorIdx;
226  CursorCache *_cursorCache;
227  void disableCursor();
228  void defaultCursor();
229  virtual void changeCursor(const Common::String &cursor, uint32 n, bool centerCursor = false);
230  virtual void changeCursor(const Common::String &cursor);
231  virtual void changeCursor(const Graphics::Surface &entry, byte *palette, bool centerCursor = false);
232 
233  // Actions
234  virtual void runMenu(Hotspots *hs, bool only_menu = false);
235  void runBackground(Background *a);
236  void runOverlay(Overlay *a);
237  void runMice(Mice *a);
238  void runEscape();
239  void runSave(Save *a);
240  void runLoad(Load *a);
241  void runLoadCheckpoint(LoadCheckpoint *a);
242  void runTimer(Timer *a);
243  void runQuit(Quit *a);
244  void runCutscene(Cutscene *a);
245  void runIntro(Intro *a);
246  void runPlay(Play *a);
247  void runSound(Sound *a);
248  void runPalette(Palette *a);
249  void runAmbient(Ambient *a);
250  void runWalN(WalN *a);
251  bool runGlobal(Global *a);
252  void runTalk(Talk *a);
253  void runSwapPointer(SwapPointer *a);
254  void runChangeLevel(ChangeLevel *a);
255  virtual void drawBackToMenu(Hotspot *h);
256 
257  // Screen
258  int _screenW, _screenH;
259  Graphics::PixelFormat _pixelFormat;
260  void changeScreenMode(const Common::String &mode);
261  Graphics::Surface *_compositeSurface;
262  uint32 _transparentColor;
263  Common::Rect screenRect;
264  void updateScreen(MVideo &video);
265  void updateVideo(MVideo &video);
266  void drawScreen();
267 
268  // intros
269  void runIntro(MVideo &video);
270  void runIntros(Videos &videos);
272 
273  // levels
274  Common::String _nextLevel;
275  Common::String _currentLevel;
276  virtual Common::String findNextLevel(const Common::String &level);
277  virtual Common::String findNextLevel(const Transition *trans);
278  uint32 _levelId;
279 
280  // hotspots
281  Hotspots *_nextHotsToAdd;
282  Hotspots *_nextHotsToRemove;
283  HotspotsStack stack;
284 
285  // Movies
286  Videos _nextSequentialVideoToPlay;
287  Videos _nextParallelVideoToPlay;
288  Videos _escapeSequentialVideoToPlay;
289  Videos _videosPlaying;
290  Videos _videosLooping;
291  MVideo *_masks;
292  MVideo *_additionalVideo;
293  const Graphics::Surface *_mask;
294 
295  // Sounds
296  Filename _soundPath;
297  Audio::SeekableAudioStream *loadAudioStream(const Filename &filename, uint32 sampleRate = 22050, bool stereo = false);
298  void playSound(const Filename &filename, uint32 loops, uint32 sampleRate = 22050, bool stereo = false);
299  void playMusic(const Filename &filename, uint32 sampleRate = 22050, bool stereo = false);
300  void stopSound();
301  void stopMusic();
302  bool isMusicActive();
303 
304  // Arcade
305  Common::String _arcadeMode;
306  MVideo *_background;
307  Filename _currentPalette;
308  virtual bool availableObjectives();
309  virtual bool checkArcadeObjectives();
310  ArcadeTransitions _transitions;
311  virtual bool checkTransition(ArcadeTransitions &transitions, ArcadeShooting *arc);
312  virtual Common::Point getPlayerPosition(bool needsUpdate);
313  virtual Common::Point computeTargetPosition(const Common::Point &mousePos);
314  virtual int detectTarget(const Common::Point &mousePos);
315  virtual void pressedKey(const int keycode);
316  virtual bool clickedPrimaryShoot(const Common::Point &mousePos);
317  virtual bool clickedSecondaryShoot(const Common::Point &mousePos);
318  virtual void drawShoot(const Common::Point &mousePos);
319  virtual bool shoot(const Common::Point &mousePos, ArcadeShooting *arc, bool secondary);
320  virtual void hitPlayer();
321  virtual void missedTarget(Shoot *s, ArcadeShooting *arc);
322  virtual void missNoTarget(ArcadeShooting *arc);
323  virtual byte *getTargetColor(Common::String name, int levelId);
324  virtual bool checkRButtonUp();
325  virtual void setRButtonUp(const bool val);
326  virtual void disableGameKeymaps();
327  virtual void enableGameKeymaps();
328 
329  // Segments
330  Segments _segments;
331  uint32 _segmentIdx;
332  uint32 _segmentOffset;
333  uint32 _segmentRepetition;
334  uint32 _segmentRepetitionMax;
335  uint32 _segmentShootSequenceOffset;
336  uint32 _segmentShootSequenceMax;
337  ShootSequence _shootSequence;
338  virtual void findNextSegment(ArcadeShooting *arc);
339  virtual void initSegment(ArcadeShooting *arc);
340 
341  ArcadeStats _stats;
342  void resetStatistics();
343  void incLivesUsed();
344  void incShotsFired();
345  void incEnemyHits();
346  void incEnemyTargets();
347  void incTargetsDestroyed();
348  void incTargetsMissed();
349  void incFriendliesEncountered();
350  void incInfoReceived();
351 
352  void incScore(int inc);
353  void incBonus(int inc);
354 
355  uint32 killRatio();
356  uint32 accuracyRatio();
357 
358  Common::String _difficulty;
359  bool _skipLevel;
360  bool _loseLevel;
361  bool _skipDefeatVideo;
362  bool _skipNextVideo;
363 
364  virtual void drawCursorArcade(const Common::Point &mousePos);
365  virtual void drawPlayer();
366  virtual void drawHealth();
367  virtual void drawAmmo();
368  int _health;
369  int _maxHealth;
370 
371  int _ammo;
372  int _maxAmmo;
373 
374  int _score;
375  int _bonus;
376  int _lives;
377 
378  Common::String _healthString;
379  Common::String _scoreString;
380  Common::String _objString;
381  Common::String _targetString;
382  Common::String _directionString;
383  Common::String _enterNameString;
384 
385  Filename _shootSound;
386  Filename _hitSound;
387  Filename _additionalSound;
388  Shoots _shoots;
389  Frames _playerFrames;
390  int _playerFrameIdx;
391  Common::List<int> _playerFrameSeps;
392  int _playerFrameStart;
393  int _playerFrameSep;
394  int _playerFrameEnd;
395 
396  // Objectives
397  uint32 _objIdx;
398  uint32 _objKillsCount[2];
399  uint32 _objMissesCount[2];
400  uint32 _objKillsRequired[2];
401  uint32 _objMissesAllowed[2];
402 
403  // Fonts
404  Common::BitArray _font05;
405  Common::BitArray _font08;
406  virtual void loadFonts(const Common::String &prefix = "");
407  virtual void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c);
408 
409  // Conversation
410  Actions _conversation;
411  bool _refreshConversation;
412  virtual void showConversation();
413  virtual void endConversation();
414  virtual void rightClickedConversation(const Common::Point &mousePos);
415  virtual void leftClickedConversation(const Common::Point &mousePos);
416  virtual bool hoverConversation(const Common::Point &mousePos);
417  // Credits
418  virtual void showCredits();
419 
420  // Timers
421  int32 _countdown;
422  bool _timerStarted;
423  bool _keepTimerDuringScenes;
424  bool startAlarm(uint32, Common::String *);
425  bool startCountdown(uint32);
426  void removeTimers();
427 
428  // Random
429  Common::RandomSource *_rnd;
430 };
431 
432 struct chapterEntry {
433  int id;
434  int energyPos[2];
435  int scorePos[2];
436  int objectivesPos[2];
437  int ammoPos[2];
438  int ammoOffset;
439  int targetColor;
440 };
441 
442 class WetEngine : public HypnoEngine {
443 public:
444  WetEngine(OSystem *syst, const ADGameDescription *gd);
445  ~WetEngine();
447  Common::Array<int> _ids;
448  int _lastLevel;
449  Common::String _name;
450 
451  void loadAssets() override;
452  void loadAssetsDemoDisc();
453  void loadAssetsEarlyDemo();
454  void loadAssetsGen4();
455  void loadAssetsPCW();
456  void loadAssetsPCG();
457  void loadAssetsFullGame();
458  void loadAssetsNI();
459 
460  void loadFonts(const Common::String &prefix = "") override;
461  void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c) override;
462  void changeCursor(const Common::String &cursor) override;
463 
464  void showCredits() override;
465  bool clickedSecondaryShoot(const Common::Point &mousePos) override;
466  void drawShoot(const Common::Point &target) override;
467  void drawPlayer() override;
468  void drawHealth() override;
469  void drawAmmo() override;
470  void hitPlayer() override;
471  void drawCursorArcade(const Common::Point &mousePos) override;
472  Common::Point computeTargetPosition(const Common::Point &mousePos) override;
473  void missedTarget(Shoot *s, ArcadeShooting *arc) override;
474  void missNoTarget(ArcadeShooting *arc) override;
475 
476  void runCode(Code *code) override;
477  Common::String findNextLevel(const Common::String &level) override;
478  Common::String findNextLevel(const Transition *trans) override;
479 
480  // Saves
481  Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
482  Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
483  bool loadProfile(const Common::String &name);
484  void saveProfile(const Common::String &name, int levelId);
485 
486  // Arcade
487  Common::Point getPlayerPosition(bool needsUpdate) override;
488  bool checkTransition(ArcadeTransitions &transitions, ArcadeShooting *arc) override;
489  void pressedKey(const int keycode) override;
490  void runBeforeArcade(ArcadeShooting *arc) override;
491  void runAfterArcade(ArcadeShooting *arc) override;
492  void findNextSegment(ArcadeShooting *arc) override;
493  void initSegment(ArcadeShooting *arc) override;
494  byte *getTargetColor(Common::String name, int levelId) override;
495  bool checkRButtonUp() override;
496  void setRButtonUp(const bool val) override;
497  void disableGameKeymaps() override;
498  void enableGameKeymaps() override;
499 
500 
501  bool hasFeature(EngineFeature f) const override {
502  return (f == kSupportsReturnToLauncher);
503  }
504 
505 private:
506  Common::String getLocalizedString(const Common::String &name);
507  uint16 getNextChar(const Common::String &str, uint32 &c);
508  void drawGlyph(const Common::BitArray &font, int x, int y, int bitoffset, int width, int height, int pitch, uint32 color, bool invert);
509  void drawKoreanChar(uint16 chr, int &curx, int y, uint32 color);
510  void runMainMenu(Code *code);
511  void runLevelMenu(Code *code);
512  void runCheckLives(Code *code);
513  void endCredits(Code *code);
514  void showDemoScore();
515  uint32 findPaletteIndexZones(uint32 id);
516 
517  Common::List<int> _scoreMilestones;
518  void restoreScoreMilestones(int score);
519  bool checkScoreMilestones(int score);
520 
521 
522  Frames _c33PlayerCursor;
523  Common::Point _c33PlayerPosition;
524  Common::List<PlayerPosition> _c33PlayerDirection;
525  bool _c33UseMouse;
526  void generateStaticEffect();
527 
528  Common::BitArray _fontg9a;
529  Common::Array<uint32> _c40SegmentPath;
530  Common::Array<uint32> _c40SegmentNext;
531  int _c40SegmentIdx;
532  int _c40lastTurn;
533  int _c50LeftTurns;
534  int _c50RigthTurns;
535 
536  bool _rButtonUp;
537 };
538 
539 class SpiderEngine : public HypnoEngine {
540 public:
541  SpiderEngine(OSystem *syst, const ADGameDescription *gd);
542  ~SpiderEngine();
543  void loadAssets() override;
544  void loadAssetsDemo();
545  void loadAssetsFullGame();
546  void showCredits() override;
547 
548  void drawCursorArcade(const Common::Point &mousePos) override;
549  void drawShoot(const Common::Point &target) override;
550  void drawPlayer() override;
551  void drawHealth() override;
552  void missedTarget(Shoot *s, ArcadeShooting *arc) override;
553  void hitPlayer() override;
554 
555  // Arcade
556  void pressedKey(const int keycode) override;
557  void runBeforeArcade(ArcadeShooting *arc) override;
558  void runAfterArcade(ArcadeShooting *arc) override;
559  void findNextSegment(ArcadeShooting *arc) override;
560  void initSegment(ArcadeShooting *arc) override;
561  byte *getTargetColor(Common::String name, int levelId) override;
562 
563  void drawBackToMenu(Hotspot *h) override;
564  void runCode(Code *code) override;
565  Common::String findNextLevel(const Common::String &level) override;
566  Common::String findNextLevel(const Transition *trans) override;
567 
568  void loadFonts(const Common::String &prefix = "") override;
569  void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c) override;
570 
571  void showConversation() override;
572  void endConversation() override;
573  void rightClickedConversation(const Common::Point &mousePos) override;
574  void leftClickedConversation(const Common::Point &mousePos) override;
575  bool hoverConversation(const Common::Point &mousePos) override;
576 
577  void loadGame(const Common::String &nextLevel, int score, int puzzleDifficulty, int combatDifficulty) override;
578  Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
579  Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
580  bool canSaveAutosaveCurrently() override {
581  return false; // No hypno engine should perform autosave using the default implementation
582  }
583 
584  bool hasFeature(EngineFeature f) const override {
585  return (f == kSupportsSavingDuringRuntime || f == kSupportsLoadingDuringRuntime || f == kSupportsReturnToLauncher);
586  }
587 
588 private:
589  void runMatrix(Code *code);
590  void addIngredient(Code *code);
591  void checkMixture(Code *code);
592  void runNote(Code *code);
593  void runFusePanel(Code *code);
594  void runRecept(Code *code);
595  void runOffice(Code *code);
596  void runFileCabinet(Code *code);
597  void runLock(Code *code);
598  void runFuseBox(Code *code);
599  void runGiveUp();
600  void showScore(const Common::String &prefix);
601 
602  uint32 _currentPlayerPosition;
603  uint32 _lastPlayerPosition;
604 
605  bool _fuseState[2][10] = {};
606  bool _isFuseRust = true;
607  bool _isFuseUnreadable = false;
608  bool ingredients[7] = {};
609 
610  Common::Rect _h1Area;
611  Common::Rect _h2Area;
612  Common::Rect _h3Area;
613 
614  const Graphics::Font *_font;
615 };
616 
617 class BoyzEngine : public HypnoEngine {
618 public:
619  BoyzEngine(OSystem *syst, const ADGameDescription *gd);
620  ~BoyzEngine();
621  Common::String _name;
622  Common::Array<int> _ids;
623  int _lastLevel;
624  bool _flashbackMode;
625  void loadAssets() override;
626  void runCode(Code *code) override;
627  Common::String findNextLevel(const Common::String &level) override;
628  Common::String findNextLevel(const Transition *trans) override;
629 
630  // Scenes
631  void resetSceneState() override;
632  void runMenu(Hotspots *hs, bool only_menu = false) override;
633  bool hoverHotspot(Common::Point) override;
634 
635  // Arcade
636  void runBeforeArcade(ArcadeShooting *arc) override;
637  void runAfterArcade(ArcadeShooting *arc) override;
638  void pressedKey(const int keycode) override;
639  int detectTarget(const Common::Point &mousePos) override;
640  void drawCursorArcade(const Common::Point &mousePos) override;
641  bool shoot(const Common::Point &mousePos, ArcadeShooting *arc, bool secondary) override;
642  bool clickedSecondaryShoot(const Common::Point &mousePos) override;
643  void showCredits() override;
644  // Stats
645  void showArcadeStats(int territory, const ArcadeStats &data);
646  ArcadeStats _lastStats;
647  ArcadeStats _globalStats;
648 
649  void missedTarget(Shoot *s, ArcadeShooting *arc) override;
650  void drawHealth() override;
651  void drawAmmo() override;
652  void drawShoot(const Common::Point &target) override;
653  void hitPlayer() override;
654  void drawPlayer() override;
655  void findNextSegment(ArcadeShooting *arc) override;
656  void initSegment(ArcadeShooting *arc) override;
657  bool checkTransition(ArcadeTransitions &transitions, ArcadeShooting *arc) override;
658 
659  void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c) override;
660 
661  // Saves
662  Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
663  Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
664  Common::StringArray listProfiles();
665  bool loadProfile(const Common::String &name);
666  void saveProfile(const Common::String &name, int levelId);
667 
668  private:
669  void renderHighlights(Hotspots *hs);
670  void waitForUserClick(uint32 timeout);
671  int pickABox();
672  int _selectedCorrectBox;
673  char selectDirection();
674 
675  void runMainMenu(Code *code);
676  bool runExitMenu();
677  void runRetryMenu(Code *code);
678  void runCheckC3(Code *code);
679  void runCheckHo(Code *code);
680  void runCheckC5(Code *code);
681  void runAlarmC5(Code *code);
682  void runDifficultyMenu(Code *code);
683  void endCredits(Code *code);
684  int getTerritory(const Common::String &level);
685  Common::String lastLevelTerritory(const Common::String &level);
686  Common::String firstLevelTerritory(const Common::String &level);
687 
688  void loadSceneState(Common::SeekableReadStream *stream);
689  void saveSceneState(Common::WriteStream *stream);
690  void unlockAllLevels();
691 
692  int _previousHealth;
693  Graphics::Surface _healthBar[7];
694  Graphics::Surface _ammoBar[7];
695  Graphics::Surface _portrait[7];
696  Filename _deathDay[7];
697  Filename _deathNight[7];
698 
699  Filename _weaponShootSound[8];
700  Filename _weaponReloadSound[8];
701  Filename _heySound[7];
702  int _weaponMaxAmmo[8];
703 
704  byte *_crosshairsPalette;
705  Graphics::Surface _crosshairsInactive[8];
706  Graphics::Surface _crosshairsActive[8];
707  Graphics::Surface _crosshairsTarget[8];
708  Graphics::Surface _leftArrowPointer;
709  Graphics::Surface _rightArrowPointer;
710  Graphics::Surface _crossPointer;
711 
712  void updateFromScript();
713  bool checkCup(const Common::String &name);
714 
715  Script _currentScript;
716  ScriptMode _currentMode;
717  uint32 _currentActor;
718  uint32 _currentWeapon;
719  Common::Array<Filename> _warningVideosDay;
720  Common::Array<Filename> _warningVideosNight;
721  Common::Array<Filename> _warningAlarmVideos;
722  Filename _warningHostage;
723 
724  Common::Array<Filename> _deathVideo;
725  Common::HashMap<Common::String, bool> _shootsDestroyed;
726 
727  bool hasFeature(EngineFeature f) const override {
728  return (f == kSupportsReturnToLauncher);
729  }
730 };
731 
732 } // End of namespace Hypno
733 
734 #endif
bool canSaveAutosaveCurrently() override
Definition: hypno.h:580
Definition: grammar.h:732
Definition: image_decoder.h:53
Definition: grammar.h:333
Definition: str.h:59
Definition: installshieldv3_archive.h:35
Definition: font.h:83
Definition: hypno.h:617
Definition: surface.h:67
Definition: grammar.h:359
EngineFeature
Definition: engine.h:258
Definition: grammar.h:121
Definition: libfile.h:39
Definition: stream.h:77
Definition: error.h:81
Definition: grammar.h:221
Definition: grammar.h:244
Definition: grammar.h:440
Definition: pixelformat.h:138
Definition: grammar.h:152
Definition: advancedDetector.h:164
Definition: random.h:44
Definition: hypno.h:432
Definition: grammar.h:214
Definition: grammar.h:235
Definition: hypno.h:539
Definition: list.h:44
Definition: rect.h:524
Definition: path.h:52
Definition: grammar.h:707
Definition: stream.h:745
Definition: audiostream.h:212
Definition: subtitles.h:77
Definition: grammar.h:228
Definition: mixer.h:49
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: hypno.h:200
Definition: hypno.h:442
Definition: grammar.h:187
Definition: grammar.h:48
Definition: hypno.h:136
Definition: grammar.h:262
Definition: hashmap.h:85
Definition: ustr.h:57
Definition: grammar.h:311
Definition: fs.h:69
Definition: bitarray.h:29
Definition: rect.h:144
Definition: grammar.h:35
Definition: grammar.h:253
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: hypno.h:202
Definition: grammar.h:132
bool hasFeature(EngineFeature f) const override
Definition: hypno.h:501
Definition: grammar.h:600
Definition: grammar.h:745
Definition: grammar.h:141
Definition: grammar.h:277
Definition: grammar.h:207
Definition: grammar.h:104
bool hasFeature(EngineFeature f) const override
Definition: hypno.h:584
Definition: system.h:163
Definition: hypno.h:114
bool canSaveAutosaveCurrently() override
Definition: hypno.h:201
Definition: movie_decoder.h:32
Definition: engine.h:144
Definition: grammar.h:395
Definition: system.h:38
Definition: grammar.h:170
Platform
Definition: platform.h:93
Definition: grammar.h:294
Language
Definition: language.h:45