Skip to content
Permalink
Browse files

TITANIC: Fix DMatrix constructors

  • Loading branch information
dreammaster committed Mar 19, 2017
1 parent c8aee75 commit 89d5eeaa5819c10266160fd1bf12f88f6e073a12
Showing with 23 additions and 15 deletions.
  1. +21 −12 engines/titanic/star_control/dmatrix.cpp
  2. +2 −3 engines/titanic/star_control/dmatrix.h
@@ -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) {
@@ -42,14 +42,13 @@ class DMatrix {
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);

0 comments on commit 89d5eea

Please sign in to comment.
You can’t perform that action at this time.