Update backend with recent changes, hope this is right.

svn-id: r8535
This commit is contained in:
Travis Howell 2003-06-17 16:03:12 +00:00
parent c7b19406cd
commit a09e7a5615

View File

@ -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)
error("SDL_BlitSurface failed: %s", SDL_GetError());
}
else { // SDL backend
if (SDL_BlitSurface(_screen, 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());
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(target, r, _hwscreen, &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);