diff options
author | Travis Howell | 2003-06-17 16:03:12 +0000 |
---|---|---|
committer | Travis Howell | 2003-06-17 16:03:12 +0000 |
commit | a09e7a56151de136f221aa87b820d906c977c4ac (patch) | |
tree | 5607bb2abe6a405b76ceef4f59b15be8db173dc3 /backends | |
parent | c7b19406cdb68f103588feec931edecc67471806 (diff) | |
download | scummvm-rg350-a09e7a56151de136f221aa87b820d906c977c4ac.tar.gz scummvm-rg350-a09e7a56151de136f221aa87b820d906c977c4ac.tar.bz2 scummvm-rg350-a09e7a56151de136f221aa87b820d906c977c4ac.zip |
Update backend with recent changes, hope this is right.
svn-id: r8535
Diffstat (limited to 'backends')
-rw-r--r-- | backends/sdl/sdl_gl.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/backends/sdl/sdl_gl.cpp b/backends/sdl/sdl_gl.cpp index 7ba030bd43..e831d1d338 100644 --- a/backends/sdl/sdl_gl.cpp +++ b/backends/sdl/sdl_gl.cpp @@ -381,35 +381,37 @@ void OSystem_SDL_OpenGL::update_screen() { if (_num_dirty_rects > 0) { SDL_Rect *r; + SDL_Rect dst; uint32 srcPitch, dstPitch; SDL_Rect *last_rect = _dirty_rect_list + _num_dirty_rects; // Convert appropriate parts of the 8bpp image into 16bpp - SDL_Rect dst; - if (!_overlayVisible) { + if (_scaler_proc == Normal1x) { + SDL_Surface *target = _overlayVisible ? _tmpscreen : _screen; for(r = _dirty_rect_list; r != last_rect; ++r) { dst = *r; - dst.x++; // Shift rect by one since 2xSai needs to acces the data around - dst.y++; // any pixel to scale it, and we want to avoid mem access crashes. - if (_scaler_proc == Normal1x) { - if (_usingOpenGL) { - if (SDL_BlitSurface(_screen, r, _tmpscreen, &dst) != 0) + if (_overlayVisible) { + // FIXME: I don't understand why this is necessary... + dst.x--; + dst.y--; + } + if (_usingOpenGL) { + if (SDL_BlitSurface(target, r, _tmpscreen, &dst) != 0) error("SDL_BlitSurface failed: %s", SDL_GetError()); } - else { // SDL backend - if (SDL_BlitSurface(_screen, r, _hwscreen, &dst) != 0) + else { // SDL backend + if (SDL_BlitSurface(target, r, _hwscreen, &dst) != 0) error("SDL_BlitSurface failed: %s", SDL_GetError()); } - } else { // _scaler_proc != Normal1x - if (SDL_BlitSurface(_screen, r, _tmpscreen, &dst) != 0) - error("SDL_BlitSurface failed: %s", SDL_GetError()); } - } } else { if (!_usingOpenGL) { + if (!_overlayVisible) { for(r = _dirty_rect_list; r != last_rect; ++r) { dst = *r; - if (SDL_BlitSurface(_tmpscreen, r, _hwscreen, &dst) != 0) + dst.x++; // Shift rect by one since 2xSai needs to acces the data around + dst.y++; // any pixel to scale it, and we want to avoid mem access crashes. + if (SDL_BlitSurface(_screen, r, _tmpscreen, &dst) != 0) error("SDL_BlitSurface failed: %s", SDL_GetError()); } } @@ -441,7 +443,6 @@ void OSystem_SDL_OpenGL::update_screen() { } else { // SDL backend - if (_scaler_proc != Normal1x) { SDL_LockSurface(_tmpscreen); SDL_LockSurface(_hwscreen); |