aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2006-06-21 11:33:04 +0000
committerTravis Howell2006-06-21 11:33:04 +0000
commit3c11d2fa18e984d6bb024d7e9bd67eb0077cffdf (patch)
tree2da9fce5f7b4ebb71fbe5ff935316dc1bb1a8135 /engines
parent286de879fd7edc2b84cec47b8b53f9d5ac89aa0c (diff)
downloadscummvm-rg350-3c11d2fa18e984d6bb024d7e9bd67eb0077cffdf.tar.gz
scummvm-rg350-3c11d2fa18e984d6bb024d7e9bd67eb0077cffdf.tar.bz2
scummvm-rg350-3c11d2fa18e984d6bb024d7e9bd67eb0077cffdf.zip
Move moveScreen to common surface functions for graphics
svn-id: r23218
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/gfx.cpp50
1 files changed, 1 insertions, 49 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 70105b0162..699c6ac3f8 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -1104,58 +1104,10 @@ void ScummEngine::moveScreen(int dx, int dy, int height) {
if ((dx == 0 && dy == 0) || height <= 0)
return;
- byte *src, *dst;
- int x, y;
-
Graphics::Surface screen;
assert(_system->grabRawScreen(&screen));
- // 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);
- }
- }
-
+ screen.move(dx, dy, height);
_system->copyRectToScreen((byte *)screen.pixels, screen.pitch, 0, 0, screen.w, screen.h);
screen.free();
}