aboutsummaryrefslogtreecommitdiff
path: root/sdl.cpp
diff options
context:
space:
mode:
authorLudvig Strigeus2002-04-13 11:32:15 +0000
committerLudvig Strigeus2002-04-13 11:32:15 +0000
commit151bbf6ccabc1203850fb3e16bb53f66fbcf0919 (patch)
treeeae92ef6cced89c23355f51354efeb85586b645d /sdl.cpp
parentb6aa3ab27d601932af66123df885356534da0c3d (diff)
downloadscummvm-rg350-151bbf6ccabc1203850fb3e16bb53f66fbcf0919.tar.gz
scummvm-rg350-151bbf6ccabc1203850fb3e16bb53f66fbcf0919.tar.bz2
scummvm-rg350-151bbf6ccabc1203850fb3e16bb53f66fbcf0919.zip
fixed gfx glitch with 2xsai
svn-id: r3921
Diffstat (limited to 'sdl.cpp')
-rw-r--r--sdl.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/sdl.cpp b/sdl.cpp
index 749ce9f456..444340112a 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -77,7 +77,7 @@ private:
DF_WANT_RECT_OPTIM = 2,
DF_2xSAI = 4,
DF_SEPARATE_HWSCREEN = 8,
-
+ DF_UPDATE_EXPAND_1_PIXEL = 16,
};
int _driver;
@@ -247,7 +247,7 @@ void OSystem_SDL::load_gfx_mode() {
if (_sai_func) {
uint16 *tmp_screen = (uint16*)calloc(320*204 + 16,sizeof(uint16));
- _driver_flags = DF_FORCE_FULL_ON_PALETTE | DF_WANT_RECT_OPTIM | DF_2xSAI | DF_SEPARATE_HWSCREEN;
+ _driver_flags = DF_FORCE_FULL_ON_PALETTE | DF_WANT_RECT_OPTIM | DF_2xSAI | DF_SEPARATE_HWSCREEN | DF_UPDATE_EXPAND_1_PIXEL;
Init_2xSaI(565);
sdl_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 200, 8, 0, 0, 0, 0);
@@ -396,6 +396,15 @@ void OSystem_SDL::add_dirty_rect(int x, int y, int w, int h) {
else {
SDL_Rect *r = &dirty_rect_list[num_dirty_rects++];
+ /* Update the dirty region by 1 pixel for graphics drivers
+ * that "smear" the screen */
+ if (_driver_flags & DF_UPDATE_EXPAND_1_PIXEL) {
+ x--;
+ y--;
+ w+=2;
+ h+=2;
+ }
+
/* clip */
if (x<0) { w+=x; x=0; }
if (y<0) { h+=y; y=0; }