ScummVM API documentation
scene.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  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BLADERUNNER_SCENE_H
23 #define BLADERUNNER_SCENE_H
24 
25 #include "bladerunner/vector.h"
26 
27 #include "common/str.h"
28 
29 namespace BladeRunner {
30 
31 class BladeRunnerEngine;
32 class BoundingBox;
33 class Regions;
34 class SaveFileReadStream;
35 class SaveFileWriteStream;
36 class Set;
37 class VQAPlayer;
38 
39 class Scene {
40  friend class Debugger;
41 
42  BladeRunnerEngine *_vm;
43 
44  int _setId;
45  int _sceneId;
46  VQAPlayer *_vqaPlayer;
47 
48  int _defaultLoop;
49  bool _defaultLoopSet;
50  bool _defaultLoopPreloadedSet;
51  int _specialLoopMode;
52  int _specialLoop;
53  // int _introFinished;
54  int _nextSetId;
55  int _nextSceneId;
56  int _frame;
57 
58  Vector3 _actorStartPosition;
59  int _actorStartFacing;
60  bool _playerWalkedIn;
61 
62 public:
63  Set *_set;
64  Regions *_regions;
65  Regions *_exits;
66 
67 public:
69  ~Scene();
70 
71  bool open(int setId, int sceneId, bool isLoadingGame);
72  bool close(bool isLoadingGame);
73  int advanceFrame(bool useTime = true);
74  void resume(bool isLoadingGame = false);
75  void startDefaultLoop();
76  void setActorStart(Vector3 position, int facing);
77 
78  void loopSetDefault(int loopId);
79  void loopStartSpecial(int specialLoopMode, int loopId, bool immediately);
80 
81  int getSetId() const { return _setId; }
82  int getSceneId() const { return _sceneId; }
83 
84  bool didPlayerWalkIn() { bool r = _playerWalkedIn; _playerWalkedIn = false; return r; }
85 
86  int findObject(const Common::String &objectName);
87  bool objectSetHotMouse(int objectId);
88  bool objectGetBoundingBox(int objectId, BoundingBox *boundingBox);
89  void objectSetIsClickable(int objectId, bool isClickable, bool sceneLoaded);
90  void objectSetIsObstacle(int objectId, bool isObstacle, bool sceneLoaded, bool updateWalkpath);
91  void objectSetIsObstacleAll(bool isObstacle, bool sceneLoaded);
92  void objectSetIsTarget(int objectId, bool isTarget, bool sceneLoaded);
93  const Common::String &objectGetName(int objectId);
94 
95  void save(SaveFileWriteStream &f);
96  void load(SaveFileReadStream &f);
97 
98 private:
99  void loopEnded(int frame, int loopId);
100  static void loopEndedStatic(void *data, int frame, int loopId);
101 };
102 
103 } // End of namespace BladeRunner
104 
105 #endif
Definition: savefile.h:88
Definition: str.h:59
Definition: actor.h:31
Definition: savefile.h:113
Definition: regions.h:35
Definition: boundingbox.h:31
Definition: vqa_player.h:45
Definition: set.h:42
Definition: scene.h:39
Definition: debugger.h:56
Definition: vector.h:47
Definition: bladerunner.h:113