diff options
author | Paul Gilbert | 2017-08-20 14:43:00 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-08-20 14:43:00 -0400 |
commit | cd9fe5c219d647bc8d3bc4cab6be29c7f2bc4525 (patch) | |
tree | 0fae8a97942eda2c6afab6bc1e98b80f86aa21b3 /engines/titanic/star_control/star_crosshairs.cpp | |
parent | a32a29a80e8dfc44c5da8a2f872914710a4009ae (diff) | |
download | scummvm-rg350-cd9fe5c219d647bc8d3bc4cab6be29c7f2bc4525.tar.gz scummvm-rg350-cd9fe5c219d647bc8d3bc4cab6be29c7f2bc4525.tar.bz2 scummvm-rg350-cd9fe5c219d647bc8d3bc4cab6be29c7f2bc4525.zip |
TITANIC: Further camera and crosshair classes cleanup
Diffstat (limited to 'engines/titanic/star_control/star_crosshairs.cpp')
-rw-r--r-- | engines/titanic/star_control/star_crosshairs.cpp | 36 |
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); |