aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorDavid Fioramonti2017-09-07 05:51:16 -0700
committerDavid Fioramonti2017-09-07 06:34:03 -0700
commit93d9ac926c466f39670073f60166630c1fd65539 (patch)
treea981e854290e853928116e9f067623fad620ebdc /engines/titanic
parentd3a0a487be01f14e8a81f2d82fd4d78f203607e2 (diff)
downloadscummvm-rg350-93d9ac926c466f39670073f60166630c1fd65539.tar.gz
scummvm-rg350-93d9ac926c466f39670073f60166630c1fd65539.tar.bz2
scummvm-rg350-93d9ac926c466f39670073f60166630c1fd65539.zip
TITANIC: star camera better handler function naming
The functions that dealt with the mover handling only had handler in the name so I added mover and type to the name to reflect that it involves the mover handler.
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/star_control/star_camera.cpp18
-rw-r--r--engines/titanic/star_control/star_camera.h12
2 files changed, 16 insertions, 14 deletions
diff --git a/engines/titanic/star_control/star_camera.cpp b/engines/titanic/star_control/star_camera.cpp
index bcfc9ea232..e4fcdcdead 100644
--- a/engines/titanic/star_control/star_camera.cpp
+++ b/engines/titanic/star_control/star_camera.cpp
@@ -41,7 +41,7 @@ FMatrix *CStarCamera::_newOrientation;
CStarCamera::CStarCamera(const CNavigationInfo *data) :
_starLockState(ZERO_LOCKED), _mover(nullptr), _isMoved(false), _isInLockingProcess(false) {
- setupHandler(data);
+ setMoverType(data);
}
CStarCamera::CStarCamera(CViewport *src) :
@@ -69,7 +69,7 @@ bool CStarCamera::isNotInLockingProcess() {
}
CStarCamera::~CStarCamera() {
- deleteHandler();
+ removeMover();
}
void CStarCamera::proc2(const CViewport *src) {
@@ -404,12 +404,12 @@ bool CStarCamera::addLockedStar(const FVector v) {
CNavigationInfo data;
_mover->copyTo(&data);
- deleteHandler();
+ removeMover();
FVector &row = _lockedStarsPos[(int)_starLockState];
_starLockState = StarLockState((int)_starLockState + 1);
row = v;
- setupHandler(&data);
+ setMoverType(&data);
return true;
}
@@ -419,10 +419,10 @@ bool CStarCamera::removeLockedStar() {
CNavigationInfo data;
_mover->copyTo(&data);
- deleteHandler();
+ removeMover();
_starLockState = StarLockState((int)_starLockState - 1);
- setupHandler(&data);
+ setMoverType(&data);
return true;
}
@@ -438,7 +438,7 @@ void CStarCamera::save(SimpleFile *file, int indent) {
_viewport.save(file, indent);
}
-bool CStarCamera::setupHandler(const CNavigationInfo *src) {
+bool CStarCamera::setMoverType(const CNavigationInfo *src) {
CCameraMover *mover = nullptr;
switch (_starLockState) {
@@ -457,7 +457,7 @@ bool CStarCamera::setupHandler(const CNavigationInfo *src) {
}
if (mover) {
- assert(!_mover);
+ assert(!_mover); // removeMover() is usually called before this function so _mover is null
_mover = mover;
return true;
} else {
@@ -465,7 +465,7 @@ bool CStarCamera::setupHandler(const CNavigationInfo *src) {
}
}
-void CStarCamera::deleteHandler() {
+void CStarCamera::removeMover() {
if (_mover) {
delete _mover;
_mover = nullptr;
diff --git a/engines/titanic/star_control/star_camera.h b/engines/titanic/star_control/star_camera.h
index 281abb9d30..f2d27212fe 100644
--- a/engines/titanic/star_control/star_camera.h
+++ b/engines/titanic/star_control/star_camera.h
@@ -47,20 +47,22 @@ private:
private:
StarLockState _starLockState;
FMatrix _lockedStarsPos; // Each row represents the location of a locked star
- CCameraMover *_mover;
+ CCameraMover *_mover; // A marked or unmarked camera mover, contains an automover
CViewport _viewport;
bool _isMoved; // Used in CPetStarfield to determine if a star destination can be set
bool _isInLockingProcess; // The mover/view is homing in on a new star
private:
/**
- * Set up a handler
+ * Set Mover type to be unmarked or marked camera mover based on
+ * the number of stars currently locked (_starLockState)
+ * The CNavigationInfo data is used to initialize the mover
*/
- bool setupHandler(const CNavigationInfo *src);
+ bool setMoverType(const CNavigationInfo *src);
/**
- * Deletes any previous handler
+ * Deletes the previous mover handle
*/
- void deleteHandler();
+ void removeMover();
/**
* Return whether the handler is locked