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" 41 class SeekableReadStream;
49 struct SceneChangeDescription;
52 class ConversationSound;
53 class PlaySecondaryMovie;
63 class ViewportOrnaments;
64 class TextboxOrnaments;
65 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);
124 void setPlayerTime(
Time time, byte relative);
125 Time getPlayerTime()
const {
return _timers.playerTime; }
126 Time getTimerTime()
const {
return _timers.timerIsActive ? _timers.timerTime : 0; }
127 byte getPlayerTOD()
const;
129 void addItemToInventory(int16
id);
130 void removeItemFromInventory(int16
id,
bool pickUp =
true);
131 int16 getHeldItem()
const {
return _flags.heldItem; }
132 void setHeldItem(int16
id);
133 void setNoHeldItem();
134 byte hasItem(int16
id)
const;
135 byte getItemDisabledState(int16
id)
const {
return _flags.disabledItems[id]; }
136 void setItemDisabledState(int16
id, byte state) { _flags.disabledItems[id] = state; }
139 void playItemCantSound(int16 itemID = -1,
bool notHoldingSound =
false);
141 void setEventFlag(int16 label, byte flag);
143 bool getEventFlag(int16 label, byte flag)
const;
146 void setLogicCondition(int16 label, byte flag);
147 bool getLogicCondition(int16 label, byte flag)
const;
148 void clearLogicConditions();
150 void setDifficulty(uint difficulty) { _difficulty = difficulty; }
151 uint16 getDifficulty()
const {
return _difficulty; }
153 byte getHintsRemaining()
const {
return _hintsRemaining[_difficulty]; }
154 void useHint(uint16 characterID, uint16 hintID);
156 void requestStateChange(NancyState::NancyState state) { _gameStateRequested = state; }
157 void resetStateToInit() { _state = kInit; }
159 void resetAndStartTimer() { _timers.timerIsActive =
true; _timers.timerTime = 0; }
160 void stopTimer() { _timers.timerIsActive =
false; _timers.timerTime = 0; }
162 Time getMovementTimeDelta(
bool fast)
const {
return fast ? _sceneState.summary.fastMoveTimeDelta : _sceneState.summary.slowMoveTimeDelta; }
164 void registerGraphics();
178 const SceneSummary &getSceneSummary()
const {
return _sceneState.summary; }
188 void beginLightning(int16 distance, uint16 pulseTime, int16 rgbPercent);
191 void specialEffect(byte type, uint16 fadeToBlackTime, uint16 frameTime);
192 void specialEffect(byte type, uint16 totalTime, uint16 fadeToBlackTime,
Common::Rect rect);
199 void load(
bool fromSaveFile =
false);
203 void initStaticData();
205 void clearSceneData();
206 void clearPuzzleData();
220 bool isScenePushed =
false;
222 int16 pushedInvItemID = -1;
223 bool isInvScenePushed =
false;
231 bool timerIsActive =
false;
233 Time playerTimeNextMinute;
249 int16 primaryVideoResponsePicked = -1;
252 struct InventorySoundOverride {
253 bool isDefault =
false;
266 Time _buttonPressActivationTime;
276 SceneState _sceneState;
281 int16 _lastHintCharacter;
283 NancyState::NancyState _gameStateRequested;
306 #define NancySceneState Nancy::State::Scene::instance() 311 #endif // NANCY_STATE_SCENE_H Definition: managed_surface.h:51
Definition: viewport.h:41
Definition: commontypes.h:151
Definition: puzzledata.h:36
Definition: inventorybox.h:42
Definition: secondarymovie.h:44
Definition: conversation.h:42
Definition: serializer.h:79
Definition: actionmanager.h:48
Definition: soundequalizerpuzzle.h:27
Definition: renderobject.h:36
Definition: ornaments.h:30
Definition: lightning.h:32
Definition: actionrecord.h:97
Definition: algorithm.h:29
Definition: commontypes.h:254
Definition: ornaments.h:38
Definition: fullscreenimage.h:30
Definition: ornaments.h:46
Definition: commontypes.h:166
Definition: actionmanager.h:32
Definition: singleton.h:42