diff options
author | Michael Pearce | 2002-09-09 05:56:11 +0000 |
---|---|---|
committer | Michael Pearce | 2002-09-09 05:56:11 +0000 |
commit | 0fbefc72aa7fd29b74dd2fac41ebfae0dfcac781 (patch) | |
tree | 7db3576c01a534d363786bb7a16c18b85eec2452 /backends/x11/x11.cpp | |
parent | 5b8eb34406373daa7a167f89d32dbe72c3cdc005 (diff) | |
download | scummvm-rg350-0fbefc72aa7fd29b74dd2fac41ebfae0dfcac781.tar.gz scummvm-rg350-0fbefc72aa7fd29b74dd2fac41ebfae0dfcac781.tar.bz2 scummvm-rg350-0fbefc72aa7fd29b74dd2fac41ebfae0dfcac781.zip |
Applied roever's screen effects patch (#602595) and fixed LethalWP's Makefile ;)
svn-id: r4909
Diffstat (limited to 'backends/x11/x11.cpp')
-rw-r--r-- | backends/x11/x11.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/backends/x11/x11.cpp b/backends/x11/x11.cpp index 1492c0d8ae..3a2e362a1d 100644 --- a/backends/x11/x11.cpp +++ b/backends/x11/x11.cpp @@ -62,6 +62,8 @@ public: // The screen will not be updated to reflect the new bitmap void copy_rect(const byte *buf, 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 update_screen(); @@ -509,6 +511,44 @@ void OSystem_X11::copy_rect(const byte *buf, int pitch, int x, int y, int w, int } } +void OSystem_X11::move_screen(int dx, int dy, int height) { + + if ((dx == 0) && (dy == 0)) + return; + + if (dx == 0) { + // vertical movement + if (dy > 0) { + // move down + // copy from bottom to top + for (int y = height - 1; y >= dy; y--) + copy_rect(local_fb + fb_width * (y - dy), fb_width, 0, y, fb_width, 1); + } else { + // move up + // copy from top to bottom + for (int y = 0; y < height + dx; y++) + copy_rect(local_fb + fb_width * (y - dy), fb_width, 0, y, fb_width, 1); + } + } else if (dy == 0) { + // horizontal movement + if (dx > 0) { + // move right + // copy from right to left + for (int x = fb_width - 1; x >= dx; x--) + copy_rect(local_fb + x - dx, fb_width, x, 0, 1, height); + } else { + // move left + // copy from left to right + for (int x = 0; x < fb_width; x++) + copy_rect(local_fb + x - dx, fb_width, x, 0, 1, height); + } + } else { + // free movement + // not neccessary for now + } +} + + void OSystem_X11::update_screen_helper(const dirty_square * d, dirty_square * dout) { int x, y; |