[Scummvm-cvs-logs] SF.net SVN: scummvm:[35731] scummvm/trunk/backends/platform/wince/wince-sdl .cpp

knakos at users.sourceforge.net knakos at users.sourceforge.net
Sun Jan 4 20:37:57 CET 2009


Revision: 35731
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35731&view=rev
Author:   knakos
Date:     2009-01-04 19:37:56 +0000 (Sun, 04 Jan 2009)

Log Message:
-----------
fix bug #2480870: crash when shaking (not stirring)

Modified Paths:
--------------
    scummvm/trunk/backends/platform/wince/wince-sdl.cpp

Modified: scummvm/trunk/backends/platform/wince/wince-sdl.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/wince-sdl.cpp	2009-01-04 17:17:28 UTC (rev 35730)
+++ scummvm/trunk/backends/platform/wince/wince-sdl.cpp	2009-01-04 19:37:56 UTC (rev 35731)
@@ -1530,7 +1530,7 @@
 	SDL_Surface *srcSurf, *origSurf;
 	static bool old_overlayVisible = false;
 	int numRectsOut = 0;
-	int16 routx, routy, routw, routh, stretch;
+	int16 routx, routy, routw, routh, stretch, shakestretch;
 
 	assert(_hwscreen != NULL);
 
@@ -1634,10 +1634,11 @@
 			}
 
 			// transform
-			routx = r->x * _scaleFactorXm / _scaleFactorXd;				// locate position in scaled screen
-			routy = (r->y + _currentShakePos) * _scaleFactorYm / _scaleFactorYd;	// adjust for shake offset
+			shakestretch = _currentShakePos * _scaleFactorYm / _scaleFactorYd;
+			routx = r->x * _scaleFactorXm / _scaleFactorXd;					// locate position in scaled screen
+			routy = r->y * _scaleFactorYm / _scaleFactorYd + shakestretch;	// adjust for shake offset
 			routw = r->w * _scaleFactorXm / _scaleFactorXd;
-			routh = r->h * _scaleFactorYm / _scaleFactorYd;
+			routh = r->h * _scaleFactorYm / _scaleFactorYd - shakestretch;
 
 			// clipping destination rectangle inside device screen (more strict, also more tricky but more stable)
 			// note that all current scalers do not make dst rect exceed left/right, unless chosen badly (FIXME)
@@ -1668,11 +1669,11 @@
 			// blit it (with added voodoo from the sdl backend, shifting the source rect again)
 			_scalerProc(	(byte *)srcSurf->pixels + (r->x * 2 + 2)+ (r->y + 1) * srcPitch, srcPitch,
 					(byte *)_hwscreen->pixels + routx * 2 + routy * dstPitch, dstPitch,
-					r->w, r->h);
+					r->w, r->h - _currentShakePos);
 
 			// add this rect to output
-			rout->x = routx;	rout->y = routy;
-			rout->w = routw;	rout->h = routh;
+			rout->x = routx;	rout->y = routy - shakestretch;
+			rout->w = routw;	rout->h = routh + shakestretch;
 			numRectsOut++;
 			rout++;
 


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