aboutsummaryrefslogtreecommitdiff
path: root/backends
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
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')
-rw-r--r--backends/dc/dc.h1
-rw-r--r--backends/dc/display.cpp40
-rw-r--r--backends/mac/mac.cpp6
-rw-r--r--backends/morphos/morphos.cpp40
-rw-r--r--backends/morphos/morphos.h1
-rw-r--r--backends/null/null.cpp1
-rw-r--r--backends/sdl/sdl-common.cpp37
-rw-r--r--backends/sdl/sdl-common.h2
-rw-r--r--backends/wince/pocketpc.cpp42
-rw-r--r--backends/x11/x11.cpp40
10 files changed, 210 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;
diff --git a/backends/mac/mac.cpp b/backends/mac/mac.cpp
index f22d72666b..2dc6dea1f5 100644
--- a/backends/mac/mac.cpp
+++ b/backends/mac/mac.cpp
@@ -772,6 +772,12 @@ void OSystem_MAC::copy_rect(const byte *buf, int pitch, int x, int y, int w, int
} while(--h);
}
+void OSystem_MAC::move_screen(int dx, int dy) {
+
+
+}
+
+
void OSystem_MAC::add_dirty_rect(int x, int y, int w, int h) {
if (force_full)
return;
diff --git a/backends/morphos/morphos.cpp b/backends/morphos/morphos.cpp
index 629b8079b8..164c046b54 100644
--- a/backends/morphos/morphos.cpp
+++ b/backends/morphos/morphos.cpp
@@ -927,6 +927,46 @@ void OSystem_MorphOS::copy_rect(const byte *src, int pitch, int x, int y, int w,
}
}
+void OSystem_MorphOS::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((byte *)ScummBuffer + ScummBufferWidth * (y - dy), ScummBufferWidth, 0, y, ScummBufferWidth, 1);
+ } else {
+ // move up
+ // copy from top to bottom
+ for (int y = 0; y < height + dx; y++)
+ copy_rect((byte *)ScummBuffer + ScummBufferWidth * (y - dy), ScummBufferWidth, 0, y, ScummBufferWidth, 1);
+ }
+ } else if (dy == 0) {
+ // horizontal movement
+ if (dx > 0) {
+ // move right
+ // copy from right to left
+ for (int x = ScummBufferWidth - 1; x >= dx; x--)
+ copy_rect((byte *)ScummBuffer + x - dx, ScummBufferWidth, x, 0, 1, height);
+ } else {
+ // move left
+ // copy from left to right
+ for (int x = 0; x < ScummBufferWidth; x++)
+ copy_rect((byte *)ScummBuffer + x - dx, ScummBufferWidth, x, 0, 1, height);
+ }
+ } else {
+ // free movement
+ // not neccessary for now
+ }
+
+
+}
+
+
bool OSystem_MorphOS::AddUpdateRect(WORD x, WORD y, WORD w, WORD h)
{
if (UpdateRects > 25)
diff --git a/backends/morphos/morphos.h b/backends/morphos/morphos.h
index aead0c3aec..6bda51d597 100644
--- a/backends/morphos/morphos.h
+++ b/backends/morphos/morphos.h
@@ -47,6 +47,7 @@ class OSystem_MorphOS : public OSystem
// Draw a bitmap to screen.
// The screen will not be updated to reflect the new bitmap
virtual 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
virtual void update_screen();
diff --git a/backends/null/null.cpp b/backends/null/null.cpp
index d48f1be764..df42dbfc38 100644
--- a/backends/null/null.cpp
+++ b/backends/null/null.cpp
@@ -30,6 +30,7 @@ public:
void set_palette(const byte *colors, uint start, uint num) {}
void init_size(uint w, uint h);
void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) {}
+ void move_screen(int dx, int dy) {}
void update_screen() {}
bool show_mouse(bool visible) { return false; }
void set_mouse_pos(int x, int y) {}
diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp
index 422ce8b353..bdedb8ed1a 100644
--- a/backends/sdl/sdl-common.cpp
+++ b/backends/sdl/sdl-common.cpp
@@ -135,6 +135,43 @@ void OSystem_SDL_Common::copy_rect(const byte *buf, int pitch, int x, int y, int
}
+void OSystem_SDL_Common::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((byte *)sdl_screen->pixels + SCREEN_WIDTH * (y - dy), SCREEN_WIDTH, 0, y, SCREEN_WIDTH, 1);
+ } else {
+ // move up
+ // copy from top to bottom
+ for (int y = 0; y < height + dx; y++)
+ copy_rect((byte *)sdl_screen->pixels + SCREEN_WIDTH * (y - dy), SCREEN_WIDTH, 0, y, SCREEN_WIDTH, 1);
+ }
+ } else if (dy == 0) {
+ // horizontal movement
+ if (dx > 0) {
+ // move right
+ // copy from right to left
+ for (int x = SCREEN_WIDTH - 1; x >= dx; x--)
+ copy_rect((byte *)sdl_screen->pixels + x - dx, SCREEN_WIDTH, x, 0, 1, height);
+ } else {
+ // move left
+ // copy from left to right
+ for (int x = 0; x < SCREEN_WIDTH; x++)
+ copy_rect((byte *)sdl_screen->pixels + x - dx, SCREEN_WIDTH, x, 0, 1, height);
+ }
+ } else {
+ // free movement
+ // not neccessary for now
+ }
+}
+
void OSystem_SDL_Common::add_dirty_rect(int x, int y, int w, int h) {
if (force_full)
return;
diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h
index ae7b64306e..bd2410ab2a 100644
--- a/backends/sdl/sdl-common.h
+++ b/backends/sdl/sdl-common.h
@@ -42,6 +42,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() = 0;
diff --git a/backends/wince/pocketpc.cpp b/backends/wince/pocketpc.cpp
index 0162d14e28..6adb61b0b3 100644
--- a/backends/wince/pocketpc.cpp
+++ b/backends/wince/pocketpc.cpp
@@ -95,6 +95,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();
@@ -1215,6 +1217,46 @@ void OSystem_WINCE3::copy_rect(const byte *buf, int pitch, int x, int y, int w,
} while (--h);
}
+void OSystem_WINCE3::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(_gfx_buf + SCREEN_WIDTH * (y - dy), SCREEN_WIDTH, 0, y, SCREEN_WIDTH, 1);
+ } else {
+ // move up
+ // copy from top to bottom
+ for (int y = 0; y < height + dx; y++)
+ copy_rect(_gfx_buf + SCREEN_WIDTH * (y - dy), SCREEN_WIDTH, 0, y, SCREEN_WIDTH, 1);
+ }
+ } else if (dy == 0) {
+ // horizontal movement
+ if (dx > 0) {
+ // move right
+ // copy from right to left
+ for (int x = SCREEN_WIDTH - 1; x >= dx; x--)
+ copy_rect(_gfx_buf + x - dx, SCREEN_WIDTH, x, 0, 1, height);
+ } else {
+ // move left
+ // copy from left to right
+ for (int x = 0; x < SCREEN_WIDTH; x++)
+ copy_rect(_gfx_buf + x - dx, SCREEN_WIDTH, x, 0, 1, height);
+ }
+ } else {
+ // free movement
+ // not neccessary for now
+ }
+
+
+}
+
+
void OSystem_WINCE3::update_screen() {
if (!hide_cursor)
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;