ScummVM API documentation
scene_common.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  * Additional copyright for this file:
8  * Copyright (C) 1995 Presto Studios, Inc.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14 
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19 
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef BURIED_SCENE_COMMON_H
26 #define BURIED_SCENE_COMMON_H
27 
28 #include "buried/avi_frames.h"
29 #include "buried/bookdata.h"
30 #include "buried/inndata.h"
31 #include "buried/environ/scene_base.h"
32 
33 namespace Buried {
34 
35 class BasicDoor : public SceneBase {
36 public:
37  BasicDoor(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
38  int left = -1, int top = -1, int right = -1, int bottom = -1, int timeZone = -1, int environment = -1,
39  int node = -1, int facing = -1, int orientation = -1, int depth = -1, int transitionType = -1, int transitionData = -1,
40  int transitionStartFrame = -1, int transitionLength = -1, int openingSoundID = -1);
41 
42  int mouseDown(Window *viewWindow, const Common::Point &pointLocation);
43  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
44  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
45 
46  bool _clicked;
47  Common::Rect _clickable;
48  DestinationScene _destData;
49  int _openingSoundID;
50 };
51 
52 class TurnDepthPreChange : public SceneBase {
53 public:
54  TurnDepthPreChange(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
55  byte &flag, int upDepth = -1, int leftDepth = -1, int rightDepth = -1, int downDepth = -1, int forwardDepth = -1);
56 };
57 
58 class GenericItemAcquire : public SceneBase {
59 public:
60  GenericItemAcquire(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
61  int left, int top, int right, int bottom, int itemID, int clearStillFrame, byte &itemFlag);
62  int mouseDown(Window *viewWindow, const Common::Point &pointLocation);
63  virtual int droppedItem(Window *viewWindow, int itemID, const Common::Point &pointLocation, int itemFlags);
64  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
65 
66 protected:
67  bool _itemPresent;
68  Common::Rect _acquireRegion;
69  int _fullFrameIndex;
70  int _clearFrameIndex;
71  int _itemID;
72  byte &_itemFlag;
73 };
74 
76 public:
77  PlaySoundExitingFromScene(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
78  int soundFileNameID = -1);
79  int postExitRoom(Window *viewWindow, const Location &newLocation);
80 
81 private:
82  int _soundFileNameID;
83 };
84 
86 public:
87  PlaySoundExitingFromSceneDeux(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
88  int soundFileNameID = -1);
89  int postExitRoom(Window *viewWindow, const Location &newLocation);
90 
91 private:
92  int _soundFileNameID;
93 };
94 
96 public:
97  PlaySoundEnteringScene(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
98  int soundFileNameID, byte &flag);
99  int postEnterRoom(Window *viewWindow, const Location &priorLocation);
100 
101 private:
102  int _soundFileNameID;
103  byte &_flag;
104 };
105 
106 class ClickChangeScene : public SceneBase {
107 public:
108  ClickChangeScene(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
109  int left = -1, int top = -1, int right = -1, int bottom = -1, int cursorID = 0,
110  int timeZone = -1, int environment = -1, int node = -1, int facing = -1, int orientation = -1, int depth = -1,
111  int transitionType = -1, int transitionData = -1, int transitionStartFrame = -1, int transitionLength = -1);
112  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
113  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
114 
115 private:
116  int _cursorID;
117  Common::Rect _clickRegion;
118  DestinationScene _clickDestination;
119 };
120 
122 public:
123  ClickPlayVideoSwitchAI(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
124  int animID, int cursorID, byte &flag, int left = 0, int top = 0, int right = 0, int bottom = 0);
125  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
126  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
127 
128 private:
129  int _cursorID;
130  int _animID;
131  Common::Rect _clickRegion;
132  byte &_flag;
133 };
134 
136 public:
137  ClickChangeSceneSetFlag(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
138  int left, int top, int right, int bottom, int cursorID,
139  int timeZone, int environment, int node, int facing, int orientation, int depth,
140  int transitionType, int transitionData, int transitionStartFrame, int transitionLength, byte &flag);
141 };
142 
143 class PlayStingers : public SceneBase {
144 public:
145  PlayStingers(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
146  int stingerVolume, byte &lastStingerFlag, byte &effectIDFlag, int firstStingerFileID, int lastStingerFileID);
147  int postEnterRoom(Window *viewWindow, const Location &priorLocation);
148 
149 private:
150  int _stingerVolume;
151  byte &_lastStingerFlag;
152  byte &_effectIDFlag;
153  int _firstStingerFileID;
154  int _lastStingerFileID;
155 };
156 
157 class ClickPlaySound : public SceneBase {
158 public:
159  ClickPlaySound(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
160  byte &flag, int soundID, int cursorID, int left, int top, int right, int bottom);
161  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
162  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
163 
164 private:
165  int _cursorID;
166  int _soundID;
167  Common::Rect _clickRegion;
168  byte &_flag;
169 };
170 
171 class ClickZoom : public SceneBase {
172 public:
173  ClickZoom(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
174  int animInID = -1, int stillInID = -1, int animOutID = -1, int stillOutID = -1,
175  int cursorID = 0, int left = 0, int top = 0, int right = 0, int bottom = 0);
176  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
177  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
178 
179 private:
180  int _cursorID;
181  Common::Rect _clickRegion;
182  int _animInID;
183  int _stillInID;
184  int _animOutID;
185  int _stillOutID;
186  bool _zoomedIn;
187  LocationStaticData _savedNavData;
188 };
189 
191 public:
192  PlaySoundEnteringFromScene(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
193  int soundFileNameID = -1, int timeZone = -1, int environment = -1, int node = -1, int facing = -1, int orientation = -1, int depth = -1);
194  int postEnterRoom(Window *viewWindow, const Location &priorLocation);
195 
196 private:
197  Location _soundLocation;
198  int _soundFileNameID;
199 };
200 
201 class SetFlagOnEntry : public SceneBase {
202 public:
203  SetFlagOnEntry(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
204  byte &flag, byte flagNewValue);
205 };
206 
208 public:
209  InteractiveNewsNetwork(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
210  int enterTransition = -1, int timeZone = -1, int environment = -1, int node = -1, int facing = -1, int orientation = -1, int depth = -1,
211  int transitionType = -1, int transitionData = -1, int transitionStartFrame = -1, int transitionLength = -1);
213  int postEnterRoom(Window *viewWindow, const Location &priorLocation);
214  int preExitRoom(Window *viewWindow, const Location &newLocation);
215  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
216  int paint(Window *viewWindow, Graphics::Surface *preBuffer);
217  int movieCallback(Window *viewWindow, VideoWindow *movie, int animationID, int status);
218  int timerCallback(Window *viewWindow);
219 
220 private:
221  int _enterTransition;
222  int _currentMovieFrame;
223  DestinationScene _returnDestination;
224  AVIFrames _stillFrames;
225  Common::Array<INNFrame> _frameDatabase;
226  Common::Array<INNMediaElement> _movieDatabase;
227  Common::Array<byte> _hyperLinkHistory;
228  bool _playingMovie;
229  bool _loopingMovie;
230  bool _playingAudio;
231  int _audioChannel;
232 
233  void loadFrameDatabase();
234  void loadMovieDatabase();
235 };
236 
238 public:
239  DisplayMessageWithEvidenceWhenEnteringNode(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
240  int evidenceID = -1, int messageBoxTextID = -1);
241  int postEnterRoom(Window *viewWindow, const Location &priorLocation);
242 
243 private:
244  int _messageBoxTextID;
245  byte _evidenceID;
246 };
247 
249 public:
250  ClickPlayLoopingVideoClip(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
251  int cursorID, int animID, int left, int top, int right, int bottom, byte &flag, int newFlagValue);
252  int preExitRoom(Window *viewWindow, const Location &newLocation);
253  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
254  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
255 
256 private:
257  int _cursorID;
258  int _animID;
259  Common::Rect _clickRegion;
260  byte &_flag;
261  int _flagValue;
262  bool _playing;
263 };
264 
266 public:
267  OneShotEntryVideoWarning(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
268  int animID, byte &flag, int warningMessageID);
269  int postEnterRoom(Window *viewWindow, const Location &priorLocation);
270 
271 private:
272  int _animID;
273  byte &_flag;
274  int _warningMessageID;
275 };
276 
278 public:
279  DisableForwardMovement(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
280  int flagValue = 1);
281 };
282 
284 public:
285  CycleEntryVideoWarning(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
286  int animIDA = 0, int animIDB = 0, int warningMessageID = -1);
287  int postEnterRoom(Window *viewWindow, const Location &priorLocation);
288 
289 private:
290  int _animIDA;
291  int _animIDB;
292  int _warningMessageID;
293 };
294 
296 public:
297  ClickPlayVideoSwitch(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
298  int animID, int cursorID, byte &flag, int left = 0, int top = 0, int right = 0, int bottom = 0);
299 
300  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
301  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
302 
303 private:
304  int _cursorID;
305  int _animID;
306  Common::Rect _clickRegion;
307  byte &_flag;
308 };
309 
310 class ClickPlayVideo : public SceneBase {
311 public:
312  ClickPlayVideo(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
313  int animID = 0, int cursorID = -1, int left = 0, int top = 0, int right = 0, int bottom = 0);
314 
315  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
316  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
317 
318 private:
319  int _cursorID;
320  int _animID;
321  Common::Rect _clickRegion;
322 };
323 
324 class VideoDeath : public SceneBase {
325 public:
326  VideoDeath(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation, int deathID = 0, int messageTextID = -1);
327  int postEnterRoom(Window *viewWindow, const Location &priorLocation);
328  int postExitRoom(Window *viewWindow, const Location &newLocation);
329 
330 private:
331  int _deathID;
332  int _messageTextID;
333 };
334 
335 class ClickChangeDepth : public SceneBase {
336 public:
337  ClickChangeDepth(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
338  int newDepth = 0, int cursorID = 0, int left = -1, int top = -1, int right = -1, int bottom = -1);
339  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
340  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
341 
342 private:
343  int _newDepth;
344  int _cursorID;
345  Common::Rect _clickableRegion;
346 };
347 
349 public:
350  OpenFirstItemAcquire(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
351  int openLeft = 0, int openTop = 0, int openRight = 0, int openBottom = 0, int getLeft = 0, int getTop = 0, int getRight = 0,
352  int getBottom = 0, int animOpenWith = 0, int animOpenWithout = 0, int itemID = 0, int fullStillFrame = 0, int clearStillFrame = 0);
353  int mouseDown(Window *viewWindow, const Common::Point &pointLocation);
354  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
355  int droppedItem(Window *viewWindow, int itemID, const Common::Point &pointLocation, int itemFlags);
356  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
357 
358 private:
359  bool _itemPresent;
360  bool _open;
361  Common::Rect _openClickRegion;
362  Common::Rect _acquireRegion;
363  int _fullFrameIndex;
364  int _clearFrameIndex;
365  int _itemID;
366  int _animOpenWith;
367  int _animOpenWithout;
368 };
369 
370 class BrowseBook : public SceneBase {
371 public:
372  BrowseBook(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
373  int bookResID = 0, int textStartResID = -1, int startingPageID = 0, int timeZone = -1, int environment = -1,
374  int node = -1, int facing = -1, int orientation = -1, int depth = -1, int transitionType = -1, int transitionData = -1,
375  int transitionStartFrame = -1, int transitionLength = -1);
376  int gdiPaint(Window *viewWindow);
377  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
378  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
379  int mouseMove(Window *viewWindow, const Common::Point &pointLocation);
380 
381 private:
382  int pageChanged(Window *viewWindow);
383  int textTranslated(Window *viewWindow);
384 
385  Common::Array<BookPage> _bookDatabase;
386  int _curPage;
387  Common::Rect _top, _bottom, _left, _right, _putDown;
388  DestinationScene _putDownDestination;
389  int _translatedTextResourceID;
390  int _curLineIndex;
391 };
392 
394 public:
395  ClickPlaySoundSynchronous(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation,
396  int soundID = 0, int cursorID = 0, int left = 0, int top = 0, int right = 0, int bottom = 0);
397  int mouseUp(Window *viewWindow, const Common::Point &pointLocation);
398  int specifyCursor(Window *viewWindow, const Common::Point &pointLocation);
399 
400 private:
401  int _cursorID;
402  int _soundID;
403  Common::Rect _clickRegion;
404 };
405 
406 class TrialRecallScene : public SceneBase {
407 public:
408  TrialRecallScene(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation);
409  int postEnterRoom(Window *viewWindow, const Location &priorLocation);
410 };
411 
412 } // End of namespace Buried
413 
414 #endif
Definition: scene_common.h:85
Definition: scene_common.h:277
Definition: window.h:37
Definition: scene_common.h:248
Definition: scene_common.h:370
Definition: surface.h:67
Definition: scene_common.h:190
Definition: scene_common.h:157
Definition: scene_common.h:58
Definition: avi_frames.h:42
Definition: array.h:52
Definition: scene_common.h:393
Definition: scene_common.h:106
Definition: scene_common.h:207
Definition: scene_common.h:348
Definition: scene_common.h:52
Definition: rect.h:144
Definition: scene_common.h:406
Definition: navdata.h:72
Definition: buried.h:67
Definition: scene_common.h:135
Definition: navdata.h:59
Definition: agent_evaluation.h:31
Definition: video_window.h:37
Definition: scene_common.h:75
Definition: scene_common.h:283
Definition: rect.h:45
Definition: scene_common.h:324
Definition: scene_common.h:171
Definition: scene_common.h:35
Definition: navdata.h:32
Definition: scene_common.h:310
Definition: scene_common.h:143
Definition: scene_common.h:265
Definition: scene_common.h:201
Definition: scene_common.h:95
Definition: scene_common.h:295
Definition: scene_common.h:121
Definition: scene_base.h:76
Definition: scene_common.h:335