aboutsummaryrefslogtreecommitdiff
path: root/backends/dc
diff options
context:
space:
mode:
authorMichael Pearce2002-09-09 05:56:11 +0000
committerMichael Pearce2002-09-09 05:56:11 +0000
commit0fbefc72aa7fd29b74dd2fac41ebfae0dfcac781 (patch)
tree7db3576c01a534d363786bb7a16c18b85eec2452 /backends/dc
parent5b8eb34406373daa7a167f89d32dbe72c3cdc005 (diff)
downloadscummvm-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/dc')
-rw-r--r--backends/dc/dc.h1
-rw-r--r--backends/dc/display.cpp40
2 files changed, 41 insertions, 0 deletions
diff --git a/backends/dc/dc.h b/backends/dc/dc.h
index 4a2b78cfb7..7bd15c9bbf 100644
--- a/backends/dc/dc.h
+++ b/backends/dc/dc.h
@@ -15,6 +15,7 @@ class OSystem_Dreamcast : public OSystem {
// Draw a bitmap to screen.
// 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();
diff --git a/backends/dc/display.cpp b/backends/dc/display.cpp
index 97c7f2aed5..317f33a0fa 100644
--- a/backends/dc/display.cpp
+++ b/backends/dc/display.cpp
@@ -132,6 +132,46 @@ void OSystem_Dreamcast::copy_rect(const byte *buf, int pitch, int x, int y,
} while (--h);
}
+void OSystem_Dreamcast::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(screen + SCREEN_W * (y - dy), SCREEN_W, 0, y, SCREEN_W, 1);
+ } else {
+ // move up
+ // copy from top to bottom
+ for (int y = 0; y < height + dx; y++)
+ copy_rect(screen + SCREEN_W * (y - dy), SCREEN_W, 0, y, SCREEN_W, 1);
+ }
+ } else if (dy == 0) {
+ // horizontal movement
+ if (dx > 0) {
+ // move right
+ // copy from right to left
+ for (int x = SCREEN_W - 1; x >= dx; x--)
+ copy_rect(screen + x - dx, SCREEN_W, x, 0, 1, height);
+ } else {
+ // move left
+ // copy from left to right
+ for (int x = 0; x < SCREEN_W; x++)
+ copy_rect(screen + x - dx, SCREEN_W, x, 0, 1, height);
+ }
+ } else {
+ // free movement
+ // not neccessary for now
+ }
+
+
+}
+
+
bool OSystem_Dreamcast::show_mouse(bool visible)
{
bool last = _ms_visible;