ScummVM API documentation
set.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_SET_H
23 #define BLADERUNNER_SET_H
24 
25 #include "bladerunner/bladerunner.h" // For BLADERUNNER_ORIGINAL_BUGS symbol
26 
27 #include "bladerunner/boundingbox.h"
28 
29 #include "common/scummsys.h"
30 #include "common/str.h"
31 
32 namespace BladeRunner {
33 
34 class BladeRunnerEngine;
35 
36 class SaveFileReadStream;
37 class SaveFileWriteStream;
38 class SetEffects;
39 class SceneObjects;
40 class VQADecoder;
41 
42 class Set {
43  friend class Debugger;
44 
45  struct Object {
46  Common::String name;
47  BoundingBox bbox;
48  uint8 isObstacle;
49  uint8 isClickable;
50  uint8 isHotMouse;
51  uint8 isTarget;
52  uint8 unknown1;
53  };
54 
55  struct Walkbox {
56  Common::String name;
57  float altitude;
58  int vertexCount;
59  Vector3 vertices[8];
60  };
61 
62  BladeRunnerEngine *_vm;
63 
64  bool _loaded;
65  int _objectCount;
66  int _walkboxCount;
67  Object *_objects;
68  Walkbox *_walkboxes;
69  int _walkboxStepSound[85];
70  int _footstepSoundOverride;
71 // float _unknown[10];
72 
73 public:
74  SetEffects *_effects;
75 
76 public:
78  ~Set();
79 
80  bool open(const Common::String &name);
81 
82  void addObjectsToScene(SceneObjects *sceneObjects) const;
83  uint32 getObjectCount() const { return _objectCount; }
84 
85  float getAltitudeAtXZ(float x, float z, bool *inWalkbox) const;
86 
87  int findWalkbox(float x, float z) const;
88  int findObject(const Common::String &objectName) const;
89 
90  bool objectSetHotMouse(int objectId) const;
91  bool objectGetBoundingBox(int objectId, BoundingBox *boundingBox) const;
92  void objectSetIsClickable(int objectId, bool isClickable);
93  void objectSetIsObstacle(int objectId, bool isObstacle);
94  void objectSetIsTarget(int objectId, bool isTarget);
95  const Common::String &objectGetName(int objectId) const;
96 
97  void setWalkboxStepSound(int walkboxId, int floorType);
98  void setFoodstepSoundOverride(int floorType);
99  void resetFoodstepSoundOverride();
100 
101  int getWalkboxSoundWalkLeft(int walkboxId) const;
102  int getWalkboxSoundWalkRight(int walkboxId) const;
103  int getWalkboxSoundRunLeft(int walkboxId) const;
104  int getWalkboxSoundRunRight(int walkboxId) const;
105 
106  void save(SaveFileWriteStream &f);
107  void load(SaveFileReadStream &f);
108 
109 private:
110  static bool isXZInWalkbox(float x, float z, const Walkbox &walkbox);
111 #if BLADERUNNER_ORIGINAL_BUGS
112 #else
113  void overrideSceneObjectInfo(int objectId) const;
114  void setupNewObjectInSet(Common::String objName, BoundingBox objBbox);
115  void patchInAdditionalObjectsInSet();
116  void patchOutBadObjectsFromSet();
117 #endif // BLADERUNNER_ORIGINAL_BUGS
118 };
119 
120 } // End of namespace BladeRunner
121 
122 #endif
Definition: savefile.h:88
Definition: str.h:59
Definition: actor.h:31
Definition: savefile.h:113
Definition: scene_objects.h:43
Definition: boundingbox.h:31
Definition: set_effects.h:33
Definition: set.h:42
Definition: debugger.h:56
Definition: vector.h:47
Definition: bladerunner.h:113