[Scummvm-cvs-logs] CVS: scummvm/sky logic.cpp,1.97,1.98 screen.cpp,1.29,1.30

Robert G?ffringmann lavosspawn at users.sourceforge.net
Mon Jun 9 16:04:01 CEST 2003


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

Modified Files:
	logic.cpp screen.cpp 
Log Message:
removed debugging leftovers, fixed one more sprite clipping issue.

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/logic.cpp,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- logic.cpp	9 Jun 2003 20:41:08 -0000	1.97
+++ logic.cpp	9 Jun 2003 23:02:55 -0000	1.98
@@ -1877,7 +1877,7 @@
 
 	Compact *cpt = SkyState::fetchCompact(id);
 	uint16 *rst = (uint16 *)SkyState::fetchCompact(resetBlock);
-	SkyCompact::jobsworth;
+
 	if (!cpt) {
 		warning("fnResetId(): Compact %d (id) == NULL\n",id);
 		return true;

Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/screen.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- screen.cpp	9 Jun 2003 02:33:27 -0000	1.29
+++ screen.cpp	9 Jun 2003 23:02:56 -0000	1.30
@@ -601,11 +601,12 @@
 	} else {
 		int32 botClip = GAME_SCREEN_HEIGHT - FROM_LE_16(sprDataFile->s_height) - spriteY;
 		if (botClip < 0) {
-			if (botClip + _sprHeight <= 0) {
+			botClip = -botClip;
+			if (_sprHeight <= botClip) {
 				_sprWidth = 0;
 				return ;
 			}
-			_sprHeight += botClip;
+			_sprHeight -= botClip;
 		}
 	}
 	_sprY = (uint32)spriteY;
@@ -633,13 +634,17 @@
 	}
 	_sprX = (uint32)spriteX;
 	uint8 *screenPtr = _backScreen + _sprY * GAME_SCREEN_WIDTH + _sprX;
+	if ((_sprHeight > 192) || (_sprY > 192)) {
+		_sprWidth = 0;
+		return;
+	}
 	if ((_sprX + _sprWidth > 320) || (_sprY + _sprHeight > 192)) {
 		warning("SkyScreen::drawSprite fatal error: got x = %d, y = %d, w = %d, h = %d\n",_sprX, _sprY, _sprWidth, _sprHeight);
 		_sprWidth = 0;
 		return ;
 	}
 	
-	for (uint8 cnty = 0; cnty < _sprHeight; cnty++) {
+	for (uint16 cnty = 0; cnty < _sprHeight; cnty++) {
 		for (uint16 cntx = 0; cntx < _sprWidth; cntx++)
 			if (spriteData[cntx + _maskX1]) screenPtr[cntx] = spriteData[cntx + _maskX1];
 		spriteData += _sprWidth + _maskX2 + _maskX1;





More information about the Scummvm-git-logs mailing list