[Scummvm-cvs-logs] SF.net SVN: scummvm: [21639] scummvm/trunk/engines/simon

kirben at users.sourceforge.net kirben at users.sourceforge.net
Thu Apr 6 01:44:06 CEST 2006


Revision: 21639
Author:   kirben
Date:     2006-04-06 01:43:20 -0700 (Thu, 06 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21639&view=rev

Log Message:
-----------
Remove duplicate code in last commit and minor fixes for FF

Modified Paths:
--------------
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/simon/simon.h
    scummvm/trunk/engines/simon/verb.cpp
Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-04-06 08:21:44 UTC (rev 21638)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-04-06 08:43:20 UTC (rev 21639)
@@ -286,7 +286,7 @@
 	_iOverflow = 0;
 	_hitAreaObjectItem = 0;
 	_lastHitArea = 0;
-	_lastHitArea2Ptr = 0;
+	_lastNameOn = 0;
 	_lastHitArea3 = 0;
 	_leftButtonDown = 0;
 	_hitAreaSubjectItem = 0;
@@ -1603,9 +1603,9 @@
 	_lastHitArea = 0;
 	_hitAreaObjectItem = NULL;
 
-	last = _lastHitArea2Ptr;
-	defocusHitarea();
-	_lastHitArea2Ptr = last;
+	last = _lastNameOn;
+	clearName();
+	_lastNameOn = last;
 
 	for (;;) {
 		_lastHitArea = NULL;
@@ -1646,7 +1646,7 @@
 out_of_here:
 	_lastHitArea3 = 0;
 	_lastHitArea = 0;
-	_lastHitArea2Ptr = NULL;
+	_lastNameOn = NULL;
 	_mouseCursor = 0;
 	_noRightClick = 0;
 }

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-04-06 08:21:44 UTC (rev 21638)
+++ scummvm/trunk/engines/simon/simon.h	2006-04-06 08:43:20 UTC (rev 21639)
@@ -280,7 +280,7 @@
 
 	Item *_hitAreaObjectItem;
 	HitArea *_lastHitArea;
-	HitArea *_lastHitArea2Ptr;
+	HitArea *_lastNameOn;
 	HitArea *_lastHitArea3;
 	byte _leftButtonDown;
 	byte _rightButtonDown;
@@ -632,7 +632,7 @@
 	void invokeTimeEvent(TimeEvent *te);
 	bool kickoffTimeEvents();
 
-	void defocusHitarea();
+	void clearName();
 	void endCutscene();
 	void runSubroutine101();
 	void checkUp(WindowBlock *window);

Modified: scummvm/trunk/engines/simon/verb.cpp
===================================================================
--- scummvm/trunk/engines/simon/verb.cpp	2006-04-06 08:21:44 UTC (rev 21638)
+++ scummvm/trunk/engines/simon/verb.cpp	2006-04-06 08:43:20 UTC (rev 21639)
@@ -188,22 +188,22 @@
 	"", "", "", "to whom ?"
 };
 
-void SimonEngine::defocusHitarea() {
+void SimonEngine::clearName() {
 	HitArea *last;
 	HitArea *ha;
 
 	if (getGameType() == GType_FF) {
-		if (getBitFlag(79)) {
-			o_sync(202);
-			_lastHitArea2Ptr = NULL;
-			return;
-		}
+		o_kill_sprite_simon2(2, 6);
+		_lastNameOn = NULL;
+		//_animatePointer = 0;
+		_mouseAnim = 1;
+		return;
 	}
 
 	if (getGameType() == GType_SIMON2) {
 		if (getBitFlag(79)) {
 			o_sync(202);
-			_lastHitArea2Ptr = NULL;
+			_lastNameOn = NULL;
 			return;
 		}
 	}
@@ -311,7 +311,7 @@
 	if (window != NULL && window->text_color != 0)
 		clearWindow(window);
 
-	_lastHitArea2Ptr = NULL;
+	_lastNameOn = NULL;
 	_hitAreaPtr7 = NULL;
 }
 
@@ -365,8 +365,8 @@
 	HitArea *ha = findHitAreaByID(hitarea);
 	if (ha != NULL) {
 		ha->flags = 0;
-		if (ha == _lastHitArea2Ptr)
-			defocusHitarea();
+		if (ha == _lastNameOn)
+			clearName();
 		_needHitAreaRecalc++;
 	}
 }
@@ -625,8 +625,12 @@
 	uint count = ARRAYSIZE(_hitAreas);
 	uint16 priority = 0;
 	uint16 x_ = x;
-	const uint16 y_ = y;
+	uint16 y_ = y;
 
+	if (getGameType() == GType_FF) {
+		x_ += _scrollX;
+		y_ += _scrollY;
+	}
 	if (getGameType() == GType_SIMON2) {
 		if (getBitFlag(79) || y < 134) {
 			x_ += _scrollX * 8;
@@ -657,7 +661,7 @@
 	_currentBoxNumber = 0;
 
 	if (best_ha == NULL) {
-		defocusHitarea();
+		clearName();
 		return;
 	}
 
@@ -670,8 +674,8 @@
 	}
 
 	if (best_ha->flags & 4) {
-		defocusHitarea();
-	} else if (best_ha != _lastHitArea2Ptr) {
+		clearName();
+	} else if (best_ha != _lastNameOn) {
 		displayName(best_ha);
 	}
 
@@ -694,7 +698,7 @@
 	}
 
 	if (result)
-		_lastHitArea2Ptr = ha;
+		_lastNameOn = ha;
 }
 
 bool SimonEngine::printTextOf(uint a) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list