aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-03-25 21:25:20 -0400
committerPaul Gilbert2017-03-25 21:25:20 -0400
commit538e6ffc8f418e736d235221ae7f31bc832611da (patch)
treedea680e0f55ae5654539a51407c77790263b5cee
parent843540b334d49a606e65e7e92997c3c469cf6ae0 (diff)
downloadscummvm-rg350-538e6ffc8f418e736d235221ae7f31bc832611da.tar.gz
scummvm-rg350-538e6ffc8f418e736d235221ae7f31bc832611da.tar.bz2
scummvm-rg350-538e6ffc8f418e736d235221ae7f31bc832611da.zip
TITANIC: Fixes to CStarView class
-rw-r--r--engines/titanic/star_control/star_view.cpp44
-rw-r--r--engines/titanic/star_control/star_view.h2
2 files changed, 7 insertions, 39 deletions
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index 6ed5f3b2f3..a9b6cdef72 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -282,7 +282,7 @@ void CStarView::fn3(bool fadeIn) {
void CStarView::fn4() {
FVector v1, v2;
- randomizeVectors2(v1, v2);
+ randomizeVectors1(v1, v2);
_sub12.setPosition(v1);
_sub12.proc5(v2);
}
@@ -299,7 +299,7 @@ void CStarView::fn7() {
const CBaseStarEntry *star = _starField->getRandomStar();
if (star) {
FVector v1, v2;
- randomizeVectors3(v1, v2);
+ randomizeVectors1(v1, v2);
v2 += star->_position;
_sub12.setPosition(v2);
_sub12.proc5(v1);
@@ -310,7 +310,7 @@ void CStarView::fn19(int index) {
const CBaseStarEntry *star = _starField->getStar(index);
if (star) {
FVector v1, v2;
- randomizeVectors3(v1, v2);
+ randomizeVectors1(v1, v2);
v1 += star->_position;
_sub12.setPosition(v1);
_sub12.proc5(v2);
@@ -362,7 +362,7 @@ void CStarView::fn14() {
void CStarView::setHasReference() {
FVector v1, v2;
- randomizeVectors1(v1, v2);
+ randomizeVectors2(v1, v2);
_sub13.setPosition(v1);
_sub13.fn11(v2);
@@ -438,53 +438,23 @@ void CStarView::fn18(CStarControlSub12 *sub12) {
}
void CStarView::randomizeVectors1(FVector &v1, FVector &v2) {
- v1._x = g_vm->getRandomFloat() * -4096.0 - 3072.0;
- v1._y = g_vm->getRandomFloat() * -4096.0 - 3072.0;
- v1._z = g_vm->getRandomFloat() * -4096.0 - 3072.0;
-
- double vx = g_vm->getRandomFloat() * 8192.0;
- double vy = g_vm->getRandomFloat() * 1024.0;
- vx -= v1._x;
- vy -= v1._y;
-
- v2._x = vx;
- v2._y = vy;
- v2._z = -v1._z;
- v2.normalize();
-}
-
-void CStarView::randomizeVectors2(FVector &v1, FVector &v2) {
- v1._x = 3072.0 - g_vm->getRandomFloat() * -4096.0;
- v1._y = 3072.0 - g_vm->getRandomFloat() * -4096.0;
- v1._z = 3072.0 - g_vm->getRandomFloat() * -4096.0;
-
- // TODO: Doublecheck
- v2._x = -v1._x;
- v2._y = -v1._y;
- v2._z = -v1._z;
- v2.normalize();
-}
-
-void CStarView::randomizeVectors3(FVector &v1, FVector &v2) {
v1._x = 3072.0 - g_vm->getRandomFloat() * -4096.0;
v1._y = 3072.0 - g_vm->getRandomFloat() * -4096.0;
v1._z = 3072.0 - g_vm->getRandomFloat() * -4096.0;
- // TODO: Doublecheck
v2._x = -v1._x;
v2._y = -v1._y;
v2._z = -v1._z;
v2.normalize();
}
-void CStarView::randomizeVectors4(FVector &v1, FVector &v2) {
+void CStarView::randomizeVectors2(FVector &v1, FVector &v2) {
v1._x = 3072.0 - g_vm->getRandomFloat() * -4096.0;
v1._y = 3072.0 - g_vm->getRandomFloat() * -4096.0;
v1._z = 3072.0 - g_vm->getRandomFloat() * -4096.0;
- // TODO: Doublecheck
- v2._x = -v1._x;
- v2._y = -v1._y;
+ v2._x = g_vm->getRandomFloat() * 8192.0 - v1._x;
+ v2._y = g_vm->getRandomFloat() * 1024.0 - v1._y;
v2._z = -v1._z;
v2.normalize();
}
diff --git a/engines/titanic/star_control/star_view.h b/engines/titanic/star_control/star_view.h
index 0e271ec1ce..9a9e0692c7 100644
--- a/engines/titanic/star_control/star_view.h
+++ b/engines/titanic/star_control/star_view.h
@@ -59,8 +59,6 @@ private:
void randomizeVectors1(FVector &v1, FVector &v2);
void randomizeVectors2(FVector &v1, FVector &v2);
- void randomizeVectors3(FVector &v1, FVector &v2);
- void randomizeVectors4(FVector &v1, FVector &v2);
/**
* Handles resizing the surface