aboutsummaryrefslogtreecommitdiff
path: root/backends/sdl
diff options
context:
space:
mode:
authorMax Horn2003-05-28 21:57:22 +0000
committerMax Horn2003-05-28 21:57:22 +0000
commit6a8bd23d025bbe7be7553ec95ccf88f1eb2a6cbb (patch)
treecbbdf7873ad602bac87360d8b5ff9842de69e4d7 /backends/sdl
parent78ef0ea5b5d336315b79f5afa9e91ffb52422fd7 (diff)
downloadscummvm-rg350-6a8bd23d025bbe7be7553ec95ccf88f1eb2a6cbb.tar.gz
scummvm-rg350-6a8bd23d025bbe7be7553ec95ccf88f1eb2a6cbb.tar.bz2
scummvm-rg350-6a8bd23d025bbe7be7553ec95ccf88f1eb2a6cbb.zip
there used to be a black border at the top/left side with the 1x scaler: fixed!
svn-id: r8065
Diffstat (limited to 'backends/sdl')
-rw-r--r--backends/sdl/sdl.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp
index cd06a6c039..a00d00162c 100644
--- a/backends/sdl/sdl.cpp
+++ b/backends/sdl/sdl.cpp
@@ -275,33 +275,34 @@ void OSystem_SDL::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 (SDL_BlitSurface(_screen, r, _hwscreen, &dst) != 0)
- error("SDL_BlitSurface failed: %s", SDL_GetError());
- } else {
+
+ if (_overlayVisible) {
+ // FIXME: I don't understand why this is necessary...
+ dst.x--;
+ dst.y--;
+ }
+ if (SDL_BlitSurface(target, r, _hwscreen, &dst) != 0)
+ error("SDL_BlitSurface failed: %s", SDL_GetError());
+ }
+ } else {
+ if (!_overlayVisible) {
+ 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 (SDL_BlitSurface(_screen, r, _tmpscreen, &dst) != 0)
error("SDL_BlitSurface failed: %s", SDL_GetError());
}
}
- } else if (_scaler_proc == Normal1x) {
- for(r = _dirty_rect_list; r != last_rect; ++r) {
- dst = *r;
- if (SDL_BlitSurface(_tmpscreen, r, _hwscreen, &dst) != 0)
- error("SDL_BlitSurface failed: %s", SDL_GetError());
- }
- }
- if (_scaler_proc != Normal1x) {
SDL_LockSurface(_tmpscreen);
SDL_LockSurface(_hwscreen);