22#ifndef HOLLYWOOD_RUNAWAY_SCENE5030_H
23#define HOLLYWOOD_RUNAWAY_SCENE5030_H
25#include "common/random.h"
26#include "common/ustr.h"
27#include "hollywood/resource.h"
28#include "hollywood/runaway/animation.h"
29#include "hollywood/runaway/audio.h"
30#include "hollywood/runaway/graphics.h"
31#include "hollywood/runaway/inventory.h"
32#include "hollywood/runaway/presentation.h"
33#include "hollywood/runaway/scene.h"
34#include "hollywood/runaway/video.h"
35#include "hollywood/scene_text_store.h"
45 kScreenWidth = kRunawayScreenWidth, kScreenHeight = kRunawayScreenHeight,
46 kRoomWidth = 1376, kRoomHeight = kRunawayViewportHeight, kRoomTop = kRunawayViewportTop
50 RunawayGameType game = kRunawayCabinDemo) :
51 _audio(audio), _inventory(inventory), _strings(strings), _game(game), _interrogation(mixer), _random(
"runawayShack"), _actor(),
52 _speech(audio, _random, game == kRunawayFullGame ? RunawaySpeech::kRecordedLipSync : RunawaySpeech::kTextLipSync),
54 bool load(uint16 entryScene)
override;
55 void start(uint32 now)
override;
56 void resume()
override;
57 void click(
Common::Point mouse, RunawayVerb verb,
byte item)
override;
58 void update(uint32 now,
int scrollDirection,
bool inventoryOpen)
override;
60 void setCameraX(
int x)
override;
61 int cameraX()
const override {
return _cameraX; }
62 int roomWidth()
const override {
return kRoomWidth; }
65 Common::U32String actionCaption(
byte hotspot, RunawayVerb verb,
byte item)
const override;
66 const Common::U32String &committedCaption()
const override {
return _committedCaption; }
67 const Common::U32String &subtitle()
const override {
return _action == kPeekConversation ? _interrogation.subtitle() : _speech.subtitle(); }
68 bool busy()
const override {
return _action != kNone || _transition.scene; }
69 bool speaking()
const override {
return _action == kPeekConversation ? _interrogation.speaking() : _speechRow != 0; }
70 byte speechFrame()
const override {
return _speech.frame(_now); }
71 void skipSpeech()
override;
72 bool playingVideo()
const override {
return _action == kIntroVideo || _action == kCleanWindowVideo; }
73 bool inventoryPresentation()
const override {
return _action == kIntroInventory; }
74 void skipVideo()
override;
77 bool escaped()
const override {
return _escaped; }
78 bool canSave()
const override {
return !busy() && !speaking() && !_escaped && !_walkPath.active(); }
80 bool restoreState(
const RunawaySaveState &state, uint32 now,
bool entering =
false)
override;
81 void setOptions(
bool antialias,
bool fastScrolling)
override { _antialias = antialias; _fastScrolling = fastScrolling; }
86 kNone, kIntroVideo, kIntro, kIntroLookAround, kIntroInventory,
87 kIntroListen, kIntroWalkToDoor, kIntroExamineDoor,
88 kOpenLid, kCloseLid, kUnplug,
89 kCleanWindowSpeech, kCleanWindowClimb, kCleanWindowVideo,
90 kWaitSpeech, kWalkingAction, kPickup, kShirt,
91 kMeltIce, kMeltWait, kInspectIce, kFinishMelting,
92 kTryMoveCooler, kMoveCooler, kRevealHatch, kFinishMoving, kHatchFound,
93 kDrainCooler, kFinishDraining, kPryHatch, kOpenHatch, kEscape,
94 kPeekDoor, kPeekConversation, kReturnFromPeek,
95 kHeatHelmet, kPrepareStirringHelmet, kStirHelmet, kEnterHatch
97 enum IceState { kFrozen, kMelted, kDrained };
98 enum HatchState { kHidden, kLocked, kUnlocked, kOpen };
99 bool loadRoomGraphics();
101 void arrive(
bool faceHotspot =
true);
102 void say(uint16 row);
103 void sayCue(uint16 cue,
byte variation);
104 void pickUp(
byte hotspot,
byte item, uint patch);
105 void useItem(
byte item,
byte hotspot);
106 void examine(
byte hotspot);
107 void collect(
byte hotspot);
108 void waitForSpeech(uint16 cue,
byte variation, Action next);
109 void walkForAction(
Common::Point target,
byte facing, Action next);
112 void showSpeechRow();
114 void playWalkFootstep();
115 void startAction(Action action);
118 void applyPatch(uint chunk);
131 const RunawayGameType _game;
134 bool _peeked =
false;
135 bool _entering =
false;
136 bool _antialias =
true, _fastScrolling =
true;
140 RunawayAnimation _intro, _lidActor, _lid, _unplug, _climb, _actionAnimation, _water, _hatch;
144 byte _facing = 3, _pendingHotspot = 0;
145 byte _pendingItem = 0;
146 RunawayVerb _pendingVerb = kVerbWalk;
147 Action _action = kNone;
148 Action _afterSpeech = kNone, _afterWalk = kNone;
149 byte _actionFacing = 0, _pickupHotspot = 0;
150 bool _lidOpen =
false, _unplugged =
false;
151 bool _windowClean =
false;
152 bool _coolerMoved =
false, _coolerInspected =
false, _escaped =
false;
153 IceState _ice = kFrozen;
154 HatchState _hatchState = kHidden;
155 bool _pickedUp[20] = {};
156 bool _examined[20] = {};
157 bool _globalSpeech =
false;
158 uint32 _now = 0, _lastUpdate = 0, _actionStarted = 0;
159 uint32 _walkElapsed = 0, _lastFootstep = 0;
161 uint16 _speechRow = 0, _speechEnd = 0;
162 uint16 _speechSample = 0;
Definition: managed_surface.h:51
Definition: resource.h:59
Definition: scene5030.h:42
Definition: graphics.h:69
Definition: graphics.h:54
Definition: animation.h:47
Definition: presentation.h:82
Definition: inventory.h:41
Definition: navigation.h:45
Definition: scene_text_store.h:64
Definition: inventory.h:44
Definition: saveload.h:32