22 #ifndef NANCY_STATE_SCENE_H 23 #define NANCY_STATE_SCENE_H 25 #include "common/singleton.h" 26 #include "common/queue.h" 28 #include "engines/nancy/commontypes.h" 29 #include "engines/nancy/puzzledata.h" 31 #include "engines/nancy/action/actionmanager.h" 33 #include "engines/nancy/state/state.h" 35 #include "engines/nancy/ui/fullscreenimage.h" 36 #include "engines/nancy/ui/viewport.h" 37 #include "engines/nancy/ui/textbox.h" 38 #include "engines/nancy/ui/inventorybox.h" 39 #include "engines/nancy/ui/inventorypopup.h" 40 #include "engines/nancy/ui/notebookpopup.h" 41 #include "engines/nancy/ui/cellphonepopup.h" 42 #include "engines/nancy/ui/conversationpopup.h" 45 class SeekableReadStream;
53 struct SceneChangeDescription;
56 class ConversationSound;
57 class PlaySecondaryMovie;
68 class ViewportOrnaments;
69 class TextboxOrnaments;
70 class InventoryBoxOrnaments;
85 uint16 videoFormat = kLargeVideoFormat;
89 byte panningType = kPan360;
90 uint16 numberOfVideoFrames = 0;
91 uint16 degreesPerRotation = 18;
92 uint16 totalViewAngle = 0;
93 uint16 horizontalScrollDelta = 1;
94 uint16 verticalScrollDelta = 10;
95 uint16 horizontalEdgeSize = 15;
96 uint16 verticalEdgeSize = 15;
97 Time slowMoveTimeDelta = 400;
98 Time fastMoveTimeDelta = 66;
101 Math::Vector3d listenerPosition;
111 void process()
override;
112 void onStateEnter(
const NancyState::NancyState prevState)
override;
113 bool onStateExit(
const NancyState::NancyState nextState)
override;
116 void setDestroyOnExit() { _destroyOnExit =
true; }
118 bool isRunningAd()
const {
return _isRunningAd; }
121 void pushScene(int16 itemID = -1);
122 void popScene(
bool inventory =
false);
131 void startUIPrepScene(int16 uiType, int16 prepSceneID);
132 void finishUIPrepScene();
133 bool isUIPrepActive()
const {
return _uiPrep.active; }
134 uint16 getSceneCounts(int16 hours)
const {
135 return _flags.sceneCounts.contains(hours) ? _flags.sceneCounts[hours] : 0;
138 void setPlayerTime(
Time time, byte relative);
139 Time getPlayerTime()
const {
return _timers.playerTime; }
140 Time getTimerTime()
const {
return _timers.timerIsActive ? _timers.timerTime : 0; }
141 byte getPlayerTOD()
const;
143 void addItemToInventory(int16
id);
144 void removeItemFromInventory(int16
id,
bool pickUp =
true);
145 int16 getHeldItem()
const {
return _flags.heldItem; }
146 void setHeldItem(int16
id);
147 void setNoHeldItem();
148 byte hasItem(int16
id)
const;
149 byte getItemDisabledState(int16
id)
const {
return _flags.disabledItems[id]; }
150 void setItemDisabledState(int16
id, byte state) {
151 if ((uint16)
id < _flags.disabledItems.size())
152 _flags.disabledItems[
id] = state;
156 void playItemCantSound(int16 itemID = -1,
bool notHoldingSound =
false);
158 void setEventFlag(int16 label, byte flag);
160 bool getEventFlag(int16 label, byte flag)
const;
164 bool isSoftwareTimerActive(uint16 index)
const;
165 uint32 getSoftwareTimerElapsed(uint16 index)
const;
171 int32 getUIResource(uint index);
172 void setUIResource(uint index, int32 value);
174 void setLogicCondition(int16 label, byte flag);
175 bool getLogicCondition(int16 label, byte flag)
const;
176 void clearLogicConditions();
177 Time getLogicConditionTimestamp(int16 label)
const {
178 return _flags.logicConditions[label].timestamp;
181 void setDifficulty(uint difficulty) { _difficulty = difficulty; }
182 uint16 getDifficulty()
const {
return _difficulty; }
184 byte getHintsRemaining()
const {
return _hintsRemaining[_difficulty]; }
185 void useHint(uint16 characterID, uint16 hintID);
187 void requestStateChange(NancyState::NancyState state) { _gameStateRequested = state; }
188 void resetStateToInit() { _state = kInit; }
190 void resetAndStartTimer() { _timers.timerIsActive =
true; _timers.timerTime = 0; }
191 void stopTimer() { _timers.timerIsActive =
false; _timers.timerTime = 0; }
193 Time getMovementTimeDelta(
bool fast)
const {
return fast ? _sceneState.summary.fastMoveTimeDelta : _sceneState.summary.slowMoveTimeDelta; }
198 void setPlayerScrolling(
bool enabled);
199 bool getPlayerScrolling()
const;
201 void registerGraphics();
220 const SceneSummary &getSceneSummary()
const {
return _sceneState.summary; }
226 void notifyRandomMovieARLoaded() { _hadRandomMovieARThisScene =
true; }
233 void beginLightning(int16 distance, uint16 pulseTime, int16 rgbPercent);
236 void specialEffect(byte type, uint16 fadeToBlackTime, uint16 frameTime);
237 void specialEffect(byte type, uint16 totalTime, uint16 fadeToBlackTime,
Common::Rect rect);
249 State getState()
const {
return _state; }
250 void setState(State state) { _state = state; }
254 void closeActivePopups();
261 bool timerIsActive =
false;
263 Time playerTimeNextMinute;
272 void load(
bool fromSaveFile =
false);
278 void tickSoftwareTimers(uint32 deltaMs);
285 void initStaticData();
287 void clearSceneData(
bool nextIsNoArt =
false);
288 void clearPuzzleData();
291 int16 eventFlagToIndex(int16 label)
const;
298 bool isScenePushed =
false;
300 int16 pushedInvItemID = -1;
301 bool isInvScenePushed =
false;
317 int16 primaryVideoResponsePicked = -1;
320 struct InventorySoundOverride {
321 bool isDefault =
false;
339 Time _buttonPressActivationTime;
343 int _pendingTaskbarButton;
353 SceneState _sceneState;
357 int16 _lastHintCharacter;
359 NancyState::NancyState _gameStateRequested;
373 bool _hadRandomMovieARThisScene =
false;
376 bool _escHeld =
false;
389 uint32 startMillis = 0;
395 #define NancySceneState Nancy::State::Scene::instance() 400 #endif // NANCY_STATE_SCENE_H Definition: managed_surface.h:51
Definition: viewport.h:42
Definition: commontypes.h:165
Definition: puzzledata.h:37
Definition: inventorybox.h:42
Definition: secondarymovie.h:46
Definition: conversation.h:41
Definition: serializer.h:80
Definition: actionmanager.h:48
Definition: soundequalizerpuzzle.h:27
Definition: renderobject.h:36
Definition: ornaments.h:30
Definition: lightning.h:32
Definition: algorithm.h:29
Definition: commontypes.h:282
Definition: puzzledata.h:298
Definition: puzzledata.h:288
Definition: ornaments.h:38
Definition: fullscreenimage.h:30
Definition: ornaments.h:46
Definition: commontypes.h:180
Definition: actionmanager.h:32
Definition: singleton.h:42