[Scummvm-cvs-logs] SF.net SVN: scummvm: [21346] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Mar 17 06:20:10 CET 2006


Revision: 21346
Author:   lordhoto
Date:     2006-03-17 06:19:18 -0800 (Fri, 17 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21346&view=rev

Log Message:
-----------
- Fixes bug #1401432 ("KYRA: Brandon graphics glitch when exiting castle catacombs")
- Fixes some sprite redraw bugs introduced with my last commits
- Fixes wsa drawing bug in the cave too

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/animator.cpp
    scummvm/trunk/engines/kyra/scene.cpp
    scummvm/trunk/engines/kyra/script_v1.cpp
    scummvm/trunk/engines/kyra/sprites.cpp
Modified: scummvm/trunk/engines/kyra/animator.cpp
===================================================================
--- scummvm/trunk/engines/kyra/animator.cpp	2006-03-17 13:13:31 UTC (rev 21345)
+++ scummvm/trunk/engines/kyra/animator.cpp	2006-03-17 14:19:18 UTC (rev 21346)
@@ -175,13 +175,13 @@
 
 void ScreenAnimator::preserveOrRestoreBackground(AnimObject *obj, bool restore) {
 	debugC(9, kDebugLevelAnimator, "ScreenAnimator::preserveOrRestoreBackground(%p, %d)", (const void *)obj, restore);
-	int x = 0, y = 0, width = obj->width << 3, height = obj->height;
+	int x = 0, y = 0, width = obj->width, height = obj->height;
 	
 	if (restore) {
-		x = obj->x2;
+		x = obj->x2 >> 3;
 		y = obj->y2;
 	} else {
-		x = obj->x1;
+		x = obj->x1 >> 3;
 		y = obj->y1;
 	}
 	
@@ -193,8 +193,8 @@
 	int temp;
 	
 	temp = x + width;
-	if (temp >= 319) {
-		x = 319 - width;
+	if (temp >= 40) {
+		x = 39 - width;
 	}
 	temp = y + height;
 	if (temp >= 136) {
@@ -202,9 +202,9 @@
 	}
 
 	if (restore) {
-		_screen->copyBlockToPage(_screen->_curPage, x, y, width, height, obj->background);
+		_screen->copyBlockToPage(_screen->_curPage, x << 3, y, width << 3, height, obj->background);
 	} else {
-		_screen->copyRegionToBuffer(_screen->_curPage, x, y, width, height, obj->background);
+		_screen->copyRegionToBuffer(_screen->_curPage, x << 3, y, width << 3, height, obj->background);
 	}
 }
 
@@ -373,24 +373,24 @@
 		if (curObject->active) {
 			if (curObject->refreshFlag || refreshFlag) {
 				int xpos = 0, ypos = 0, width = 0, height = 0;
-				xpos = curObject->x1 - curObject->width2 - 8;
+				xpos = (curObject->x1>>3) - (curObject->width2>>3) - 1;
 				ypos = curObject->y1 - curObject->height2;
-				width = (curObject->width<<3) + curObject->width2 + 16;
+				width = curObject->width + (curObject->width2>>3) + 2;
 				height = curObject->height + curObject->height2*2;
 				
-				if (xpos < 8) {
-					xpos = 8;
-				} else if (xpos + width > 312) {
-					width = 312 - xpos;
+				if (xpos < 1) {
+					xpos = 1;
+				} else if (xpos + width > 39) {
+					width = width - (xpos + width - 39);
 				}
 				
 				if (ypos < 8) {
 					ypos = 8;
-				} else if (ypos + height > 136) {
-					height = 136 - ypos;
+				} else if (ypos + height > 135) {
+					height = height - (ypos + height - 136);
 				}
 				
-				_screen->copyRegion(xpos, ypos, xpos, ypos, width, height, 2, 0, Screen::CR_CLIPPED);
+				_screen->copyRegion(xpos << 3, ypos, xpos << 3, ypos, width << 3, height, 2, 0, Screen::CR_CLIPPED);
 				curObject->refreshFlag = 0;
 				_updateScreen = true;
 			}

Modified: scummvm/trunk/engines/kyra/scene.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene.cpp	2006-03-17 13:13:31 UTC (rev 21345)
+++ scummvm/trunk/engines/kyra/scene.cpp	2006-03-17 14:19:18 UTC (rev 21346)
@@ -777,7 +777,7 @@
 		}
 		curAnimState->height = _sprites->_anims[i].height;
 		curAnimState->height2 = _sprites->_anims[i].height2;
-		curAnimState->width = _sprites->_anims[i].width;
+		curAnimState->width = _sprites->_anims[i].width + 1;
 		curAnimState->width2 = _sprites->_anims[i].width2;
 		curAnimState->drawY = _sprites->_anims[i].drawY;
 		curAnimState->x1 = curAnimState->x2 = _sprites->_anims[i].x;

Modified: scummvm/trunk/engines/kyra/script_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v1.cpp	2006-03-17 13:13:31 UTC (rev 21345)
+++ scummvm/trunk/engines/kyra/script_v1.cpp	2006-03-17 14:19:18 UTC (rev 21346)
@@ -410,12 +410,12 @@
 }
 
 int KyraEngine::cmd_openWSAFile(ScriptState *script) {
-	debugC(3, kDebugLevelScriptFuncs, "cmd_openWSAFile(%p) ('%s', %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2));
+	debugC(3, kDebugLevelScriptFuncs, "cmd_openWSAFile(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3));
 	
 	char *filename = stackPosString(0);
 	int wsaIndex = stackPos(1);
 	
-	_movieObjects[wsaIndex]->open(filename, (stackPos(2) != 0) ? 1 : 0, 0);
+	_movieObjects[wsaIndex]->open(filename, (stackPos(3) != 0) ? 1 : 0, 0);
 	assert(_movieObjects[wsaIndex]->opened());
 	
 	return 0;

Modified: scummvm/trunk/engines/kyra/sprites.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sprites.cpp	2006-03-17 13:13:31 UTC (rev 21345)
+++ scummvm/trunk/engines/kyra/sprites.cpp	2006-03-17 14:19:18 UTC (rev 21346)
@@ -76,7 +76,7 @@
 			_anims[i].unk2 = READ_LE_UINT16(data);
 			data += 4;
 
-			if (_engine->_northExitHeight > READ_LE_UINT16(data))
+			if (_engine->_northExitHeight & 0xFF > READ_LE_UINT16(data))
 				_anims[i].drawY = _engine->_northExitHeight;
 			else
 				_anims[i].drawY = READ_LE_UINT16(data);
@@ -108,13 +108,13 @@
 
 			_anims[i].script = data;
 
-			int bkgdWidth = _anims[i].width << 3;
+			int bkgdWidth = _anims[i].width;
 			int bkgdHeight = _anims[i].height;
 
-			if (_anims[i].width2)
-				bkgdWidth += _anims[i].width2 << 3;
+			if (_anims[i].width2 > 0)
+				bkgdWidth += (_anims[i].width2 >> 3) + 1;
 
-			if (_anims[i].height2)
+			if (_anims[i].height2 > 0)
 				bkgdHeight += _anims[i].height2;
 
 			_anims[i].background = (uint8 *)malloc(_screen->getRectSize(bkgdWidth + 1, bkgdHeight));


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