25 #include "common/hashmap.h" 26 #include "common/hash-str.h" 27 #include "common/savefile.h" 28 #include "common/serializer.h" 30 #include "engines/myst3/myst3.h" 43 #define DECLARE_VAR(name) \ 44 void set##name(int32 value) { engineSet(#name, value); } \ 45 int32 get##name() { return engineGet(#name); } \ 46 bool hasVar##name() { return _varDescriptions.contains(#name); } 57 int32 getVar(uint16 var);
58 void setVar(uint16 var, int32 value);
59 bool evaluate(int16 condition);
60 int32 valueOrVarValue(int16 value);
65 DECLARE_VAR(CursorTransparency)
67 DECLARE_VAR(ProjectorAngleX)
68 DECLARE_VAR(ProjectorAngleY)
69 DECLARE_VAR(ProjectorAngleZoom)
70 DECLARE_VAR(ProjectorAngleBlur)
71 DECLARE_VAR(DraggedWeight)
73 DECLARE_VAR(DragEnded)
74 DECLARE_VAR(DragLeverSpeed)
75 DECLARE_VAR(DragPositionFound)
76 DECLARE_VAR(DragLeverPositionChanged)
78 DECLARE_VAR(LocationAge)
79 DECLARE_VAR(LocationRoom)
80 DECLARE_VAR(LocationNode)
81 DECLARE_VAR(BookSavedAge)
82 DECLARE_VAR(BookSavedRoom)
83 DECLARE_VAR(BookSavedNode)
84 DECLARE_VAR(MenuSavedAge)
85 DECLARE_VAR(MenuSavedRoom)
86 DECLARE_VAR(MenuSavedNode)
88 DECLARE_VAR(SecondsCountdown)
89 DECLARE_VAR(TickCountdown)
91 DECLARE_VAR(SweepEnabled)
92 DECLARE_VAR(SweepValue)
93 DECLARE_VAR(SweepStep)
97 DECLARE_VAR(InputMousePressed)
98 DECLARE_VAR(InputEscapePressed)
99 DECLARE_VAR(InputTildePressed)
100 DECLARE_VAR(InputSpacePressed)
102 DECLARE_VAR(HotspotActiveRect)
104 DECLARE_VAR(WaterEffectRunning)
105 DECLARE_VAR(WaterEffectActive)
106 DECLARE_VAR(WaterEffectSpeed)
107 DECLARE_VAR(WaterEffectAttenuation)
108 DECLARE_VAR(WaterEffectFrequency)
109 DECLARE_VAR(WaterEffectAmpl)
110 DECLARE_VAR(WaterEffectMaxStep)
111 DECLARE_VAR(WaterEffectAmplOffset)
113 DECLARE_VAR(LavaEffectActive)
114 DECLARE_VAR(LavaEffectSpeed)
115 DECLARE_VAR(LavaEffectAmpl)
116 DECLARE_VAR(LavaEffectStepSize)
118 DECLARE_VAR(MagnetEffectActive)
119 DECLARE_VAR(MagnetEffectSpeed)
120 DECLARE_VAR(MagnetEffectUnk1)
121 DECLARE_VAR(MagnetEffectUnk2)
122 DECLARE_VAR(MagnetEffectSound)
123 DECLARE_VAR(MagnetEffectNode)
124 DECLARE_VAR(MagnetEffectUnk3)
126 DECLARE_VAR(ShakeEffectAmpl)
127 DECLARE_VAR(ShakeEffectTickPeriod)
128 DECLARE_VAR(RotationEffectSpeed)
129 DECLARE_VAR(SunspotIntensity)
130 DECLARE_VAR(SunspotColor)
131 DECLARE_VAR(SunspotRadius)
133 DECLARE_VAR(AmbiantFadeOutDelay)
134 DECLARE_VAR(AmbiantPreviousFadeOutDelay)
135 DECLARE_VAR(AmbientOverrideFadeOutDelay)
136 DECLARE_VAR(SoundScriptsSuspended)
138 DECLARE_VAR(SoundNextMultipleSounds)
139 DECLARE_VAR(SoundNextIsChoosen)
140 DECLARE_VAR(SoundNextId)
141 DECLARE_VAR(SoundNextIsLast)
142 DECLARE_VAR(SoundScriptsTimer)
143 DECLARE_VAR(SoundScriptsPaused)
144 DECLARE_VAR(SoundScriptFadeOutDelay)
146 DECLARE_VAR(CursorLocked)
147 DECLARE_VAR(CursorHidden)
149 DECLARE_VAR(CameraPitch)
150 DECLARE_VAR(CameraHeading)
151 DECLARE_VAR(CameraMinPitch)
152 DECLARE_VAR(CameraMaxPitch)
154 DECLARE_VAR(MovieStartFrame)
155 DECLARE_VAR(MovieEndFrame)
156 DECLARE_VAR(MovieVolume1)
157 DECLARE_VAR(MovieVolume2)
158 DECLARE_VAR(MovieOverrideSubtitles)
159 DECLARE_VAR(MovieConditionBit)
160 DECLARE_VAR(MoviePreloadToMemory)
161 DECLARE_VAR(MovieScriptDriven)
162 DECLARE_VAR(MovieNextFrameSetVar)
163 DECLARE_VAR(MovieNextFrameGetVar)
164 DECLARE_VAR(MovieStartFrameVar)
165 DECLARE_VAR(MovieEndFrameVar)
166 DECLARE_VAR(MovieForce2d)
167 DECLARE_VAR(MovieVolumeVar)
168 DECLARE_VAR(MovieSoundHeading)
169 DECLARE_VAR(MoviePanningStrenght)
170 DECLARE_VAR(MovieSynchronized)
171 DECLARE_VAR(MovieOverrideCondition)
172 DECLARE_VAR(MovieUVar)
173 DECLARE_VAR(MovieVVar)
174 DECLARE_VAR(MovieOverridePosition)
175 DECLARE_VAR(MovieOverridePosU)
176 DECLARE_VAR(MovieOverridePosV)
177 DECLARE_VAR(MovieAdditiveBlending)
178 DECLARE_VAR(MovieTransparency)
179 DECLARE_VAR(MovieTransparencyVar)
180 DECLARE_VAR(MoviePlayingVar)
181 DECLARE_VAR(MovieStartSoundId)
182 DECLARE_VAR(MovieStartSoundVolume)
183 DECLARE_VAR(MovieStartSoundHeading)
184 DECLARE_VAR(MovieStartSoundAttenuation)
186 DECLARE_VAR(MovieUseBackground)
187 DECLARE_VAR(CameraSkipAnimation)
188 DECLARE_VAR(MovieAmbiantScriptStartFrame)
189 DECLARE_VAR(MovieAmbiantScript)
190 DECLARE_VAR(MovieScriptStartFrame)
191 DECLARE_VAR(MovieScript)
193 DECLARE_VAR(CameraMoveSpeed)
195 DECLARE_VAR(TransitionSound)
196 DECLARE_VAR(TransitionSoundVolume)
198 DECLARE_VAR(LocationNextNode)
199 DECLARE_VAR(LocationNextRoom)
200 DECLARE_VAR(LocationNextAge)
202 DECLARE_VAR(BallPosition)
203 DECLARE_VAR(BallFrame)
204 DECLARE_VAR(BallLeverLeft)
205 DECLARE_VAR(BallLeverRight)
207 DECLARE_VAR(BallDoorOpen)
209 DECLARE_VAR(ProjectorX)
210 DECLARE_VAR(ProjectorY)
211 DECLARE_VAR(ProjectorZoom)
212 DECLARE_VAR(ProjectorBlur)
213 DECLARE_VAR(ProjectorAngleXOffset)
214 DECLARE_VAR(ProjectorAngleYOffset)
215 DECLARE_VAR(ProjectorAngleZoomOffset)
216 DECLARE_VAR(ProjectorAngleBlurOffset)
218 DECLARE_VAR(JournalAtrusState)
219 DECLARE_VAR(JournalSaavedroState)
220 DECLARE_VAR(JournalSaavedroClosed)
221 DECLARE_VAR(JournalSaavedroOpen)
222 DECLARE_VAR(JournalSaavedroLastPage)
223 DECLARE_VAR(JournalSaavedroChapter)
224 DECLARE_VAR(JournalSaavedroPageInChapter)
226 DECLARE_VAR(TeslaAllAligned)
227 DECLARE_VAR(TeslaTopAligned)
228 DECLARE_VAR(TeslaMiddleAligned)
229 DECLARE_VAR(TeslaBottomAligned)
230 DECLARE_VAR(TeslaMovieStart)
232 DECLARE_VAR(AmateriaSecondsCounter)
233 DECLARE_VAR(AmateriaTicksCounter)
235 DECLARE_VAR(ResonanceRingsSolved)
237 DECLARE_VAR(PinballRemainingPegs)
239 DECLARE_VAR(OuterShieldUp)
240 DECLARE_VAR(InnerShieldUp)
241 DECLARE_VAR(SaavedroStatus)
243 DECLARE_VAR(BookStateTomahna)
244 DECLARE_VAR(BookStateReleeshahn)
246 DECLARE_VAR(SymbolCode2Solved)
247 DECLARE_VAR(SymbolCode1AllSolved)
248 DECLARE_VAR(SymbolCode1CurrentSolved)
249 DECLARE_VAR(SymbolCode1TopSolved)
250 DECLARE_VAR(SymbolCode1LeftSolved)
251 DECLARE_VAR(SymbolCode1RightSolved)
253 DECLARE_VAR(SoundVoltaicUnk540)
254 DECLARE_VAR(SoundEdannaUnk587)
255 DECLARE_VAR(SoundAmateriaUnk627)
256 DECLARE_VAR(SoundAmateriaUnk930)
257 DECLARE_VAR(SoundEdannaUnk1031)
258 DECLARE_VAR(SoundVoltaicUnk1146)
260 DECLARE_VAR(ZipModeEnabled)
261 DECLARE_VAR(SubtitlesEnabled)
262 DECLARE_VAR(WaterEffects)
263 DECLARE_VAR(TransitionSpeed)
264 DECLARE_VAR(MouseSpeed)
265 DECLARE_VAR(DialogResult)
267 DECLARE_VAR(MenuEscapePressed)
268 DECLARE_VAR(MenuNextAction)
269 DECLARE_VAR(MenuLoadBack)
270 DECLARE_VAR(MenuSaveBack)
271 DECLARE_VAR(MenuSaveAction)
272 DECLARE_VAR(MenuOptionsBack)
274 DECLARE_VAR(MenuSaveLoadPageLeft)
275 DECLARE_VAR(MenuSaveLoadPageRight)
276 DECLARE_VAR(MenuSaveLoadSelectedItem)
277 DECLARE_VAR(MenuSaveLoadCurrentPage)
279 DECLARE_VAR(OverallVolume)
280 DECLARE_VAR(MusicVolume)
281 DECLARE_VAR(MusicFrequency)
282 DECLARE_VAR(LanguageAudio)
283 DECLARE_VAR(LanguageText)
284 DECLARE_VAR(HotspotIgnoreClick)
285 DECLARE_VAR(HotspotHovered)
286 DECLARE_VAR(SpotSubtitle)
288 DECLARE_VAR(DragLeverLimited)
289 DECLARE_VAR(DragLeverLimitMin)
290 DECLARE_VAR(DragLeverLimitMax)
292 DECLARE_VAR(ShieldEffectActive)
295 DECLARE_VAR(GamePadActionPressed)
296 DECLARE_VAR(GamePadDownPressed)
297 DECLARE_VAR(GamePadUpPressed)
298 DECLARE_VAR(GamePadLeftPressed)
299 DECLARE_VAR(GamePadRightPressed)
300 DECLARE_VAR(GamePadCancelPressed)
302 DECLARE_VAR(DragWithDirectionKeys)
303 DECLARE_VAR(MenuSavesAvailable)
304 DECLARE_VAR(MenuSelectedSave)
305 DECLARE_VAR(MenuAttractCountDown)
306 DECLARE_VAR(MovieOptional)
307 DECLARE_VAR(VibrationEnabled)
308 DECLARE_VAR(StateCanSave)
310 void updateFrameCounters();
311 uint getTickCount()
const;
316 ViewType getViewType() {
return static_cast<ViewType
>(_data.currentNodeType); }
317 void setViewType(ViewType t) { _data.currentNodeType = t; }
319 float getLookAtFOV() {
return _data.lookatFOV; }
320 void setLookAtFOV(
float fov) { _data.lookatFOV = fov; }
321 float getLookAtPitch() {
return _data.lookatPitch; }
322 float getLookAtHeading() {
return _data.lookatHeading; }
323 void lookAt(
float pitch,
float heading) { _data.lookatPitch = pitch; _data.lookatHeading = heading; }
325 void limitCubeCamera(
float minPitch,
float maxPitch,
float minHeading,
float maxHeading);
326 void freeCubeCamera() { _data.limitCubeCamera =
false; }
327 bool isCameraLimited() {
return _data.limitCubeCamera != 0; }
328 float getMinPitch() {
return _data.minPitch; }
329 float getMaxPitch() {
return _data.maxPitch; }
330 float getMinHeading() {
return _data.minHeading; }
331 float getMaxHeading() {
return _data.maxHeading; }
333 void markNodeAsVisited(uint16 node, uint16 room, uint32 age);
334 bool isZipDestinationAvailable(uint16 node, uint16 room, uint32 age);
345 uint32 nextSecondsUpdate;
346 uint32 secondsPlayed;
355 uint32 currentNodeType;
361 uint32 limitCubeCamera;
368 uint32 inventoryCount;
369 uint32 inventoryList[7];
370 uint32 zipDestinations[64];
392 static const uint kThumbnailWidth = 240;
393 static const uint kThumbnailHeight = 135;
399 static const uint32 kSaveVersion = 150;
403 static const uint32 kTickDuration = 1000 / 30;
404 uint32 _lastTickStartTime;
406 struct VarDescription {
407 VarDescription() : var(0), name(0), unknown(0) {}
408 VarDescription(uint16 v,
const char *n,
bool u) : var(v), name(n), unknown(u) {}
417 VarMap _varDescriptions;
419 void checkRange(uint16 var);
420 const VarDescription findDescription(uint16 var);
421 void shiftVariables(uint16 base, int32 value);
427 Common::Serializer::Version minVersion = 0,
428 Common::Serializer::Version maxVersion = Common::Serializer::kLastVersion);
430 void updateTickCounters();
446 #endif // VARIABLES_H_
Definition: savefile.h:54
Definition: serializer.h:79
void pauseEngine(bool pause)
Definition: database.h:162
Definition: savefile.h:142