From 4bd05071e511c077811040c7c746d1c5f8e8c3f8 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 4 Sep 2004 01:31:04 +0000 Subject: Got rid of OSystem::move_screen svn-id: r14882 --- backends/sdl/graphics.cpp | 71 ----------------------------------------------- backends/sdl/sdl-common.h | 2 -- 2 files changed, 73 deletions(-) (limited to 'backends/sdl') diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp index 692f200e7f..89958d6440 100644 --- a/backends/sdl/graphics.cpp +++ b/backends/sdl/graphics.cpp @@ -720,77 +720,6 @@ void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) { _paletteDirtyEnd = start + num; } -void OSystem_SDL::move_screen(int dx, int dy, int height) { - - // Short circuit check - do we have to do anything anyway? - if ((dx == 0 && dy == 0) || height <= 0) - return; - - Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends - - byte *src, *dst; - int x, y; - - // We'll have to do a full screen redraw anyway, so set the flag. - _forceFull = true; - - // Hide the mouse - undraw_mouse(); - - // Try to lock the screen surface - if (SDL_LockSurface(_screen) == -1) - error("SDL_LockSurface failed: %s", SDL_GetError()); - - // vertical movement - if (dy > 0) { - // move down - copy from bottom to top - dst = (byte *)_screen->pixels + (height - 1) * _screenWidth; - src = dst - dy * _screenWidth; - for (y = dy; y < height; y++) { - memcpy(dst, src, _screenWidth); - src -= _screenWidth; - dst -= _screenWidth; - } - } else if (dy < 0) { - // move up - copy from top to bottom - dst = (byte *)_screen->pixels; - src = dst - dy * _screenWidth; - for (y = -dy; y < height; y++) { - memcpy(dst, src, _screenWidth); - src += _screenWidth; - dst += _screenWidth; - } - } - - // horizontal movement - if (dx > 0) { - // move right - copy from right to left - dst = (byte *)_screen->pixels + (_screenWidth - 1); - src = dst - dx; - for (y = 0; y < height; y++) { - for (x = dx; x < _screenWidth; x++) { - *dst-- = *src--; - } - src += _screenWidth + (_screenWidth - dx); - dst += _screenWidth + (_screenWidth - dx); - } - } else if (dx < 0) { - // move left - copy from left to right - dst = (byte *)_screen->pixels; - src = dst - dx; - for (y = 0; y < height; y++) { - for (x = -dx; x < _screenWidth; x++) { - *dst++ = *src++; - } - src += _screenWidth - (_screenWidth + dx); - dst += _screenWidth - (_screenWidth + dx); - } - } - - // Unlock the screen surface - SDL_UnlockSurface(_screen); -} - void OSystem_SDL::set_shake_pos(int shake_pos) { _newShakePos = shake_pos; } diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h index 10f6c8b5e4..3c1e600eaa 100644 --- a/backends/sdl/sdl-common.h +++ b/backends/sdl/sdl-common.h @@ -52,8 +52,6 @@ public: // The screen will not be updated to reflect the new bitmap void copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h); - void move_screen(int dx, int dy, int height); - // Update the dirty areas of the screen void updateScreen(); -- cgit v1.2.3