[Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl_gl.cpp,1.30,1.31
Travis Howell
kirben at users.sourceforge.net
Tue Jun 17 09:04:04 CEST 2003
Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory sc8-pr-cvs1:/tmp/cvs-serv27709/backends/sdl
Modified Files:
sdl_gl.cpp
Log Message:
Update backend with recent changes, hope this is right.
Index: sdl_gl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl_gl.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- sdl_gl.cpp 17 Jun 2003 06:13:57 -0000 1.30
+++ sdl_gl.cpp 17 Jun 2003 16:03:12 -0000 1.31
@@ -381,35 +381,37 @@
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 @@
}
else { // SDL backend
- if (_scaler_proc != Normal1x) {
SDL_LockSurface(_tmpscreen);
SDL_LockSurface(_hwscreen);
More information about the Scummvm-git-logs
mailing list