diff options
-rw-r--r-- | engines/titanic/star_control/photo_crosshairs.h | 8 | ||||
-rw-r--r-- | engines/titanic/star_control/star_field.cpp | 4 |
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); |