aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-03-05 15:09:57 -0500
committerPaul Gilbert2017-03-05 15:09:57 -0500
commit15c0cb425899803c3ba884413303a817ed5ed5a5 (patch)
tree752ed7623d9e01a0e4ded74ee0b7c60444d978b3
parent7e418108f63fdccaac097380d8375c44205fe755 (diff)
downloadscummvm-rg350-15c0cb425899803c3ba884413303a817ed5ed5a5.tar.gz
scummvm-rg350-15c0cb425899803c3ba884413303a817ed5ed5a5.tar.bz2
scummvm-rg350-15c0cb425899803c3ba884413303a817ed5ed5a5.zip
TITANIC: Added remainder of CStarView class
-rw-r--r--engines/titanic/star_control/fvector.h12
-rw-r--r--engines/titanic/star_control/star_control_sub12.cpp15
-rw-r--r--engines/titanic/star_control/star_control_sub12.h4
-rw-r--r--engines/titanic/star_control/star_control_sub5.cpp7
-rw-r--r--engines/titanic/star_control/star_control_sub5.h8
-rw-r--r--engines/titanic/star_control/star_field.h6
-rw-r--r--engines/titanic/star_control/star_view.cpp37
7 files changed, 77 insertions, 12 deletions
diff --git a/engines/titanic/star_control/fvector.h b/engines/titanic/star_control/fvector.h
index a54e94dda7..b85cbb1e65 100644
--- a/engines/titanic/star_control/fvector.h
+++ b/engines/titanic/star_control/fvector.h
@@ -23,6 +23,8 @@
#ifndef TITANIC_FVECTOR_H
#define TITANIC_FVECTOR_H
+#include "titanic/star_control/fpoint.h"
+
namespace Titanic {
class CStarControlSub6;
@@ -83,6 +85,16 @@ public:
_y -= delta._y;
_z -= delta._z;
}
+
+ void operator+=(const FPoint &delta) {
+ _x += delta._x;
+ _y += delta._y;
+ }
+
+ void operator-=(const FPoint &delta) {
+ _x -= delta._x;
+ _y -= delta._y;
+ }
};
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp
index ff0edb5cc7..79061301d3 100644
--- a/engines/titanic/star_control/star_control_sub12.cpp
+++ b/engines/titanic/star_control/star_control_sub12.cpp
@@ -269,7 +269,8 @@ bool CStarControlSub12::setupHandler(const CStar20Data *src) {
assert(!_handlerP);
_handlerP = handler;
return true;
- } else {
+ }
+ else {
return false;
}
}
@@ -281,4 +282,16 @@ void CStarControlSub12::deleteHandler() {
}
}
+void CStarControlSub12::fn1(CStarControlSub13 *sub13, const FVector &v) {
+ // TODO
+}
+
+void CStarControlSub12::fn2(FVector v1, FVector v2, FVector v3) {
+ // TODO
+}
+
+void CStarControlSub12::fn3(CStarControlSub13 *sub13, const FVector &v) {
+ // TODO
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index 2e5d83b6d4..5fac6bf11a 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -121,6 +121,10 @@ public:
bool is108() const { return _field108; }
void set108() { _field108 = true; }
void reset108() { _field108 = false; }
+
+ void fn1(CStarControlSub13 *sub13, const FVector &v);
+ void fn2(FVector v1, FVector v2, FVector v3);
+ void fn3(CStarControlSub13 *sub13, const FVector &v);
};
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub5.cpp b/engines/titanic/star_control/star_control_sub5.cpp
index 16aff46096..731d81f246 100644
--- a/engines/titanic/star_control/star_control_sub5.cpp
+++ b/engines/titanic/star_control/star_control_sub5.cpp
@@ -25,8 +25,7 @@
namespace Titanic {
-CStarControlSub5::CStarControlSub5() :
- _field4(1) {
+CStarControlSub5::CStarControlSub5() : _flag(true) {
}
bool CStarControlSub5::setup() {
@@ -43,4 +42,8 @@ void CStarControlSub5::proc3(CErrorCode *errorCode) {
// TODO
}
+void CStarControlSub5::fn1() {
+ _flag = !_flag;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub5.h b/engines/titanic/star_control/star_control_sub5.h
index 4e1a5be5d3..4927a144cd 100644
--- a/engines/titanic/star_control/star_control_sub5.h
+++ b/engines/titanic/star_control/star_control_sub5.h
@@ -39,7 +39,7 @@ class CStarControlSub5 {
int _fieldC;
};
private:
- int _field4;
+ bool _flag;
CStarControlSub6 _sub1, _sub2;
#if 0
SubEntry _array[5];
@@ -56,8 +56,10 @@ public:
CSurfaceArea *surfaceArea, CStarControlSub12 *sub12);
virtual void proc3(CErrorCode *errorCode);
- int get4() const { return _field4; }
- void set4(int val) { _field4 = val; }
+ bool get4() const { return _flag; }
+ void set4(bool val) { _flag = val; }
+
+ void fn1();
};
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_field.h b/engines/titanic/star_control/star_field.h
index 34f11719d3..6046ce2486 100644
--- a/engines/titanic/star_control/star_field.h
+++ b/engines/titanic/star_control/star_field.h
@@ -48,9 +48,6 @@ private:
private:
void fn3(CSurfaceArea *surfaceArea);
void fn4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12);
- double fn5(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12,
- FVector &v1, FVector &v2, FVector &v3);
-
public:
CStarField();
@@ -108,9 +105,12 @@ public:
}
void fn1(CErrorCode *errorCode);
+ double fn5(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12,
+ FVector &v1, FVector &v2, FVector &v3);
void fn6(CVideoSurface *surface, CStarControlSub12 *sub12);
void fn7();
void fn8(CVideoSurface *surface);
+ void fn9() { _sub5.fn1(); }
/**
* Called when the starfield is clicked
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index 836de0f5a4..23e9325a64 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -339,11 +339,13 @@ void CStarView::toggleMode() {
}
void CStarView::fn11() {
- // TODO
+ if (_starField)
+ _starField->fn9();
}
void CStarView::fn12() {
- // TODO
+ if (_starField)
+ _starField->toggle4();
}
void CStarView::fn13() {
@@ -373,7 +375,36 @@ void CStarView::setHasReference() {
}
void CStarView::fn16() {
- // TODO
+ if (_starField && !_showingPhoto) {
+ CSurfaceArea surfaceArea(_videoSurface);
+ FVector v1, v2, v3;
+ double val = _starField->fn5(&surfaceArea, &_sub12, v1, v2, v3);
+
+ if (val > -1.0) {
+ v1 += surfaceArea._centroid;
+ v3 += surfaceArea._centroid;
+
+ switch (_starField->get88()) {
+ case -1:
+ _sub12.fn2(v1, v2, v3);
+ _starField->fn7();
+ break;
+
+ case 0:
+ _sub12.fn3(&_sub13, v2);
+ _starField->fn7();
+ break;
+
+ case 1:
+ _sub12.fn1(&_sub13, v2);
+ _starField->fn7();
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
}
void CStarView::fn17() {