[Scummvm-cvs-logs] CVS: scummvm/sky control.cpp,1.6,1.7 control.h,1.4,1.5 logic.cpp,1.106,1.107

Robert G?ffringmann lavosspawn at users.sourceforge.net
Tue Jul 1 09:07:02 CEST 2003


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

Modified Files:
	control.cpp control.h logic.cpp 
Log Message:
fixed mouse restore on savegame restore and bug in fnTheyStartSub

Index: control.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/control.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- control.cpp	1 Jul 2003 13:04:00 -0000	1.6
+++ control.cpp	1 Jul 2003 16:06:09 -0000	1.7
@@ -301,7 +301,7 @@
 	
 	drawMainPanel();
 
-	uint16 savedMouse = _skyMouse->giveCurrentMouseType();
+	_savedMouse = _skyMouse->giveCurrentMouseType();
 	
 	_skyMouse->spriteMouse(MOUSE_NORMAL,0,0);
 	bool quitPanel = false;
@@ -343,7 +343,7 @@
 	_skyScreen->forceRefresh();
 	_skyScreen->setPalette((uint8*)SkyState::fetchCompact(SkyState::_systemVars.currentPalette));
 	removePanel();
-	_skyMouse->spriteMouse(savedMouse, 0, 0);
+	_skyMouse->spriteMouse(_savedMouse, 0, 0);
 }
 
 uint16 SkyControl::handleClick(SkyConResource *pButton) {
@@ -950,7 +950,7 @@
 
 	//TODO: save queued sfx
 	STOSD(destPos, _skyText->giveCurrentCharSet());
-	STOSD(destPos, _skyMouse->giveCurrentMouseType());
+	STOSD(destPos, _savedMouse);
 	STOSD(destPos, SkyState::_systemVars.currentPalette);
 	for (cnt = 0; cnt < 838; cnt++)
 		STOSD(destPos, SkyLogic::_scriptVariables[cnt]);
@@ -1156,7 +1156,7 @@
 	_skyDisk->refreshFilesList(reloadList);
 	_skyMusic->startMusic((uint16)music);
 	_skyText->fnSetFont(charSet);
-	_skyMouse->spriteMouse((uint16)mouseType, 0, 0);
+	_savedMouse = (uint16)mouseType;
 	SkyState::_systemVars.currentPalette = palette; // will be set when doControlPanel ends
 	SkyState::_systemVars.systemFlags |= SF_GAME_RESTORED; // what's that for?
 

Index: control.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/control.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- control.h	1 Jul 2003 13:04:00 -0000	1.4
+++ control.h	1 Jul 2003 16:06:09 -0000	1.5
@@ -227,6 +227,7 @@
 	int _lastButton;
 	uint32 _curButtonText;
 	uint16 _firstText;
+	uint16 _savedMouse;
     
 	dataFileHeader *_textSprite;
 	SkyTextResource *_text;

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/logic.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- logic.cpp	1 Jul 2003 13:04:00 -0000	1.106
+++ logic.cpp	1 Jul 2003 16:06:09 -0000	1.107
@@ -583,8 +583,9 @@
 
 	Compact *cpt = SkyState::fetchCompact(_compact->extCompact->waitingFor);
 
-	if (!cpt->mood && collide(cpt))
-		return;
+	if (cpt)
+		if (!cpt->mood && collide(cpt))
+			return;
 
 	// we are free, continue processing the script
 
@@ -1346,8 +1347,8 @@
 bool SkyLogic::fnTheyStartSub(uint32 mega, uint32 scr, uint32 c) {
 	Compact *cpt = SkyState::fetchCompact(mega);
 	cpt->mode += 4;
-	*SkyCompact::getSub(cpt, _compact->mode) = (uint16)(scr & 0xffff);
-	*SkyCompact::getSub(cpt, _compact->mode + 2) = (uint16)(scr >> 16);
+	*SkyCompact::getSub(cpt, cpt->mode) = (uint16)(scr & 0xffff);
+	*SkyCompact::getSub(cpt, cpt->mode + 2) = (uint16)(scr >> 16);
 	return true;
 }
 
@@ -1830,7 +1831,7 @@
 	// sprite offsets can ruin the formula - instead we
 	// will use the bottom of the mouse collision area
 
-	int16 y = _compact->ycood - (cpt->ycood - cpt->mouseRelY - cpt->mouseSizeY);
+	int16 y = _compact->ycood - (cpt->ycood + cpt->mouseRelY + cpt->mouseSizeY);
 
 	if (y < 0) { // it's below
 		y = -y;





More information about the Scummvm-git-logs mailing list