aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-05-30 22:23:31 -0400
committerPaul Gilbert2017-05-30 22:23:31 -0400
commitb21e829a9fab7818159539b83cd20f81a6b16465 (patch)
treeacaef1897ef8e355679f40ee71b72c3a94d760ca /engines
parentf698d04008c5342f98d58607d6c3259d42965a5f (diff)
downloadscummvm-rg350-b21e829a9fab7818159539b83cd20f81a6b16465.tar.gz
scummvm-rg350-b21e829a9fab7818159539b83cd20f81a6b16465.tar.bz2
scummvm-rg350-b21e829a9fab7818159539b83cd20f81a6b16465.zip
TITANIC: Renamings and fixes for starfield marker buttons in PET
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/pet_control/pet_control.cpp4
-rw-r--r--engines/titanic/pet_control/pet_control.h2
-rw-r--r--engines/titanic/pet_control/pet_starfield.cpp16
-rw-r--r--engines/titanic/pet_control/pet_starfield.h4
-rw-r--r--engines/titanic/star_control/star_control.cpp12
-rw-r--r--engines/titanic/star_control/star_field.cpp10
-rw-r--r--engines/titanic/star_control/star_field.h7
7 files changed, 29 insertions, 26 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 0388859cb2..402ed22719 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -706,8 +706,8 @@ PassengerClass CPetControl::getMailDestClass(const CRoomFlags &roomFlags) const
return roomFlags.getSuccUBusClass(roomFlags.getSuccUBusRoomName());
}
-void CPetControl::starsSetButtons(int val1, int val2) {
- _starfield.setButtons(val1, val2);
+void CPetControl::starsSetButtons(int matchIndex, bool isMarkerClose) {
+ _starfield.setButtons(matchIndex, isMarkerClose);
if (_currentArea == PET_STARFIELD)
_starfield.makePetDirty();
}
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 18a6d400f6..6e64d8d344 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -585,7 +585,7 @@ public:
/**
* Sets the status buttons for the starfield control
*/
- void starsSetButtons(int val1, int val2);
+ void starsSetButtons(int matchIndex, bool isMarkerClose);
/**
* Sets that the user has the galactic reference material
diff --git a/engines/titanic/pet_control/pet_starfield.cpp b/engines/titanic/pet_control/pet_starfield.cpp
index dd953b592d..874fb5064f 100644
--- a/engines/titanic/pet_control/pet_starfield.cpp
+++ b/engines/titanic/pet_control/pet_starfield.cpp
@@ -187,24 +187,24 @@ void CPetStarfield::drawButton(int offset, int index, CScreenManager *screenMana
_leds[index + offset].draw(screenManager);
}
-void CPetStarfield::setButtons(int val1, int val2) {
+void CPetStarfield::setButtons(int matchIndex, bool isMarkerClose) {
_btnOffsets[0] = 0;
_btnOffsets[1] = 0;
_btnOffsets[2] = 0;
- if (val1 >= 0)
+ if (matchIndex >= 0)
_btnOffsets[0] = 2;
- if (val1 >= 1)
+ if (matchIndex >= 1)
_btnOffsets[1] = 2;
- if (val1 >= 2)
+ if (matchIndex >= 2)
_btnOffsets[2] = 2;
- if (val2) {
- if (val1 == -1)
+ if (isMarkerClose) {
+ if (matchIndex == -1)
_btnOffsets[0] = 1;
- if (val1 == 0)
+ if (matchIndex == 0)
_btnOffsets[1] = 1;
- if (val1 == 1)
+ if (matchIndex == 1)
_btnOffsets[2] = 1;
}
diff --git a/engines/titanic/pet_control/pet_starfield.h b/engines/titanic/pet_control/pet_starfield.h
index ec96fb93ef..01dddfd564 100644
--- a/engines/titanic/pet_control/pet_starfield.h
+++ b/engines/titanic/pet_control/pet_starfield.h
@@ -105,9 +105,9 @@ public:
virtual void save(SimpleFile *file, int indent);
/**
- * Sets the offsets for each of the buttons
+ * Sets the display for the marker buttons
*/
- void setButtons(int val1, int val2);
+ void setButtons(int matchIndex, bool isMarkerClose);
/**
* Sets whether the player has the galactic reference material
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index 06ab3d363a..b58a5408c7 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -136,16 +136,16 @@ void CStarControl::newFrame() {
_petControl = getPetControl();
if (_petControl) {
- int val1 = _starField.getMatchedIndex();
- int val2 = 0;
+ int matchIndex = _starField.getMatchedIndex();
+ bool isClose = false;
if (_starField.getMode() == MODE_STARFIELD) {
- val2 = _starField.get5();
- if ((val1 + 2) == _starField.getMarkerCount())
- val2 = 0;
+ isClose = _starField.isCloseToMarker();
+ if ((matchIndex + 2) != _starField.getMarkerCount())
+ isClose = false;
}
- _petControl->starsSetButtons(val1, val2);
+ _petControl->starsSetButtons(matchIndex, isClose);
}
}
diff --git a/engines/titanic/star_control/star_field.cpp b/engines/titanic/star_control/star_field.cpp
index 486cc50c60..1cfc57631b 100644
--- a/engines/titanic/star_control/star_field.cpp
+++ b/engines/titanic/star_control/star_field.cpp
@@ -28,7 +28,7 @@
namespace Titanic {
CStarField::CStarField() : _points1On(false), _points2On(false), _mode(MODE_STARFIELD),
- _showBox(true), _val5(0), _isSolved(false) {
+ _showBox(true), _closeToMarker(false), _isSolved(false) {
}
void CStarField::load(SimpleFile *file) {
@@ -126,8 +126,8 @@ int CStarField::getMatchedIndex() const {
return _crosshairs._matchIndex;
}
-int CStarField::get5() const {
- return _val5;
+bool CStarField::isCloseToMarker() const {
+ return _closeToMarker;
}
void CStarField::setSolved() {
@@ -170,7 +170,7 @@ void CStarField::drawBox(CSurfaceArea *surfaceArea) {
void CStarField::fn4(CSurfaceArea *surfaceArea, CStarCamera *camera) {
FVector v1, v2, v3;
- _val5 = 0;
+ _closeToMarker = false;
if (_mode == MODE_STARFIELD) {
if (fn5(surfaceArea, camera, v1, v2, v3) > -1.0) {
@@ -206,7 +206,7 @@ double CStarField::fn5(CSurfaceArea *surfaceArea, CStarCamera *camera,
if ((v1._y - pt._y) * (v1._y - pt._y) + incr > 3600.0)
return -1.0;
- _val5 = 1;
+ _closeToMarker = true;
return v1._y - pt._y;
}
diff --git a/engines/titanic/star_control/star_field.h b/engines/titanic/star_control/star_field.h
index 1cca40567b..12af83a6a8 100644
--- a/engines/titanic/star_control/star_field.h
+++ b/engines/titanic/star_control/star_field.h
@@ -43,7 +43,7 @@ private:
bool _points2On;
StarMode _mode;
bool _showBox;
- int _val5;
+ bool _closeToMarker;
bool _isSolved;
private:
/**
@@ -104,7 +104,10 @@ public:
*/
int getMatchedIndex() const;
- int get5() const;
+ /**
+ * Returns true if the center of the starfield viewpoint is close to a marker
+ */
+ bool isCloseToMarker() const;
/**
* Sets the flag that the starfield has been solved