mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-04 16:26:53 +00:00
TITANIC: Change ship view and position even if not moved
The code was preventing the position and view from changing when the distance between the current and new position for a marked auto mover was zero. This happens if you lock the 2nd or 3rd star and then unlock and relock again. It was prevented this with asserts and if statement checks and I removed them all. This section of code isn't doing any inverses based on the reciprocal of the distance so theres no issue with allowing transition speeds/distances of zero. Fixes #10148.
This commit is contained in:
parent
cd9fe5c219
commit
ffbfdac87e
@ -50,10 +50,8 @@ void CCameraAutoMover::proc2(const FVector &oldPos, const FVector &newPos,
|
||||
_destPos = newPos;
|
||||
_posDelta = _destPos - _srcPos;
|
||||
float temp = 0.0;
|
||||
if (!_posDelta.normalize(temp)) { // Do the normalization, put the scale amount in temp,
|
||||
// but if it is unsuccessful, crash
|
||||
assert(temp);
|
||||
}
|
||||
bool unused_status = _posDelta.normalize(temp); // Do the normalization, put the scale amount in temp
|
||||
|
||||
_distance = temp;
|
||||
_active = false;
|
||||
_field34 = false;
|
||||
|
@ -32,24 +32,22 @@ void CMarkedAutoMover::proc2(const FVector &oldPos, const FVector &newPos,
|
||||
CCameraAutoMover::proc2(oldPos, newPos, oldOrientation, newOrientation);
|
||||
|
||||
double distance = _distance;
|
||||
if (distance > 0.0) {
|
||||
_active = true;
|
||||
_field34 = true;
|
||||
proc6(120, 4, distance);
|
||||
|
||||
|
||||
_orientationChanger.load(oldOrientation, newOrientation);
|
||||
_transitionPercent = 0.0;
|
||||
|
||||
if (_field4C == 0) {
|
||||
_transitionPercentInc = 0.1;
|
||||
_active = true;
|
||||
} else {
|
||||
_transitionPercentInc = 1.0 / _field4C;
|
||||
_active = true;
|
||||
_field34 = true;
|
||||
proc6(120, 4, distance);
|
||||
}
|
||||
|
||||
if (newPos != oldPos) {
|
||||
_orientationChanger.load(oldOrientation, newOrientation);
|
||||
_transitionPercent = 0.0;
|
||||
|
||||
if (_field4C == 0) {
|
||||
_transitionPercentInc = 0.1;
|
||||
_active = true;
|
||||
} else {
|
||||
_transitionPercentInc = 1.0 / _field4C;
|
||||
_active = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int CMarkedAutoMover::proc5(CErrorCode &errorCode, FVector &pos, FMatrix &orientation) {
|
||||
|
@ -582,10 +582,7 @@ void CStarCamera::lockMarker2(CViewport *viewport, const FVector &v) {
|
||||
|
||||
FVector newPos = m4._col1;
|
||||
|
||||
if (_viewport._position != newPos) {
|
||||
// Only change view if positions are different
|
||||
_mover->proc8(_viewport._position, newPos, m6, m5);
|
||||
}
|
||||
_mover->proc8(_viewport._position, newPos, m6, m5);
|
||||
|
||||
CStarVector *sv = new CStarVector(this, v);
|
||||
_mover->setVector(sv);
|
||||
@ -600,10 +597,7 @@ void CStarCamera::lockMarker3(CViewport *viewport, const FVector &v) {
|
||||
FVector newPos = viewport->_position;
|
||||
FVector oldPos = _viewport._position;
|
||||
|
||||
if (oldPos != newPos) {
|
||||
// Only change view if positions are different
|
||||
_mover->proc8(oldPos, newPos, oldOr, newOr);
|
||||
}
|
||||
_mover->proc8(oldPos, newPos, oldOr, newOr);
|
||||
|
||||
CStarVector *sv = new CStarVector(this, v);
|
||||
_mover->setVector(sv);
|
||||
|
Loading…
Reference in New Issue
Block a user