BLADERUNNER: VK small fixes

Fixed rendering of non-visible objects
This commit is contained in:
Peter Kohaut 2018-02-11 15:22:27 +01:00
parent 3ce56d5427
commit 70e68ace18
2 changed files with 11 additions and 5 deletions

View file

@ -115,8 +115,9 @@ void SliceRenderer::calculateBoundingRect() {
top = bottom + _scale * (top - bottom);
if (bottom.z < 0.0f || top.z < 0.0f)
if (bottom.z < 0.0f || top.z < 0.0f) {
return;
}
Matrix3x2 facingRotation = calculateFacingRotationMatrix();
@ -346,6 +347,10 @@ void SliceRenderer::drawInWorld(int animationId, int animationFrame, Vector3 pos
_vm->_sliceRenderer->setupFrameInWorld(animationId, animationFrame, position, facing);
assert(_sliceFramePtr);
if (_screenRectangle.isEmpty()) {
return;
}
SliceLineIterator sliceLineIterator;
sliceLineIterator.setup(
_endScreenVector.x, _endScreenVector.y, _endScreenVector.z,