diff options
author | Peter Kohaut | 2016-09-12 00:54:40 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-09-29 22:33:41 +0200 |
commit | ae03eda3d131017d630139ae63972ebcf75e3fa7 (patch) | |
tree | 0fcd8d945634caea4f83cfbc2380741665c01f9e | |
parent | c6011c1349364fcd9ffd29e3b44ce58bc681d3db (diff) | |
download | scummvm-rg350-ae03eda3d131017d630139ae63972ebcf75e3fa7.tar.gz scummvm-rg350-ae03eda3d131017d630139ae63972ebcf75e3fa7.tar.bz2 scummvm-rg350-ae03eda3d131017d630139ae63972ebcf75e3fa7.zip |
BLADERUNNER: add more logic to actor::tick, added support for looking up scene objects
-rw-r--r-- | engines/bladerunner/actor.cpp | 249 | ||||
-rw-r--r-- | engines/bladerunner/actor.h | 2 | ||||
-rw-r--r-- | engines/bladerunner/bladerunner.cpp | 5 | ||||
-rw-r--r-- | engines/bladerunner/scene_objects.cpp | 91 | ||||
-rw-r--r-- | engines/bladerunner/scene_objects.h | 1 | ||||
-rw-r--r-- | engines/bladerunner/slice_animations.cpp | 8 | ||||
-rw-r--r-- | engines/bladerunner/slice_animations.h | 3 |
7 files changed, 241 insertions, 118 deletions
diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp index 4b893c6851..c112c722b6 100644 --- a/engines/bladerunner/actor.cpp +++ b/engines/bladerunner/actor.cpp @@ -47,30 +47,30 @@ Actor::Actor(BladeRunnerEngine *vm, int actorId) { _vm = vm; _id = actorId; - _walkInfo = new ActorWalk(vm); + _walkInfo = new ActorWalk(vm); _movementTrack = new MovementTrack(); - _clues = new ActorClues(vm, (actorId && actorId != 99) ? 2 : 4); - _bbox = new BoundingBox(); - _combatInfo = new ActorCombat(vm); + _clues = new ActorClues(vm, (actorId && actorId != 99) ? 2 : 4); + _bbox = new BoundingBox(); + _combatInfo = new ActorCombat(vm); _friendlinessToOther = new int[_vm->_gameInfo->getActorCount()]; } Actor::~Actor() { delete[] _friendlinessToOther; - delete _combatInfo; - delete _bbox; - delete _clues; - delete _movementTrack; - delete _walkInfo; + delete _combatInfo; + delete _bbox; + delete _clues; + delete _movementTrack; + delete _walkInfo; } void Actor::setup(int actorId) { - _id = actorId; + _id = actorId; _setId = -1; - _position = Vector3(0.0, 0.0, 0.0); - _facing = 512; + _position = Vector3(0.0, 0.0, 0.0); + _facing = 512; _targetFacing = -1; _walkboxId = -1; @@ -79,32 +79,32 @@ void Actor::setup(int actorId) { _fps = 15; _frame_ms = 1000 / _fps; - _isTargetable = false; - _isInvisible = false; + _isTargetable = false; + _isInvisible = false; _isImmuneToObstacles = false; - _isRetired = false; + _isRetired = false; - _width = 0; - _height = 0; - _retiredWidth = 0; + _width = 0; + _height = 0; + _retiredWidth = 0; _retiredHeight = 0; for (int i = 0; i != 7; ++i) { _timersRemain[i] = 0; - _timersStart[i] = _vm->getTotalPlayTime(); + _timersStart[i] = _vm->getTotalPlayTime(); } _scale = 1.0; - _honesty = 50; - _intelligence = 50; + _honesty = 50; + _intelligence = 50; _combatAggressiveness = 50; - _stability = 50; + _stability = 50; - _currentHP = 50; - _maxHP = 50; - _goalNumber = -1; + _currentHP = 50; + _maxHP = 50; + _goalNumber = -1; _timersRemain[4] = 60000; _animationMode = -1; @@ -125,8 +125,7 @@ void Actor::setup(int actorId) { _actorSpeed = Vector3(); } -void Actor::changeAnimationMode(int animationMode, bool force) -{ +void Actor::changeAnimationMode(int animationMode, bool force) { if (force) _animationMode = -1; @@ -136,31 +135,48 @@ void Actor::changeAnimationMode(int animationMode, bool force) } } -void Actor::setFPS(int fps) -{ +void Actor::setFPS(int fps) { _fps = fps; - if (fps == 0) - { + if (fps == 0) { _frame_ms = 0; - } - else if (fps == -1) - { + } else if (fps == -1) { _frame_ms = -1000; - } - else if (fps == -2) - { + } else if (fps == -2) { _fps = _vm->_sliceAnimations->getFPS(_animationId); _frame_ms = 1000 / _fps; - } - else - { + } else { _frame_ms = 1000 / fps; } } -void Actor::setAtXYZ(Vector3 pos, int facing, bool snapFacing, bool moving, bool retired) -{ +void Actor::processMovement() { + /*if (movementTrack::is_paused(this->movementTrack) != 1 && this->id) + { + if (this->walkingWaypointId >= 0 && this->timeoutWalkingWaypoint >= 0) + { + worldWaypoints::get_sceneId(WorldWaypoints, this->walkingWaypointId); + if (!this->timeoutWalkingWaypoint) + { + this->timeoutWalkingWaypoint = 1; + } + if (actorScript::call_ReachedMovementTrackWaypoint(ActorScript, this->id, this->walkingWaypointId) == 1) + { + seconds = this->timeoutWalkingWaypoint; + if (seconds > 1) + { + actor::changeAnimationMode(this, 0, 0); + seconds = this->timeoutWalkingWaypoint; + } + actor::startTimer(this, 3, seconds); + } + } + this->walkingWaypointId = -1; + this->timeoutWalkingWaypoint = 0; + }*/ +} + +void Actor::setAtXYZ(Vector3 pos, int facing, bool snapFacing, bool moving, bool retired) { _position = pos; setFacing(facing, snapFacing); @@ -174,13 +190,12 @@ void Actor::setAtXYZ(Vector3 pos, int facing, bool snapFacing, bool moving, bool _vm->_sceneObjects->remove(_id); - if(_vm->_scene->getSetId() == _setId) { + if (_vm->_scene->getSetId() == _setId) { _vm->_sceneObjects->addActor(_id, _bbox, &_screenRectangle, 1, moving, _isTargetable, retired); } } -void Actor::setAtWaypoint(int waypointId, int angle, int moving, bool retired) -{ +void Actor::setAtWaypoint(int waypointId, int angle, int moving, bool retired) { Vector3 waypointPosition; _vm->_waypoints->getXYZ(waypointId, &waypointPosition.x, &waypointPosition.y, &waypointPosition.z); setAtXYZ(waypointPosition, angle, true, moving, retired); @@ -190,13 +205,11 @@ void Actor::loopWalkToXYZ(float x, float y, float z, int a4, int a5, int a6, int this->loopWalkToXYZ(Vector3(x, y, z)); } -void Actor::loopWalkToXYZ(Vector3 destination) -{ +void Actor::loopWalkToXYZ(Vector3 destination) { int unk1; _walkInfo->setup(_id, false, _position, destination, 0, &unk1); - for (;;) - { + for (;;) { _vm->gameTick(); if (!_walkInfo->isWalking() && !_walkInfo->isRunning()) break; @@ -208,8 +221,7 @@ void Actor::loopWalkToXYZ(Vector3 destination) float distance(float, float, float, float); float distance(Vector3 &v1, Vector3 &v2); -void Actor::loopWalkToSceneObject(const char *objectName, int destinationOffset) -{ +void Actor::loopWalkToSceneObject(const char *objectName, int destinationOffset) { int sceneObject = _vm->_scene->_set->findObject(objectName); if (sceneObject < 0) return; @@ -261,66 +273,132 @@ void Actor::loopWalkToSceneObject(const char *objectName, int destinationOffset) loopWalkToXYZ(destination); } -bool Actor::tick(bool forceDraw) -{ +bool Actor::tick(bool forceDraw) { int remain = 0; bool needsUpdate = false; - if (_fps > 0) - { + if (_fps > 0) { countdownTimerUpdate(5); remain = countdownTimerGetRemainingTime(5); needsUpdate = remain <= 0; - } - else if (forceDraw) - { + } else if (forceDraw) { needsUpdate = true; remain = 0; } - if (needsUpdate) - { + if (needsUpdate) { int newAnimation = 0, newFrame = 0; _vm->_aiScripts->UpdateAnimation(_id, &newAnimation, &newFrame); if (_animationId != newAnimation) { - _animationId = newAnimation; - setFPS(-2); + if (_fps != 0 && _fps != -1) { + _animationId = newAnimation; + setFPS(-2); + } } + _animationId = newAnimation; _animationFrame = newFrame; - if (isWalking()) - { - float stepDistance = 3.0; - if (stepDistance <= 0.0) { - stepDistance = 4.0; - } - if (_walkInfo->tick(_id, stepDistance, false)) { - _vm->_actors[_id]->changeAnimationMode(0); + Vector3 positionChange = _vm->_sliceAnimations->getPositionChange(_animationId); + float facingChange = _vm->_sliceAnimations->getFacingChange(_animationId); + + if (_id == 47) { + positionChange.x = 0.0f; + positionChange.y = 0.0f; + positionChange.z = 0.0f; + } + + if (isWalking()) { + if (0.0f <= positionChange.y) { + positionChange.y = -4.0f; } - Vector3 pos; int facing; + this->_targetFacing = -1; + + bool walked = _walkInfo->tick(_id, -positionChange.y, false); + Vector3 pos; + int facing; _walkInfo->getCurrentPosition(_id, &pos, &facing); - setAtXYZ(pos, facing); + setAtXYZ(pos, facing, false, this->_isMoving, false); + if (walked) { + _vm->_actors[_id]->changeAnimationMode(0); + + this->processMovement(); + if (this->inCombat()) { + this->changeAnimationMode(this->_combatAnimationMode, false); + } else { + this->changeAnimationMode(0, false); + } + } + } else { + if (facingChange != 0.0f) { + int v27 = (512.0f / M_PI) * facingChange; + if (v27 != 0) { + this->_facing = this->_facing - v27; + if (this->_facing < 0) { + this->_facing += 1024; + } + + if (this->_facing >= 1024) { + this->_facing = this->_facing - 1024; + } + } + } + + if (0.0f != positionChange.x || 0.0f != positionChange.y || 0.0f != positionChange.z) { + if (this->_actorSpeed.x != 0.0f) { + positionChange.x = positionChange.x * this->_actorSpeed.x; + } + if (this->_actorSpeed.y != 0.0f) { + positionChange.y = positionChange.y * this->_actorSpeed.y; + } + if (this->_actorSpeed.z != 0.0f) { + positionChange.z = positionChange.z * this->_actorSpeed.z; + } + + float facing = (_facing / 512.0f) * M_PI; + float sinx = sin(facing); + float cosx = cos(facing); + + float originalX = this->_position.x; + float originalY = this->_position.y; + float originalZ = this->_position.z; + + this->_position.x = this->_position.x + positionChange.x * cosx - positionChange.y * sinx; + this->_position.z = this->_position.z - positionChange.x * sinx - positionChange.y * cosx; //why minus? + this->_position.y = this->_position.y + positionChange.z; + + if (_vm->_sceneObjects->existsOnXZ(this->_id, this->_position.x, this->_position.z, false, false) == 1 && !this->_isImmuneToObstacles) { + this->_position.x = originalX; + this->_position.y = originalY; + this->_position.z = originalZ; + } + setAtXYZ(this->_position, this->_facing, true, this->_isMoving, this->_isRetired); + } } } draw(); - if (needsUpdate) - { + if (needsUpdate) { int nextFrameTime = remain + _frame_ms; if (nextFrameTime <= 0) nextFrameTime = 1; countdownTimerStart(5, nextFrameTime); } - + if (this->_targetFacing >= 0) { + if (this->_targetFacing == this->_facing) { + this->_targetFacing = -1; + } else { + this->setFacing(this->_targetFacing, false); + } + } return false; } void Actor::draw() { Vector3 draw_position(_position.x, -_position.z, _position.y + 2.0); - float draw_facing = M_PI - _facing * M_PI / 512.0; + float draw_facing = M_PI - _facing * M_PI / 512.0; // float draw_scale = _scale; // TODO: Handle SHORTY mode @@ -340,7 +418,7 @@ void Actor::setSetId(int setId) { int i; - if(_setId > 0) { + if (_setId > 0) { for (i = 0; i < (int)_vm->_gameInfo->getActorCount(); i++) { if (_vm->_actors[i]->_id != _id && _vm->_actors[i]->_setId == _setId) { // TODO: actorScript->OtherAgentExitedThisScene( i, _id); @@ -497,8 +575,7 @@ void Actor::faceHeading(int heading, bool animate) { if (heading != _facing) { if (animate) { _targetFacing = heading; - } - else { + } else { setFacing(heading, true); } } @@ -644,7 +721,7 @@ float Actor::getZ() { return _position.z; } -void Actor::getXYZ(float* x, float* y, float* z) { +void Actor::getXYZ(float *x, float *y, float *z) { *x = _position.x; *y = _position.y; *z = _position.z; @@ -726,27 +803,23 @@ void Actor::copyClues(int actorId) { } } -void Actor::countdownTimerStart(int timerId, int interval) -{ +void Actor::countdownTimerStart(int timerId, int interval) { assert(timerId >= 0 && timerId < 7); _timersRemain[timerId] = interval; _timersStart[timerId] = _vm->getTotalPlayTime(); } -void Actor::countdownTimerReset(int timerId) -{ +void Actor::countdownTimerReset(int timerId) { assert(timerId >= 0 && timerId < 7); _timersRemain[timerId] = 0; } -int Actor::countdownTimerGetRemainingTime(int timerId) -{ +int Actor::countdownTimerGetRemainingTime(int timerId) { assert(timerId >= 0 && timerId < 7); return _timersRemain[timerId]; } -void Actor::countdownTimerUpdate(int timerId) -{ +void Actor::countdownTimerUpdate(int timerId) { if (_timersRemain[timerId] == 0) return; diff --git a/engines/bladerunner/actor.h b/engines/bladerunner/actor.h index 7827141210..e0984113f6 100644 --- a/engines/bladerunner/actor.h +++ b/engines/bladerunner/actor.h @@ -120,6 +120,8 @@ public: void changeAnimationMode(int animationMode, bool force = false); void setFPS(int fps); + void processMovement(); + void loopWalkToXYZ(Vector3 destination); void loopWalkToXYZ(float x, float y, float z, int a4, int a5, int a6, int a7); void loopWalkToSceneObject(const char *objectName, int destinationOffset = 0); diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index bf9077f3df..13889ba687 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -558,9 +558,12 @@ void BladeRunnerEngine::gameTick() { _sliceRenderer->setView(*_view); // Tick and draw all actors in current set + int setId = _scene->_setId; for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i) { - if (i == 0 || i == 23) // Currently limited to McCoy and Officer Leroy + //if (_actors[i]->getSetId() == setId) { + if (i == 0 || i == 23){ // Currently limited to McCoy and Officer Leroy _actors[i]->tick(backgroundChanged); + } } // TODO: Draw items diff --git a/engines/bladerunner/scene_objects.cpp b/engines/bladerunner/scene_objects.cpp index ba09edf477..4c038fa9c7 100644 --- a/engines/bladerunner/scene_objects.cpp +++ b/engines/bladerunner/scene_objects.cpp @@ -63,21 +63,20 @@ void SceneObjects::clear() { } } -bool SceneObjects::addActor(int sceneObjectId, BoundingBox* boundingBox, Common::Rect* screenRectangle, uint8 isClickable, uint8 isMoving, uint8 isTarget, uint8 isRetired) { +bool SceneObjects::addActor(int sceneObjectId, BoundingBox *boundingBox, Common::Rect *screenRectangle, uint8 isClickable, uint8 isMoving, uint8 isTarget, uint8 isRetired) { return addSceneObject(sceneObjectId, SceneObjectTypeActor, boundingBox, screenRectangle, isClickable, 0, 0, isTarget, isMoving, isRetired); } -bool SceneObjects::addObject(int sceneObjectId, BoundingBox* boundingBox, uint8 isClickable, uint8 isObstacle, uint8 unknown1, uint8 isTarget) { +bool SceneObjects::addObject(int sceneObjectId, BoundingBox *boundingBox, uint8 isClickable, uint8 isObstacle, uint8 unknown1, uint8 isTarget) { Common::Rect rect(-1, -1, -1, -1); return addSceneObject(sceneObjectId, SceneObjectTypeObject, boundingBox, &rect, isClickable, isObstacle, unknown1, isTarget, 0, 0); } -bool SceneObjects::addItem(int sceneObjectId, BoundingBox* boundingBox, Common::Rect* screenRectangle, uint8 isTarget, uint8 isObstacle) { +bool SceneObjects::addItem(int sceneObjectId, BoundingBox *boundingBox, Common::Rect *screenRectangle, uint8 isTarget, uint8 isObstacle) { return addSceneObject(sceneObjectId, SceneObjectTypeItem, boundingBox, screenRectangle, isObstacle, 0, 0, isTarget, 0, 0); } -bool SceneObjects::remove(int sceneObjectId) -{ +bool SceneObjects::remove(int sceneObjectId) { int i = findById(sceneObjectId); if (i == -1) { return false; @@ -99,8 +98,8 @@ bool SceneObjects::remove(int sceneObjectId) int SceneObjects::findByXYZ(int *isClickable, int *isObstacle, int *isTarget, float x, float y, float z, int findClickables, int findObstacles, int findTargets) { *isClickable = 0; - *isObstacle = 0; - *isTarget = 0; + *isObstacle = 0; + *isTarget = 0; for (int i = 0; i < _count; ++i) { assert(_sceneObjectsSortedByDistance[i] < _count); @@ -108,9 +107,8 @@ int SceneObjects::findByXYZ(int *isClickable, int *isObstacle, int *isTarget, fl SceneObject &sceneObject = _sceneObjects[_sceneObjectsSortedByDistance[i]]; if ((findClickables && sceneObject._isClickable) || - (findObstacles && sceneObject._isObstacle) || - (findTargets && sceneObject._isTarget)) - { + (findObstacles && sceneObject._isObstacle) || + (findTargets && sceneObject._isTarget)) { BoundingBox boundingBox = sceneObject._boundingBox; if (sceneObject._sceneObjectType == SceneObjectTypeObject || sceneObject._sceneObjectType == SceneObjectTypeItem) { @@ -119,8 +117,8 @@ int SceneObjects::findByXYZ(int *isClickable, int *isObstacle, int *isTarget, fl if (boundingBox.inside(x, y, z)) { *isClickable = sceneObject._isClickable; - *isObstacle = sceneObject._isObstacle; - *isTarget = sceneObject._isTarget; + *isObstacle = sceneObject._isObstacle; + *isTarget = sceneObject._isTarget; return sceneObject._sceneObjectId; } @@ -130,8 +128,43 @@ int SceneObjects::findByXYZ(int *isClickable, int *isObstacle, int *isTarget, fl return -1; } -int SceneObjects::findById(int sceneObjectId) -{ +bool SceneObjects::existsOnXZ(int exceptSceneObjectId, float x, float z, bool a5, bool a6) { + float xMin = x - 12.5f; + float xMax = x + 12.5f; + float zMin = z - 12.5f; + float zMax = z + 12.5f; + + int count = this->_count; + + if (count > 0) { + for (int i = 0; i < count; i++) { + SceneObject *sceneObject = &this->_sceneObjects[this->_sceneObjectsSortedByDistance[i]]; + bool v13 = false; + if (sceneObject->_sceneObjectType == SceneObjectTypeActor) { + if (sceneObject->_isRetired) { + v13 = false; + } else if (sceneObject->_isMoving) { + v13 = a5 != 0; + } else { + v13 = a6 != 0; + } + } else { + v13 = sceneObject->_isObstacle; + } + + if (v13 && sceneObject->_sceneObjectId != exceptSceneObjectId) { + float x1, y1, z1, x2, y2, z2; + sceneObject->_boundingBox.getXYZ(&x1, &y1, &z1, &x2, &y2, &z2); + if (z1 <= zMax && z2 >= zMin && x1 <= xMax && x2 >= xMin) { + return true; + } + } + } + } + return false; +} + +int SceneObjects::findById(int sceneObjectId) { for (int i = 0; i < _count; ++i) { if (_sceneObjects[i]._present && _sceneObjects[i]._sceneObjectId == sceneObjectId) { return i; @@ -140,23 +173,23 @@ int SceneObjects::findById(int sceneObjectId) return -1; } -bool SceneObjects::addSceneObject(int sceneObjectId, SceneObjectType sceneObjectType, BoundingBox* boundingBox, Common::Rect* screenRectangle, uint8 isClickable, uint8 isObstacle, uint8 unknown1, uint8 isTarget, uint isMoving, uint isRetired) { +bool SceneObjects::addSceneObject(int sceneObjectId, SceneObjectType sceneObjectType, BoundingBox *boundingBox, Common::Rect *screenRectangle, uint8 isClickable, uint8 isObstacle, uint8 unknown1, uint8 isTarget, uint isMoving, uint isRetired) { int index = findEmpty(); if (index == -1) { return false; } - _sceneObjects[index]._sceneObjectId = sceneObjectId; + _sceneObjects[index]._sceneObjectId = sceneObjectId; _sceneObjects[index]._sceneObjectType = sceneObjectType; - _sceneObjects[index]._present = 1; - _sceneObjects[index]._boundingBox = *boundingBox; + _sceneObjects[index]._present = 1; + _sceneObjects[index]._boundingBox = *boundingBox; _sceneObjects[index]._screenRectangle = *screenRectangle; - _sceneObjects[index]._isClickable = isClickable; - _sceneObjects[index]._isObstacle = isObstacle; - _sceneObjects[index]._unknown1 = unknown1; - _sceneObjects[index]._isTarget = isTarget; - _sceneObjects[index]._isMoving = isMoving; - _sceneObjects[index]._isRetired = isRetired; + _sceneObjects[index]._isClickable = isClickable; + _sceneObjects[index]._isObstacle = isObstacle; + _sceneObjects[index]._unknown1 = unknown1; + _sceneObjects[index]._isTarget = isTarget; + _sceneObjects[index]._isMoving = isMoving; + _sceneObjects[index]._isRetired = isRetired; float centerZ = (_sceneObjects[index]._boundingBox.getZ0() + _sceneObjects[index]._boundingBox.getZ1()) / 2.0; @@ -213,11 +246,11 @@ bool SceneObjects::isBetweenTwoXZ(int sceneObjectId, float x1, float z1, float x _sceneObjects[i]._boundingBox.getXYZ(&objectX1, &objectY1, &objectZ1, &objectX2, &objectY2, &objectZ2); //TODO -// if (!lineIntersectection(sourceX, sourceZ, targetX, targetZ, objectX1, objectZ1, objectX2, objectZ1, &intersectionX, &intersectionY, &v18) -// && !lineIntersectection(sourceX, sourceZ, targetX, targetZ, objectX2, objectZ1, objectX2, objectZ2, &intersectionX, &intersectionY, &v18) -// && !lineIntersectection(sourceX, sourceZ, targetX, targetZ, objectX2, objectZ2, objectX1, objectZ2, &intersectionX, &intersectionY, &v18) -// && !lineIntersectection(sourceX, sourceZ, targetX, targetZ, objectX1, objectZ2, objectX1, objectZ1, &intersectionX, &intersectionY, &v18)) -// return false; + // if (!lineIntersectection(sourceX, sourceZ, targetX, targetZ, objectX1, objectZ1, objectX2, objectZ1, &intersectionX, &intersectionY, &v18) + // && !lineIntersectection(sourceX, sourceZ, targetX, targetZ, objectX2, objectZ1, objectX2, objectZ2, &intersectionX, &intersectionY, &v18) + // && !lineIntersectection(sourceX, sourceZ, targetX, targetZ, objectX2, objectZ2, objectX1, objectZ2, &intersectionX, &intersectionY, &v18) + // && !lineIntersectection(sourceX, sourceZ, targetX, targetZ, objectX1, objectZ2, objectX1, objectZ1, &intersectionX, &intersectionY, &v18)) + // return false; return true; } diff --git a/engines/bladerunner/scene_objects.h b/engines/bladerunner/scene_objects.h index 047301d880..6414c5d671 100644 --- a/engines/bladerunner/scene_objects.h +++ b/engines/bladerunner/scene_objects.h @@ -79,6 +79,7 @@ public: bool remove(int sceneObjectId); void clear(); int findByXYZ(int *isClickable, int *isObstacle, int *isTarget, float x, float y, float z, int findClickables, int findObstacles, int findTargets); + bool existsOnXZ(int exceptSceneObjectId, float x, float z, bool a5, bool a6); void setMoving(int sceneObjectId, bool isMoving); void setRetired(int sceneObjectId, bool isRetired); bool isBetweenTwoXZ(int sceneObjectId, float x1, float z1, float x2, float z2); diff --git a/engines/bladerunner/slice_animations.cpp b/engines/bladerunner/slice_animations.cpp index 8497620265..aafd26885a 100644 --- a/engines/bladerunner/slice_animations.cpp +++ b/engines/bladerunner/slice_animations.cpp @@ -170,4 +170,12 @@ void *SliceAnimations::getFramePtr(uint32 animation, uint32 frame) { return (byte*)_pages[page]._data + pageOffset; } +Vector3 SliceAnimations::getPositionChange(int animation) { + return _animations[animation].positionChange; +} + +float SliceAnimations::getFacingChange(int animation) { + return _animations[animation].facingChange; +} + } // End of namespace BladeRunner diff --git a/engines/bladerunner/slice_animations.h b/engines/bladerunner/slice_animations.h index dc5c88fbb1..1e35d6b90c 100644 --- a/engines/bladerunner/slice_animations.h +++ b/engines/bladerunner/slice_animations.h @@ -106,6 +106,9 @@ public: float getFrameCount(int animation){ return _animations[animation].frameCount; } float getFPS(int animation){ return _animations[animation].fps; } + + Vector3 getPositionChange(int animation); + float getFacingChange(int animation); }; } // End of namespace BladeRunner |