aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-06-07 21:50:03 -0400
committerPaul Gilbert2017-06-07 21:50:03 -0400
commitc105be916ed2ee5cb0207ecfa69703ea89a61655 (patch)
treea143c9feaf441f77ebc0fba999fa9914692b015c
parent0331fab01b021160fd8aea6d7ef491c42f8a869d (diff)
downloadscummvm-rg350-c105be916ed2ee5cb0207ecfa69703ea89a61655.tar.gz
scummvm-rg350-c105be916ed2ee5cb0207ecfa69703ea89a61655.tar.bz2
scummvm-rg350-c105be916ed2ee5cb0207ecfa69703ea89a61655.zip
TITANIC: Renamings for automatic camera mover classes
-rw-r--r--engines/titanic/module.mk6
-rw-r--r--engines/titanic/star_control/camera_auto_mover.cpp (renamed from engines/titanic/star_control/star_control_sub23.cpp)12
-rw-r--r--engines/titanic/star_control/camera_auto_mover.h (renamed from engines/titanic/star_control/star_control_sub23.h)15
-rw-r--r--engines/titanic/star_control/marked_auto_mover.cpp (renamed from engines/titanic/star_control/star_control_sub27.cpp)10
-rw-r--r--engines/titanic/star_control/marked_auto_mover.h (renamed from engines/titanic/star_control/star_control_sub27.h)15
-rw-r--r--engines/titanic/star_control/star_control_sub21.cpp8
-rw-r--r--engines/titanic/star_control/star_control_sub21.h4
-rw-r--r--engines/titanic/star_control/star_control_sub22.cpp6
-rw-r--r--engines/titanic/star_control/star_control_sub22.h4
-rw-r--r--engines/titanic/star_control/unmarked_auto_mover.cpp (renamed from engines/titanic/star_control/star_control_sub24.cpp)12
-rw-r--r--engines/titanic/star_control/unmarked_auto_mover.h (renamed from engines/titanic/star_control/star_control_sub24.h)15
11 files changed, 58 insertions, 49 deletions
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 1e85874fd8..d6c8396588 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_auto_mover.o \
star_control/camera_mover.o \
star_control/dmatrix.o \
star_control/dvector.o \
@@ -441,6 +442,7 @@ MODULE_OBJS := \
star_control/frange.o \
star_control/frect.o \
star_control/fvector.o \
+ star_control/marked_auto_mover.o \
star_control/matrix_transform.o \
star_control/orientation_changer.o \
star_control/star_camera.o \
@@ -448,9 +450,6 @@ MODULE_OBJS := \
star_control/star_control_sub2.o \
star_control/star_control_sub21.o \
star_control/star_control_sub22.o \
- star_control/star_control_sub23.o \
- star_control/star_control_sub24.o \
- star_control/star_control_sub27.o \
star_control/star_crosshairs.o \
star_control/star_field.o \
star_control/star_markers.o \
@@ -460,6 +459,7 @@ MODULE_OBJS := \
star_control/star_view.o \
star_control/surface_area.o \
star_control/surface_fader.o \
+ star_control/unmarked_auto_mover.o \
star_control/viewport.o \
support/avi_surface.o \
support/direct_draw.o \
diff --git a/engines/titanic/star_control/star_control_sub23.cpp b/engines/titanic/star_control/camera_auto_mover.cpp
index f72d5c846b..45e5a9e03e 100644
--- a/engines/titanic/star_control/star_control_sub23.cpp
+++ b/engines/titanic/star_control/camera_auto_mover.cpp
@@ -20,12 +20,12 @@
*
*/
-#include "titanic/star_control/star_control_sub23.h"
+#include "titanic/star_control/camera_auto_mover.h"
#include "common/textconsole.h"
namespace Titanic {
-CStarControlSub23::CStarControlSub23() : _srcPos(0.0, 1000000.0, 0.0) {
+CCameraAutoMover::CCameraAutoMover() : _srcPos(0.0, 1000000.0, 0.0) {
_field4 = 0;
_active = false;
_distance = 0.0;
@@ -41,7 +41,7 @@ CStarControlSub23::CStarControlSub23() : _srcPos(0.0, 1000000.0, 0.0) {
_transitionPercentInc = 0.0;
}
-void CStarControlSub23::proc2(const FVector &oldPos, const FVector &newPos,
+void CCameraAutoMover::proc2(const FVector &oldPos, const FVector &newPos,
const FMatrix &oldOrientation, const FMatrix &newOrientation) {
_srcPos = oldPos;
_destPos = newPos;
@@ -57,7 +57,7 @@ void CStarControlSub23::proc2(const FVector &oldPos, const FVector &newPos,
_field4C = 0;
}
-void CStarControlSub23::proc3(const FMatrix &srcOrient, const FMatrix &destOrient) {
+void CCameraAutoMover::proc3(const FMatrix &srcOrient, const FMatrix &destOrient) {
_srcPos.clear();
_destPos.clear();
_transitionPercent = 1.0;
@@ -66,7 +66,7 @@ void CStarControlSub23::proc3(const FMatrix &srcOrient, const FMatrix &destOrien
_field34 = false;
}
-void CStarControlSub23::setPath(const FVector &srcV, const FVector &destV, const FMatrix &orientation) {
+void CCameraAutoMover::setPath(const FVector &srcV, const FVector &destV, const FMatrix &orientation) {
_srcPos = srcV;
_destPos = destV;
_posDelta = _destPos - _srcPos;
@@ -81,7 +81,7 @@ void CStarControlSub23::setPath(const FVector &srcV, const FVector &destV, const
_transitionPercent = 1.0;
}
-void CStarControlSub23::proc6(int val1, int val2, float val) {
+void CCameraAutoMover::proc6(int val1, int val2, float val) {
_field44 = val1;
_field4C = val1 + 62;
_field38 = val / (double)(val1 + val2 * 2);
diff --git a/engines/titanic/star_control/star_control_sub23.h b/engines/titanic/star_control/camera_auto_mover.h
index af6d9de784..52938284ed 100644
--- a/engines/titanic/star_control/star_control_sub23.h
+++ b/engines/titanic/star_control/camera_auto_mover.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef TITANIC_STAR_CONTROL_SUB23_H
-#define TITANIC_STAR_CONTROL_SUB23_H
+#ifndef TITANIC_CAMERA_AUTO_MOVER_H
+#define TITANIC_CAMERA_AUTO_MOVER_H
#include "titanic/star_control/error_code.h"
#include "titanic/star_control/fmatrix.h"
@@ -30,7 +30,10 @@
namespace Titanic {
-class CStarControlSub23 {
+/**
+ * Base class for automatic movement of the starview camera
+ */
+class CCameraAutoMover {
protected:
int _field4;
bool _active;
@@ -50,8 +53,8 @@ protected:
double _transitionPercentInc;
COrientationChanger _orientationChanger;
public:
- CStarControlSub23();
- virtual ~CStarControlSub23() {}
+ CCameraAutoMover();
+ virtual ~CCameraAutoMover() {}
virtual void proc2(const FVector &oldPos, const FVector &newPos,
const FMatrix &oldOrientation, const FMatrix &newOrientation);
@@ -65,4 +68,4 @@ public:
} // End of namespace Titanic
-#endif /* TITANIC_STAR_CONTROL_SUB23_H */
+#endif /* TITANIC_CAMERA_AUTO_MOVER_H */
diff --git a/engines/titanic/star_control/star_control_sub27.cpp b/engines/titanic/star_control/marked_auto_mover.cpp
index d45bee6f99..828fe03a95 100644
--- a/engines/titanic/star_control/star_control_sub27.cpp
+++ b/engines/titanic/star_control/marked_auto_mover.cpp
@@ -20,14 +20,14 @@
*
*/
-#include "titanic/star_control/star_control_sub27.h"
+#include "titanic/star_control/marked_auto_mover.h"
#include "common/textconsole.h"
namespace Titanic {
-void CStarControlSub27::proc2(const FVector &oldPos, const FVector &newPos,
+void CMarkedAutoMover::proc2(const FVector &oldPos, const FVector &newPos,
const FMatrix &oldOrientation, const FMatrix &newOrientation) {
- CStarControlSub23::proc2(oldPos, newPos, oldOrientation, newOrientation);
+ CCameraAutoMover::proc2(oldPos, newPos, oldOrientation, newOrientation);
double distance = _distance;
if (distance > 0.0) {
@@ -50,7 +50,7 @@ void CStarControlSub27::proc2(const FVector &oldPos, const FVector &newPos,
}
}
-int CStarControlSub27::proc5(CErrorCode &errorCode, FVector &pos, FMatrix &orientation) {
+int CMarkedAutoMover::proc5(CErrorCode &errorCode, FVector &pos, FMatrix &orientation) {
if (!_active)
return 0;
@@ -87,7 +87,7 @@ int CStarControlSub27::proc5(CErrorCode &errorCode, FVector &pos, FMatrix &orien
}
}
-void CStarControlSub27::getVectorOnPath(FVector &pos) const {
+void CMarkedAutoMover::getVectorOnPath(FVector &pos) const {
double distance = _posDelta.getDistance(pos);
distance /= _distance;
diff --git a/engines/titanic/star_control/star_control_sub27.h b/engines/titanic/star_control/marked_auto_mover.h
index c6d29b1ddf..5127496241 100644
--- a/engines/titanic/star_control/star_control_sub27.h
+++ b/engines/titanic/star_control/marked_auto_mover.h
@@ -20,14 +20,17 @@
*
*/
-#ifndef TITANIC_STAR_CONTROL_SUB27_H
-#define TITANIC_STAR_CONTROL_SUB27_H
+#ifndef TITANIC_MARKED_AUTO_MOVER_H
+#define TITANIC_MARKED_AUTO_MOVER_H
-#include "titanic/star_control/star_control_sub23.h"
+#include "titanic/star_control/camera_auto_mover.h"
namespace Titanic {
-class CStarControlSub27 : public CStarControlSub23 {
+/**
+ * Automatic camera mover used when one or more markers have been set
+ */
+class CMarkedAutoMover : public CCameraAutoMover {
private:
/**
* Given a vector, figures out how far is from the movement source, and
@@ -36,7 +39,7 @@ private:
*/
void getVectorOnPath(FVector &pos) const;
public:
- virtual ~CStarControlSub27() {}
+ virtual ~CMarkedAutoMover() {}
virtual void proc2(const FVector &oldPos, const FVector &newPos,
const FMatrix &oldOrientation, const FMatrix &newOrientation);
@@ -45,4 +48,4 @@ public:
} // End of namespace Titanic
-#endif /* TITANIC_STAR_CONTROL_SUB27_H */
+#endif /* TITANIC_MARKED_AUTO_MOVER_H */
diff --git a/engines/titanic/star_control/star_control_sub21.cpp b/engines/titanic/star_control/star_control_sub21.cpp
index bf5af80860..4b7a6c396b 100644
--- a/engines/titanic/star_control/star_control_sub21.cpp
+++ b/engines/titanic/star_control/star_control_sub21.cpp
@@ -38,7 +38,7 @@ void CStarControlSub21::moveTo(const FVector &srcV, const FVector &destV, const
debugC(DEBUG_BASIC, kDebugStarfield, "Starfield move %s to %s", srcV.toString().c_str(),
destV.toString().c_str());
- _sub24.setPath(srcV, destV, orientation);
+ _autoMover.setPath(srcV, destV, orientation);
}
void CStarControlSub21::proc10(const FVector &v1, const FVector &v2, const FVector &v3, const FMatrix &m) {
@@ -50,14 +50,14 @@ void CStarControlSub21::proc10(const FVector &v1, const FVector &v2, const FVect
DMatrix matrix1 = vector2.fn4(vector1);
DMatrix matrix2 = matrix1.fn4(m);
- _sub24.proc3(m, matrix2);
+ _autoMover.proc3(m, matrix2);
incLockCount();
}
void CStarControlSub21::updatePosition(CErrorCode &errorCode, FVector &pos, FMatrix &orientation) {
- if (_sub24.isActive()) {
+ if (_autoMover.isActive()) {
decLockCount();
- int val = _sub24.proc5(errorCode, pos, orientation);
+ int val = _autoMover.proc5(errorCode, pos, orientation);
if (val == 1)
incLockCount();
if (val == 2) {
diff --git a/engines/titanic/star_control/star_control_sub21.h b/engines/titanic/star_control/star_control_sub21.h
index 3b804d95ff..bd876e5631 100644
--- a/engines/titanic/star_control/star_control_sub21.h
+++ b/engines/titanic/star_control/star_control_sub21.h
@@ -24,13 +24,13 @@
#define TITANIC_STAR_CONTROL_SUB21_H
#include "titanic/star_control/camera_mover.h"
-#include "titanic/star_control/star_control_sub24.h"
+#include "titanic/star_control/unmarked_auto_mover.h"
namespace Titanic {
class CStarControlSub21 : public CCameraMover {
private:
- CStarControlSub24 _sub24;
+ CUnmarkedAutoMover _autoMover;
public:
CStarControlSub21(const CNavigationInfo *src);
virtual ~CStarControlSub21() {}
diff --git a/engines/titanic/star_control/star_control_sub22.cpp b/engines/titanic/star_control/star_control_sub22.cpp
index f3d9b6dc7a..f26fbb59a8 100644
--- a/engines/titanic/star_control/star_control_sub22.cpp
+++ b/engines/titanic/star_control/star_control_sub22.cpp
@@ -34,14 +34,14 @@ void CStarControlSub22::proc8(const FVector &oldPos, const FVector &newPos,
if (isLocked())
decLockCount();
- _sub27.proc2(oldPos, newPos, oldOrientation, newOrientation);
+ _autoMover.proc2(oldPos, newPos, oldOrientation, newOrientation);
incLockCount();
}
void CStarControlSub22::updatePosition(CErrorCode &errorCode, FVector &pos, FMatrix &orientation) {
- if (_sub27.isActive()) {
+ if (_autoMover.isActive()) {
decLockCount();
- int val = _sub27.proc5(errorCode, pos, orientation);
+ int val = _autoMover.proc5(errorCode, pos, orientation);
if (val == 1)
incLockCount();
if (val == 2) {
diff --git a/engines/titanic/star_control/star_control_sub22.h b/engines/titanic/star_control/star_control_sub22.h
index 876e06daa5..91b9c4052b 100644
--- a/engines/titanic/star_control/star_control_sub22.h
+++ b/engines/titanic/star_control/star_control_sub22.h
@@ -24,13 +24,13 @@
#define TITANIC_STAR_CONTROL_SUB22_H
#include "titanic/star_control/camera_mover.h"
-#include "titanic/star_control/star_control_sub27.h"
+#include "titanic/star_control/marked_auto_mover.h"
namespace Titanic {
class CStarControlSub22 : public CCameraMover {
private:
- CStarControlSub27 _sub27;
+ CMarkedAutoMover _autoMover;
public:
CStarControlSub22(const CNavigationInfo *src);
virtual ~CStarControlSub22() {}
diff --git a/engines/titanic/star_control/star_control_sub24.cpp b/engines/titanic/star_control/unmarked_auto_mover.cpp
index 7b2588e469..4f38f68a40 100644
--- a/engines/titanic/star_control/star_control_sub24.cpp
+++ b/engines/titanic/star_control/unmarked_auto_mover.cpp
@@ -20,13 +20,13 @@
*
*/
-#include "titanic/star_control/star_control_sub24.h"
+#include "titanic/star_control/unmarked_auto_mover.h"
#include "common/textconsole.h"
namespace Titanic {
-void CStarControlSub24::proc3(const FMatrix &srcOrient, const FMatrix &destOrient) {
- CStarControlSub23::proc3(srcOrient, destOrient);
+void CUnmarkedAutoMover::proc3(const FMatrix &srcOrient, const FMatrix &destOrient) {
+ CCameraAutoMover::proc3(srcOrient, destOrient);
_orientationChanger.load(srcOrient, destOrient);
_transitionPercentInc = 0.1;
_transitionPercent = 0.0;
@@ -34,8 +34,8 @@ void CStarControlSub24::proc3(const FMatrix &srcOrient, const FMatrix &destOrien
_active = true;
}
-void CStarControlSub24::setPath(const FVector &srcV, const FVector &destV, const FMatrix &orientation) {
- CStarControlSub23::setPath(srcV, destV, orientation);
+void CUnmarkedAutoMover::setPath(const FVector &srcV, const FVector &destV, const FMatrix &orientation) {
+ CCameraAutoMover::setPath(srcV, destV, orientation);
if (_distance > 8000.0) {
_active = true;
@@ -73,7 +73,7 @@ void CStarControlSub24::setPath(const FVector &srcV, const FVector &destV, const
}
}
-int CStarControlSub24::proc5(CErrorCode &errorCode, FVector &pos, FMatrix &orientation) {
+int CUnmarkedAutoMover::proc5(CErrorCode &errorCode, FVector &pos, FMatrix &orientation) {
FVector v1, v2, v3, v4;
if (!_active)
diff --git a/engines/titanic/star_control/star_control_sub24.h b/engines/titanic/star_control/unmarked_auto_mover.h
index 4b810ed924..fa1aa95140 100644
--- a/engines/titanic/star_control/star_control_sub24.h
+++ b/engines/titanic/star_control/unmarked_auto_mover.h
@@ -20,16 +20,19 @@
*
*/
-#ifndef TITANIC_STAR_CONTROL_SUB24_H
-#define TITANIC_STAR_CONTROL_SUB24_H
+#ifndef TITANIC_UNMARKED_AUTO_MOVER_H
+#define TITANIC_UNMARKED_AUTO_MOVER_H
-#include "titanic/star_control/star_control_sub23.h"
+#include "titanic/star_control/camera_auto_mover.h"
namespace Titanic {
-class CStarControlSub24 : public CStarControlSub23 {
+/**
+ * Automatic camera mover used when no markers have been set
+ */
+class CUnmarkedAutoMover : public CCameraAutoMover {
public:
- virtual ~CStarControlSub24() {}
+ virtual ~CUnmarkedAutoMover() {}
virtual void proc3(const FMatrix &srcOrient, const FMatrix &destOrient);
@@ -43,4 +46,4 @@ public:
} // End of namespace Titanic
-#endif /* TITANIC_STAR_CONTROL_SUB24_H */
+#endif /* TITANIC_UNMARKED_AUTO_MOVER_H */