From cd9fe5c219d647bc8d3bc4cab6be29c7f2bc4525 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 20 Aug 2017 14:43:00 -0400 Subject: TITANIC: Further camera and crosshair classes cleanup --- engines/titanic/star_control/star_crosshairs.cpp | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'engines/titanic/star_control/star_crosshairs.cpp') diff --git a/engines/titanic/star_control/star_crosshairs.cpp b/engines/titanic/star_control/star_crosshairs.cpp index 61d11bf950..ec2aa1f409 100644 --- a/engines/titanic/star_control/star_crosshairs.cpp +++ b/engines/titanic/star_control/star_crosshairs.cpp @@ -40,14 +40,15 @@ void CStarCrosshairs::selectStar(int index, CVideoSurface *surface, // a selection addition if not all three stars have been found if (!isSolved()) { // Don't allow the most recent match or the one before - // it to be re-selected (while they are locked/matched) + // it to be re-selected (while they are locked/matched) if (_positions[index] != _entries[_entryIndex]) { - if (_entryIndex == 1) {//2 stars are matched - if (_positions[index] == _entries[_entryIndex-1]) { - return; - } - } - surface->lock(); + if (_entryIndex == 1) { + // 2 stars are matched + if (_positions[index] == _entries[_entryIndex - 1]) + return; + } + + surface->lock(); // Draw crosshairs around the selected star CSurfaceArea surfaceArea(surface); @@ -69,7 +70,7 @@ void CStarCrosshairs::selectStar(int index, CVideoSurface *surface, // So we allow the user to reselect it to remove the selection, or shift // the selection to some other star if (_positions[index] == _entries[_entryIndex]) { - // Player has selected the most recent star + // Player has selected the most recent star // Remove the crosshairs for the previously selected star surface->lock(); CSurfaceArea surfaceArea(surface); @@ -83,16 +84,15 @@ void CStarCrosshairs::selectStar(int index, CVideoSurface *surface, const CBaseStarEntry *starP = starField->getDataPtr(_positions[index]._index1); markers->addStar(starP); } else { - // Player has selected some other star other than the most recent - // Remove/Add it if it is not one of the other star(s) already matched - - // Check that it is not a previously star and don't remove it if it is - for (int i=0;i<_entryIndex;i++) { - if (_positions[index] == _entries[i]) { - return; - } - } - + // Player has selected some other star other than the most recent + // Remove/Add it if it is not one of the other star(s) already matched + + // Check that it is not a previously star and don't remove it if it is + for (int i = 0; i < _entryIndex; ++i) { + if (_positions[index] == _entries[i]) + return; + } + // Erase the prior selection and draw the new one surface->lock(); CSurfaceArea surfaceArea(surface); -- cgit v1.2.3