aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2017-05-29 00:03:22 -0400
committerPaul Gilbert2017-05-29 00:03:22 -0400
commit496839d766a0c3d959220193a2183198f0210cec (patch)
treeeb4a28592f1e917ee4c045e3e64177fa584d2ec8 /engines/titanic
parent4358712c282aac909776a90118f8c114632697e2 (diff)
downloadscummvm-rg350-496839d766a0c3d959220193a2183198f0210cec.tar.gz
scummvm-rg350-496839d766a0c3d959220193a2183198f0210cec.tar.bz2
scummvm-rg350-496839d766a0c3d959220193a2183198f0210cec.zip
TITANIC: Merge incorrectly duplicated field in CPhotoCrosshairs
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/star_control/photo_crosshairs.h8
-rw-r--r--engines/titanic/star_control/star_field.cpp4
2 files changed, 8 insertions, 4 deletions
diff --git a/engines/titanic/star_control/photo_crosshairs.h b/engines/titanic/star_control/photo_crosshairs.h
index 82dade2e71..6462aeead1 100644
--- a/engines/titanic/star_control/photo_crosshairs.h
+++ b/engines/titanic/star_control/photo_crosshairs.h
@@ -40,7 +40,6 @@ class CStarCamera;
class CPhotoCrosshairs {
private:
Common::Array<CStarPosition> _positions;
- int _entryIndex;
CStarPosition _entries[3];
private:
/**
@@ -54,7 +53,7 @@ private:
void clear();
public:
int _field8;
- int _fieldC;
+ int _entryIndex;
public:
CPhotoCrosshairs();
~CPhotoCrosshairs() { clear(); }
@@ -69,6 +68,11 @@ public:
*/
void save(SimpleFile *file, int indent) {}
+ /**
+ * Returns true if there are no crosshairs present
+ */
+ bool isEmpty() const { return _entryIndex == -1; }
+
void selectStar(int starNum, CVideoSurface *surface, CStarField *starField,
CStarMarkers *markers);
diff --git a/engines/titanic/star_control/star_field.cpp b/engines/titanic/star_control/star_field.cpp
index a8949b13e2..1db4c44e85 100644
--- a/engines/titanic/star_control/star_field.cpp
+++ b/engines/titanic/star_control/star_field.cpp
@@ -183,10 +183,10 @@ void CStarField::fn4(CSurfaceArea *surfaceArea, CStarCamera *camera) {
double CStarField::fn5(CSurfaceArea *surfaceArea, CStarCamera *camera,
FVector &v1, FVector &v2, FVector &v3) {
- if (_crosshairs._fieldC < 0)
+ if (_crosshairs.isEmpty())
return -1.0;
- const CBaseStarEntry *dataP = _markers.getDataPtr(_crosshairs._fieldC);
+ const CBaseStarEntry *dataP = _markers.getDataPtr(_crosshairs._entryIndex);
v2 = dataP->_position;
FVector tv = camera->proc29(2, v2);