aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-03-19 19:18:45 -0400
committerPaul Gilbert2017-03-19 19:18:45 -0400
commit89d5eeaa5819c10266160fd1bf12f88f6e073a12 (patch)
tree3fab0c313c4f20cec9a054acf325a7827ca644ab /engines
parentc8aee753845c3af98744531b2473b1ad1ac60227 (diff)
downloadscummvm-rg350-89d5eeaa5819c10266160fd1bf12f88f6e073a12.tar.gz
scummvm-rg350-89d5eeaa5819c10266160fd1bf12f88f6e073a12.tar.bz2
scummvm-rg350-89d5eeaa5819c10266160fd1bf12f88f6e073a12.zip
TITANIC: Fix DMatrix constructors
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/star_control/dmatrix.cpp33
-rw-r--r--engines/titanic/star_control/dmatrix.h5
2 files changed, 23 insertions, 15 deletions
diff --git a/engines/titanic/star_control/dmatrix.cpp b/engines/titanic/star_control/dmatrix.cpp
index 1405f4f693..940b34833f 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 a015ebdb1d..c3490770fb 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);