From 16d21cd0ff7fa200664fb75b915da015cccc8a48 Mon Sep 17 00:00:00 2001
From: Paul Gilbert
Date: Sat, 25 Feb 2017 15:03:16 -0500
Subject: TITANIC: Fix CStarPoints2 initialization

---
 engines/titanic/star_control/star_points2.cpp | 9 +++++----
 engines/titanic/star_control/star_points2.h   | 9 ++-------
 2 files changed, 7 insertions(+), 11 deletions(-)

(limited to 'engines')

diff --git a/engines/titanic/star_control/star_points2.cpp b/engines/titanic/star_control/star_points2.cpp
index 97047181fd..287a46eaa7 100644
--- a/engines/titanic/star_control/star_points2.cpp
+++ b/engines/titanic/star_control/star_points2.cpp
@@ -42,14 +42,15 @@ bool CStarPoints2::initialize() {
 		RootEntry &rootEntry = _data[rootCtr];
 		rootEntry.resize(count * 2);
 		for (int idx = 0; idx < count * 2; ++idx) {
-			DataEntry &entry = rootEntry[idx];
+			FVector &entry = rootEntry[idx];
 			v1 = stream->readSint32LE();
 			v2 = stream->readSint32LE();
 			v1 *= 0.015 * FACTOR;
 			v2 *= 0.0099999998 * FACTOR;
-			entry._v1 = static_cast<int>(cos(v1) * 3000000.0 * cos(v2));
-			entry._v2 = static_cast<int>(sin(v1) * 3000000.0 * cos(v2));
-			entry._v3 = static_cast<int>(sin(v2) * 3000000.0);
+
+			entry._x = cos(v1) * 3000000.0 * cos(v2);
+			entry._y = sin(v1) * 3000000.0 * cos(v2);
+			entry._z = sin(v2) * 3000000.0;
 		}
 	}
 
diff --git a/engines/titanic/star_control/star_points2.h b/engines/titanic/star_control/star_points2.h
index 31bded4069..df302f690b 100644
--- a/engines/titanic/star_control/star_points2.h
+++ b/engines/titanic/star_control/star_points2.h
@@ -24,17 +24,12 @@
 #define TITANIC_STAR_POINTS2_H
 
 #include "common/array.h"
+#include "titanic/star_control/fvector.h"
 
 namespace Titanic {
 
 class CStarPoints2 {
-	struct DataEntry {
-		int _v1;
-		int _v2;
-		int _v3;
-	};
-
-	class RootEntry : public Common::Array<DataEntry> {
+	class RootEntry : public Common::Array<FVector> {
 	public:
 		int _field0;
 		RootEntry() : _field0(0) {}
-- 
cgit v1.2.3