aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/star_control/camera_auto_mover.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2017-06-07 21:50:03 -0400
committerPaul Gilbert2017-06-07 21:50:03 -0400
commitc105be916ed2ee5cb0207ecfa69703ea89a61655 (patch)
treea143c9feaf441f77ebc0fba999fa9914692b015c /engines/titanic/star_control/camera_auto_mover.cpp
parent0331fab01b021160fd8aea6d7ef491c42f8a869d (diff)
downloadscummvm-rg350-c105be916ed2ee5cb0207ecfa69703ea89a61655.tar.gz
scummvm-rg350-c105be916ed2ee5cb0207ecfa69703ea89a61655.tar.bz2
scummvm-rg350-c105be916ed2ee5cb0207ecfa69703ea89a61655.zip
TITANIC: Renamings for automatic camera mover classes
Diffstat (limited to 'engines/titanic/star_control/camera_auto_mover.cpp')
-rw-r--r--engines/titanic/star_control/camera_auto_mover.cpp106
1 files changed, 106 insertions, 0 deletions
diff --git a/engines/titanic/star_control/camera_auto_mover.cpp b/engines/titanic/star_control/camera_auto_mover.cpp
new file mode 100644
index 0000000000..45e5a9e03e
--- /dev/null
+++ b/engines/titanic/star_control/camera_auto_mover.cpp
@@ -0,0 +1,106 @@
+/* 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/camera_auto_mover.h"
+#include "common/textconsole.h"
+
+namespace Titanic {
+
+CCameraAutoMover::CCameraAutoMover() : _srcPos(0.0, 1000000.0, 0.0) {
+ _field4 = 0;
+ _active = false;
+ _distance = 0.0;
+ _field34 = false;
+ _field38 = 0.0;
+ _field3C = 0;
+ _field40 = 0;
+ _field44 = 0;
+ _field48 = 0;
+ _field4C = 0;
+ _field54 = 0;
+ _transitionPercent = 0.0;
+ _transitionPercentInc = 0.0;
+}
+
+void CCameraAutoMover::proc2(const FVector &oldPos, const FVector &newPos,
+ const FMatrix &oldOrientation, const FMatrix &newOrientation) {
+ _srcPos = oldPos;
+ _destPos = newPos;
+ _posDelta = _destPos - _srcPos;
+ _distance = _posDelta.normalize();
+
+ _active = false;
+ _field34 = false;
+ _transitionPercent = 1.0;
+ _field40 = -1;
+ _field44 = -1;
+ _field48 = -1;
+ _field4C = 0;
+}
+
+void CCameraAutoMover::proc3(const FMatrix &srcOrient, const FMatrix &destOrient) {
+ _srcPos.clear();
+ _destPos.clear();
+ _transitionPercent = 1.0;
+ _distance = 0.0;
+ _active = false;
+ _field34 = false;
+}
+
+void CCameraAutoMover::setPath(const FVector &srcV, const FVector &destV, const FMatrix &orientation) {
+ _srcPos = srcV;
+ _destPos = destV;
+ _posDelta = _destPos - _srcPos;
+ _distance = _posDelta.normalize();
+
+ _active = false;
+ _field34 = false;
+ _field40 = -1;
+ _field44 = -1;
+ _field48 = -1;
+ _field4C = -1;
+ _transitionPercent = 1.0;
+}
+
+void CCameraAutoMover::proc6(int val1, int val2, float val) {
+ _field44 = val1;
+ _field4C = val1 + 62;
+ _field38 = val / (double)(val1 + val2 * 2);
+ _field40 = 31;
+ _field48 = 31;
+ _field3C = (double)val2 * _field38;
+
+ // Calculate the speeds for a graduated movement between stars
+ double base = 0.0, total = 0.0;
+ _speeds.resize(32);
+ for (int idx = 31; idx >= 0; --idx) {
+ _speeds[idx] = pow(base, 4.0);
+ total += _speeds[idx];
+ base += 0.03125;
+ }
+
+ for (int idx = 0; idx < 32; ++idx) {
+ _speeds[idx] = _speeds[idx] * _field3C / total;
+ }
+}
+
+} // End of namespace Titanic