diff options
author | Paul Gilbert | 2017-04-16 22:03:33 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-04-16 22:03:33 -0400 |
commit | b22b572e64083c155ee644c8e74f06c854a7017d (patch) | |
tree | c568dc6c2dbe4bf456571965fd4f3409502e3142 /engines | |
parent | feb359e4a97833b709ecba2b3940fd860754ec4a (diff) | |
download | scummvm-rg350-b22b572e64083c155ee644c8e74f06c854a7017d.tar.gz scummvm-rg350-b22b572e64083c155ee644c8e74f06c854a7017d.tar.bz2 scummvm-rg350-b22b572e64083c155ee644c8e74f06c854a7017d.zip |
TITANIC: Further positioning renames
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/star_control/star_camera.cpp | 10 | ||||
-rw-r--r-- | engines/titanic/star_control/star_camera.h | 18 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub23.cpp | 25 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub23.h | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub24.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub27.cpp | 12 | ||||
-rw-r--r-- | engines/titanic/star_control/star_view.cpp | 4 |
7 files changed, 44 insertions, 33 deletions
diff --git a/engines/titanic/star_control/star_camera.cpp b/engines/titanic/star_control/star_camera.cpp index 5c7f9910a7..d4461e88f4 100644 --- a/engines/titanic/star_control/star_camera.cpp +++ b/engines/titanic/star_control/star_camera.cpp @@ -33,12 +33,12 @@ FMatrix *CStarCamera::_priorOrientation; FMatrix *CStarCamera::_newOrientation; CStarCamera::CStarCamera(const CNavigationInfo *data) : - _matrixRow(-1), _mover(nullptr), _field108(0) { + _matrixRow(-1), _mover(nullptr), _isMoved(false) { setupHandler(data); } CStarCamera::CStarCamera(CViewport *src) : - _matrixRow(-1), _mover(nullptr), _field108(0), _viewport(src) { + _matrixRow(-1), _mover(nullptr), _isMoved(false), _viewport(src) { } void CStarCamera::init() { @@ -68,7 +68,7 @@ void CStarCamera::proc3(const CNavigationInfo *src) { void CStarCamera::setPosition(const FVector &v) { if (!isLocked()) { _viewport.setPosition(v); - set108(); + setIsMoved(); } } @@ -138,7 +138,7 @@ void CStarCamera::updatePosition(CErrorCode *errorCode) { if (newPos != priorPos) { _viewport.setPosition(newPos); - set108(); + setIsMoved(); } if (*_priorOrientation != *_newOrientation) { @@ -170,7 +170,7 @@ void CStarCamera::proc20(double factor) { void CStarCamera::proc21(const FPose &pose) { if (!isLocked()) { _viewport.setPosition(pose); - set108(); + setIsMoved(); } } diff --git a/engines/titanic/star_control/star_camera.h b/engines/titanic/star_control/star_camera.h index 5e0232516d..3ca653275f 100644 --- a/engines/titanic/star_control/star_camera.h +++ b/engines/titanic/star_control/star_camera.h @@ -45,7 +45,7 @@ private: FMatrix _matrix; CCameraMover *_mover; CViewport _viewport; - int _field108; + bool _isMoved; private: /** * Set up a handler @@ -135,10 +135,20 @@ public: */ virtual void save(SimpleFile *file, int indent); + /** + * Returns true for whether the camera has been moved + */ + bool isMoved() const { return _isMoved; } - bool is108() const { return _field108; } - void set108() { _field108 = true; } - void reset108() { _field108 = false; } + /** + * Sets the camera as having been moved + */ + void setIsMoved() { _isMoved = true; } + + /** + * Resets the flag for whether the camera has moved + */ + void clearIsMoved() { _isMoved = false; } void fn1(CViewport *sub13, const FVector &v); void fn2(FVector v1, FVector v2, FVector v3); diff --git a/engines/titanic/star_control/star_control_sub23.cpp b/engines/titanic/star_control/star_control_sub23.cpp index 792c3a2304..ec3ca65638 100644 --- a/engines/titanic/star_control/star_control_sub23.cpp +++ b/engines/titanic/star_control/star_control_sub23.cpp @@ -28,9 +28,9 @@ namespace Titanic { CStarControlSub23::CStarControlSub23() : _srcPos(0.0, 1000000.0, 0.0) { _field4 = 0; _active = false; - _field24 = 0.0; - _field34 = 0; - _field38 = 0; + _distance = 0.0; + _field34 = false; + _field38 = 0.0; _field3C = 0; _field40 = 0; _field44 = 0; @@ -41,14 +41,15 @@ CStarControlSub23::CStarControlSub23() : _srcPos(0.0, 1000000.0, 0.0) { _moveDelayInc = 0.0; } -void CStarControlSub23::proc2(FVector &v1, FVector &v2, FMatrix &m1, FMatrix &m2) { - _srcPos = v1; - _destPos = v2; +void CStarControlSub23::proc2(FVector &oldPos, FVector &newPos, + FMatrix &oldOrientation, FMatrix &newOrientation) { + _srcPos = oldPos; + _destPos = newPos; _posDelta = _destPos - _srcPos; - _field24 = _posDelta.normalize(); + _distance = _posDelta.normalize(); _active = false; - _field34 = 0; + _field34 = false; _moveDelayCtr = 1.0; _field40 = -1; _field44 = -1; @@ -60,19 +61,19 @@ void CStarControlSub23::proc3(const FMatrix &m1, const FMatrix &m2) { _srcPos.clear(); _destPos.clear(); _moveDelayCtr = 1.0; - _field24 = 0.0; + _distance = 0.0; _active = false; - _field34 = 0; + _field34 = false; } void CStarControlSub23::setPath(const FVector &srcV, const FVector &destV, const FMatrix &srcM) { _srcPos = srcV; _destPos = destV; _posDelta = _destPos - _srcPos; - _field24 = _posDelta.normalize(); + _distance = _posDelta.normalize(); _active = false; - _field34 = 0; + _field34 = false; _field40 = -1; _field44 = -1; _field48 = -1; diff --git a/engines/titanic/star_control/star_control_sub23.h b/engines/titanic/star_control/star_control_sub23.h index 00adb4332a..3d16031cba 100644 --- a/engines/titanic/star_control/star_control_sub23.h +++ b/engines/titanic/star_control/star_control_sub23.h @@ -35,9 +35,9 @@ protected: int _field4; bool _active; FVector _srcPos, _destPos; - double _field24; + double _distance; FVector _posDelta; - int _field34; + bool _field34; double _field38; double _field3C; int _field40; diff --git a/engines/titanic/star_control/star_control_sub24.cpp b/engines/titanic/star_control/star_control_sub24.cpp index d716079e31..6bfaef97ef 100644 --- a/engines/titanic/star_control/star_control_sub24.cpp +++ b/engines/titanic/star_control/star_control_sub24.cpp @@ -37,10 +37,10 @@ void CStarControlSub24::proc3(const FMatrix &m1, const FMatrix &m2) { void CStarControlSub24::setPath(const FVector &srcV, const FVector &destV, const FMatrix &srcM) { CStarControlSub23::setPath(srcV, destV, srcM); - if (_field24 > 8000.0) { + if (_distance > 8000.0) { _active = true; _field34 = 1; - proc6(120, 4, _field24 - 8000.0); + proc6(120, 4, _distance - 8000.0); } FVector row3 = srcM._row3; diff --git a/engines/titanic/star_control/star_control_sub27.cpp b/engines/titanic/star_control/star_control_sub27.cpp index d48333f125..3c56b7d93e 100644 --- a/engines/titanic/star_control/star_control_sub27.cpp +++ b/engines/titanic/star_control/star_control_sub27.cpp @@ -29,11 +29,11 @@ void CStarControlSub27::proc2(FVector &oldPos, FVector &newPos, FMatrix &oldOrientation, FMatrix &newOrientation) { CStarControlSub23::proc2(oldPos, newPos, oldOrientation, newOrientation); - double factor = _field24; - if (_field24 > 0.0) { + double distance = _distance; + if (distance > 0.0) { _active = true; - _field34 = 1; - proc6(120, 4, _field24); + _field34 = true; + proc6(120, 4, distance); } if (newPos != oldPos) { @@ -44,7 +44,7 @@ void CStarControlSub27::proc2(FVector &oldPos, FVector &newPos, _moveDelayInc = 0.1; _active = true; } else { - _moveDelayInc = 1.0 / factor; + _moveDelayInc = 1.0 / distance; _active = true; } } @@ -89,7 +89,7 @@ int CStarControlSub27::proc5(CErrorCode &errorCode, FVector &pos, FMatrix &orien void CStarControlSub27::getVectorOnPath(FVector &pos) const { double distance = _posDelta.getDistance(pos); - distance /= _field24; + distance /= _distance; if (distance <= 0.0) { pos = _srcPos; diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp index e3d6162977..6409e911ef 100644 --- a/engines/titanic/star_control/star_view.cpp +++ b/engines/titanic/star_control/star_view.cpp @@ -234,11 +234,11 @@ bool CStarView::KeyCharMsg(int key, CErrorCode *errorCode) { } bool CStarView::canSetStarDestination() const { - return _camera.is108(); + return _camera.isMoved(); } void CStarView::starDestinationSet() { - _camera.reset108(); + _camera.clearIsMoved(); } void CStarView::resetPosition() { |