aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/star_control/star_crosshairs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/star_control/star_crosshairs.cpp')
-rw-r--r--engines/titanic/star_control/star_crosshairs.cpp36
1 files changed, 18 insertions, 18 deletions
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);