diff options
author | Paul Gilbert | 2017-05-28 22:25:13 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-05-28 22:25:13 -0400 |
commit | 77703ed31652e6ebacc377560a79ae02d23262b0 (patch) | |
tree | 472da3b088eb112dc6e4ac209a19d19f587012fa | |
parent | a4fca682172c4b9be36a0d54a2204157bb249d2f (diff) | |
download | scummvm-rg350-77703ed31652e6ebacc377560a79ae02d23262b0.tar.gz scummvm-rg350-77703ed31652e6ebacc377560a79ae02d23262b0.tar.bz2 scummvm-rg350-77703ed31652e6ebacc377560a79ae02d23262b0.zip |
TITANIC: Renamed CStarControlSub7 to CStarMarkers
-rw-r--r-- | engines/titanic/module.mk | 2 | ||||
-rw-r--r-- | engines/titanic/star_control/photo_crosshairs.cpp | 24 | ||||
-rw-r--r-- | engines/titanic/star_control/photo_crosshairs.h | 8 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/star_control/star_field.cpp | 12 | ||||
-rw-r--r-- | engines/titanic/star_control/star_field.h | 11 | ||||
-rw-r--r-- | engines/titanic/star_control/star_markers.cpp (renamed from engines/titanic/star_control/star_control_sub7.cpp) | 6 | ||||
-rw-r--r-- | engines/titanic/star_control/star_markers.h (renamed from engines/titanic/star_control/star_control_sub7.h) | 10 |
8 files changed, 39 insertions, 36 deletions
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index c90fb91308..dc6b9b7f5f 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -447,13 +447,13 @@ MODULE_OBJS := \ star_control/star_camera.o \ star_control/star_closeup.o \ star_control/star_control_sub2.o \ - star_control/star_control_sub7.o \ star_control/star_control_sub21.o \ star_control/star_control_sub22.o \ star_control/star_control_sub23.o \ star_control/star_control_sub24.o \ star_control/star_control_sub27.o \ star_control/star_field.o \ + star_control/star_markers.o \ star_control/star_points1.o \ star_control/star_points2.o \ star_control/star_ref.o \ diff --git a/engines/titanic/star_control/photo_crosshairs.cpp b/engines/titanic/star_control/photo_crosshairs.cpp index 061bd358fa..b28164eaa2 100644 --- a/engines/titanic/star_control/photo_crosshairs.cpp +++ b/engines/titanic/star_control/photo_crosshairs.cpp @@ -21,7 +21,7 @@ */ #include "titanic/star_control/photo_crosshairs.h" -#include "titanic/star_control/star_control_sub7.h" +#include "titanic/star_control/star_markers.h" #include "titanic/star_control/star_camera.h" #include "titanic/star_control/star_field.h" #include "titanic/star_control/star_ref.h" @@ -32,7 +32,7 @@ CPhotoCrosshairs::CPhotoCrosshairs() : _field8(-1), _entryIndex(-1) { } void CPhotoCrosshairs::selectStar(int index, CVideoSurface *surface, - CStarField *starField, CStarControlSub7 *sub7) { + CStarField *starField, CStarMarkers *markers) { if (_entryIndex >= 0) { if (_entryIndex == _field8) { if (_field8 != 2) { @@ -48,7 +48,7 @@ void CPhotoCrosshairs::selectStar(int index, CVideoSurface *surface, newP = _positions[index]; const CBaseStarEntry *starP = starField->getDataPtr(_positions[index]._index1); - sub7->addStar(starP); + markers->addStar(starP); } } } else if (_entryIndex == _field8 + 1) { @@ -60,7 +60,7 @@ void CPhotoCrosshairs::selectStar(int index, CVideoSurface *surface, --_entryIndex; const CBaseStarEntry *starP = starField->getDataPtr(_positions[index]._index1); - sub7->addStar(starP); + markers->addStar(starP); } else { surface->lock(); CSurfaceArea surfaceArea(surface); @@ -70,9 +70,9 @@ void CPhotoCrosshairs::selectStar(int index, CVideoSurface *surface, const CBaseStarEntry *starP; starP = starField->getDataPtr(_positions[_entryIndex]._index1); - sub7->addStar(starP); + markers->addStar(starP); starP = starField->getDataPtr(_positions[index]._index1); - sub7->addStar(starP); + markers->addStar(starP); CStarPosition &newP = _positions[_entryIndex + 1]; newP = _positions[index]; @@ -89,7 +89,7 @@ void CPhotoCrosshairs::selectStar(int index, CVideoSurface *surface, newP = _positions[index]; const CBaseStarEntry *starP = starField->getDataPtr(_positions[index]._index1); - sub7->addStar(starP); + markers->addStar(starP); } } @@ -107,16 +107,16 @@ bool CPhotoCrosshairs::fn1(CStarField *starField, CSurfaceArea *surfaceArea, CSt } } -void CPhotoCrosshairs::fn2(CVideoSurface *surface, CStarField *starField, CStarControlSub7 *sub7) { +void CPhotoCrosshairs::fn2(CVideoSurface *surface, CStarField *starField, CStarMarkers *markers) { if (_field8 <= -1) { if (_entryIndex > -1) { - fn5(_entryIndex, surface, starField, sub7); + fn5(_entryIndex, surface, starField, markers); --_entryIndex; } } else { --_field8; if (_entryIndex - _field8 > 1) { - fn5(_entryIndex, surface, starField, sub7); + fn5(_entryIndex, surface, starField, markers); --_entryIndex; } } @@ -189,14 +189,14 @@ void CPhotoCrosshairs::fn4(int index, CSurfaceArea *surfaceArea) { } } -void CPhotoCrosshairs::fn5(int index, CVideoSurface *surface, CStarField *starField, CStarControlSub7 *sub7) { +void CPhotoCrosshairs::fn5(int index, CVideoSurface *surface, CStarField *starField, CStarMarkers *markers) { surface->lock(); CSurfaceArea surfaceArea(surface); fn7(_positions[index + 1], &surfaceArea); surface->unlock(); const CBaseStarEntry *starP = starField->getDataPtr(_positions[index + 1]._index1); - sub7->addStar(starP); + markers->addStar(starP); } void CPhotoCrosshairs::fn6(CSurfaceArea *surfaceArea) { diff --git a/engines/titanic/star_control/photo_crosshairs.h b/engines/titanic/star_control/photo_crosshairs.h index 469c425006..82dade2e71 100644 --- a/engines/titanic/star_control/photo_crosshairs.h +++ b/engines/titanic/star_control/photo_crosshairs.h @@ -34,7 +34,7 @@ namespace Titanic { class CStarField; -class CStarControlSub7; +class CStarMarkers; class CStarCamera; class CPhotoCrosshairs { @@ -70,15 +70,15 @@ public: void save(SimpleFile *file, int indent) {} void selectStar(int starNum, CVideoSurface *surface, CStarField *starField, - CStarControlSub7 *sub7); + CStarMarkers *markers); void draw(CSurfaceArea *surfaceArea); bool fn1(CStarField *starField, CSurfaceArea *surfaceArea, CStarCamera *camera); - void fn2(CVideoSurface *surface, CStarField *starField, CStarControlSub7 *sub7); + void fn2(CVideoSurface *surface, CStarField *starField, CStarMarkers *markers); void fn3(); void fn4(int index, CSurfaceArea *surfaceArea); - void fn5(int index, CVideoSurface *surface, CStarField *starField, CStarControlSub7 *sub7); + void fn5(int index, CVideoSurface *surface, CStarField *starField, CStarMarkers *markers); void fn6(CSurfaceArea *surfaceArea); void fn7(const FPoint &pt, CSurfaceArea *surfaceArea); FPoint getPosition() const; diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp index bce12efd69..b836ed236b 100644 --- a/engines/titanic/star_control/star_control.cpp +++ b/engines/titanic/star_control/star_control.cpp @@ -141,7 +141,7 @@ void CStarControl::newFrame() { if (_starField.getMode() == MODE_STARFIELD) { val2 = _starField.get5(); - if ((val1 + 2) == _starField.get7Count()) + if ((val1 + 2) == _starField.getMarkerCount()) val2 = 0; } diff --git a/engines/titanic/star_control/star_field.cpp b/engines/titanic/star_control/star_field.cpp index 54ad3f6b20..a8949b13e2 100644 --- a/engines/titanic/star_control/star_field.cpp +++ b/engines/titanic/star_control/star_field.cpp @@ -32,7 +32,7 @@ CStarField::CStarField() : _points1On(false), _points2On(false), _mode(MODE_STAR } void CStarField::load(SimpleFile *file) { - _sub7.load(file); + _markers.load(file); _crosshairs.load(file); _points1On = file->readNumber(); _points2On = file->readNumber(); @@ -42,7 +42,7 @@ void CStarField::load(SimpleFile *file) { } void CStarField::save(SimpleFile *file, int indent) { - _sub7.save(file, indent); + _markers.save(file, indent); _crosshairs.save(file, indent); file->writeNumberLine(_points1On, indent); file->writeNumberLine(_points2On, indent); @@ -69,7 +69,7 @@ void CStarField::render(CVideoSurface *surface, CStarCamera *camera) { if (_showCrosshairs) drawCrosshairs(&surfaceArea); - _sub7.draw(&surfaceArea, camera, nullptr); + _markers.draw(&surfaceArea, camera, nullptr); _crosshairs.draw(&surfaceArea); if (_points2On) @@ -186,7 +186,7 @@ double CStarField::fn5(CSurfaceArea *surfaceArea, CStarCamera *camera, if (_crosshairs._fieldC < 0) return -1.0; - const CBaseStarEntry *dataP = _sub7.getDataPtr(_crosshairs._fieldC); + const CBaseStarEntry *dataP = _markers.getDataPtr(_crosshairs._fieldC); v2 = dataP->_position; FVector tv = camera->proc29(2, v2); @@ -221,7 +221,7 @@ void CStarField::fn7() { } void CStarField::fn8(CVideoSurface *surface) { - _crosshairs.fn2(surface, this, &_sub7); + _crosshairs.fn2(surface, this, &_markers); setSolved(); } @@ -233,7 +233,7 @@ bool CStarField::mouseButtonDown(CVideoSurface *surface, CStarCamera *camera, } else { int starNum = _crosshairs.indexOf(pt); if (starNum >= 0) { - _crosshairs.selectStar(starNum, surface, this, &_sub7); + _crosshairs.selectStar(starNum, surface, this, &_markers); return true; } diff --git a/engines/titanic/star_control/star_field.h b/engines/titanic/star_control/star_field.h index aed5cec1ae..489e24c45a 100644 --- a/engines/titanic/star_control/star_field.h +++ b/engines/titanic/star_control/star_field.h @@ -25,7 +25,7 @@ #include "titanic/star_control/star_control_sub2.h" #include "titanic/star_control/star_closeup.h" -#include "titanic/star_control/star_control_sub7.h" +#include "titanic/star_control/star_markers.h" #include "titanic/star_control/photo_crosshairs.h" #include "titanic/star_control/star_points1.h" #include "titanic/star_control/star_points2.h" @@ -34,7 +34,7 @@ namespace Titanic { class CStarField : public CStarControlSub2 { private: - CStarControlSub7 _sub7; + CStarMarkers _markers; CPhotoCrosshairs _crosshairs; CStarPoints1 _points1; CStarPoints2 _points2; @@ -112,8 +112,11 @@ public: */ bool isSolved() const; - int get7Count() const { - return _sub7.size(); + /** + * Returns the number of markers placed in the starfield + */ + int getMarkerCount() const { + return _markers.size(); } void fn1(CErrorCode *errorCode); diff --git a/engines/titanic/star_control/star_control_sub7.cpp b/engines/titanic/star_control/star_markers.cpp index c5e267e47e..a65b61151d 100644 --- a/engines/titanic/star_control/star_control_sub7.cpp +++ b/engines/titanic/star_control/star_markers.cpp @@ -20,12 +20,12 @@ * */ -#include "titanic/star_control/star_control_sub7.h" +#include "titanic/star_control/star_markers.h" #include "titanic/star_control/star_camera.h" namespace Titanic { -void CStarControlSub7::draw(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup) { +void CStarMarkers::draw(CSurfaceArea *surfaceArea, CStarCamera *camera, CStarCloseup *closeup) { if (_data.empty()) return; @@ -71,7 +71,7 @@ void CStarControlSub7::draw(CSurfaceArea *surfaceArea, CStarCamera *camera, CSta surfaceArea->setColorFromPixel(); } -bool CStarControlSub7::addStar(const CBaseStarEntry *entry) { +bool CStarMarkers::addStar(const CBaseStarEntry *entry) { // iterate through the existing stars for (uint idx = 0; idx < _data.size(); ++idx) { CBaseStarEntry &star = _data[idx]; diff --git a/engines/titanic/star_control/star_control_sub7.h b/engines/titanic/star_control/star_markers.h index e751ae0d59..96b76d3c3b 100644 --- a/engines/titanic/star_control/star_control_sub7.h +++ b/engines/titanic/star_control/star_markers.h @@ -20,15 +20,15 @@ * */ -#ifndef TITANIC_STAR_CONTROL_SUB7_H -#define TITANIC_STAR_CONTROL_SUB7_H +#ifndef TITANIC_STAR_MARKERS_H +#define TITANIC_STAR_MARKERS_H #include "titanic/star_control/base_stars.h" namespace Titanic { -class CStarControlSub7 : public CBaseStars { +class CStarMarkers : public CBaseStars { public: - virtual ~CStarControlSub7() { clear(); } + virtual ~CStarMarkers() { clear(); } /** * Draw the item @@ -43,4 +43,4 @@ public: } // End of namespace Titanic -#endif /* TITANIC_STAR_CONTROL_SUB7_H */ +#endif /* TITANIC_STAR_MARKERS_H */ |