[Scummvm-git-logs] scummvm master -> 1f99c01f1241b240017846822d387501b208f1d2

dreammaster dreammaster at scummvm.org
Mon Feb 27 15:08:36 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:
1f99c01f12 TITANIC: Added remainder of CStarControl class


Commit: 1f99c01f1241b240017846822d387501b208f1d2
    https://github.com/scummvm/scummvm/commit/1f99c01f1241b240017846822d387501b208f1d2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-27T09:08:34-05:00

Commit Message:
TITANIC: Added remainder of CStarControl class

Changed paths:
    engines/titanic/star_control/base_star.h
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control.h
    engines/titanic/star_control/star_field.h


diff --git a/engines/titanic/star_control/base_star.h b/engines/titanic/star_control/base_star.h
index cf5cbc7..7e6329f 100644
--- a/engines/titanic/star_control/base_star.h
+++ b/engines/titanic/star_control/base_star.h
@@ -103,6 +103,8 @@ public:
 	void clear();
 
 	void initialize();
+
+	int size() const { return _data.size(); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index 5874d01..dcde81e 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -72,7 +72,7 @@ void CStarControl::load(SimpleFile *file) {
 		_view.load(file, 0);
 		CScreenManager *screenManager = CScreenManager::setCurrent();
 		if (!screenManager)
-			error("There's no screen  manager during loading");
+			error("There's no screen manager during loading");
 
 		_view.setup(screenManager, &_starField, this);
 		_view.reset();
@@ -131,7 +131,21 @@ bool CStarControl::FrameMsg(CFrameMsg *msg) {
 }
 
 void CStarControl::newFrame() {
-	// TODO
+	if (!_petControl)
+		_petControl = getPetControl();
+
+	if (_petControl) {
+		int val1 = _starField.get88();
+		int val2 = 0;
+
+		if (!_starField.get3()) {
+			val2 = _starField.get5();
+			if ((val1 + 2) == _starField.get7Count())
+				val2 = 0;
+		}
+
+		_petControl->starsSetButtons(val1, val2);
+	}
 }
 
 void CStarControl::doAction(StarControlAction action) {
@@ -238,10 +252,7 @@ void CStarControl::doAction(StarControlAction action) {
 	case STAR_19:
 		_view.petDestinationSet();
 		break;
-
 	}
-
-	// TODO
 }
 
 bool CStarControl::isSolved() const {
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index 830d586..11e6053 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -26,6 +26,7 @@
 #include "titanic/core/game_object.h"
 #include "titanic/star_control/star_field.h"
 #include "titanic/star_control/star_view.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -40,9 +41,7 @@ private:
 	CStarField _starField;
 	CStarView _view;
 	Rect _starRect;
-#if 0
-	int _field80B0;
-#endif
+	CPetControl *_petControl;
 private:
 	/**
 	 * Called for ever new game frame
diff --git a/engines/titanic/star_control/star_field.h b/engines/titanic/star_control/star_field.h
index 41f0189..6c186f9 100644
--- a/engines/titanic/star_control/star_field.h
+++ b/engines/titanic/star_control/star_field.h
@@ -87,6 +87,10 @@ public:
 	 * Returns true if the starfield puzzle has been solved
 	 */
 	bool isSolved() const;
+
+	int get7Count() const {
+		return _sub7.size();
+	}
 };
 
 } // End of namespace Titanic





More information about the Scummvm-git-logs mailing list