[Scummvm-cvs-logs] scummvm master -> d1298c47645e89748a498a59bf321964bd1d18ad

dreammaster dreammaster at scummvm.org
Thu Sep 8 14:50:32 CEST 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e6828dada9 TSAGE: Fix score display in user interface
d1298c4764 TSAGE: Fix fallback item description display for scenes


Commit: e6828dada91bcc268917b502cc2cd72975ec2559
    https://github.com/scummvm/scummvm/commit/e6828dada91bcc268917b502cc2cd72975ec2559
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-09-08T05:44:17-07:00

Commit Message:
TSAGE: Fix score display in user interface

Changed paths:
    engines/tsage/blue_force/blueforce_ui.cpp



diff --git a/engines/tsage/blue_force/blueforce_ui.cpp b/engines/tsage/blue_force/blueforce_ui.cpp
index 81411b1..f9f5800 100644
--- a/engines/tsage/blue_force/blueforce_ui.cpp
+++ b/engines/tsage/blue_force/blueforce_ui.cpp
@@ -114,10 +114,10 @@ void UIScore::draw() {
 void UIScore::updateScore() {
 	int score = BF_GLOBALS._uiElements._scoreValue;
 	
-	_digit3.setFrame(score / 1000); score %= 1000;
-	_digit2.setFrame(score / 100); score %= 100;
-	_digit1.setFrame(score / 10); score %= 10;
-	_digit0.setFrame(score);
+	_digit3.setFrame(score / 1000 + 1); score %= 1000;
+	_digit2.setFrame(score / 100 + 1); score %= 100;
+	_digit1.setFrame(score / 10 + 1); score %= 10;
+	_digit0.setFrame(score + 1);
 }
 
 /*--------------------------------------------------------------------------*/


Commit: d1298c47645e89748a498a59bf321964bd1d18ad
    https://github.com/scummvm/scummvm/commit/d1298c47645e89748a498a59bf321964bd1d18ad
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-09-08T05:44:53-07:00

Commit Message:
TSAGE: Fix fallback item description display for scenes

Changed paths:
    engines/tsage/blue_force/blueforce_logic.cpp
    engines/tsage/blue_force/blueforce_logic.h
    engines/tsage/core.cpp
    engines/tsage/core.h



diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp
index 616a773..c91007e 100644
--- a/engines/tsage/blue_force/blueforce_logic.cpp
+++ b/engines/tsage/blue_force/blueforce_logic.cpp
@@ -567,7 +567,7 @@ void SceneExt::checkGun() {
 	BF_GLOBALS._sound3.play(4);
 }
 
-void SceneExt::display(CursorType action) {
+bool SceneExt::display(CursorType action) {
 	switch (action) {
 	case CURSOR_LOOK:
 		SceneItem::display2(9000, BF_GLOBALS._randomSource.getRandomNumber(2));
@@ -584,8 +584,12 @@ void SceneExt::display(CursorType action) {
 	default:
 		if (action < BF_LAST_INVENT)
 			SceneItem::display2(9002, (int)action);
+		else
+			return false;
 		break;
 	}
+
+	return true;
 }
 
 void SceneExt::gunDisplay() {
@@ -687,8 +691,22 @@ void SceneHandlerExt::process(Event &event) {
 	}
 
 	SceneHandler::process(event);
+}
 
-	// TODO: All the new stuff from Blue Force
+void SceneHandlerExt::playerAction(Event &event) {
+	if (BF_GLOBALS._events.getCursor() == INV_DOG_WHISTLE) {
+		SceneItem::display2(1, 6);
+		event.handled = true;
+	}
+}
+
+void SceneHandlerExt::processEnd(Event &event) {
+	// Check for a fallback text display for the given cursor/item being used in the scene
+	if (!event.handled && BF_GLOBALS._sceneManager._scene) {
+		CursorType cursor = BF_GLOBALS._events.getCursor();
+		if (((SceneExt *)BF_GLOBALS._sceneManager._scene)->display(cursor))
+			event.handled = true;
+	}
 }
 
 /*--------------------------------------------------------------------------*/
diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h
index b2cab69..11719e7 100644
--- a/engines/tsage/blue_force/blueforce_logic.h
+++ b/engines/tsage/blue_force/blueforce_logic.h
@@ -169,7 +169,7 @@ public:
 
 	void addTimer(Timer *timer) { _timerList.add(timer); }
 	void removeTimer(Timer *timer) { _timerList.remove(timer); }
-	void display(CursorType action);
+	bool display(CursorType action);
 };
 
 class GroupedScene: public SceneExt {
@@ -187,6 +187,9 @@ class SceneHandlerExt: public SceneHandler {
 public:
 	virtual void postInit(SceneObjectList *OwnerList = NULL);
 	virtual void process(Event &event);
+
+	virtual void playerAction(Event &event);
+	virtual void processEnd(Event &event);
 };
 
 class BlueForceInvObjectList : public InvObjectList {
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 7dff8c0..87c4309 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -3787,6 +3787,13 @@ void SceneHandler::process(Event &event) {
 		// Mouse press handling
 		if (_globals->_player._uiEnabled && (event.eventType == EVENT_BUTTON_DOWN) &&
 				!_globals->_sceneItems.empty()) {
+			// Check if the mouse is on the player
+			if (_globals->_player.contains(event.mousePos)) {
+				playerAction(event);
+				if (event.handled)
+					return;
+			}
+
 			// Scan the item list to find one the mouse is within
 			SynchronizedList<SceneItem *>::iterator i = _globals->_sceneItems.begin();
 			while ((i != _globals->_sceneItems.end()) && !(*i)->contains(event.mousePos))
@@ -3807,6 +3814,9 @@ void SceneHandler::process(Event &event) {
 				}
 			}
 
+			// Handle any fallback text display
+			processEnd(event);
+
 			// Handle player processing
 			_globals->_player.process(event);
 		}
diff --git a/engines/tsage/core.h b/engines/tsage/core.h
index 0ea9936..5cfaf5c 100644
--- a/engines/tsage/core.h
+++ b/engines/tsage/core.h
@@ -863,6 +863,9 @@ public:
 	int _delayTicks;
 	Common::String _saveName;
 	uint32 _prevFrameNumber;
+protected:
+	virtual void playerAction(Event &event) {}
+	virtual void processEnd(Event &event) {}
 public:
 	SceneHandler();
 	void registerHandler();






More information about the Scummvm-git-logs mailing list