[Scummvm-git-logs] scummvm master -> 87ebc7140c1bc650e7a6ac89b102f8f2d2970f63

dreammaster dreammaster at scummvm.org
Sat Sep 2 02:46:44 CEST 2017


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0df15f0b0d TITANIC: Don't allow unlocking stars while locking onto a star
87ebc7140c Merge pull request #1004 from dafioram/fix10170


Commit: 0df15f0b0de7c31f75dab63836e92bc7899aa51d
    https://github.com/scummvm/scummvm/commit/0df15f0b0de7c31f75dab63836e92bc7899aa51d
Author: David Fioramonti (dafioram at gmail.com)
Date: 2017-08-31T19:25:40-07:00

Commit Message:
TITANIC: Don't allow unlocking stars while locking onto a star

Fixes #10170.

I've added a boolean variable that tracks whether the game is
in the process of locking onto a star or not.

When the user hits the unlock button _isInLockingProcess gets checked and
the request to unlock is denied if the locking on is currently happening.

Once the locking on is finished then the release is lifted and the user
can unlock at this time (or after locking onto the next star).

Changed paths:
    engines/titanic/star_control/star_camera.cpp
    engines/titanic/star_control/star_camera.h
    engines/titanic/star_control/star_view.cpp


diff --git a/engines/titanic/star_control/star_camera.cpp b/engines/titanic/star_control/star_camera.cpp
index d3bc3d9..c9cffd4 100644
--- a/engines/titanic/star_control/star_camera.cpp
+++ b/engines/titanic/star_control/star_camera.cpp
@@ -41,12 +41,12 @@ FMatrix *CStarCamera::_priorOrientation;
 FMatrix *CStarCamera::_newOrientation;
 
 CStarCamera::CStarCamera(const CNavigationInfo *data) :
-		_starLockState(ZERO_LOCKED), _mover(nullptr), _isMoved(false) {
+		_starLockState(ZERO_LOCKED), _mover(nullptr), _isMoved(false), _isInLockingProcess(false) {
 	setupHandler(data);
 }
 
 CStarCamera::CStarCamera(CViewport *src) :
-		_starLockState(ZERO_LOCKED), _mover(nullptr), _isMoved(false), _viewport(src) {
+		_starLockState(ZERO_LOCKED), _mover(nullptr), _isMoved(false), _isInLockingProcess(false), _viewport(src) {
 }
 
 void CStarCamera::init() {
@@ -65,6 +65,10 @@ bool CStarCamera::isLocked() {
 	return _mover->isLocked();
 }
 
+bool CStarCamera::isNotInLockingProcess() { 
+	return !_isInLockingProcess;
+}
+
 CStarCamera::~CStarCamera() {
 	deleteHandler();
 }
@@ -252,6 +256,8 @@ void CStarCamera::setViewportAngle(const FPoint &angles) {
 	if (isLocked())
 		return;
 
+	_isInLockingProcess = false;
+
 	switch(_starLockState) {
 	case ZERO_LOCKED: {
 		FPose subX(X_AXIS, angles._y);
@@ -471,6 +477,7 @@ bool CStarCamera::lockMarker1(FVector v1, FVector firstStarPosition, FVector v3)
 	if (_starLockState != ZERO_LOCKED)
 		return true;
 
+	_isInLockingProcess = true;
 	FVector tempV;
 	double val1, val2, val3, val4, val5;
 	double val6, val7, val8, val9;
@@ -504,12 +511,15 @@ bool CStarCamera::lockMarker1(FVector v1, FVector firstStarPosition, FVector v3)
 
 	CStarVector *sv = new CStarVector(this, firstStarPosition);
 	_mover->setVector(sv);
+
 	return	true;
 }
 
 bool CStarCamera::lockMarker2(CViewport *viewport, const FVector &secondStarPosition) {
 	if (_starLockState != ONE_LOCKED)
 		return true;
+
+	_isInLockingProcess = true;
 	FVector firstStarPosition = _lockedStarsPos._row1;
 	DAffine m2(0, firstStarPosition); // Identity matrix and col4 as the 1st stars position
 	DVector starDelta = secondStarPosition - firstStarPosition;
@@ -603,6 +613,7 @@ bool CStarCamera::lockMarker3(CViewport *viewport, const FVector &thirdStarPosit
 	if (_starLockState != TWO_LOCKED)
 		return true;
 
+	_isInLockingProcess = true;
 	FMatrix newOr = viewport->getOrientation();
 	FMatrix oldOr = _viewport.getOrientation();
 	FVector newPos = viewport->_position;
@@ -612,6 +623,7 @@ bool CStarCamera::lockMarker3(CViewport *viewport, const FVector &thirdStarPosit
 
 	CStarVector *sv = new CStarVector(this, thirdStarPosition);
 	_mover->setVector(sv);
+
 	return true;
 }
 
diff --git a/engines/titanic/star_control/star_camera.h b/engines/titanic/star_control/star_camera.h
index 71be90d..72c26c1 100644
--- a/engines/titanic/star_control/star_camera.h
+++ b/engines/titanic/star_control/star_camera.h
@@ -49,7 +49,8 @@ private:
 	FMatrix _lockedStarsPos; // Each row represents the location of a locked star
 	CCameraMover *_mover;
 	CViewport _viewport;
-	bool _isMoved;
+	bool _isMoved; // TODO: determine if this is being used
+	bool _isInLockingProcess; // The mover/view is homing in on a new star
 private:
 	/**
 	 * Set up a handler
@@ -77,6 +78,13 @@ public:
 	virtual void proc3(const CNavigationInfo *src);
 
 	/**
+	 * The mover/view is not currently homing in on a new star
+	 * This can mean it is unmarked, or that it is fully locked 
+	 * onto one star or more (but not in the process of doing so)
+	 */
+	bool isNotInLockingProcess();
+
+	/**
 	 * Set the camera position
 	 */
 	virtual void setPosition(const FVector &v);
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index 6730d02..e65c5da 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -434,7 +434,7 @@ void CStarView::lockStar() {
 }
 
 void CStarView::unlockStar() {
-	if (_starField && !_showingPhoto) {
+	if (_starField && !_showingPhoto && _camera.isNotInLockingProcess()) {
 		_camera.removeLockedStar();
 		_starField->fn8(_photoSurface);
 	}


Commit: 87ebc7140c1bc650e7a6ac89b102f8f2d2970f63
    https://github.com/scummvm/scummvm/commit/87ebc7140c1bc650e7a6ac89b102f8f2d2970f63
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-09-01T20:46:39-04:00

Commit Message:
Merge pull request #1004 from dafioram/fix10170

TITANIC: Don't allow unlocking stars while locking onto a star

Changed paths:
    engines/titanic/star_control/star_camera.cpp
    engines/titanic/star_control/star_camera.h
    engines/titanic/star_control/star_view.cpp







More information about the Scummvm-git-logs mailing list