[Scummvm-git-logs] scummvm master -> 46f4047a1d290202b797cdf2a1090e64adb21a61

dreammaster dreammaster at scummvm.org
Thu Jun 8 04:00:30 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
46f4047a1d TITANIC: Renamings for camera mover classes


Commit: 46f4047a1d290202b797cdf2a1090e64adb21a61
    https://github.com/scummvm/scummvm/commit/46f4047a1d290202b797cdf2a1090e64adb21a61
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-06-07T22:00:22-04:00

Commit Message:
TITANIC: Renamings for camera mover classes

Changed paths:
  A engines/titanic/star_control/marked_camera_mover.cpp
  A engines/titanic/star_control/marked_camera_mover.h
  A engines/titanic/star_control/unmarked_camera_mover.cpp
  A engines/titanic/star_control/unmarked_camera_mover.h
  R engines/titanic/star_control/star_control_sub21.cpp
  R engines/titanic/star_control/star_control_sub21.h
  R engines/titanic/star_control/star_control_sub22.cpp
  R engines/titanic/star_control/star_control_sub22.h
    engines/titanic/module.mk
    engines/titanic/star_control/star_camera.cpp


diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index d6c8396..e3f4392 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -443,13 +443,12 @@ MODULE_OBJS := \
 	star_control/frect.o \
 	star_control/fvector.o \
 	star_control/marked_auto_mover.o \
+	star_control/marked_camera_mover.o \
 	star_control/matrix_transform.o \
 	star_control/orientation_changer.o \
 	star_control/star_camera.o \
 	star_control/star_closeup.o \
 	star_control/star_control_sub2.o \
-	star_control/star_control_sub21.o \
-	star_control/star_control_sub22.o \
 	star_control/star_crosshairs.o \
 	star_control/star_field.o \
 	star_control/star_markers.o \
@@ -460,6 +459,7 @@ MODULE_OBJS := \
 	star_control/surface_area.o \
 	star_control/surface_fader.o \
 	star_control/unmarked_auto_mover.o \
+	star_control/unmarked_camera_mover.o \
 	star_control/viewport.o \
 	support/avi_surface.o \
 	support/direct_draw.o \
diff --git a/engines/titanic/star_control/marked_camera_mover.cpp b/engines/titanic/star_control/marked_camera_mover.cpp
new file mode 100644
index 0000000..2e3fa8f
--- /dev/null
+++ b/engines/titanic/star_control/marked_camera_mover.cpp
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/marked_camera_mover.h"
+#include "common/textconsole.h"
+
+namespace Titanic {
+
+CMarkedCameraMover::CMarkedCameraMover(const CNavigationInfo *src) :
+		CCameraMover(src) {
+}
+
+void CMarkedCameraMover::proc8(const FVector &oldPos, const FVector &newPos,
+		const FMatrix &oldOrientation, const FMatrix &newOrientation) {
+	if (isLocked())
+		decLockCount();
+
+	_autoMover.proc2(oldPos, newPos, oldOrientation, newOrientation);
+	incLockCount();
+}
+
+void CMarkedCameraMover::updatePosition(CErrorCode &errorCode, FVector &pos, FMatrix &orientation) {
+	if (_autoMover.isActive()) {
+		decLockCount();
+		int val = _autoMover.proc5(errorCode, pos, orientation);
+		if (val == 1)
+			incLockCount();
+		if (val == 2) {
+			stop();
+			if (_starVector)
+				_starVector->apply();
+		}
+	} else if (_speed != 0.0) {
+		pos._x += orientation._row3._x * _speed;
+		pos._y += orientation._row3._y * _speed;
+		pos._z += orientation._row3._z * _speed;
+		errorCode.set();
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/marked_camera_mover.h b/engines/titanic/star_control/marked_camera_mover.h
new file mode 100644
index 0000000..7706db1
--- /dev/null
+++ b/engines/titanic/star_control/marked_camera_mover.h
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MARKED_CAMERA_MOVER_H
+#define TITANIC_MARKED_CAMERA_MOVER_H
+
+#include "titanic/star_control/camera_mover.h"
+#include "titanic/star_control/marked_auto_mover.h"
+
+namespace Titanic {
+
+class CMarkedCameraMover : public CCameraMover {
+private:
+	CMarkedAutoMover _autoMover;
+public:
+	CMarkedCameraMover(const CNavigationInfo *src);
+	virtual ~CMarkedCameraMover() {}
+
+	virtual void proc8(const FVector &oldPos, const FVector &newPos,
+		const FMatrix &oldOrientation, const FMatrix &newOrientation);
+
+	/**
+	 * Update the passed position and orientation matrix
+	 */
+	virtual void updatePosition(CErrorCode &errorCode, FVector &pos, FMatrix &orientation);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MARKED_CAMERA_MOVER_H */
diff --git a/engines/titanic/star_control/star_camera.cpp b/engines/titanic/star_control/star_camera.cpp
index 93aee9e..c715daf 100644
--- a/engines/titanic/star_control/star_camera.cpp
+++ b/engines/titanic/star_control/star_camera.cpp
@@ -21,8 +21,8 @@
  */
 
 #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/unmarked_camera_mover.h"
+#include "titanic/star_control/marked_camera_mover.h"
 #include "titanic/star_control/dmatrix.h"
 #include "titanic/star_control/fmatrix.h"
 #include "titanic/titanic.h"
@@ -389,13 +389,13 @@ bool CStarCamera::setupHandler(const CNavigationInfo *src) {
 
 	switch (_matrixRow) {
 	case -1:
-		mover = new CStarControlSub21(src);
+		mover = new CUnmarkedCameraMover(src);
 		break;
 
 	case 0:
 	case 1:
 	case 2:
-		mover = new CStarControlSub22(src);
+		mover = new CMarkedCameraMover(src);
 		break;
 
 	default:
diff --git a/engines/titanic/star_control/star_control_sub21.cpp b/engines/titanic/star_control/star_control_sub21.cpp
deleted file mode 100644
index 4b7a6c3..0000000
--- a/engines/titanic/star_control/star_control_sub21.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/star_control/star_control_sub21.h"
-#include "titanic/star_control/dmatrix.h"
-#include "titanic/star_control/dvector.h"
-#include "titanic/titanic.h"
-#include "common/textconsole.h"
-
-namespace Titanic {
-
-CStarControlSub21::CStarControlSub21(const CNavigationInfo *src) :
-		CCameraMover(src) {
-}
-
-void CStarControlSub21::moveTo(const FVector &srcV, const FVector &destV, const FMatrix &orientation) {
-	if (isLocked())
-		decLockCount();
-
-	debugC(DEBUG_BASIC, kDebugStarfield, "Starfield move %s to %s", srcV.toString().c_str(),
-		destV.toString().c_str());
-	_autoMover.setPath(srcV, destV, orientation);
-}
-
-void CStarControlSub21::proc10(const FVector &v1, const FVector &v2, const FVector &v3, const FMatrix &m) {
-	if (isLocked())
-		decLockCount();
-
-	DVector vector1 = v1;
-	DVector vector2 = v2;
-	DMatrix matrix1 = vector2.fn4(vector1);
-	DMatrix matrix2 = matrix1.fn4(m);
-
-	_autoMover.proc3(m, matrix2);
-	incLockCount();
-}
-
-void CStarControlSub21::updatePosition(CErrorCode &errorCode, FVector &pos, FMatrix &orientation) {
-	if (_autoMover.isActive()) {
-		decLockCount();
-		int val = _autoMover.proc5(errorCode, pos, orientation);
-		if (val == 1)
-			incLockCount();
-		if (val == 2) {
-			stop();
-			if (_starVector)
-				_starVector->apply();
-		}
-	} else if (_speed != 0.0) {
-		pos._x += orientation._row3._x * _speed;
-		pos._y += orientation._row3._y * _speed;
-		pos._z += orientation._row3._z * _speed;
-		errorCode.set();
-	}
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub21.h b/engines/titanic/star_control/star_control_sub21.h
deleted file mode 100644
index bd876e5..0000000
--- a/engines/titanic/star_control/star_control_sub21.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_SUB21_H
-#define TITANIC_STAR_CONTROL_SUB21_H
-
-#include "titanic/star_control/camera_mover.h"
-#include "titanic/star_control/unmarked_auto_mover.h"
-
-namespace Titanic {
-
-class CStarControlSub21 : public CCameraMover {
-private:
-	CUnmarkedAutoMover _autoMover;
-public:
-	CStarControlSub21(const CNavigationInfo *src);
-	virtual ~CStarControlSub21() {}
-
-	/**
-	 * Start a movement to a given specified destination
-	 */
-	virtual void moveTo(const FVector &srcV, const FVector &destV, const FMatrix &orientation);
-
-	virtual void proc10(const FVector &v1, const FVector &v2, const FVector &v3, const FMatrix &m);
-
-	/**
-	 * Update the passed position and orientation matrix
-	 */
-	virtual void updatePosition(CErrorCode &errorCode, FVector &pos, FMatrix &orientation);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB21_H */
diff --git a/engines/titanic/star_control/star_control_sub22.cpp b/engines/titanic/star_control/star_control_sub22.cpp
deleted file mode 100644
index f26fbb5..0000000
--- a/engines/titanic/star_control/star_control_sub22.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/star_control/star_control_sub22.h"
-#include "common/textconsole.h"
-
-namespace Titanic {
-
-CStarControlSub22::CStarControlSub22(const CNavigationInfo *src) :
-		CCameraMover(src) {
-}
-
-void CStarControlSub22::proc8(const FVector &oldPos, const FVector &newPos,
-		const FMatrix &oldOrientation, const FMatrix &newOrientation) {
-	if (isLocked())
-		decLockCount();
-
-	_autoMover.proc2(oldPos, newPos, oldOrientation, newOrientation);
-	incLockCount();
-}
-
-void CStarControlSub22::updatePosition(CErrorCode &errorCode, FVector &pos, FMatrix &orientation) {
-	if (_autoMover.isActive()) {
-		decLockCount();
-		int val = _autoMover.proc5(errorCode, pos, orientation);
-		if (val == 1)
-			incLockCount();
-		if (val == 2) {
-			stop();
-			if (_starVector)
-				_starVector->apply();
-		}
-	} else if (_speed != 0.0) {
-		pos._x += orientation._row3._x * _speed;
-		pos._y += orientation._row3._y * _speed;
-		pos._z += orientation._row3._z * _speed;
-		errorCode.set();
-	}
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub22.h b/engines/titanic/star_control/star_control_sub22.h
deleted file mode 100644
index 91b9c40..0000000
--- a/engines/titanic/star_control/star_control_sub22.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_SUB22_H
-#define TITANIC_STAR_CONTROL_SUB22_H
-
-#include "titanic/star_control/camera_mover.h"
-#include "titanic/star_control/marked_auto_mover.h"
-
-namespace Titanic {
-
-class CStarControlSub22 : public CCameraMover {
-private:
-	CMarkedAutoMover _autoMover;
-public:
-	CStarControlSub22(const CNavigationInfo *src);
-	virtual ~CStarControlSub22() {}
-
-	virtual void proc8(const FVector &oldPos, const FVector &newPos,
-		const FMatrix &oldOrientation, const FMatrix &newOrientation);
-
-	/**
-	 * Update the passed position and orientation matrix
-	 */
-	virtual void updatePosition(CErrorCode &errorCode, FVector &pos, FMatrix &orientation);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB22_H */
diff --git a/engines/titanic/star_control/unmarked_camera_mover.cpp b/engines/titanic/star_control/unmarked_camera_mover.cpp
new file mode 100644
index 0000000..bafab7b
--- /dev/null
+++ b/engines/titanic/star_control/unmarked_camera_mover.cpp
@@ -0,0 +1,76 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/unmarked_camera_mover.h"
+#include "titanic/star_control/dmatrix.h"
+#include "titanic/star_control/dvector.h"
+#include "titanic/titanic.h"
+#include "common/textconsole.h"
+
+namespace Titanic {
+
+CUnmarkedCameraMover::CUnmarkedCameraMover(const CNavigationInfo *src) :
+		CCameraMover(src) {
+}
+
+void CUnmarkedCameraMover::moveTo(const FVector &srcV, const FVector &destV, const FMatrix &orientation) {
+	if (isLocked())
+		decLockCount();
+
+	debugC(DEBUG_BASIC, kDebugStarfield, "Starfield move %s to %s", srcV.toString().c_str(),
+		destV.toString().c_str());
+	_autoMover.setPath(srcV, destV, orientation);
+}
+
+void CUnmarkedCameraMover::proc10(const FVector &v1, const FVector &v2, const FVector &v3, const FMatrix &m) {
+	if (isLocked())
+		decLockCount();
+
+	DVector vector1 = v1;
+	DVector vector2 = v2;
+	DMatrix matrix1 = vector2.fn4(vector1);
+	DMatrix matrix2 = matrix1.fn4(m);
+
+	_autoMover.proc3(m, matrix2);
+	incLockCount();
+}
+
+void CUnmarkedCameraMover::updatePosition(CErrorCode &errorCode, FVector &pos, FMatrix &orientation) {
+	if (_autoMover.isActive()) {
+		decLockCount();
+		int val = _autoMover.proc5(errorCode, pos, orientation);
+		if (val == 1)
+			incLockCount();
+		if (val == 2) {
+			stop();
+			if (_starVector)
+				_starVector->apply();
+		}
+	} else if (_speed != 0.0) {
+		pos._x += orientation._row3._x * _speed;
+		pos._y += orientation._row3._y * _speed;
+		pos._z += orientation._row3._z * _speed;
+		errorCode.set();
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/unmarked_camera_mover.h b/engines/titanic/star_control/unmarked_camera_mover.h
new file mode 100644
index 0000000..bcf9046
--- /dev/null
+++ b/engines/titanic/star_control/unmarked_camera_mover.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_UNMARKED_CAMERA_MOVER_H
+#define TITANIC_UNMARKED_CAMERA_MOVER_H
+
+#include "titanic/star_control/camera_mover.h"
+#include "titanic/star_control/unmarked_auto_mover.h"
+
+namespace Titanic {
+
+class CUnmarkedCameraMover : public CCameraMover {
+private:
+	CUnmarkedAutoMover _autoMover;
+public:
+	CUnmarkedCameraMover(const CNavigationInfo *src);
+	virtual ~CUnmarkedCameraMover() {}
+
+	/**
+	 * Start a movement to a given specified destination
+	 */
+	virtual void moveTo(const FVector &srcV, const FVector &destV, const FMatrix &orientation);
+
+	virtual void proc10(const FVector &v1, const FVector &v2, const FVector &v3, const FMatrix &m);
+
+	/**
+	 * Update the passed position and orientation matrix
+	 */
+	virtual void updatePosition(CErrorCode &errorCode, FVector &pos, FMatrix &orientation);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_UNMARKED_CAMERA_MOVER_H */





More information about the Scummvm-git-logs mailing list