[Scummvm-cvs-logs] CVS: scummvm/sky logic.cpp,1.89,1.90 logic.h,1.26,1.27 mouse.cpp,1.11,1.12

Robert G?ffringmann lavosspawn at users.sourceforge.net
Fri Jun 6 09:41:07 CEST 2003


Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv16371/sky

Modified Files:
	logic.cpp logic.h mouse.cpp 
Log Message:
misc fixes

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/logic.cpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- logic.cpp	6 Jun 2003 14:40:46 -0000	1.89
+++ logic.cpp	6 Jun 2003 16:40:43 -0000	1.90
@@ -1044,7 +1044,7 @@
 	_scriptVariables[709] = 1;
 	_scriptVariables[710] = 1;
 	_scriptVariables[711] = 1;
-	_scriptVariables[79] = 1;
+	_scriptVariables[719] = 1;
 	_scriptVariables[720] = 1;
 	_scriptVariables[793] = 1;
 	_scriptVariables[797] = 1;
@@ -1067,6 +1067,15 @@
 	memcpy(_scriptVariables + 505, forwardList5b, sizeof(forwardList5b));
 }
 
+uint16 SkyLogic::mouseScript(uint32 scrNum, Compact *scriptComp) {
+
+	Compact *tmpComp = _compact;
+	_compact = scriptComp;
+	uint16 retVal = script((uint16)(scrNum & 0xFFFF), (uint16)(scrNum >> 16)); 
+	_compact = tmpComp;
+	return retVal;
+};
+
 /**
  * \fn uint32 SkyLogic::script(uint16 scriptNo, uint16 offset)
  * \brief This is the actual script engine. 
@@ -1374,11 +1383,13 @@
 }
 
 bool SkyLogic::fnOpenHand(uint32 a, uint32 b, uint32 c) {
-	error("Stub: fnOpenHand");
+	warning("Stub: fnOpenHand");
+	return true;
 }
 
 bool SkyLogic::fnCloseHand(uint32 a, uint32 b, uint32 c) {
-	error("Stub: fnCloseHand");
+	warning("Stub: fnCloseHand");
+	return true;
 }
 
 bool SkyLogic::fnGetTo(uint32 targetPlaceId, uint32 mode, uint32 c) {
@@ -1740,10 +1751,10 @@
 		cpt->xcood = rollingX;
 		rollingX += 24;
 
-		if (_scriptVariables[MENU] == 2)
+		//if (_scriptVariables[MENU] == 2)
 			cpt->ycood = 136;
-		else
-			cpt->ycood = 112;
+		/*else
+			cpt->ycood = 112;*/
 	}
 
 	return true;
@@ -1958,7 +1969,9 @@
 }
 
 bool SkyLogic::fnToggleMouse(uint32 a, uint32 b, uint32 c) {
-	error("Stub: fnToggleMouse");
+	
+	SkyState::fetchCompact(a)->status ^= ST_MOUSE;
+	return true;
 }
 
 bool SkyLogic::fnMouseOn(uint32 a, uint32 b, uint32 c) {
@@ -2233,12 +2246,12 @@
 }
 
 bool SkyLogic::fnPauseFx(uint32 a, uint32 b, uint32 c) {
-	warning("Stub: fnPauseFx");
+	//warning("Stub: fnPauseFx");
 	return true;
 }
 
 bool SkyLogic::fnUnPauseFx(uint32 a, uint32 b, uint32 c) {
-	warning("Stub: fnUnPauseFx");
+	//warning("Stub: fnUnPauseFx");
 	return true;
 }
 

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/logic.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- logic.h	5 Jun 2003 18:54:26 -0000	1.26
+++ logic.h	6 Jun 2003 16:40:43 -0000	1.27
@@ -92,7 +92,7 @@
 	void pause();
 	void waitSync();
 	void simpleAnim();
-	uint16 script(uint32 num) { return script((uint16)(num & 0xFFFF), (uint16)(num >> 16)); };
+	uint16 mouseScript(uint32 scrNum, Compact *scriptComp);
 	uint16 script(uint16 scriptNo, uint16 offset);
 
 	bool fnCacheChip(uint32 a, uint32 b, uint32 c);

Index: mouse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/mouse.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- mouse.cpp	5 Jun 2003 23:18:10 -0000	1.11
+++ mouse.cpp	6 Jun 2003 16:40:44 -0000	1.12
@@ -135,7 +135,7 @@
 		//surely this script should be run just in case
 		//I am going to try it anyway
 		if (SkyLogic::_scriptVariables[GET_OFF])
-			_skyLogic->script(SkyLogic::_scriptVariables[GET_OFF]);
+			_skyLogic->script((uint16)SkyLogic::_scriptVariables[GET_OFF],(uint16)(SkyLogic::_scriptVariables[GET_OFF] >> 16));
 	
 		SkyLogic::_scriptVariables[SPECIAL_ITEM] = 0xFFFFFFFF;
 		SkyLogic::_scriptVariables[GET_OFF] = RESET_MOUSE;
@@ -239,18 +239,19 @@
 			Compact *itemData = SkyState::fetchCompact(itemNum);
 			currentList++;
 			if ((itemData->screen == SkyLogic::_scriptVariables[SCREEN]) &&	(itemData->status & 16)) {
-				if (itemData->xcood + itemData->mouseRelX > _tMouseX) continue;
-				if (itemData->xcood + itemData->mouseRelX + itemData->mouseSizeX < _tMouseX) continue;
-				if (itemData->ycood + itemData->mouseRelY > _tMouseY) continue;
-				if (itemData->ycood + itemData->mouseRelY + itemData->mouseSizeY < _tMouseY) continue;
+				if (itemData->xcood + ((int16)itemData->mouseRelX) > _tMouseX) continue;
+				if (itemData->xcood + ((int16)itemData->mouseRelX) + itemData->mouseSizeX < _tMouseX) continue;
+				if (itemData->ycood + ((int16)itemData->mouseRelY) > _tMouseY) continue;
+				if (itemData->ycood + ((int16)itemData->mouseRelY) + itemData->mouseSizeY < _tMouseY) continue;
 				// we've hit the item
 				if (SkyLogic::_scriptVariables[SPECIAL_ITEM] == itemNum)
 					return;
 				SkyLogic::_scriptVariables[SPECIAL_ITEM] = itemNum;
 				if (SkyLogic::_scriptVariables[GET_OFF])
-					_skyLogic->script(SkyLogic::_scriptVariables[GET_OFF]);
+					_skyLogic->mouseScript(SkyLogic::_scriptVariables[GET_OFF], itemData);
 				SkyLogic::_scriptVariables[GET_OFF] = itemData->mouseOff;
-				if (itemData->mouseOn) _skyLogic->script(itemData->mouseOn);
+				if (itemData->mouseOn)
+					_skyLogic->mouseScript(itemData->mouseOn, itemData);
 				return;
 			}
 		}
@@ -259,8 +260,9 @@
 	} while (*currentList != 0);
 	if (SkyLogic::_scriptVariables[SPECIAL_ITEM] != 0) {
 		SkyLogic::_scriptVariables[SPECIAL_ITEM] = 0;
+		
 		if (SkyLogic::_scriptVariables[GET_OFF])
-			_skyLogic->script(SkyLogic::_scriptVariables[GET_OFF]);
+			_skyLogic->script((uint16)SkyLogic::_scriptVariables[GET_OFF],(uint16)(SkyLogic::_scriptVariables[GET_OFF] >> 16));
 		SkyLogic::_scriptVariables[GET_OFF] = 0;
 	}
 }
@@ -275,7 +277,7 @@
 		if (SkyLogic::_scriptVariables[SPECIAL_ITEM]) { //over anything?
 			Compact *item = SkyState::fetchCompact(SkyLogic::_scriptVariables[SPECIAL_ITEM]);
 			if (item->mouseClick)
-				_skyLogic->script(item->mouseClick, 0);
+				_skyLogic->mouseScript(item->mouseClick, item);
 		}
 	}
 }





More information about the Scummvm-git-logs mailing list