aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorKostas Nakos2009-01-04 19:37:56 +0000
committerKostas Nakos2009-01-04 19:37:56 +0000
commit78a6d9e3885884444f1e4eea5d2fba6658047626 (patch)
treeb9aeea8f0eeb5f1c89082fdd999a40b96f894500 /backends/platform
parent83a8f7bc29043259a7edb0235bc471beeb5eb022 (diff)
downloadscummvm-rg350-78a6d9e3885884444f1e4eea5d2fba6658047626.tar.gz
scummvm-rg350-78a6d9e3885884444f1e4eea5d2fba6658047626.tar.bz2
scummvm-rg350-78a6d9e3885884444f1e4eea5d2fba6658047626.zip
fix bug #2480870: crash when shaking (not stirring)
svn-id: r35731
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/wince/wince-sdl.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index 78dc552dce..831d4c61be 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -1530,7 +1530,7 @@ void OSystem_WINCE3::internUpdateScreen() {
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 @@ void OSystem_WINCE3::internUpdateScreen() {
}
// 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 @@ void OSystem_WINCE3::internUpdateScreen() {
// 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++;