[Scummvm-git-logs] scummvm master -> 89d5eeaa5819c10266160fd1bf12f88f6e073a12

dreammaster dreammaster at scummvm.org
Mon Mar 20 00:19:52 CET 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:
89d5eeaa58 TITANIC: Fix DMatrix constructors


Commit: 89d5eeaa5819c10266160fd1bf12f88f6e073a12
    https://github.com/scummvm/scummvm/commit/89d5eeaa5819c10266160fd1bf12f88f6e073a12
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-03-19T19:18:45-04:00

Commit Message:
TITANIC: Fix DMatrix constructors

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


diff --git a/engines/titanic/star_control/dmatrix.cpp b/engines/titanic/star_control/dmatrix.cpp
index 1405f4f..940b348 100644
--- a/engines/titanic/star_control/dmatrix.cpp
+++ b/engines/titanic/star_control/dmatrix.cpp
@@ -32,18 +32,27 @@ DMatrix::DMatrix() :
 	_row1(1.875, 0.0, 0.0), _row2(0.0, 1.875, 0.0), _row3(0.0, 0.0, 1.875) {
 }
 
-DMatrix::DMatrix(int mode, const FMatrix *src) {
-	assert(!mode);
-
-	_row1._x = 1.875;
-	_row2._y = 1.875;
-	_row3._z = 1.875;
-	_frow1._x = src->_row1._x;
-	_frow1._y = src->_row1._y;
-	_frow1._z = src->_row1._z;
-	_frow2._x = src->_row2._x;
-	_frow2._y = src->_row2._y;
-	_frow2._z = src->_row2._z;
+DMatrix::DMatrix(int mode, const DVector &src) {
+	switch (mode) {
+	case 0:
+		_row1._x = 1.0;
+		_row2._y = 1.0;
+		_row3._z = 1.0;
+		_row4 = src;
+		break;
+
+	case 1:
+		_row1._x = src._x;
+		_row2._y = src._y;
+		_row3._z = src._z;
+		break;
+
+	default:
+		_row1._x = 1.0;
+		_row2._y = 1.0;
+		_row3._z = 1.0;
+		break;
+	}
 }
 
 DMatrix::DMatrix(Axis axis, double amount) {
diff --git a/engines/titanic/star_control/dmatrix.h b/engines/titanic/star_control/dmatrix.h
index a015ebd..c349077 100644
--- a/engines/titanic/star_control/dmatrix.h
+++ b/engines/titanic/star_control/dmatrix.h
@@ -42,14 +42,13 @@ public:
 	DVector _row1;
 	DVector _row2;
 	DVector _row3;
-	FVector _frow1;
-	FVector _frow2;
+	DVector _row4;
 public:
 	static void init();
 	static void deinit();
 public:
 	DMatrix();
-	DMatrix(int mode, const FMatrix *src);
+	DMatrix(int mode, const DVector &src);
 	DMatrix(Axis axis, double amount);
 	DMatrix(const FMatrix &src);
 





More information about the Scummvm-git-logs mailing list