diff options
author | Paul Gilbert | 2017-02-20 21:15:00 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-02-20 21:15:00 -0500 |
commit | 90e4e8a06403dc54b862cc08676718a29fdf6f94 (patch) | |
tree | b5709060fcc2c6f0cd03e3f1bfe544aae4438b5b /engines/titanic/star_control | |
parent | e878332cc4f0581343b794d8a20b396b726e3543 (diff) | |
download | scummvm-rg350-90e4e8a06403dc54b862cc08676718a29fdf6f94.tar.gz scummvm-rg350-90e4e8a06403dc54b862cc08676718a29fdf6f94.tar.bz2 scummvm-rg350-90e4e8a06403dc54b862cc08676718a29fdf6f94.zip |
TITANIC: Initial cleanup & renamings for bridge controls
Diffstat (limited to 'engines/titanic/star_control')
-rw-r--r-- | engines/titanic/star_control/star_control.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control.h | 6 | ||||
-rw-r--r-- | engines/titanic/star_control/star_field.cpp | 14 | ||||
-rw-r--r-- | engines/titanic/star_control/star_field.h | 14 |
4 files changed, 25 insertions, 13 deletions
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp index dcb004231a..a1c4f33ad2 100644 --- a/engines/titanic/star_control/star_control.cpp +++ b/engines/titanic/star_control/star_control.cpp @@ -133,8 +133,8 @@ void CStarControl::fn1(int action) { // TODO } -bool CStarControl::fn4() { - return _starField.get6(); +bool CStarControl::isSolved() const { + return _starField.isSolved(); } bool CStarControl::canSetStarDestination() const { diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h index bf964b7cfa..0ee7c6530e 100644 --- a/engines/titanic/star_control/star_control.h +++ b/engines/titanic/star_control/star_control.h @@ -69,7 +69,11 @@ public: virtual void draw(CScreenManager *screenManager); void fn1(int action); - bool fn4(); + + /** + * Returns true if the starfield puzzle has been solved + */ + bool isSolved() const; /** * Returns true if a star destination can be set diff --git a/engines/titanic/star_control/star_field.cpp b/engines/titanic/star_control/star_field.cpp index 0dbc5fd700..7502f84d3d 100644 --- a/engines/titanic/star_control/star_field.cpp +++ b/engines/titanic/star_control/star_field.cpp @@ -26,7 +26,7 @@ namespace Titanic { CStarField::CStarField() : _val1(0), _val2(0), _val3(0), _val4(true), - _val5(0), _val6(false) { + _val5(0), _isSolved(false) { } void CStarField::load(SimpleFile *file) { @@ -36,7 +36,7 @@ void CStarField::load(SimpleFile *file) { _val2 = file->readNumber(); _val3 = file->readNumber(); _val4 = file->readNumber(); - _val6 = file->readNumber(); + _isSolved = file->readNumber(); } void CStarField::save(SimpleFile *file, int indent) { @@ -46,7 +46,7 @@ void CStarField::save(SimpleFile *file, int indent) { file->writeNumberLine(_val2, indent); file->writeNumberLine(_val3, indent); file->writeNumberLine(_val4, indent); - file->writeNumberLine(_val6, indent); + file->writeNumberLine(_isSolved, indent); } bool CStarField::initDocument() { @@ -119,12 +119,12 @@ int CStarField::get5() const { return _val5; } -void CStarField::update6() { - _val6 = _sub8._field8 == 2; +void CStarField::setSolved() { + _isSolved = _sub8._field8 == 2; } -int CStarField::get6() const { - return _val6; +bool CStarField::isSolved() const { + return _isSolved; } } // End of namespace Titanic diff --git a/engines/titanic/star_control/star_field.h b/engines/titanic/star_control/star_field.h index 91cefbb457..41f01894f4 100644 --- a/engines/titanic/star_control/star_field.h +++ b/engines/titanic/star_control/star_field.h @@ -44,7 +44,7 @@ private: int _val3; bool _val4; int _val5; - bool _val6; + bool _isSolved; public: CStarField(); @@ -77,8 +77,16 @@ public: bool set4(bool val); int get88() const; int get5() const; - void update6(); - int get6() const; + + /** + * Sets the flag that the starfield has been solved + */ + void setSolved(); + + /** + * Returns true if the starfield puzzle has been solved + */ + bool isSolved() const; }; } // End of namespace Titanic |