diff options
Diffstat (limited to 'engines/titanic')
24 files changed, 226 insertions, 226 deletions
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index aa165d301e..9eeaa18e28 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -440,11 +440,11 @@ MODULE_OBJS := \ star_control/frange.o \ star_control/frect.o \ star_control/fvector.o \ + star_control/star_camera.o \ star_control/star_closeup.o \ star_control/star_control_sub2.o \ star_control/star_control_sub7.o \ star_control/star_control_sub8.o \ - star_control/star_control_sub12.o \ star_control/star_control_sub13.o \ star_control/star_control_sub20.o \ star_control/star_control_sub21.o \ diff --git a/engines/titanic/star_control/base_stars.cpp b/engines/titanic/star_control/base_stars.cpp index a5c6143d45..1da535e94a 100644 --- a/engines/titanic/star_control/base_stars.cpp +++ b/engines/titanic/star_control/base_stars.cpp @@ -21,7 +21,7 @@ */ #include "titanic/star_control/base_stars.h" -#include "titanic/star_control/star_control_sub12.h" +#include "titanic/star_control/star_camera.h" #include "titanic/star_control/star_ref.h" #include "titanic/titanic.h" @@ -123,16 +123,16 @@ void CBaseStars::resetEntry(CBaseStarEntry &entry) { entry._data[idx] = 0; } -void CBaseStars::draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) { +void CBaseStars::draw(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup) { if (!_data.empty()) { - switch (sub12->proc27()) { + switch (camera->proc27()) { case 0: switch (surfaceArea->_bpp) { case 1: - draw1(surfaceArea, sub12, closeup); + draw1(surfaceArea, camera, closeup); break; case 2: - draw2(surfaceArea, sub12, closeup); + draw2(surfaceArea, camera, closeup); break; default: break; @@ -142,10 +142,10 @@ void CBaseStars::draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStar case 2: switch (surfaceArea->_bpp) { case 1: - draw3(surfaceArea, sub12, closeup); + draw3(surfaceArea, camera, closeup); break; case 2: - draw4(surfaceArea, sub12, closeup); + draw4(surfaceArea, camera, closeup); break; default: break; @@ -158,13 +158,13 @@ void CBaseStars::draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStar } } -void CBaseStars::draw1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) { - FPose pose = sub12->proc23(); - sub12->proc36(&_value1, &_value2, &_value3, &_value4); +void CBaseStars::draw1(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup) { + FPose pose = camera->proc23(); + camera->proc36(&_value1, &_value2, &_value3, &_value4); const double MAX_VAL = 1.0e9 * 1.0e9; FPoint centroid = surfaceArea->_centroid - FPoint(0.5, 0.5); - double threshold = sub12->proc25(); + double threshold = camera->proc25(); double minVal = threshold - 9216.0; int width1 = surfaceArea->_width - 1; int height1 = surfaceArea->_height - 1; @@ -185,7 +185,7 @@ void CBaseStars::draw1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CSta if (total2 < 1.0e12) { closeup->draw(pose, vector, FVector(centroid._x, centroid._y, total2), - surfaceArea, sub12); + surfaceArea, camera); continue; } @@ -243,13 +243,13 @@ void CBaseStars::draw1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CSta } } -void CBaseStars::draw2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) { - FPose pose = sub12->proc23(); - sub12->proc36(&_value1, &_value2, &_value3, &_value4); +void CBaseStars::draw2(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup) { + FPose pose = camera->proc23(); + camera->proc36(&_value1, &_value2, &_value3, &_value4); const double MAX_VAL = 1.0e9 * 1.0e9; FPoint centroid = surfaceArea->_centroid - FPoint(0.5, 0.5); - double threshold = sub12->proc25(); + double threshold = camera->proc25(); double minVal = threshold - 9216.0; int width1 = surfaceArea->_width - 1; int height1 = surfaceArea->_height - 1; @@ -270,7 +270,7 @@ void CBaseStars::draw2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CSta if (total2 < 1.0e12) { closeup->draw(pose, vector, FVector(centroid._x, centroid._y, total2), - surfaceArea, sub12); + surfaceArea, camera); continue; } @@ -329,13 +329,13 @@ void CBaseStars::draw2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CSta } } -void CBaseStars::draw3(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) { - FPose pose = sub12->proc23(); - sub12->proc36(&_value1, &_value2, &_value3, &_value4); +void CBaseStars::draw3(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup) { + FPose pose = camera->proc23(); + camera->proc36(&_value1, &_value2, &_value3, &_value4); const double MAX_VAL = 1.0e9 * 1.0e9; FPoint centroid = surfaceArea->_centroid - FPoint(0.5, 0.5); - double threshold = sub12->proc25(); + double threshold = camera->proc25(); double minVal = threshold - 9216.0; int width1 = surfaceArea->_width - 1; int height1 = surfaceArea->_height - 1; @@ -359,7 +359,7 @@ void CBaseStars::draw3(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CSta if (total2 < 1.0e12) { closeup->draw(pose, vector, FVector(centroid._x, centroid._y, total2), - surfaceArea, sub12); + surfaceArea, camera); continue; } @@ -436,13 +436,13 @@ void CBaseStars::draw3(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CSta } } -void CBaseStars::draw4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) { - FPose pose = sub12->proc23(); - sub12->proc36(&_value1, &_value2, &_value3, &_value4); +void CBaseStars::draw4(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup) { + FPose pose = camera->proc23(); + camera->proc36(&_value1, &_value2, &_value3, &_value4); const double MAX_VAL = 1.0e9 * 1.0e9; FPoint centroid = surfaceArea->_centroid - FPoint(0.5, 0.5); - double threshold = sub12->proc25(); + double threshold = camera->proc25(); double minVal = threshold - 9216.0; int width1 = surfaceArea->_width - 1; int height1 = surfaceArea->_height - 1; @@ -466,7 +466,7 @@ void CBaseStars::draw4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CSta if (total2 < 1.0e12) { closeup->draw(pose, vector, FVector(centroid._x, centroid._y, total2), - surfaceArea, sub12); + surfaceArea, camera); continue; } @@ -543,16 +543,16 @@ void CBaseStars::draw4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CSta } } -int CBaseStars::baseFn1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, +int CBaseStars::baseFn1(CSurfaceArea *surfaceArea, CStarCamera *camera, const Common::Point &pt) { CStarRef1 ref(this, pt); - ref.process(surfaceArea, sub12); + ref.process(surfaceArea, camera); return ref._index; } -int CBaseStars::baseFn2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12) { +int CBaseStars::baseFn2(CSurfaceArea *surfaceArea, CStarCamera *camera) { CStarRef3 ref(this); - ref.process(surfaceArea, sub12); + ref.process(surfaceArea, camera); return ref._index; } diff --git a/engines/titanic/star_control/base_stars.h b/engines/titanic/star_control/base_stars.h index 0394bfe124..34bec4b6dc 100644 --- a/engines/titanic/star_control/base_stars.h +++ b/engines/titanic/star_control/base_stars.h @@ -20,8 +20,8 @@ * */ -#ifndef TITANIC_STAR_CONTROL_SUB3_H -#define TITANIC_STAR_CONTROL_SUB3_H +#ifndef TITANIC_BASE_STARS_H +#define TITANIC_BASE_STARS_H #include "titanic/support/simple_file.h" #include "titanic/star_control/frange.h" @@ -32,7 +32,7 @@ namespace Titanic { enum StarMode { MODE_STARFIELD = 0, MODE_PHOTO = 1 }; -class CStarControlSub12; +class CStarCamera; struct CBaseStarEntry { byte _red; @@ -68,10 +68,10 @@ struct CStarPosition : public Common::Point { */ class CBaseStars { private: - void draw1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup); - void draw2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup); - void draw3(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup); - void draw4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup); + void draw1(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup); + void draw2(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup); + void draw3(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup); + void draw4(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup); protected: FRange _minMax; double _minVal; @@ -103,14 +103,14 @@ public: /** * Draw the item */ - virtual void draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup); + virtual void draw(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup); virtual bool loadYale(int v1) { return true; } /** * Selects a star */ - virtual bool selectStar(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, + virtual bool selectStar(CSurfaceArea *surfaceArea, CStarCamera *camera, const Common::Point &pt, void *handler = nullptr) { return false; } /** @@ -144,18 +144,18 @@ public: */ const CBaseStarEntry *getDataPtr(int index) const; - int baseFn1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, + int baseFn1(CSurfaceArea *surfaceArea, CStarCamera *camera, const Common::Point &pt); - int baseFn2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12); + int baseFn2(CSurfaceArea *surfaceArea, CStarCamera *camera); }; class CStarVector { private: - CStarControlSub12 *_owner; + CStarCamera *_owner; FVector _vector; public: - CStarVector(CStarControlSub12 *owner, const FVector &v) : _owner(owner), _vector(v) {} + CStarVector(CStarCamera *owner, const FVector &v) : _owner(owner), _vector(v) {} /** * Applies the saved vector @@ -165,4 +165,4 @@ public: } // End of namespace Titanic -#endif /* TITANIC_STAR_CONTROL_SUB3_H */ +#endif /* TITANIC_BASE_STARS_H */ diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_camera.cpp index 8893902a53..2ccf2e3355 100644 --- a/engines/titanic/star_control/star_control_sub12.cpp +++ b/engines/titanic/star_control/star_camera.cpp @@ -20,7 +20,7 @@ * */ -#include "titanic/star_control/star_control_sub12.h" +#include "titanic/star_control/star_camera.h" #include "titanic/star_control/star_control_sub21.h" #include "titanic/star_control/star_control_sub22.h" #include "titanic/star_control/dmatrix.h" @@ -29,101 +29,101 @@ namespace Titanic { -FMatrix *CStarControlSub12::_matrix1; -FMatrix *CStarControlSub12::_matrix2; +FMatrix *CStarCamera::_matrix1; +FMatrix *CStarCamera::_matrix2; -CStarControlSub12::CStarControlSub12(const CStar20Data *data) : +CStarCamera::CStarCamera(const CStar20Data *data) : _matrixRow(-1), _handlerP(nullptr), _field108(0) { setupHandler(data); } -CStarControlSub12::CStarControlSub12(CStarControlSub13 *src) : +CStarCamera::CStarCamera(CStarControlSub13 *src) : _matrixRow(-1), _handlerP(nullptr), _field108(0), _sub13(src) { } -void CStarControlSub12::init() { +void CStarCamera::init() { _matrix1 = nullptr; _matrix2 = nullptr; } -void CStarControlSub12::deinit() { +void CStarCamera::deinit() { delete _matrix1; delete _matrix2; _matrix1 = nullptr; _matrix2 = nullptr; } -CStarControlSub12::~CStarControlSub12() { +CStarCamera::~CStarCamera() { deleteHandler(); } -void CStarControlSub12::proc2(const CStarControlSub13 *src) { +void CStarCamera::proc2(const CStarControlSub13 *src) { _sub13.copyFrom(src); } -void CStarControlSub12::proc3(const CStar20Data *src) { +void CStarCamera::proc3(const CStar20Data *src) { _handlerP->copyFrom(src); } -void CStarControlSub12::setPosition(const FVector &v) { +void CStarCamera::setPosition(const FVector &v) { if (!isLocked()) { _sub13.setPosition(v); set108(); } } -void CStarControlSub12::proc5(const FVector &v) { +void CStarCamera::proc5(const FVector &v) { if (!isLocked()) _sub13.fn11(v); } -void CStarControlSub12::proc6(int v) { +void CStarCamera::proc6(int v) { if (!isLocked()) _sub13.setC(v); } -void CStarControlSub12::proc7(int v) { +void CStarCamera::proc7(int v) { if (!isLocked()) _sub13.set10(v); } -void CStarControlSub12::proc8(int v) { +void CStarCamera::proc8(int v) { if (!isLocked()) _sub13.set14(v); } -void CStarControlSub12::proc9(int v) { +void CStarCamera::proc9(int v) { if (!isLocked()) _sub13.set18(v); } -void CStarControlSub12::proc10(int v) { +void CStarCamera::proc10(int v) { if (!isLocked()) _sub13.set1C(v); } -void CStarControlSub12::proc11() { +void CStarCamera::proc11() { if (!isLocked()) _sub13.fn12(); } -void CStarControlSub12::proc12(StarMode mode, double v2) { +void CStarCamera::proc12(StarMode mode, double v2) { if (!isLocked()) _sub13.fn13(mode, v2); } -void CStarControlSub12::proc13(CStarControlSub13 *dest) { +void CStarCamera::proc13(CStarControlSub13 *dest) { *dest = _sub13; } -void CStarControlSub12::proc14(FVector &v) { +void CStarCamera::proc14(FVector &v) { FMatrix matrix = _sub13.getMatrix(); FVector vector = _sub13._position; _handlerP->proc9(vector, v, matrix); } -void CStarControlSub12::proc15(CErrorCode *errorCode) { +void CStarCamera::proc15(CErrorCode *errorCode) { if (!_matrix1) _matrix1 = new FMatrix(); if (!_matrix2) @@ -146,60 +146,60 @@ void CStarControlSub12::proc15(CErrorCode *errorCode) { } } -void CStarControlSub12::proc16() { +void CStarCamera::proc16() { _handlerP->proc4(); } -void CStarControlSub12::proc17() { +void CStarCamera::proc17() { _handlerP->proc5(); } -void CStarControlSub12::proc18() { +void CStarCamera::proc18() { _handlerP->proc6(); } -void CStarControlSub12::proc19() { +void CStarCamera::proc19() { _handlerP->proc7(); } -void CStarControlSub12::proc20(double factor) { +void CStarCamera::proc20(double factor) { if (!isLocked()) _sub13.reposition(factor); } -void CStarControlSub12::proc21(const FPose &pose) { +void CStarCamera::proc21(const FPose &pose) { if (!isLocked()) { _sub13.setPosition(pose); set108(); } } -void CStarControlSub12::proc22(FMatrix &m) { +void CStarCamera::proc22(FMatrix &m) { if (!isLocked()) _sub13.fn15(m); } -FPose CStarControlSub12::proc23() { +FPose CStarCamera::proc23() { return _sub13.getSub1(); } -FPose CStarControlSub12::proc24() { +FPose CStarCamera::proc24() { return _sub13.getSub2(); } -double CStarControlSub12::proc25() const { +double CStarCamera::proc25() const { return _sub13._field10; } -double CStarControlSub12::proc26() const { +double CStarCamera::proc26() const { return _sub13._field14; } -int CStarControlSub12::proc27() const { +int CStarCamera::proc27() const { return _sub13._field24; } -FVector CStarControlSub12::proc28(int index, const FVector &src) { +FVector CStarCamera::proc28(int index, const FVector &src) { FVector dest; dest._x = ((_sub13._valArray[index] + src._x) * _sub13._centerVector._x) / (_sub13._centerVector._y * src._z); @@ -208,19 +208,19 @@ FVector CStarControlSub12::proc28(int index, const FVector &src) { return dest; } -FVector CStarControlSub12::proc29(int index, const FVector &src) { +FVector CStarCamera::proc29(int index, const FVector &src) { return _sub13.fn16(index, src); } -FVector CStarControlSub12::proc30(int index, const FVector &v) { +FVector CStarCamera::proc30(int index, const FVector &v) { return _sub13.fn17(index, v); } -FVector CStarControlSub12::proc31(int index, const FVector &v) { +FVector CStarCamera::proc31(int index, const FVector &v) { return _sub13.fn18(index, v); } -void CStarControlSub12::setViewportPosition(const FPoint &angles) { +void CStarCamera::setViewportPosition(const FPoint &angles) { debug(DEBUG_INTERMEDIATE, "setViewportPosition %f %f", angles._x, angles._y); if (isLocked()) @@ -391,7 +391,7 @@ void CStarControlSub12::setViewportPosition(const FPoint &angles) { } } -bool CStarControlSub12::addMatrixRow(const FVector &v) { +bool CStarCamera::addMatrixRow(const FVector &v) { if (_matrixRow >= 2) return false; @@ -405,7 +405,7 @@ bool CStarControlSub12::addMatrixRow(const FVector &v) { return true; } -bool CStarControlSub12::removeMatrixRow() { +bool CStarCamera::removeMatrixRow() { if (_matrixRow == -1) return false; @@ -418,19 +418,19 @@ bool CStarControlSub12::removeMatrixRow() { return true; } -void CStarControlSub12::proc36(double *v1, double *v2, double *v3, double *v4) { +void CStarCamera::proc36(double *v1, double *v2, double *v3, double *v4) { _sub13.fn19(v1, v2, v3, v4); } -void CStarControlSub12::load(SimpleFile *file, int param) { +void CStarCamera::load(SimpleFile *file, int param) { _sub13.load(file, param); } -void CStarControlSub12::save(SimpleFile *file, int indent) { +void CStarCamera::save(SimpleFile *file, int indent) { _sub13.save(file, indent); } -bool CStarControlSub12::setupHandler(const CStar20Data *src) { +bool CStarCamera::setupHandler(const CStar20Data *src) { CStarControlSub20 *handler = nullptr; switch (_matrixRow) { @@ -458,14 +458,14 @@ bool CStarControlSub12::setupHandler(const CStar20Data *src) { } } -void CStarControlSub12::deleteHandler() { +void CStarCamera::deleteHandler() { if (_handlerP) { delete _handlerP; _handlerP = nullptr; } } -void CStarControlSub12::fn1(CStarControlSub13 *sub13, const FVector &v) { +void CStarCamera::fn1(CStarControlSub13 *sub13, const FVector &v) { if (_matrixRow == 1) { FMatrix m1 = sub13->getMatrix(); FMatrix m2 = _sub13.getMatrix(); @@ -478,7 +478,7 @@ void CStarControlSub12::fn1(CStarControlSub13 *sub13, const FVector &v) { } } -void CStarControlSub12::fn2(FVector v1, FVector v2, FVector v3) { +void CStarCamera::fn2(FVector v1, FVector v2, FVector v3) { if (_matrixRow == -1) { FVector tempV; tempV._z = _sub13._field10; @@ -501,7 +501,7 @@ void CStarControlSub12::fn2(FVector v1, FVector v2, FVector v3) { } } -void CStarControlSub12::fn3(CStarControlSub13 *sub13, const FVector &v) { +void CStarCamera::fn3(CStarControlSub13 *sub13, const FVector &v) { if (_matrixRow != 0) return; diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_camera.h index 06edd962f4..ecc185c8f4 100644 --- a/engines/titanic/star_control/star_control_sub12.h +++ b/engines/titanic/star_control/star_camera.h @@ -20,8 +20,8 @@ * */ -#ifndef TITANIC_STAR_CONTROL_SUB12_H -#define TITANIC_STAR_CONTROL_SUB12_H +#ifndef TITANIC_STAR_CAMERA_H +#define TITANIC_STAR_CAMERA_H #include "titanic/support/simple_file.h" #include "titanic/star_control/fmatrix.h" @@ -33,7 +33,7 @@ namespace Titanic { -class CStarControlSub12 { +class CStarCamera { private: static FMatrix *_matrix1; static FMatrix *_matrix2; @@ -62,9 +62,9 @@ public: static void init(); static void deinit(); public: - CStarControlSub12(const CStar20Data *data); - CStarControlSub12(CStarControlSub13 *src); - virtual ~CStarControlSub12(); + CStarCamera(const CStar20Data *data); + CStarCamera(CStarControlSub13 *src); + virtual ~CStarCamera(); virtual void proc2(const CStarControlSub13 *src); virtual void proc3(const CStar20Data *src); @@ -129,4 +129,4 @@ public: } // End of namespace Titanic -#endif /* TITANIC_STAR_CONTROL_SUB12_H */ +#endif /* TITANIC_STAR_CAMERA_H */ diff --git a/engines/titanic/star_control/star_closeup.cpp b/engines/titanic/star_control/star_closeup.cpp index 9128c2d89e..c74a916e94 100644 --- a/engines/titanic/star_control/star_closeup.cpp +++ b/engines/titanic/star_control/star_closeup.cpp @@ -21,7 +21,7 @@ */ #include "titanic/star_control/star_closeup.h" -#include "titanic/star_control/star_control_sub12.h" +#include "titanic/star_control/star_camera.h" #include "titanic/titanic.h" namespace Titanic { @@ -190,10 +190,10 @@ bool CStarCloseup::setup2(int val1, int val2) { } void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector &vector2, - CSurfaceArea *surfaceArea, CStarControlSub12 *sub12) { + CSurfaceArea *surfaceArea, CStarCamera *camera) { const int VALUES[] = { 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4 }; - double val1 = sub12->proc25(); - int val2 = sub12->proc27(); + double val1 = camera->proc25(); + int val2 = camera->proc27(); if (!_flag) return; @@ -318,7 +318,7 @@ void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector for (int ctr2 = 0; ctr2 < size2; ++ctr2) { GridEntry &gridEntry = _grid[ctr2]; - tempV = sub12->proc28(2, gridEntry); + tempV = camera->proc28(2, gridEntry); gridEntry._position._x = tempV._x; gridEntry._position._y = tempV._y + vector2._y; } @@ -340,7 +340,7 @@ void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector for (int ctr2 = 0; ctr2 < size2; ++ctr2) { GridEntry &gridEntry = _grid[ctr2]; - tempV = sub12->proc28(0, gridEntry); + tempV = camera->proc28(0, gridEntry); gridEntry._position._x = tempV._x + vector2._x; gridEntry._position._y = tempV._y + vector2._y; } @@ -362,7 +362,7 @@ void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector for (int ctr2 = 0; ctr2 < size2; ++ctr2) { GridEntry &gridEntry = _grid[ctr2]; - tempV = sub12->proc28(1, gridEntry); + tempV = camera->proc28(1, gridEntry); gridEntry._position._x = tempV._x + vector2._x; gridEntry._position._y = tempV._y + vector2._y; } @@ -432,7 +432,7 @@ void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector for (uint ctr = 0; ctr < entry._data2.size(); ++ctr) { GridEntry &gridEntry = _grid[ctr]; - tempV = sub12->proc28(2, gridEntry); + tempV = camera->proc28(2, gridEntry); gridEntry._position._x = tempV._x + vector2._x; gridEntry._position._y = tempV._y + vector2._y; } @@ -454,7 +454,7 @@ void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector for (uint ctr = 0; ctr < entry._data2.size(); ++ctr) { GridEntry &gridEntry = _grid[ctr]; - tempV = sub12->proc28(2, gridEntry); + tempV = camera->proc28(2, gridEntry); gridEntry._position._x = tempV._x + vector2._x; gridEntry._position._y = tempV._y + vector2._y; } @@ -476,7 +476,7 @@ void CStarCloseup::draw(const FPose &pose, const FVector &vector, const FVector for (uint ctr = 0; ctr < entry._data2.size(); ++ctr) { GridEntry &gridEntry = _grid[ctr]; - tempV = sub12->proc28(2, gridEntry); + tempV = camera->proc28(2, gridEntry); gridEntry._position._x = tempV._x + vector2._x; gridEntry._position._y = tempV._y + vector2._y; } diff --git a/engines/titanic/star_control/star_closeup.h b/engines/titanic/star_control/star_closeup.h index 3f4541f66d..d07b17bd2f 100644 --- a/engines/titanic/star_control/star_closeup.h +++ b/engines/titanic/star_control/star_closeup.h @@ -31,7 +31,7 @@ namespace Titanic { -class CStarControlSub12; +class CStarCamera; /** * Handles drawing a 3D rendered closeup of a star @@ -124,7 +124,7 @@ public: * Draws the star globe */ virtual void draw(const FPose &pose, const FVector &vector, const FVector &vector2, - CSurfaceArea *surfaceArea, CStarControlSub12 *sub12); + CSurfaceArea *surfaceArea, CStarCamera *camera); virtual void proc3(CErrorCode *errorCode); diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp index fd007d33b6..045dc0369e 100644 --- a/engines/titanic/star_control/star_control.cpp +++ b/engines/titanic/star_control/star_control.cpp @@ -26,7 +26,7 @@ #include "titanic/star_control/dmatrix.h" #include "titanic/star_control/error_code.h" #include "titanic/star_control/fpose.h" -#include "titanic/star_control/star_control_sub12.h" +#include "titanic/star_control/star_camera.h" #include "titanic/game_manager.h" #include "titanic/core/dont_save_file_item.h" #include "titanic/core/project_item.h" @@ -43,12 +43,12 @@ END_MESSAGE_MAP() CStarControl::CStarControl() : _enabled(false), _petControl(nullptr), _starRect(20, 10, 620, 350) { - CStarControlSub12::init(); + CStarCamera::init(); DMatrix::init(); } CStarControl::~CStarControl() { - CStarControlSub12::deinit(); + CStarCamera::deinit(); DMatrix::deinit(); } diff --git a/engines/titanic/star_control/star_control_sub2.cpp b/engines/titanic/star_control/star_control_sub2.cpp index ebeb9bf239..221efa9772 100644 --- a/engines/titanic/star_control/star_control_sub2.cpp +++ b/engines/titanic/star_control/star_control_sub2.cpp @@ -21,7 +21,7 @@ */ #include "titanic/star_control/star_control_sub2.h" -#include "titanic/star_control/star_control_sub12.h" +#include "titanic/star_control/star_camera.h" namespace Titanic { @@ -37,12 +37,12 @@ bool CStarControlSub2::loadYale(int v1) { } bool CStarControlSub2::selectStar(CSurfaceArea *surfaceArea, - CStarControlSub12 *sub12, const Common::Point &pt, void *handler) { - int index = baseFn1(surfaceArea, sub12, pt); + CStarCamera *camera, const Common::Point &pt, void *handler) { + int index = baseFn1(surfaceArea, camera, pt); if (index == -1) { return false; } else if (!handler) { - sub12->proc14(_data[index]._position); + camera->proc14(_data[index]._position); return true; } else { error("no handler ever passed in original"); diff --git a/engines/titanic/star_control/star_control_sub2.h b/engines/titanic/star_control/star_control_sub2.h index 39f1de6fa5..cd82b025cb 100644 --- a/engines/titanic/star_control/star_control_sub2.h +++ b/engines/titanic/star_control/star_control_sub2.h @@ -36,7 +36,7 @@ public: /** * Selects a star */ - virtual bool selectStar(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, + virtual bool selectStar(CSurfaceArea *surfaceArea, CStarCamera *camera, const Common::Point &pt, void *handler = nullptr); virtual bool loadStar(); diff --git a/engines/titanic/star_control/star_control_sub7.cpp b/engines/titanic/star_control/star_control_sub7.cpp index 257c2034dc..8671586b0f 100644 --- a/engines/titanic/star_control/star_control_sub7.cpp +++ b/engines/titanic/star_control/star_control_sub7.cpp @@ -21,16 +21,16 @@ */ #include "titanic/star_control/star_control_sub7.h" -#include "titanic/star_control/star_control_sub12.h" +#include "titanic/star_control/star_camera.h" namespace Titanic { -void CStarControlSub7::draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup) { +void CStarControlSub7::draw(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup) { if (_data.empty()) return; - FPose pose = sub12->proc23(); - double threshold = sub12->proc25(); + FPose pose = camera->proc23(); + double threshold = camera->proc25(); FPoint center((double)surfaceArea->_width * 0.5, surfaceArea->_height * 0.5); FVector newV; @@ -50,7 +50,7 @@ void CStarControlSub7::draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, + pose._row2._z * star._position._y + pose._vector._z; if (newV._z > threshold) { - FVector vTemp = sub12->proc28(2, newV); + FVector vTemp = camera->proc28(2, newV); FRect r1(center._x + vTemp._x, center._y + vTemp._y, center._x + vTemp._x + 4.0, center._y + vTemp._y + 4.0); diff --git a/engines/titanic/star_control/star_control_sub7.h b/engines/titanic/star_control/star_control_sub7.h index be5a51f31b..e751ae0d59 100644 --- a/engines/titanic/star_control/star_control_sub7.h +++ b/engines/titanic/star_control/star_control_sub7.h @@ -33,7 +33,7 @@ public: /** * Draw the item */ - virtual void draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarCloseup *closeup); + virtual void draw(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup); /** * Adds a new star, or removes one if already present at the given co-ordinates diff --git a/engines/titanic/star_control/star_control_sub8.cpp b/engines/titanic/star_control/star_control_sub8.cpp index cba4fe01b7..23a65e8702 100644 --- a/engines/titanic/star_control/star_control_sub8.cpp +++ b/engines/titanic/star_control/star_control_sub8.cpp @@ -22,7 +22,7 @@ #include "titanic/star_control/star_control_sub8.h" #include "titanic/star_control/star_control_sub7.h" -#include "titanic/star_control/star_control_sub12.h" +#include "titanic/star_control/star_camera.h" #include "titanic/star_control/star_field.h" #include "titanic/star_control/star_ref.h" @@ -93,13 +93,13 @@ void CStarControlSub8::selectStar(int index, CVideoSurface *surface, } } -bool CStarControlSub8::fn1(CStarField *starField, CSurfaceArea *surfaceArea, CStarControlSub12 *sub12) { - int count = starField->baseFn2(surfaceArea, sub12); +bool CStarControlSub8::fn1(CStarField *starField, CSurfaceArea *surfaceArea, CStarCamera *camera) { + int count = starField->baseFn2(surfaceArea, camera); if (count > 0) { allocate(count); CStarRef2 starRef(starField, &_positions); - starRef.process(surfaceArea, sub12); + starRef.process(surfaceArea, camera); return true; } else { clear(); diff --git a/engines/titanic/star_control/star_control_sub8.h b/engines/titanic/star_control/star_control_sub8.h index 992420fbf5..7c965826b5 100644 --- a/engines/titanic/star_control/star_control_sub8.h +++ b/engines/titanic/star_control/star_control_sub8.h @@ -35,7 +35,7 @@ namespace Titanic { class CStarField; class CStarControlSub7; -class CStarControlSub12; +class CStarCamera; class CStarControlSub8 { private: @@ -74,7 +74,7 @@ public: void draw(CSurfaceArea *surfaceArea); - bool fn1(CStarField *starField, CSurfaceArea *surfaceArea, CStarControlSub12 *sub12); + bool fn1(CStarField *starField, CSurfaceArea *surfaceArea, CStarCamera *camera); void fn2(CVideoSurface *surface, CStarField *starField, CStarControlSub7 *sub7); void fn3(); void fn4(int index, CSurfaceArea *surfaceArea); diff --git a/engines/titanic/star_control/star_field.cpp b/engines/titanic/star_control/star_field.cpp index 3890b04eb4..52629ebe7a 100644 --- a/engines/titanic/star_control/star_field.cpp +++ b/engines/titanic/star_control/star_field.cpp @@ -22,7 +22,7 @@ #include "titanic/star_control/star_field.h" #include "titanic/star_control/surface_area.h" -#include "titanic/star_control/star_control_sub12.h" +#include "titanic/star_control/star_camera.h" #include "titanic/titanic.h" namespace Titanic { @@ -63,21 +63,21 @@ bool CStarField::initDocument() { return valid; } -void CStarField::render(CVideoSurface *surface, CStarControlSub12 *sub12) { +void CStarField::render(CVideoSurface *surface, CStarCamera *camera) { CSurfaceArea surfaceArea(surface); - draw(&surfaceArea, sub12, &_starCloseup); + draw(&surfaceArea, camera, &_starCloseup); if (_showCrosshairs) drawCrosshairs(&surfaceArea); - _sub7.draw(&surfaceArea, sub12, nullptr); + _sub7.draw(&surfaceArea, camera, nullptr); _sub8.draw(&surfaceArea); if (_points2On) - _points2.draw(&surfaceArea, sub12); + _points2.draw(&surfaceArea, camera); if (_points1On) - _points1.draw(&surfaceArea, sub12); + _points1.draw(&surfaceArea, camera); - fn4(&surfaceArea, sub12); + fn4(&surfaceArea, camera); } int CStarField::get1() const { @@ -168,12 +168,12 @@ void CStarField::drawCrosshairs(CSurfaceArea *surfaceArea) { surfaceArea->setColorFromPixel(); } -void CStarField::fn4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12) { +void CStarField::fn4(CSurfaceArea *surfaceArea, CStarCamera *camera) { FVector v1, v2, v3; _val5 = 0; if (_mode == MODE_STARFIELD) { - if (fn5(surfaceArea, sub12, v1, v2, v3) > -1.0) { + if (fn5(surfaceArea, camera, v1, v2, v3) > -1.0) { surfaceArea->_pixel = 0xA0A0; surfaceArea->setColorFromPixel(); surfaceArea->fillRect(FRect(v1._x, v1._y, v3._x, v3._y)); @@ -181,19 +181,19 @@ void CStarField::fn4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12) { } } -double CStarField::fn5(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, +double CStarField::fn5(CSurfaceArea *surfaceArea, CStarCamera *camera, FVector &v1, FVector &v2, FVector &v3) { if (_sub8._fieldC < 0) return -1.0; const CBaseStarEntry *dataP = _sub7.getDataPtr(_sub8._fieldC); v2 = dataP->_position; - FVector tv = sub12->proc29(2, v2); + FVector tv = camera->proc29(2, v2); - if (sub12->proc25() >= tv._z) + if (camera->proc25() >= tv._z) return -1.0; - tv = sub12->proc28(2, tv); + tv = camera->proc28(2, tv); v1 = FVector(tv._x + surfaceArea->_centroid._x, tv._y + surfaceArea->_centroid._y, tv._z); @@ -210,9 +210,9 @@ double CStarField::fn5(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, return v1._y - pt._y; } -void CStarField::fn6(CVideoSurface *surface, CStarControlSub12 *sub12) { +void CStarField::fn6(CVideoSurface *surface, CStarCamera *camera) { CSurfaceArea surfaceArea(surface); - _sub8.fn1(this, &surfaceArea, sub12); + _sub8.fn1(this, &surfaceArea, camera); } void CStarField::fn7() { @@ -225,11 +225,11 @@ void CStarField::fn8(CVideoSurface *surface) { setSolved(); } -bool CStarField::mouseButtonDown(CVideoSurface *surface, CStarControlSub12 *sub12, +bool CStarField::mouseButtonDown(CVideoSurface *surface, CStarCamera *camera, int flags, const Common::Point &pt) { if (_mode == MODE_STARFIELD) { CSurfaceArea surfaceArea(surface); - return selectStar(&surfaceArea, sub12, pt); + return selectStar(&surfaceArea, camera, pt); } else { int starNum = _sub8.indexOf(pt); if (starNum >= 0) { diff --git a/engines/titanic/star_control/star_field.h b/engines/titanic/star_control/star_field.h index 82acbed57d..0d80e27d9d 100644 --- a/engines/titanic/star_control/star_field.h +++ b/engines/titanic/star_control/star_field.h @@ -51,7 +51,7 @@ private: */ void drawCrosshairs(CSurfaceArea *surfaceArea); - void fn4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12); + void fn4(CSurfaceArea *surfaceArea, CStarCamera *camera); public: CStarField(); @@ -70,7 +70,7 @@ public: /** * Renders the contents of the starfield */ - void render(CVideoSurface *surface, CStarControlSub12 *sub12); + void render(CVideoSurface *surface, CStarCamera *camera); int get1() const; void set1(int val); @@ -117,9 +117,9 @@ public: } void fn1(CErrorCode *errorCode); - double fn5(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, + double fn5(CSurfaceArea *surfaceArea, CStarCamera *camera, FVector &v1, FVector &v2, FVector &v3); - void fn6(CVideoSurface *surface, CStarControlSub12 *sub12); + void fn6(CVideoSurface *surface, CStarCamera *camera); void fn7(); void fn8(CVideoSurface *surface); void fn9() { _starCloseup.fn1(); } @@ -127,7 +127,7 @@ public: /** * Called when the starfield is clicked */ - bool mouseButtonDown(CVideoSurface *surface, CStarControlSub12 *sub12, + bool mouseButtonDown(CVideoSurface *surface, CStarCamera *camera, int flags, const Common::Point &pt); /** diff --git a/engines/titanic/star_control/star_points1.cpp b/engines/titanic/star_control/star_points1.cpp index cf5c98ebf4..7e3a79b6d9 100644 --- a/engines/titanic/star_control/star_points1.cpp +++ b/engines/titanic/star_control/star_points1.cpp @@ -21,7 +21,7 @@ */ #include "titanic/star_control/star_points1.h" -#include "titanic/star_control/star_control_sub12.h" +#include "titanic/star_control/star_camera.h" #include "titanic/titanic.h" namespace Titanic { @@ -57,12 +57,12 @@ bool CStarPoints1::initialize() { return true; } -void CStarPoints1::draw(CSurfaceArea *surface, CStarControlSub12 *sub12) { +void CStarPoints1::draw(CSurfaceArea *surface, CStarCamera *camera) { if (_data.empty()) return; - FPose pose = sub12->proc23(); - double threshold = sub12->proc25(); + FPose pose = camera->proc23(); + double threshold = camera->proc25(); FVector vector1, vector2, vector3, vector4; FVector vTemp = _data[0]; double vWidth2 = (double)surface->_width * 0.5; @@ -88,8 +88,8 @@ void CStarPoints1::draw(CSurfaceArea *surface, CStarControlSub12 *sub12) { vector3._z = vTemp._x * pose._row1._z + vTemp._y * pose._row2._z + vTemp._z * pose._row3._z + pose._vector._z; if (flag && vector1._z > threshold && vector3._z > threshold) { - vector2 = sub12->proc28(2, vector1); - vector4 = sub12->proc28(2, vector3); + vector2 = camera->proc28(2, vector1); + vector4 = camera->proc28(2, vector3); r.bottom = vector4._y + vHeight2; r.right = vector4._x + vWidth2; diff --git a/engines/titanic/star_control/star_points1.h b/engines/titanic/star_control/star_points1.h index 780cc50111..aeab68f72f 100644 --- a/engines/titanic/star_control/star_points1.h +++ b/engines/titanic/star_control/star_points1.h @@ -29,7 +29,7 @@ namespace Titanic { -class CStarControlSub12; +class CStarCamera; class CStarPoints1 { struct CStarPointEntry : public FVector { @@ -49,7 +49,7 @@ public: /** * Draw the starfield points */ - void draw(CSurfaceArea *surface, CStarControlSub12 *sub12); + void draw(CSurfaceArea *surface, CStarCamera *camera); }; } // End of namespace Titanic diff --git a/engines/titanic/star_control/star_points2.cpp b/engines/titanic/star_control/star_points2.cpp index 7dec3f8605..9adbd1c8b7 100644 --- a/engines/titanic/star_control/star_points2.cpp +++ b/engines/titanic/star_control/star_points2.cpp @@ -21,7 +21,7 @@ */ #include "titanic/star_control/star_points2.h" -#include "titanic/star_control/star_control_sub12.h" +#include "titanic/star_control/star_camera.h" #include "titanic/titanic.h" namespace Titanic { @@ -62,12 +62,12 @@ bool CStarPoints2::initialize() { return true; } -void CStarPoints2::draw(CSurfaceArea *surface, CStarControlSub12 *sub12) { +void CStarPoints2::draw(CSurfaceArea *surface, CStarCamera *camera) { if (_data.empty()) return; - FPose pose = sub12->proc23(); - double threshold = sub12->proc25(); + FPose pose = camera->proc23(); + double threshold = camera->proc25(); FVector vector1, vector2, vector3, vector4; double vWidth2 = (double)surface->_width * 0.5; double vHeight2 = (double)surface->_height * 0.5; @@ -99,8 +99,8 @@ void CStarPoints2::draw(CSurfaceArea *surface, CStarControlSub12 *sub12) { + pose._row1._y * se._v2._x + pose._vector._y; if (vector1._z > threshold && vector3._z > threshold) { - vector2 = sub12->proc28(2, vector1); - vector4 = sub12->proc28(2, vector3); + vector2 = camera->proc28(2, vector1); + vector4 = camera->proc28(2, vector3); r.bottom = vector4._y + vHeight2; r.right = vector4._x + vWidth2; diff --git a/engines/titanic/star_control/star_points2.h b/engines/titanic/star_control/star_points2.h index c80de886fe..b8077120d9 100644 --- a/engines/titanic/star_control/star_points2.h +++ b/engines/titanic/star_control/star_points2.h @@ -29,7 +29,7 @@ namespace Titanic { -class CStarControlSub12; +class CStarCamera; class CStarPoints2 { struct CStarPointEntry { @@ -51,7 +51,7 @@ public: /** * Draw the starfield points */ - void draw(CSurfaceArea *surface, CStarControlSub12 *sub12); + void draw(CSurfaceArea *surface, CStarCamera *camera); }; } // End of namespace Titanic diff --git a/engines/titanic/star_control/star_ref.cpp b/engines/titanic/star_control/star_ref.cpp index fe3f2339f0..bdafd4057c 100644 --- a/engines/titanic/star_control/star_ref.cpp +++ b/engines/titanic/star_control/star_ref.cpp @@ -24,13 +24,13 @@ namespace Titanic { -void CBaseStarRef::process(CSurfaceArea *surface, CStarControlSub12 *sub12) { +void CBaseStarRef::process(CSurfaceArea *surface, CStarCamera *camera) { if (_stars->_data.empty()) return; const double MAX_VAL = 1.0e9 * 1.0e9; - FPose pose = sub12->proc23(); - double threshold = sub12->proc25(); + FPose pose = camera->proc23(); + double threshold = camera->proc25(); double vWidth2 = (double)surface->_width * 0.5; double vHeight2 = (double)surface->_height * 0.5; FVector vTemp, vector1, vector2; @@ -45,7 +45,7 @@ void CBaseStarRef::process(CSurfaceArea *surface, CStarControlSub12 *sub12) { double hyp = vector1._x * vector1._x + vector1._y * vector1._y + vector1._z * vector1._z; if (vector1._z > threshold && hyp >= 1.0e12 && hyp < MAX_VAL) { - vector2 = sub12->proc28(2, vector1); + vector2 = camera->proc28(2, vector1); const Common::Point pt((int)(vector2._x + vWidth2 - -0.5), (int)(vector2._y + vHeight2 - -0.5)); diff --git a/engines/titanic/star_control/star_ref.h b/engines/titanic/star_control/star_ref.h index 1ed22139c4..cb94555dcd 100644 --- a/engines/titanic/star_control/star_ref.h +++ b/engines/titanic/star_control/star_ref.h @@ -22,7 +22,7 @@ #include "common/rect.h" #include "titanic/star_control/base_stars.h" -#include "titanic/star_control/star_control_sub12.h" +#include "titanic/star_control/star_camera.h" #include "titanic/star_control/surface_area.h" #ifndef TITANIC_STAR_REF_H @@ -38,7 +38,7 @@ public: CBaseStarRef() : _stars(nullptr) {} virtual ~CBaseStarRef() {} - void process(CSurfaceArea *surface, CStarControlSub12 *sub12); + void process(CSurfaceArea *surface, CStarCamera *camera); virtual bool check(const Common::Point &pt, int index) { return false; } }; diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp index 6cd539144c..9f869c8dbe 100644 --- a/engines/titanic/star_control/star_view.cpp +++ b/engines/titanic/star_control/star_view.cpp @@ -30,18 +30,18 @@ namespace Titanic { -CStarView::CStarView() : _sub12((const CStar20Data *)nullptr), _owner(nullptr), +CStarView::CStarView() : _camera((const CStar20Data *)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 }; - _sub12.proc3(&data); + _camera.proc3(&data); } void CStarView::load(SimpleFile *file, int param) { if (!param) { - _sub12.load(file, param); + _camera.load(file, param); _hasReference = file->readNumber(); if (_hasReference) @@ -53,7 +53,7 @@ void CStarView::load(SimpleFile *file, int param) { } void CStarView::save(SimpleFile *file, int indent) { - _sub12.save(file, indent); + _camera.save(file, indent); file->writeNumberLine(_hasReference, indent); if (_hasReference) @@ -70,8 +70,8 @@ void CStarView::setup(CScreenManager *screenManager, CStarField *starField, CSta void CStarView::reset() { if (_hasReference) { - CStarControlSub12 sub12(&_sub13); - fn18(&sub12); + CStarCamera camera(&_sub13); + fn18(&camera); } } @@ -101,7 +101,7 @@ void CStarView::draw(CScreenManager *screenManager) { // Render the display _videoSurface->clear(); _videoSurface->lock(); - _starField->render(_videoSurface, &_sub12); + _starField->render(_videoSurface, &_camera); _videoSurface->unlock(); // Blit the resulting surface to the screen @@ -114,7 +114,7 @@ bool CStarView::MouseButtonDownMsg(int flags, const Point &pt) { if (_starField) { return _starField->mouseButtonDown( _showingPhoto ? _videoSurface2 : _videoSurface, - &_sub12, flags, pt); + &_camera, flags, pt); } return false; @@ -135,7 +135,7 @@ bool CStarView::MouseMoveMsg(int unused, const Point &pt) { FPoint angle(tempPt._x * -2.0 * distance / threshold, tempPt._y * -2.0 * distance / threshold); - _sub12.setViewportPosition(angle); + _camera.setViewportPosition(angle); return true; } } @@ -178,15 +178,15 @@ bool CStarView::KeyCharMsg(int key, CErrorCode *errorCode) { case Common::KEYCODE_c: if (v == -1) { pose.setRotationMatrix(key == Common::KEYCODE_z ? Y_AXIS : X_AXIS, 1.0); - _sub12.proc22(pose); - _sub12.proc15(errorCode); + _camera.proc22(pose); + _camera.proc15(errorCode); return true; } break; case Common::KEYCODE_SEMICOLON: if (v == -1) { - _sub12.proc16(); + _camera.proc16(); errorCode->set(); return true; } @@ -194,7 +194,7 @@ bool CStarView::KeyCharMsg(int key, CErrorCode *errorCode) { case Common::KEYCODE_PERIOD: if (v == -1) { - _sub12.proc17(); + _camera.proc17(); errorCode->set(); return true; } @@ -202,7 +202,7 @@ bool CStarView::KeyCharMsg(int key, CErrorCode *errorCode) { case Common::KEYCODE_SPACE: if (v == -1) { - _sub12.proc19(); + _camera.proc19(); errorCode->set(); return true; } @@ -211,8 +211,8 @@ bool CStarView::KeyCharMsg(int key, CErrorCode *errorCode) { case Common::KEYCODE_x: if (v == -1) { pose.setRotationMatrix(Y_AXIS, -1.0); - _sub12.proc22(pose); - _sub12.proc15(errorCode); + _camera.proc22(pose); + _camera.proc15(errorCode); return true; } break; @@ -220,8 +220,8 @@ bool CStarView::KeyCharMsg(int key, CErrorCode *errorCode) { case Common::KEYCODE_QUOTE: if (v == -1) { pose.setRotationMatrix(X_AXIS, -1.0); - _sub12.proc22(pose); - _sub12.proc15(errorCode); + _camera.proc22(pose); + _camera.proc15(errorCode); return true; } break; @@ -234,21 +234,21 @@ bool CStarView::KeyCharMsg(int key, CErrorCode *errorCode) { } bool CStarView::canSetStarDestination() const { - return _sub12.is108(); + return _camera.is108(); } void CStarView::starDestinationSet() { - _sub12.reset108(); + _camera.reset108(); } void CStarView::resetPosition() { - _sub12.setPosition(FVector(0.0, 0.0, 0.0)); + _camera.setPosition(FVector(0.0, 0.0, 0.0)); } bool CStarView::fn1() { if (_videoSurface) { CErrorCode errorCode; - _sub12.proc15(&errorCode); + _camera.proc15(&errorCode); if (_fader._index < 0 || _fader._index >= _fader._count) _starField->fn1(&errorCode); @@ -283,8 +283,8 @@ void CStarView::fn3(bool fadeIn) { void CStarView::fn4() { FVector v1, v2; randomizeVectors1(v1, v2); - _sub12.setPosition(v1); - _sub12.proc5(v2); + _camera.setPosition(v1); + _camera.proc5(v2); } void CStarView::fn5() { @@ -301,8 +301,8 @@ void CStarView::fn7() { FVector v1, v2; randomizeVectors1(v1, v2); v2 += star->_position; - _sub12.setPosition(v2); - _sub12.proc5(v1); + _camera.setPosition(v2); + _camera.proc5(v1); } } @@ -312,23 +312,23 @@ void CStarView::fn19(int index) { FVector v1, v2; randomizeVectors1(v1, v2); v1 += star->_position; - _sub12.setPosition(v1); - _sub12.proc5(v2); + _camera.setPosition(v1); + _camera.proc5(v2); } } void CStarView::fn8() { - _sub12.proc18(); + _camera.proc18(); } void CStarView::fn9() { _field218 = !_field218; if (_field218) { - _sub12.proc12(MODE_PHOTO, 30.0); - _sub12.proc12(MODE_STARFIELD, 28000.0); + _camera.proc12(MODE_PHOTO, 30.0); + _camera.proc12(MODE_STARFIELD, 28000.0); } else { - _sub12.proc12(MODE_PHOTO, 0.0); - _sub12.proc12(MODE_STARFIELD, 0.0); + _camera.proc12(MODE_PHOTO, 0.0); + _camera.proc12(MODE_STARFIELD, 0.0); } } @@ -350,14 +350,14 @@ void CStarView::toggleCrosshairs() { void CStarView::fn13() { _field218 = true; - _sub12.proc12(MODE_PHOTO, 30.0); - _sub12.proc12(MODE_STARFIELD, 28000.0); + _camera.proc12(MODE_PHOTO, 30.0); + _camera.proc12(MODE_STARFIELD, 28000.0); } void CStarView::fn14() { _field218 = false; - _sub12.proc12(MODE_PHOTO, 0.0); - _sub12.proc12(MODE_STARFIELD, 0.0); + _camera.proc12(MODE_PHOTO, 0.0); + _camera.proc12(MODE_STARFIELD, 0.0); } void CStarView::setHasReference() { @@ -378,7 +378,7 @@ void CStarView::fn16() { if (_starField && !_showingPhoto) { CSurfaceArea surfaceArea(_videoSurface); FVector v1, v2, v3; - double val = _starField->fn5(&surfaceArea, &_sub12, v1, v2, v3); + double val = _starField->fn5(&surfaceArea, &_camera, v1, v2, v3); if (val > -1.0) { v1 += surfaceArea._centroid; @@ -386,17 +386,17 @@ void CStarView::fn16() { switch (_starField->get88()) { case -1: - _sub12.fn2(v1, v2, v3); + _camera.fn2(v1, v2, v3); _starField->fn7(); break; case 0: - _sub12.fn3(&_sub13, v2); + _camera.fn3(&_sub13, v2); _starField->fn7(); break; case 1: - _sub12.fn1(&_sub13, v2); + _camera.fn1(&_sub13, v2); _starField->fn7(); break; @@ -409,12 +409,12 @@ void CStarView::fn16() { void CStarView::fn17() { if (_starField && !_showingPhoto) { - _sub12.removeMatrixRow(); + _camera.removeMatrixRow(); _starField->fn8(_videoSurface2); } } -void CStarView::fn18(CStarControlSub12 *sub12) { +void CStarView::fn18(CStarCamera *camera) { if (_starField) { if (!_videoSurface2) { CScreenManager *scrManager = CScreenManager::setCurrent(); @@ -428,11 +428,11 @@ void CStarView::fn18(CStarControlSub12 *sub12) { _videoSurface2->clear(); _videoSurface2->lock(); - _starField->render(_videoSurface2, sub12); + _starField->render(_videoSurface2, camera); _starField->setCrosshairs(oldCrosshairs); _starField->set54(oldVal); - _starField->fn6(_videoSurface2, sub12); + _starField->fn6(_videoSurface2, camera); _videoSurface2->unlock(); } } diff --git a/engines/titanic/star_control/star_view.h b/engines/titanic/star_control/star_view.h index f52dffea78..b1acad371a 100644 --- a/engines/titanic/star_control/star_view.h +++ b/engines/titanic/star_control/star_view.h @@ -25,7 +25,7 @@ #include "titanic/support/simple_file.h" #include "titanic/support/video_surface.h" -#include "titanic/star_control/star_control_sub12.h" +#include "titanic/star_control/star_camera.h" #include "titanic/star_control/star_control_sub13.h" #include "titanic/star_control/surface_fader.h" #include "titanic/star_control/error_code.h" @@ -41,7 +41,7 @@ private: CStarControl *_owner; CStarField *_starField; CVideoSurface *_videoSurface; - CStarControlSub12 _sub12; + CStarCamera _camera; bool _hasReference; CStarControlSub13 _sub13; CSurfaceFader _fader; @@ -51,7 +51,7 @@ private: bool _showingPhoto; private: bool fn1(); - void fn18(CStarControlSub12 *sub12); + void fn18(CStarCamera *camera); void fn19(int v); void randomizeVectors1(FVector &v1, FVector &v2); |