diff options
author | Paul Gilbert | 2017-05-28 15:53:52 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-05-28 15:53:52 -0400 |
commit | 38beceef7d0a9393f1dab47df42e43d8191a4d09 (patch) | |
tree | 1a43e5e218235d70444335ee0bb1b36546e9a968 /engines/titanic/star_control | |
parent | 0be151d5072615a438af9cce0288fb086c143410 (diff) | |
download | scummvm-rg350-38beceef7d0a9393f1dab47df42e43d8191a4d09.tar.gz scummvm-rg350-38beceef7d0a9393f1dab47df42e43d8191a4d09.tar.bz2 scummvm-rg350-38beceef7d0a9393f1dab47df42e43d8191a4d09.zip |
TITANIC: Renamings of orientation related variables and methods
Diffstat (limited to 'engines/titanic/star_control')
-rw-r--r-- | engines/titanic/star_control/fmatrix.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/star_control/fmatrix.h | 6 | ||||
-rw-r--r-- | engines/titanic/star_control/star_camera.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/star_camera.h | 6 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub2.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub24.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/star_view.cpp | 56 | ||||
-rw-r--r-- | engines/titanic/star_control/star_view.h | 13 | ||||
-rw-r--r-- | engines/titanic/star_control/viewport.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/viewport.h | 8 |
10 files changed, 62 insertions, 43 deletions
diff --git a/engines/titanic/star_control/fmatrix.cpp b/engines/titanic/star_control/fmatrix.cpp index 11d96536f3..ca351972e8 100644 --- a/engines/titanic/star_control/fmatrix.cpp +++ b/engines/titanic/star_control/fmatrix.cpp @@ -93,7 +93,7 @@ void FMatrix::set(const DVector &row1, const DVector &row2, const DVector &row3) _row3 = row3; } -void FMatrix::fn1(const FVector &v) { +void FMatrix::set(const FVector &v) { _row3 = v; _row2 = _row3.fn1(); diff --git a/engines/titanic/star_control/fmatrix.h b/engines/titanic/star_control/fmatrix.h index 0cbecb2ff8..34f39cf568 100644 --- a/engines/titanic/star_control/fmatrix.h +++ b/engines/titanic/star_control/fmatrix.h @@ -80,7 +80,11 @@ public: */ void set(const DVector &row1, const DVector &row2, const DVector &row3); - void fn1(const FVector &v); + /** + * Sets the data for the matrix from a vector + */ + void set(const FVector &v); + void fn2(const FMatrix &m); void fn3(const FMatrix &m); diff --git a/engines/titanic/star_control/star_camera.cpp b/engines/titanic/star_control/star_camera.cpp index d47111804a..1fac6efe29 100644 --- a/engines/titanic/star_control/star_camera.cpp +++ b/engines/titanic/star_control/star_camera.cpp @@ -72,9 +72,9 @@ void CStarCamera::setPosition(const FVector &v) { } } -void CStarCamera::proc5(const FVector &v) { +void CStarCamera::setOrientation(const FVector &v) { if (!isLocked()) - _viewport.fn11(v); + _viewport.setOrientation(v); } void CStarCamera::proc6(int v) { diff --git a/engines/titanic/star_control/star_camera.h b/engines/titanic/star_control/star_camera.h index 52baa62b3a..cc37e47f99 100644 --- a/engines/titanic/star_control/star_camera.h +++ b/engines/titanic/star_control/star_camera.h @@ -77,7 +77,11 @@ public: */ virtual void setPosition(const FVector &v); - virtual void proc5(const FVector &v); + /** + * Sets the camera orientation + */ + virtual void setOrientation(const FVector &v); + virtual void proc6(int v); virtual void proc7(int v); virtual void proc8(int v); diff --git a/engines/titanic/star_control/star_control_sub2.cpp b/engines/titanic/star_control/star_control_sub2.cpp index 9870309b2a..6eb918ca00 100644 --- a/engines/titanic/star_control/star_control_sub2.cpp +++ b/engines/titanic/star_control/star_control_sub2.cpp @@ -39,7 +39,7 @@ bool CStarControlSub2::loadYale(int v1) { bool CStarControlSub2::selectStar(CSurfaceArea *surfaceArea, CStarCamera *camera, const Common::Point &pt, void *handler) { - int index = findStar(surfaceArea, camera, pt); + int index = findStar(surfaceArea, camera, pt); if (index == -1) { return false; } else if (!handler) { diff --git a/engines/titanic/star_control/star_control_sub24.cpp b/engines/titanic/star_control/star_control_sub24.cpp index 8671fa76fd..7b2588e469 100644 --- a/engines/titanic/star_control/star_control_sub24.cpp +++ b/engines/titanic/star_control/star_control_sub24.cpp @@ -64,7 +64,7 @@ void CStarControlSub24::setPath(const FVector &srcV, const FVector &destV, const tempV1 = row3.addAndNormalize(tempV1); FMatrix newOrient; - newOrient.fn1(tempV1); + newOrient.set(tempV1); _orientationChanger.load(orientation, newOrient); _transitionPercent = 0.0; @@ -114,7 +114,7 @@ int CStarControlSub24::proc5(CErrorCode &errorCode, FVector &pos, FMatrix &orien v1 = v2.addAndNormalize(v1); v1 = v2.addAndNormalize(v1); - orientation.fn1(v1); + orientation.set(v1); v2 = v1; } diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp index 7583cb00e8..e5cfdd5acb 100644 --- a/engines/titanic/star_control/star_view.cpp +++ b/engines/titanic/star_control/star_view.cpp @@ -45,7 +45,7 @@ void CStarView::load(SimpleFile *file, int param) { _hasReference = file->readNumber(); if (_hasReference) - _sub13.load(file, 0); + _photoViewport.load(file, 0); _field218 = file->readNumber(); _showingPhoto = file->readNumber(); @@ -57,7 +57,7 @@ void CStarView::save(SimpleFile *file, int indent) { file->writeNumberLine(_hasReference, indent); if (_hasReference) - _sub13.save(file, indent); + _photoViewport.save(file, indent); file->writeNumberLine(_field218, indent); file->writeNumberLine(_showingPhoto, indent); @@ -70,7 +70,7 @@ void CStarView::setup(CScreenManager *screenManager, CStarField *starField, CSta void CStarView::reset() { if (_hasReference) { - CStarCamera camera(&_sub13); + CStarCamera camera(&_photoViewport); fn18(&camera); } } @@ -284,7 +284,7 @@ void CStarView::fn4() { FVector v1, v2; randomizeVectors1(v1, v2); _camera.setPosition(v1); - _camera.proc5(v2); + _camera.setOrientation(v2); } void CStarView::fn5() { @@ -298,22 +298,22 @@ void CStarView::fn6() { void CStarView::fn7() { const CBaseStarEntry *star = _starField->getRandomStar(); if (star) { - FVector v1, v2; - randomizeVectors1(v1, v2); - v2 += star->_position; - _camera.setPosition(v2); - _camera.proc5(v1); + FVector pos, orientation; + randomizeVectors1(pos, orientation); + pos += star->_position; + _camera.setPosition(pos); + _camera.setOrientation(orientation); } } void CStarView::fn19(int index) { const CBaseStarEntry *star = _starField->getStar(index); if (star) { - FVector v1, v2; - randomizeVectors1(v1, v2); - v1 += star->_position; - _camera.setPosition(v1); - _camera.proc5(v2); + FVector pos, orientation; + randomizeVectors1(pos, orientation); + pos += star->_position; + _camera.setPosition(pos); + _camera.setOrientation(orientation); } } @@ -361,14 +361,14 @@ void CStarView::fn14() { } void CStarView::setHasReference() { - FVector v1, v2; - randomizeVectors2(v1, v2); + FVector pos, orientation; + randomizeVectors2(pos, orientation); - _sub13.setPosition(v1); - _sub13.fn11(v2); + _photoViewport.setPosition(pos); + _photoViewport.setOrientation(orientation); _field218 = false; - _sub13.fn13(MODE_PHOTO, 0.0); - _sub13.fn13(MODE_STARFIELD, 0.0); + _photoViewport.fn13(MODE_PHOTO, 0.0); + _photoViewport.fn13(MODE_STARFIELD, 0.0); _hasReference = true; reset(); _field218 = true; @@ -391,12 +391,12 @@ void CStarView::fn16() { break; case 0: - _camera.fn3(&_sub13, v2); + _camera.fn3(&_photoViewport, v2); _starField->fn7(); break; case 1: - _camera.fn1(&_sub13, v2); + _camera.fn1(&_photoViewport, v2); _starField->fn7(); break; @@ -438,7 +438,7 @@ void CStarView::fn18(CStarCamera *camera) { } } -void CStarView::randomizeVectors1(FVector &v1, FVector &v2) { +void CStarView::randomizeVectors1(FVector &pos, FVector &orientation) { /* ***DEBUG*** v1._x = 3072.0 - g_vm->getRandomFloat() * -4096.0; v1._y = 3072.0 - g_vm->getRandomFloat() * -4096.0; @@ -450,11 +450,11 @@ void CStarView::randomizeVectors1(FVector &v1, FVector &v2) { v2.normalize(); */ // Values temporarily hardcoded to match hacked values in original EXE - v1 = FVector((float)69481544.0, (float)69481544.0, (float)69481544.0); - v2 = FVector((float)-0.577350259, (float)-0.577350259, (float)-0.577350259); + pos = FVector((float)69481544.0, (float)69481544.0, (float)69481544.0); + orientation = FVector((float)-0.577350259, (float)-0.577350259, (float)-0.577350259); } -void CStarView::randomizeVectors2(FVector &v1, FVector &v2) { +void CStarView::randomizeVectors2(FVector &pos, FVector &orientation) { /* ****DEBUG*** v1._x = 3072.0 - g_vm->getRandomFloat() * -4096.0; v1._y = 3072.0 - g_vm->getRandomFloat() * -4096.0; @@ -466,8 +466,8 @@ void CStarView::randomizeVectors2(FVector &v1, FVector &v2) { v2.normalize(); */ // Values temporarily hardcoded to match hacked values in original EXE - v1 = FVector((float)69481544.0, (float)69481544.0, (float)69481544.0); - v2 = FVector((float)0.624659300, (float)-0.468542814, (float)-0.624714553); + pos = FVector((float)69481544.0, (float)69481544.0, (float)69481544.0); + orientation = FVector((float)0.624659300, (float)-0.468542814, (float)-0.624714553); } void CStarView::resizeSurface(CScreenManager *scrManager, int width, int height, diff --git a/engines/titanic/star_control/star_view.h b/engines/titanic/star_control/star_view.h index 690c5cb782..04cc7d83e9 100644 --- a/engines/titanic/star_control/star_view.h +++ b/engines/titanic/star_control/star_view.h @@ -43,7 +43,7 @@ private: CVideoSurface *_videoSurface; CStarCamera _camera; bool _hasReference; - CViewport _sub13; + CViewport _photoViewport; CSurfaceFader _fader; CVideoSurface *_videoSurface2; CGameObject *_homePhotoMask; @@ -54,8 +54,15 @@ private: void fn18(CStarCamera *camera); void fn19(int v); - void randomizeVectors1(FVector &v1, FVector &v2); - void randomizeVectors2(FVector &v1, FVector &v2); + /** + * Gets a random position and orientation + */ + void randomizeVectors1(FVector &pos, FVector &orientation); + + /** + * Gets a random position and orientation + */ + void randomizeVectors2(FVector &pos, FVector &orientation); /** * Handles resizing the surface diff --git a/engines/titanic/star_control/viewport.cpp b/engines/titanic/star_control/viewport.cpp index c312f5769f..bad28ba2f9 100644 --- a/engines/titanic/star_control/viewport.cpp +++ b/engines/titanic/star_control/viewport.cpp @@ -116,8 +116,8 @@ void CViewport::setOrientation(const FMatrix &m) { _flag = false; } -void CViewport::fn11(const FVector &v) { - _orientation.fn1(v); +void CViewport::setOrientation(const FVector &v) { + _orientation.set(v); _flag = false; } diff --git a/engines/titanic/star_control/viewport.h b/engines/titanic/star_control/viewport.h index 41dfb740f2..1780889081 100644 --- a/engines/titanic/star_control/viewport.h +++ b/engines/titanic/star_control/viewport.h @@ -85,11 +85,15 @@ public: void setPosition(const FPose &pose); /** - * Sets the orientation + * Sets the orientation from a passed matrix */ void setOrientation(const FMatrix &m); - void fn11(const FVector &v); + /** + * Sets the orientation from a passed vector + */ + void setOrientation(const FVector &v); + void fn12(); void fn13(StarMode mode, double val); void reposition(double factor); |