[Scummvm-git-logs] scummvm master -> a6870e04ad0273d489691fc1ec348d12e69f479b
dreammaster
dreammaster at scummvm.org
Sat Mar 18 23:26:16 CET 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a6870e04ad TITANIC: Finished CStarControlSub8 class
Commit: a6870e04ad0273d489691fc1ec348d12e69f479b
https://github.com/scummvm/scummvm/commit/a6870e04ad0273d489691fc1ec348d12e69f479b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-03-18T18:26:13-04:00
Commit Message:
TITANIC: Finished CStarControlSub8 class
Changed paths:
engines/titanic/star_control/star_control_sub8.cpp
engines/titanic/star_control/star_control_sub8.h
engines/titanic/star_control/star_field.cpp
diff --git a/engines/titanic/star_control/star_control_sub8.cpp b/engines/titanic/star_control/star_control_sub8.cpp
index 53f2394..bf29b05 100644
--- a/engines/titanic/star_control/star_control_sub8.cpp
+++ b/engines/titanic/star_control/star_control_sub8.cpp
@@ -31,11 +31,6 @@ namespace Titanic {
CStarControlSub8::CStarControlSub8() : _field8(-1), _entryIndex(-1) {
}
-int CStarControlSub8::findStar(const Common::Point &pt) {
- // TODO
- return -1;
-}
-
void CStarControlSub8::selectStar(int index, CVideoSurface *surface,
CStarField *starField, CStarControlSub7 *sub7) {
if (_entryIndex >= 0) {
@@ -110,9 +105,6 @@ bool CStarControlSub8::fn1(CStarField *starField, CSurfaceArea *surfaceArea, CSt
clear();
return false;
}
-
- // TODO
- return true;
}
void CStarControlSub8::fn2(CVideoSurface *surface, CStarField *starField, CStarControlSub7 *sub7) {
@@ -198,7 +190,13 @@ void CStarControlSub8::fn4(int index, CSurfaceArea *surfaceArea) {
}
void CStarControlSub8::fn5(int index, CVideoSurface *surface, CStarField *starField, CStarControlSub7 *sub7) {
- // TODO
+ surface->lock();
+ CSurfaceArea surfaceArea(surface);
+ fn7(_positions[index + 1], &surfaceArea);
+ surface->unlock();
+
+ const CBaseStarEntry *starP = starField->getDataPtr(_positions[index + 1]._index1);
+ sub7->addStar(starP);
}
void CStarControlSub8::fn6(CSurfaceArea *surfaceArea) {
diff --git a/engines/titanic/star_control/star_control_sub8.h b/engines/titanic/star_control/star_control_sub8.h
index f61a6ff..4939179 100644
--- a/engines/titanic/star_control/star_control_sub8.h
+++ b/engines/titanic/star_control/star_control_sub8.h
@@ -69,8 +69,6 @@ public:
*/
void save(SimpleFile *file, int indent) {}
- int findStar(const Common::Point &pt);
-
void selectStar(int starNum, CVideoSurface *surface, CStarField *starField,
CStarControlSub7 *sub7);
diff --git a/engines/titanic/star_control/star_field.cpp b/engines/titanic/star_control/star_field.cpp
index 07c5ff4..5c22e5e 100644
--- a/engines/titanic/star_control/star_field.cpp
+++ b/engines/titanic/star_control/star_field.cpp
@@ -232,7 +232,7 @@ bool CStarField::mouseButtonDown(CVideoSurface *surface, CStarControlSub12 *sub1
CSurfaceArea surfaceArea(surface);
return selectStar(&surfaceArea, sub12, pt);
} else {
- int starNum = _sub8.findStar(pt);
+ int starNum = _sub8.indexOf(pt);
if (starNum >= 0) {
_sub8.selectStar(starNum, surface, this, &_sub7);
return true;
More information about the Scummvm-git-logs
mailing list