mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-05 00:36:57 +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,13 +32,11 @@ 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);
|
||||
}
|
||||
|
||||
if (newPos != oldPos) {
|
||||
|
||||
_orientationChanger.load(oldOrientation, newOrientation);
|
||||
_transitionPercent = 0.0;
|
||||
|
||||
@ -49,7 +47,7 @@ void CMarkedAutoMover::proc2(const FVector &oldPos, const FVector &newPos,
|
||||
_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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
CStarVector *sv = new CStarVector(this, v);
|
||||
_mover->setVector(sv);
|
||||
|
Loading…
Reference in New Issue
Block a user