From 0fbefc72aa7fd29b74dd2fac41ebfae0dfcac781 Mon Sep 17 00:00:00 2001 From: Michael Pearce Date: Mon, 9 Sep 2002 05:56:11 +0000 Subject: Applied roever's screen effects patch (#602595) and fixed LethalWP's Makefile ;) svn-id: r4909 --- backends/morphos/morphos.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ backends/morphos/morphos.h | 1 + 2 files changed, 41 insertions(+) (limited to 'backends/morphos') 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(); -- cgit v1.2.3