From 12c2318c769cc506df1c37d193823054e8cce60c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 9 May 2002 17:39:38 +0000 Subject: fixed redraw bug in SDL backend svn-id: r4255 --- sdl.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sdl.cpp') diff --git a/sdl.cpp b/sdl.cpp index 168ba9e480..c74c4efca3 100644 --- a/sdl.cpp +++ b/sdl.cpp @@ -467,14 +467,16 @@ void OSystem_SDL::add_dirty_rect(int x, int y, int w, int h) { #define DOLINE(x) a ^= ((uint32*)buf)[0+(x)*(SCREEN_WIDTH/4)]; b ^= ((uint32*)buf)[1+(x)*(SCREEN_WIDTH/4)] void OSystem_SDL::mk_checksums(const byte *buf) { uint32 *sums = dirty_checksums; - int x,y; + uint x,y; + const uint last_x = (uint)SCREEN_WIDTH/8; + const uint last_y = (uint)SCREEN_HEIGHT/8; /* the 8x8 blocks in buf are enumerated starting in the top left corner and * reading each line at a time from left to right */ - for(y=0; y!=SCREEN_HEIGHT/8; y++,buf+=SCREEN_WIDTH*(8-1)) - for(x=0; x!=SCREEN_WIDTH/8; x++,buf+=8) { - int32 a = x; - int32 b = y; + for(y=0; y != last_y; y++, buf+=SCREEN_WIDTH*(8-1)) + for(x=0; x != last_x; x++, buf+=8) { + uint32 a = x; + uint32 b = y; DOLINE(0); ROL(a,13); ROL(b,11); DOLINE(2); ROL(a,13); ROL(b,11); -- cgit v1.2.3