diff options
author | Thanasis Antoniou | 2019-05-26 17:15:52 +0300 |
---|---|---|
committer | Thanasis Antoniou | 2019-05-26 17:17:05 +0300 |
commit | 605e21953d161ca043bedebb56994676f4902fe3 (patch) | |
tree | fc7e8fe6055454e20eed3c0236c271b17da595eb /engines/bladerunner/view.cpp | |
parent | 93768c33073129237109a056d219623ae9f6d712 (diff) | |
download | scummvm-rg350-605e21953d161ca043bedebb56994676f4902fe3.tar.gz scummvm-rg350-605e21953d161ca043bedebb56994676f4902fe3.tar.bz2 scummvm-rg350-605e21953d161ca043bedebb56994676f4902fe3.zip |
BLADERUNNER: Fix for View::calculateScreenPosition
Draw objects in debugger no longer draws mishappen rectangles
Diffstat (limited to 'engines/bladerunner/view.cpp')
-rw-r--r-- | engines/bladerunner/view.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/bladerunner/view.cpp b/engines/bladerunner/view.cpp index cb14f51ee5..f2f9749982 100644 --- a/engines/bladerunner/view.cpp +++ b/engines/bladerunner/view.cpp @@ -24,6 +24,7 @@ #include "common/debug.h" #include "common/stream.h" +#include "common/util.h" namespace BladeRunner { @@ -73,8 +74,8 @@ void View::calculateCameraPosition() { Vector3 View::calculateScreenPosition(Vector3 worldPosition) { Vector3 viewPosition = _frameViewMatrix * worldPosition; return Vector3( - _viewportPosition.x - viewPosition.x / viewPosition.z * _viewportPosition.z, - _viewportPosition.y - viewPosition.y / viewPosition.z * _viewportPosition.z, + _viewportPosition.x - ((viewPosition.x / ABS(viewPosition.z)) * ABS(_viewportPosition.z)), + _viewportPosition.y - ((viewPosition.y / ABS(viewPosition.z)) * ABS(_viewportPosition.z)), viewPosition.z ); } |