[Scummvm-git-logs] scummvm master -> 538e6ffc8f418e736d235221ae7f31bc832611da

dreammaster dreammaster at scummvm.org
Sun Mar 26 03:25:24 CEST 2017


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

Summary:
538e6ffc8f TITANIC: Fixes to CStarView class


Commit: 538e6ffc8f418e736d235221ae7f31bc832611da
    https://github.com/scummvm/scummvm/commit/538e6ffc8f418e736d235221ae7f31bc832611da
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-03-25T21:25:20-04:00

Commit Message:
TITANIC: Fixes to CStarView class

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


diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index 6ed5f3b..a9b6cde 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -282,7 +282,7 @@ void CStarView::fn3(bool fadeIn) {
 
 void CStarView::fn4() {
 	FVector v1, v2;
-	randomizeVectors2(v1, v2);
+	randomizeVectors1(v1, v2);
 	_sub12.setPosition(v1);
 	_sub12.proc5(v2);
 }
@@ -299,7 +299,7 @@ void CStarView::fn7() {
 	const CBaseStarEntry *star = _starField->getRandomStar();
 	if (star) {
 		FVector v1, v2;
-		randomizeVectors3(v1, v2);
+		randomizeVectors1(v1, v2);
 		v2 += star->_position;
 		_sub12.setPosition(v2);
 		_sub12.proc5(v1);
@@ -310,7 +310,7 @@ void CStarView::fn19(int index) {
 	const CBaseStarEntry *star = _starField->getStar(index);
 	if (star) {
 		FVector v1, v2;
-		randomizeVectors3(v1, v2);
+		randomizeVectors1(v1, v2);
 		v1 += star->_position;
 		_sub12.setPosition(v1);
 		_sub12.proc5(v2);
@@ -362,7 +362,7 @@ void CStarView::fn14() {
 
 void CStarView::setHasReference() {
 	FVector v1, v2;
-	randomizeVectors1(v1, v2);
+	randomizeVectors2(v1, v2);
 
 	_sub13.setPosition(v1);
 	_sub13.fn11(v2);
@@ -438,53 +438,23 @@ void CStarView::fn18(CStarControlSub12 *sub12) {
 }
 
 void CStarView::randomizeVectors1(FVector &v1, FVector &v2) {
-	v1._x = g_vm->getRandomFloat() * -4096.0 - 3072.0;
-	v1._y = g_vm->getRandomFloat() * -4096.0 - 3072.0;
-	v1._z = g_vm->getRandomFloat() * -4096.0 - 3072.0;
-
-	double vx = g_vm->getRandomFloat() * 8192.0;
-	double vy = g_vm->getRandomFloat() * 1024.0;
-	vx -= v1._x;
-	vy -= v1._y;
-	
-	v2._x = vx;
-	v2._y = vy;
-	v2._z = -v1._z;
-	v2.normalize();
-}
-
-void CStarView::randomizeVectors2(FVector &v1, FVector &v2) {
-	v1._x = 3072.0 - g_vm->getRandomFloat() * -4096.0;
-	v1._y = 3072.0 - g_vm->getRandomFloat() * -4096.0;
-	v1._z = 3072.0 - g_vm->getRandomFloat() * -4096.0;
-
-	// TODO: Doublecheck
-	v2._x = -v1._x;
-	v2._y = -v1._y;
-	v2._z = -v1._z;
-	v2.normalize();
-}
-
-void CStarView::randomizeVectors3(FVector &v1, FVector &v2) {
 	v1._x = 3072.0 - g_vm->getRandomFloat() * -4096.0;
 	v1._y = 3072.0 - g_vm->getRandomFloat() * -4096.0;
 	v1._z = 3072.0 - g_vm->getRandomFloat() * -4096.0;
 
-	// TODO: Doublecheck
 	v2._x = -v1._x;
 	v2._y = -v1._y;
 	v2._z = -v1._z;
 	v2.normalize();
 }
 
-void CStarView::randomizeVectors4(FVector &v1, FVector &v2) {
+void CStarView::randomizeVectors2(FVector &v1, FVector &v2) {
 	v1._x = 3072.0 - g_vm->getRandomFloat() * -4096.0;
 	v1._y = 3072.0 - g_vm->getRandomFloat() * -4096.0;
 	v1._z = 3072.0 - g_vm->getRandomFloat() * -4096.0;
 
-	// TODO: Doublecheck
-	v2._x = -v1._x;
-	v2._y = -v1._y;
+	v2._x = g_vm->getRandomFloat() * 8192.0 - v1._x;
+	v2._y = g_vm->getRandomFloat() * 1024.0 - v1._y;
 	v2._z = -v1._z;
 	v2.normalize();
 }
diff --git a/engines/titanic/star_control/star_view.h b/engines/titanic/star_control/star_view.h
index 0e271ec..9a9e069 100644
--- a/engines/titanic/star_control/star_view.h
+++ b/engines/titanic/star_control/star_view.h
@@ -59,8 +59,6 @@ private:
 
 	void randomizeVectors1(FVector &v1, FVector &v2);
 	void randomizeVectors2(FVector &v1, FVector &v2);
-	void randomizeVectors3(FVector &v1, FVector &v2);
-	void randomizeVectors4(FVector &v1, FVector &v2);
 
 	/**
 	 * Handles resizing the surface





More information about the Scummvm-git-logs mailing list