[Scummvm-cvs-logs] CVS: scummvm/sword1 logic.h,1.7,1.8 menu.cpp,1.14,1.15 mouse.cpp,1.17,1.18 mouse.h,1.9,1.10 sworddefs.h,1.11,1.12

Robert G?ffringmann lavosspawn at users.sourceforge.net
Thu Jan 1 10:01:15 CET 2004


Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1:/tmp/cvs-serv8776/sword1

Modified Files:
	logic.h menu.cpp mouse.cpp mouse.h sworddefs.h 
Log Message:
implemented examining inventory items

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/logic.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- logic.h	20 Dec 2003 09:12:54 -0000	1.7
+++ logic.h	1 Jan 2004 18:00:34 -0000	1.8
@@ -60,6 +60,8 @@
 	int fnMegaSet		(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	int fnNoSprite		(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 
+// public for mouse (menu looking)
+	int cfnPresetScript	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 private:
 	ObjectMan *_objMan;
 	ResMan *_resMan;
@@ -124,7 +126,6 @@
 	
 	int cfnClickInteract(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	int cfnSetScript	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
-	int cfnPresetScript	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 
 	int fnInteract		(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);
 	int fnIssueEvent	(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x);

Index: menu.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/menu.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- menu.cpp	31 Dec 2003 15:52:48 -0000	1.14
+++ menu.cpp	1 Jan 2004 18:00:34 -0000	1.15
@@ -125,6 +125,12 @@
 	} else {
 		for (uint8 cnt = 0; cnt < _inMenu; cnt++) {
 			if (_objects[cnt]->wasClicked(x, y))
+				if (mouseEvent & BS1R_BUTTON_DOWN) { // looking at item
+					SwordLogic::_scriptVars[OBJECT_HELD] = _menuList[cnt];
+					SwordLogic::_scriptVars[MENU_LOOKING] = 1;
+					SwordLogic::_scriptVars[DEFAULT_ICON_TEXT] = _objectDefs[_menuList[cnt]].textDesc;
+					refreshMenus = true;
+				}
 				if (mouseEvent & BS1L_BUTTON_DOWN) {
 					if (SwordLogic::_scriptVars[OBJECT_HELD]) {
 						if (SwordLogic::_scriptVars[OBJECT_HELD] == _menuList[cnt]) {

Index: mouse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/mouse.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- mouse.cpp	31 Dec 2003 15:52:48 -0000	1.17
+++ mouse.cpp	1 Jan 2004 18:00:34 -0000	1.18
@@ -152,8 +152,12 @@
 	} else
 		SwordLogic::_scriptVars[SPECIAL_ITEM] = 0;
 	if (_state & MOUSE_DOWN_MASK) {
-		if (_inTopMenu && SwordLogic::_scriptVars[SECOND_ITEM])
-			_logic->runMouseScript(NULL, _menu->_objectDefs[SwordLogic::_scriptVars[SECOND_ITEM]].useScript);
+		if (_inTopMenu) {
+			if (SwordLogic::_scriptVars[SECOND_ITEM])
+				_logic->runMouseScript(NULL, _menu->_objectDefs[SwordLogic::_scriptVars[SECOND_ITEM]].useScript);
+			if (SwordLogic::_scriptVars[MENU_LOOKING])
+				_logic->cfnPresetScript(NULL, -1, PLAYER, SCR_menu_look, 0, 0, 0, 0);
+		}
 		
 		SwordLogic::_scriptVars[MOUSE_BUTTON] = _state & MOUSE_DOWN_MASK;
 		if (SwordLogic::_scriptVars[SPECIAL_ITEM]) {

Index: mouse.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/mouse.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- mouse.h	30 Dec 2003 21:32:50 -0000	1.9
+++ mouse.h	1 Jan 2004 18:00:34 -0000	1.10
@@ -75,7 +75,6 @@
 	void animate(void);
 	void engine(uint16 x, uint16 y, uint16 eventFlags);
 	uint16 testEvent(void);
-	//void flushEvents(void);
 	void giveCoords(uint16 *x, uint16 *y);
 	void fnNoHuman(void);
 	void fnAddHuman(void);
@@ -96,13 +95,9 @@
 
 	uint32 _currentPtrId, _currentLuggageId, _frame;
 	MousePtr *_currentPtr;
-	//uint8 _mouseCount;
 	uint16 _numObjs;
 	uint16 _lastState, _state;
 	uint32 _getOff;
-	//uint32 _specialPtrId; // for special mouse cursors which aren't in the _pointers[] array.
-	//MousePtr *_specialPtr;
-	//MousePtr *_pointers[17];
 	bool _inTopMenu, _mouseOverride;
 };
 

Index: sworddefs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/sworddefs.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- sworddefs.h	22 Dec 2003 00:34:02 -0000	1.11
+++ sworddefs.h	1 Jan 2004 18:00:34 -0000	1.12
@@ -1551,6 +1551,7 @@
 #define GUARD_ROOF_63 4128781
 #define LEFT_TREE_POINTER_71 4653058
 #define RIGHT_TREE_POINTER_71 4653059
+#define SCR_menu_look (0*0x10000 + 24)
 #define SCR_icon_combine_script (0*0x10000 + 25)
 
 #endif //SWORDDEFS_H





More information about the Scummvm-git-logs mailing list