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

kirben at users.sourceforge.net kirben at users.sourceforge.net
Thu Apr 13 16:36:02 CEST 2006


Revision: 21854
Author:   kirben
Date:     2006-04-13 16:34:58 -0700 (Thu, 13 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21854&view=rev

Log Message:
-----------
Add invertBox function for FF

Modified Paths:
--------------
    scummvm/trunk/engines/simon/saveload.cpp
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/simon/simon.h
    scummvm/trunk/engines/simon/verb.cpp
Modified: scummvm/trunk/engines/simon/saveload.cpp
===================================================================
--- scummvm/trunk/engines/simon/saveload.cpp	2006-04-13 23:13:56 UTC (rev 21853)
+++ scummvm/trunk/engines/simon/saveload.cpp	2006-04-13 23:34:58 UTC (rev 21854)
@@ -211,8 +211,8 @@
 	if_1:;
 		unk132_result = i;
 
-		set_hitarea_bit_0x40(0xd0 + i);
-		leaveHitAreaById(0xd0 + i);
+		set_hitarea_bit_0x40(208 + i);
+		leaveHitAreaById(208 + i);
 
 		// some code here
 

Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-04-13 23:13:56 UTC (rev 21853)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-04-13 23:34:58 UTC (rev 21854)
@@ -252,10 +252,14 @@
 	_speech = true;
 	_subtitles = true;
 	_fade = true;
+
 	_animatePointer = 0;
 	_mouseCursor = 0;
 	_mouseAnim = 0;
 	_mouseAnimMax = 0;
+	_oldMouseCursor = 0;
+	_oldMouseAnimMax = 0;
+
 	_vgaVar9 = 0;
 	_scriptUnk1 = 0;
 	_restoreWindow6 = 0;

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-04-13 23:13:56 UTC (rev 21853)
+++ scummvm/trunk/engines/simon/simon.h	2006-04-13 23:34:58 UTC (rev 21854)
@@ -262,10 +262,6 @@
 	bool _speech;
 	bool _subtitles;
 	bool _fade;
-	byte _animatePointer;
-	byte _mouseCursor;
-	byte _mouseAnim;
-	byte _mouseAnimMax;
 	bool _vgaVar9;
 	int16 _scriptUnk1;
 	bool _restoreWindow6;
@@ -297,7 +293,6 @@
 	uint _needHitAreaRecalc;
 	uint _verbHitArea;
 	uint16 _defaultVerb;
-	uint _mouseHideCount;
 	uint _currentBoxNumber;
 	uint _iOverflow;
 
@@ -317,6 +312,11 @@
 	int _mouseX, _mouseY;
 	int _mouseXOld, _mouseYOld;
 
+	byte _animatePointer;
+	byte _mouseCursor, _mouseAnim, _mouseAnimMax;
+	byte _oldMouseCursor, _oldMouseAnimMax;
+	uint _mouseHideCount;
+
 	byte _leftButtonDown;
 	byte _rightButtonDown;
 	bool _noRightClick;
@@ -568,7 +568,7 @@
 	HitArea *findEmptyHitArea();
 	void resetVerbs();
 	void setVerb(HitArea * ha);
-	void hitarea_leave(HitArea * ha);
+	void hitarea_leave(HitArea * ha, bool state = false);
 	void leaveHitAreaById(uint hitarea_id);
 
 	void waitForSync(uint a);
@@ -650,6 +650,7 @@
 	void displayName(HitArea * ha);
 	void displayBoxStars();
 	void hitarea_stuff();
+	void invertBox(HitArea *ha, bool state);
 
 	void handleMouseMoved();
 	void pollMouseXY();

Modified: scummvm/trunk/engines/simon/verb.cpp
===================================================================
--- scummvm/trunk/engines/simon/verb.cpp	2006-04-13 23:13:56 UTC (rev 21853)
+++ scummvm/trunk/engines/simon/verb.cpp	2006-04-13 23:34:58 UTC (rev 21854)
@@ -515,11 +515,13 @@
 	}
 }
 
-void SimonEngine::hitarea_leave(HitArea *ha) {
-	if (!(getGameType() == GType_SIMON2)) {
+void SimonEngine::hitarea_leave(HitArea *ha, bool state) {
+	if (getGameType() == GType_FF) {
+		invertBox(ha, state);
+	} else if (getGameType() == GType_SIMON2) {
+		video_toggle_colors(ha, 0xe7, 0xe5, 0xe6, 1);
+	} else {
 		video_toggle_colors(ha, 0xdf, 0xd5, 0xda, 5);
-	} else {
-		video_toggle_colors(ha, 0xe7, 0xe5, 0xe6, 1);
 	}
 }
 
@@ -661,7 +663,7 @@
 					best_ha = ha;
 				} else {
 					if (ha->flags & kBFBoxSelected) {
-						hitarea_leave(ha);
+						hitarea_leave(ha , true);
 						ha->flags &= ~kBFBoxSelected;
 					}
 				}
@@ -693,7 +695,7 @@
 	}
 
 	if (best_ha->flags & kBFInvertTouch && !(best_ha->flags & kBFBoxSelected)) {
-		hitarea_leave(best_ha);
+		hitarea_leave(best_ha, false);
 		best_ha->flags |= kBFBoxSelected;
 	}
 
@@ -742,4 +744,47 @@
 		_lastNameOn = ha;
 }
 
+void SimonEngine::invertBox(HitArea *ha, bool state) {
+	if (getBitFlag(205) && getBitFlag(206)) {
+		if (state != 0) {
+			_mouseAnimMax = _oldMouseAnimMax;
+			_mouseCursor = _oldMouseCursor;
+		} else if (_mouseCursor != 18) {
+			_oldMouseCursor = _mouseCursor;
+			_animatePointer = 0;
+			_oldMouseAnimMax = _mouseAnimMax;
+			_mouseAnimMax = 2;
+			_mouseCursor = 18;
+
+		}
+	} else {
+		if (getBitFlag(207)) {
+			if (state != 0) {
+				_noRightClick = 0;
+				resetVerbs();
+			} else {
+				int cursor = ha->id + 9;
+				if (cursor >= 23)
+					cursor = 21;
+				_mouseCursor = cursor;
+				_mouseAnimMax = 8;
+				_noRightClick = 1;
+			}
+		} else {
+			VgaSprite *vsp = _vgaSprites;
+
+			int id = ha->id - 43;
+			while (vsp->id) {
+				if (vsp->id == id && vsp->zoneNum == 2) {
+					if (state == 0)
+						vsp->flags |= kDFShaded;
+					else
+						vsp->flags &= ~kDFShaded;
+					break;
+				}
+			}
+		}
+	}
+}
+
 } // End of namespace Simon


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