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

View file

@ -472,6 +472,7 @@ void VK::draw() {
_soundTrackId2 = _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(426), 33, 0, 0, 50, 0); _soundTrackId2 = _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(426), 33, 0, 0, 50, 0);
_vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(431), 50, 0, 0, 50, 0); _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(431), 50, 0, 0, 50, 0);
} else if (frame == 26) { } else if (frame == 26) {
setAdjustment(158);
_vm->_audioPlayer->stop(_soundTrackId2, false); _vm->_audioPlayer->stop(_soundTrackId2, false);
_soundTrackId1 = _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(429), 50, 30, 30, 50, kAudioPlayerLoop); _soundTrackId1 = _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(429), 50, 30, 30, 50, kAudioPlayerLoop);
} else if (frame == 40) { } else if (frame == 40) {
@ -664,8 +665,8 @@ void VK::drawNeedle(Graphics::Surface &surface) {
x = CLIP(x + (int)_vm->_rnd.getRandomNumberRng(0, 4) - 2, 165, 245); x = CLIP(x + (int)_vm->_rnd.getRandomNumberRng(0, 4) - 2, 165, 245);
} }
float needleOffset = ABS(38.0f - _needleValue); int needleOffset = abs(38 - _needleValue);
float y = 345 - sqrt(72.0f * 72.0f - needleOffset * needleOffset); int y = 345 - sqrt(72 * 72 - needleOffset * needleOffset);
float colorIntensity = MIN(78.0f, _needleValue + 39.0f) / 78.0f; float colorIntensity = MIN(78.0f, _needleValue + 39.0f) / 78.0f;
@ -846,8 +847,8 @@ void VK::animateAdjustment(int target) {
void VK::setAdjustment(int x) { void VK::setAdjustment(int x) {
_adjustment = CLIP(x - 4, 154, 246); _adjustment = CLIP(x - 4, 154, 246);
float offset = ABS(199.0f - _adjustment); int offset = abs(199 - _adjustment);
int y = sqrt(88.0f * 88.0f - offset * offset); int y = sqrt(88 * 88 - offset * offset);
_buttons->setImageLeft(1, _adjustment); _buttons->setImageLeft(1, _adjustment);
_buttons->setImageTop(1, 345 - y); _buttons->setImageTop(1, 345 - y);
} }