diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/bladerunner/scene.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/set.cpp | 9 | ||||
-rw-r--r-- | engines/bladerunner/set.h | 4 |
3 files changed, 8 insertions, 7 deletions
diff --git a/engines/bladerunner/scene.cpp b/engines/bladerunner/scene.cpp index 4ca5da495a..78b1bb6da4 100644 --- a/engines/bladerunner/scene.cpp +++ b/engines/bladerunner/scene.cpp @@ -170,7 +170,7 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) { } } - _set->addObjectsToScene(_vm->_sceneObjects, _sceneId); + _set->addObjectsToScene(_vm->_sceneObjects); _vm->_items->addToSet(setId); _vm->_sceneObjects->updateObstacles(); // TODO: add all items to scene diff --git a/engines/bladerunner/set.cpp b/engines/bladerunner/set.cpp index a257cee4fc..975f50a98d 100644 --- a/engines/bladerunner/set.cpp +++ b/engines/bladerunner/set.cpp @@ -26,6 +26,7 @@ #include "bladerunner/game_constants.h" #include "bladerunner/lights.h" #include "bladerunner/savefile.h" +#include "bladerunner/scene.h" #include "bladerunner/scene_objects.h" #include "bladerunner/set_effects.h" #include "bladerunner/slice_renderer.h" @@ -127,9 +128,9 @@ bool Set::open(const Common::String &name) { return true; } -void Set::addObjectsToScene(SceneObjects *sceneObjects, int sceneId) const { +void Set::addObjectsToScene(SceneObjects *sceneObjects) const { for (int i = 0; i < _objectCount; i++) { - overrideSceneObjectInfo(sceneId, i); // For bugfixes with respect to clickable/targetable box positioning/bounding box + overrideSceneObjectInfo(i); // For bugfixes with respect to clickable/targetable box positioning/bounding box sceneObjects->addObject(i + kSceneObjectOffsetObjects, _objects[i].bbox, _objects[i].isClickable, _objects[i].isObstacle, _objects[i].unknown1, _objects[i].isTarget); } } @@ -402,8 +403,8 @@ void Set::load(SaveFileReadStream &f) { * TODO If we have many such cases, perhaps we could use a lookup table * using sceneId, objectId (or name) as keys */ -void Set::overrideSceneObjectInfo(int sceneId, int objectId) const { // For bugfixes with respect to clickable/targetable box positioning/bounding box - if (sceneId == kSceneBB06) { /// Sebastian's room with doll +void Set::overrideSceneObjectInfo(int objectId) const { // For bugfixes with respect to clickable/targetable box positioning/bounding box + if (_vm->_scene->getSceneId() == kSceneBB06) { /// Sebastian's room with doll if (_objects[objectId].name == "BOX31") { // dollhouse box in BB06 _objects[objectId].bbox.setXYZ(-161.47f, 30.0f, 53.75f, -110.53f, 69.81f, 90.90f); } diff --git a/engines/bladerunner/set.h b/engines/bladerunner/set.h index 1097a53dd9..719cc55867 100644 --- a/engines/bladerunner/set.h +++ b/engines/bladerunner/set.h @@ -78,7 +78,7 @@ public: bool open(const Common::String &name); - void addObjectsToScene(SceneObjects *sceneObjects, int sceneId) const; + void addObjectsToScene(SceneObjects *sceneObjects) const; uint32 getObjectCount() const { return _objectCount; } float getAltitudeAtXZ(float x, float z, bool *inWalkbox) const; @@ -107,7 +107,7 @@ public: private: static bool isXZInWalkbox(float x, float z, const Walkbox &walkbox); - void overrideSceneObjectInfo(int sceneId, int objectId) const; + void overrideSceneObjectInfo(int objectId) const; }; } // End of namespace BladeRunner |