diff options
author | Paul Gilbert | 2017-04-16 11:35:32 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-04-16 11:35:32 -0400 |
commit | b57fd696ba5290397096c05334c3bedb4b0c87d2 (patch) | |
tree | 2360cd8baf14f3881f3f898fa9e46d54389bd531 /engines/titanic | |
parent | f1b2d9c71bdac6770519bb288fea6fdc489ed3b8 (diff) | |
download | scummvm-rg350-b57fd696ba5290397096c05334c3bedb4b0c87d2.tar.gz scummvm-rg350-b57fd696ba5290397096c05334c3bedb4b0c87d2.tar.bz2 scummvm-rg350-b57fd696ba5290397096c05334c3bedb4b0c87d2.zip |
TITANIC: Renamed CStarControlSub20 to CCameraMover
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/module.mk | 2 | ||||
-rw-r--r-- | engines/titanic/star_control/camera_mover.cpp (renamed from engines/titanic/star_control/star_control_sub20.cpp) | 36 | ||||
-rw-r--r-- | engines/titanic/star_control/camera_mover.h (renamed from engines/titanic/star_control/star_control_sub20.h) | 18 | ||||
-rw-r--r-- | engines/titanic/star_control/star_camera.cpp | 62 | ||||
-rw-r--r-- | engines/titanic/star_control/star_camera.h | 12 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub21.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub21.h | 6 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub22.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub22.h | 6 | ||||
-rw-r--r-- | engines/titanic/star_control/star_view.cpp | 4 |
10 files changed, 77 insertions, 77 deletions
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index 9eeaa18e28..305c341784 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -432,6 +432,7 @@ MODULE_OBJS := \ sound/wave_file.o \ star_control/star_control.o \ star_control/base_stars.o \ + star_control/camera_mover.o \ star_control/dmatrix.o \ star_control/dvector.o \ star_control/fmatrix.o \ @@ -446,7 +447,6 @@ MODULE_OBJS := \ star_control/star_control_sub7.o \ star_control/star_control_sub8.o \ star_control/star_control_sub13.o \ - star_control/star_control_sub20.o \ star_control/star_control_sub21.o \ star_control/star_control_sub22.o \ star_control/star_control_sub23.o \ diff --git a/engines/titanic/star_control/star_control_sub20.cpp b/engines/titanic/star_control/camera_mover.cpp index fd12573fac..198e21ae2d 100644 --- a/engines/titanic/star_control/star_control_sub20.cpp +++ b/engines/titanic/star_control/camera_mover.cpp @@ -20,12 +20,12 @@ * */ -#include "titanic/star_control/star_control_sub20.h" +#include "titanic/star_control/camera_mover.h" #include "common/textconsole.h" namespace Titanic { -CStarControlSub20::CStarControlSub20(const CStar20Data *src) { +CCameraMover::CCameraMover(const CNavigationInfo *src) { _lockCounter = 0; _starVector = nullptr; @@ -43,19 +43,19 @@ CStarControlSub20::CStarControlSub20(const CStar20Data *src) { } } -CStarControlSub20::~CStarControlSub20() { +CCameraMover::~CCameraMover() { clear(); } -void CStarControlSub20::copyFrom(const CStar20Data *src) { - *((CStar20Data *)this) = *src; +void CCameraMover::copyFrom(const CNavigationInfo *src) { + *((CNavigationInfo *)this) = *src; } -void CStarControlSub20::copyTo(CStar20Data *dest) { - *dest = *((CStar20Data *)this); +void CCameraMover::copyTo(CNavigationInfo *dest) { + *dest = *((CNavigationInfo *)this); } -void CStarControlSub20::proc4() { +void CCameraMover::proc4() { if (!isLocked() && _size < _field10) { _field4 += _size; if (_field8 == _field4) @@ -65,7 +65,7 @@ void CStarControlSub20::proc4() { } } -void CStarControlSub20::proc5() { +void CCameraMover::proc5() { if (!isLocked()) { _field4 -= _field8; if (_field4 == _size) @@ -78,19 +78,19 @@ void CStarControlSub20::proc5() { } } -void CStarControlSub20::proc6() { +void CCameraMover::proc6() { if (!isLocked()) _size = _field10; } -void CStarControlSub20::proc7() { +void CCameraMover::proc7() { if (!isLocked()) { _size = 0.0; _field4 = 0.0; } } -void CStarControlSub20::proc11(CErrorCode &errorCode, FVector &v, FMatrix &m) { +void CCameraMover::proc11(CErrorCode &errorCode, FVector &v, FMatrix &m) { if (_size > 0.0) { v._x += m._row3._x * _size; v._y += m._row3._y * _size; @@ -100,19 +100,19 @@ void CStarControlSub20::proc11(CErrorCode &errorCode, FVector &v, FMatrix &m) { } } -void CStarControlSub20::setVector(CStarVector *sv) { +void CCameraMover::setVector(CStarVector *sv) { clear(); _starVector = sv; } -void CStarControlSub20::clear() { +void CCameraMover::clear() { if (_starVector) { delete _starVector; _starVector = nullptr; } } -void CStarControlSub20::load(SimpleFile *file, int val) { +void CCameraMover::load(SimpleFile *file, int val) { if (!val) { _size = file->readFloat(); _field4 = file->readFloat(); @@ -125,7 +125,7 @@ void CStarControlSub20::load(SimpleFile *file, int val) { } } -void CStarControlSub20::save(SimpleFile *file, int indent) { +void CCameraMover::save(SimpleFile *file, int indent) { file->writeFloatLine(_size, indent); file->writeFloatLine(_field4, indent); file->writeFloatLine(_field8, indent); @@ -136,11 +136,11 @@ void CStarControlSub20::save(SimpleFile *file, int indent) { file->writeFloatLine(_field1C, indent); } -void CStarControlSub20::incLockCount() { +void CCameraMover::incLockCount() { ++_lockCounter; } -void CStarControlSub20::decLockCount() { +void CCameraMover::decLockCount() { if (_lockCounter > 0) --_lockCounter; } diff --git a/engines/titanic/star_control/star_control_sub20.h b/engines/titanic/star_control/camera_mover.h index 102773f1d6..bd1f6b1d83 100644 --- a/engines/titanic/star_control/star_control_sub20.h +++ b/engines/titanic/star_control/camera_mover.h @@ -20,8 +20,8 @@ * */ -#ifndef TITANIC_STAR_CONTROL_SUB20_H -#define TITANIC_STAR_CONTROL_SUB20_H +#ifndef TITANIC_CAMERA_MOVER_H +#define TITANIC_CAMERA_MOVER_H #include "titanic/support/simple_file.h" #include "titanic/star_control/base_stars.h" @@ -30,7 +30,7 @@ namespace Titanic { -struct CStar20Data { +struct CNavigationInfo { double _size; double _field4; double _field8; @@ -41,16 +41,16 @@ struct CStar20Data { double _field1C; }; -class CStarControlSub20 : public CStar20Data { +class CCameraMover : public CNavigationInfo { public: int _lockCounter; CStarVector *_starVector; public: - CStarControlSub20(const CStar20Data *src); - virtual ~CStarControlSub20(); + CCameraMover(const CNavigationInfo *src); + virtual ~CCameraMover(); - virtual void copyFrom(const CStar20Data *src); - virtual void copyTo(CStar20Data *dest); + virtual void copyFrom(const CNavigationInfo *src); + virtual void copyTo(CNavigationInfo *dest); virtual void proc4(); virtual void proc5(); virtual void proc6(); @@ -99,4 +99,4 @@ public: } // End of namespace Titanic -#endif /* TITANIC_STAR_CONTROL_SUB20_H */ +#endif /* TITANIC_CAMERA_MOVER_H */ diff --git a/engines/titanic/star_control/star_camera.cpp b/engines/titanic/star_control/star_camera.cpp index 8f091821ab..071448a8a7 100644 --- a/engines/titanic/star_control/star_camera.cpp +++ b/engines/titanic/star_control/star_camera.cpp @@ -32,13 +32,13 @@ namespace Titanic { FMatrix *CStarCamera::_matrix1; FMatrix *CStarCamera::_matrix2; -CStarCamera::CStarCamera(const CStar20Data *data) : - _matrixRow(-1), _handlerP(nullptr), _field108(0) { +CStarCamera::CStarCamera(const CNavigationInfo *data) : + _matrixRow(-1), _mover(nullptr), _field108(0) { setupHandler(data); } CStarCamera::CStarCamera(CStarControlSub13 *src) : - _matrixRow(-1), _handlerP(nullptr), _field108(0), _sub13(src) { + _matrixRow(-1), _mover(nullptr), _field108(0), _sub13(src) { } void CStarCamera::init() { @@ -61,8 +61,8 @@ void CStarCamera::proc2(const CStarControlSub13 *src) { _sub13.copyFrom(src); } -void CStarCamera::proc3(const CStar20Data *src) { - _handlerP->copyFrom(src); +void CStarCamera::proc3(const CNavigationInfo *src) { + _mover->copyFrom(src); } void CStarCamera::setPosition(const FVector &v) { @@ -120,7 +120,7 @@ void CStarCamera::setDestination(const FVector &v) { FMatrix matrix = _sub13.getMatrix(); FVector vector = _sub13._position; - _handlerP->moveTo(vector, v, matrix); + _mover->moveTo(vector, v, matrix); } void CStarCamera::proc15(CErrorCode *errorCode) { @@ -134,7 +134,7 @@ void CStarCamera::proc15(CErrorCode *errorCode) { FVector v1 = _sub13._position; FVector v2 = _sub13._position; - _handlerP->proc11(*errorCode, v2, *_matrix2); + _mover->proc11(*errorCode, v2, *_matrix2); if (v1 != v2) { _sub13.setPosition(v2); @@ -147,19 +147,19 @@ void CStarCamera::proc15(CErrorCode *errorCode) { } void CStarCamera::proc16() { - _handlerP->proc4(); + _mover->proc4(); } void CStarCamera::proc17() { - _handlerP->proc5(); + _mover->proc5(); } void CStarCamera::proc18() { - _handlerP->proc6(); + _mover->proc6(); } void CStarCamera::proc19() { - _handlerP->proc7(); + _mover->proc7(); } void CStarCamera::proc20(double factor) { @@ -395,8 +395,8 @@ bool CStarCamera::addMatrixRow(const FVector &v) { if (_matrixRow >= 2) return false; - CStar20Data data; - _handlerP->copyTo(&data); + CNavigationInfo data; + _mover->copyTo(&data); deleteHandler(); FVector &row = _matrix[++_matrixRow]; @@ -409,8 +409,8 @@ bool CStarCamera::removeMatrixRow() { if (_matrixRow == -1) return false; - CStar20Data data; - _handlerP->copyTo(&data); + CNavigationInfo data; + _mover->copyTo(&data); deleteHandler(); --_matrixRow; @@ -430,27 +430,27 @@ void CStarCamera::save(SimpleFile *file, int indent) { _sub13.save(file, indent); } -bool CStarCamera::setupHandler(const CStar20Data *src) { - CStarControlSub20 *handler = nullptr; +bool CStarCamera::setupHandler(const CNavigationInfo *src) { + CCameraMover *mover = nullptr; switch (_matrixRow) { case -1: - handler = new CStarControlSub21(src); + mover = new CStarControlSub21(src); break; case 0: case 1: case 2: - handler = new CStarControlSub22(src); + mover = new CStarControlSub22(src); break; default: break; } - if (handler) { - assert(!_handlerP); - _handlerP = handler; + if (mover) { + assert(!_mover); + _mover = mover; return true; } else { return false; @@ -458,9 +458,9 @@ bool CStarCamera::setupHandler(const CStar20Data *src) { } void CStarCamera::deleteHandler() { - if (_handlerP) { - delete _handlerP; - _handlerP = nullptr; + if (_mover) { + delete _mover; + _mover = nullptr; } } @@ -471,9 +471,9 @@ void CStarCamera::fn1(CStarControlSub13 *sub13, const FVector &v) { FVector v1 = sub13->_position; FVector v2 = _sub13._position; - _handlerP->proc8(v2, v1, m2, m1); + _mover->proc8(v2, v1, m2, m1); CStarVector *sv = new CStarVector(this, v); - _handlerP->setVector(sv); + _mover->setVector(sv); } } @@ -493,10 +493,10 @@ void CStarCamera::fn2(FVector v1, FVector v2, FVector v3) { FMatrix matrix = _sub13.getMatrix(); const FVector &pos = _sub13._position; - _handlerP->proc10(v3, tempV, pos, matrix); + _mover->proc10(v3, tempV, pos, matrix); CStarVector *sv = new CStarVector(this, v2); - _handlerP->setVector(sv); + _mover->setVector(sv); } } @@ -596,10 +596,10 @@ void CStarCamera::fn3(CStarControlSub13 *sub13, const FVector &v) { FVector tempV6 = m4._row1; FMatrix m6 = _sub13.getMatrix(); - _handlerP->proc8(_sub13._position, tempV6, m6, m5); + _mover->proc8(_sub13._position, tempV6, m6, m5); CStarVector *sv = new CStarVector(this, v); - _handlerP->setVector(sv); + _mover->setVector(sv); } } // End of namespace Titanic diff --git a/engines/titanic/star_control/star_camera.h b/engines/titanic/star_control/star_camera.h index 194079a0fc..4363606dc8 100644 --- a/engines/titanic/star_control/star_camera.h +++ b/engines/titanic/star_control/star_camera.h @@ -28,7 +28,7 @@ #include "titanic/star_control/fpoint.h" #include "titanic/star_control/base_stars.h" #include "titanic/star_control/star_control_sub13.h" -#include "titanic/star_control/star_control_sub20.h" +#include "titanic/star_control/camera_mover.h" #include "titanic/star_control/error_code.h" namespace Titanic { @@ -40,14 +40,14 @@ private: private: int _matrixRow; FMatrix _matrix; - CStarControlSub20 *_handlerP; + CCameraMover *_mover; CStarControlSub13 _sub13; int _field108; private: /** * Set up a handler */ - bool setupHandler(const CStar20Data *src); + bool setupHandler(const CNavigationInfo *src); /** * Deletes any previous handler @@ -57,17 +57,17 @@ private: /** * Return whether the handler is locked */ - bool isLocked() { return _handlerP->isLocked(); } + bool isLocked() { return _mover->isLocked(); } public: static void init(); static void deinit(); public: - CStarCamera(const CStar20Data *data); + CStarCamera(const CNavigationInfo *data); CStarCamera(CStarControlSub13 *src); virtual ~CStarCamera(); virtual void proc2(const CStarControlSub13 *src); - virtual void proc3(const CStar20Data *src); + virtual void proc3(const CNavigationInfo *src); virtual void setPosition(const FVector &v); virtual void proc5(const FVector &v); virtual void proc6(int v); diff --git a/engines/titanic/star_control/star_control_sub21.cpp b/engines/titanic/star_control/star_control_sub21.cpp index 6c5608eb27..4f95ad206d 100644 --- a/engines/titanic/star_control/star_control_sub21.cpp +++ b/engines/titanic/star_control/star_control_sub21.cpp @@ -27,8 +27,8 @@ namespace Titanic { -CStarControlSub21::CStarControlSub21(const CStar20Data *src) : - CStarControlSub20(src) { +CStarControlSub21::CStarControlSub21(const CNavigationInfo *src) : + CCameraMover(src) { } void CStarControlSub21::moveTo(const FVector &srcV, const FVector &destV, const FMatrix &srcM) { diff --git a/engines/titanic/star_control/star_control_sub21.h b/engines/titanic/star_control/star_control_sub21.h index 3776121d96..4ebf823fd3 100644 --- a/engines/titanic/star_control/star_control_sub21.h +++ b/engines/titanic/star_control/star_control_sub21.h @@ -23,16 +23,16 @@ #ifndef TITANIC_STAR_CONTROL_SUB21_H #define TITANIC_STAR_CONTROL_SUB21_H -#include "titanic/star_control/star_control_sub20.h" +#include "titanic/star_control/camera_mover.h" #include "titanic/star_control/star_control_sub24.h" namespace Titanic { -class CStarControlSub21 : public CStarControlSub20 { +class CStarControlSub21 : public CCameraMover { private: CStarControlSub24 _sub24; public: - CStarControlSub21(const CStar20Data *src); + CStarControlSub21(const CNavigationInfo *src); virtual ~CStarControlSub21() {} virtual void moveTo(const FVector &srcV, const FVector &destV, const FMatrix &srcM); diff --git a/engines/titanic/star_control/star_control_sub22.cpp b/engines/titanic/star_control/star_control_sub22.cpp index 574cf73cce..8c3c7fa2ab 100644 --- a/engines/titanic/star_control/star_control_sub22.cpp +++ b/engines/titanic/star_control/star_control_sub22.cpp @@ -25,8 +25,8 @@ namespace Titanic { -CStarControlSub22::CStarControlSub22(const CStar20Data *src) : - CStarControlSub20(src) { +CStarControlSub22::CStarControlSub22(const CNavigationInfo *src) : + CCameraMover(src) { } void CStarControlSub22::proc8(FVector &v1, FVector &v2, FMatrix &m1, FMatrix &m2) { diff --git a/engines/titanic/star_control/star_control_sub22.h b/engines/titanic/star_control/star_control_sub22.h index 704cfa7d6c..5a597ef50e 100644 --- a/engines/titanic/star_control/star_control_sub22.h +++ b/engines/titanic/star_control/star_control_sub22.h @@ -23,16 +23,16 @@ #ifndef TITANIC_STAR_CONTROL_SUB22_H #define TITANIC_STAR_CONTROL_SUB22_H -#include "titanic/star_control/star_control_sub20.h" +#include "titanic/star_control/camera_mover.h" #include "titanic/star_control/star_control_sub27.h" namespace Titanic { -class CStarControlSub22 : public CStarControlSub20 { +class CStarControlSub22 : public CCameraMover { private: CStarControlSub27 _sub27; public: - CStarControlSub22(const CStar20Data *src); + CStarControlSub22(const CNavigationInfo *src); virtual ~CStarControlSub22() {} virtual void proc8(FVector &v1, FVector &v2, FMatrix &m1, FMatrix &m2); diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp index 9f869c8dbe..95c6a3831c 100644 --- a/engines/titanic/star_control/star_view.cpp +++ b/engines/titanic/star_control/star_view.cpp @@ -30,11 +30,11 @@ namespace Titanic { -CStarView::CStarView() : _camera((const CStar20Data *)nullptr), _owner(nullptr), +CStarView::CStarView() : _camera((const CNavigationInfo *)nullptr), _owner(nullptr), _starField(nullptr), _videoSurface(nullptr), _hasReference(0), _videoSurface2(nullptr), _homePhotoMask(nullptr), _field218(false), _showingPhoto(false) { - CStar20Data data = { 0, 0, 100000.0, 0, 20.0, 1.0, 1.0, 1.0 }; + CNavigationInfo data = { 0, 0, 100000.0, 0, 20.0, 1.0, 1.0, 1.0 }; _camera.proc3(&data); } |