diff options
Diffstat (limited to 'engines/titanic/star_control/star_view.cpp')
-rw-r--r-- | engines/titanic/star_control/star_view.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
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(); } } |