[Scummvm-cvs-logs] CVS: scummvm/backends/x11 x11.cpp,1.2,1.3
Michael Pearce
chuzwuzza at users.sourceforge.net
Sun Sep 8 22:57:02 CEST 2002
Update of /cvsroot/scummvm/scummvm/backends/x11
In directory usw-pr-cvs1:/tmp/cvs-serv24674/backends/x11
Modified Files:
x11.cpp
Log Message:
Applied roever's screen effects patch (#602595) and fixed LethalWP's Makefile ;)
Index: x11.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/x11/x11.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- x11.cpp 29 Aug 2002 19:40:51 -0000 1.2
+++ x11.cpp 9 Sep 2002 05:56:10 -0000 1.3
@@ -62,6 +62,8 @@
// 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();
@@ -508,6 +510,44 @@
buf += pitch;
}
}
+
+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)
{
More information about the Scummvm-git-logs
mailing list