X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fripples.c;h=323f1c1c34a2b51dd3996941f7ce7421c2d01bd8;hb=40eacb5812ef7c0e3374fb139afbb4f5bc8bbfb5;hp=fd7e4fa79920f15eefc98f39b3afb7c2f6017090;hpb=0ed85ca0e4b0eae40a4f50a51d63f2f41e45373a;p=xscreensaver diff --git a/hacks/ripples.c b/hacks/ripples.c index fd7e4fa7..323f1c1c 100644 --- a/hacks/ripples.c +++ b/hacks/ripples.c @@ -84,8 +84,11 @@ static void (*draw_transparent)(short *src); /* How hard to hit the water */ #define SPLASH 512 +#undef MIN #define MIN(x, y) ((x) < (y) ? (x) : (y)) +#undef MAX #define MAX(x, y) ((x) > (y) ? (x) : (y)) +#undef DIRTY #define DIRTY 3 /* dirty >= 2, 1 = restore original pixel, 0 = leave alone */ /* From fortune(6) */ @@ -433,12 +436,20 @@ setup_X(Display * disp, Window win) bigheight = xwa.height; visual = xwa.visual; -#if 1 /* I'm not entirely sure if I need this */ + + /* This causes buffer_map to be 1 pixel taller and wider than orig_map, + which can cause the two XImages to have different bytes-per-line, + which causes stair-stepping. So this better not be necessary... + -jwz, 23-Nov-01 + */ +#if 0 /* I'm not entirely sure if I need this */ if (bigwidth % 2) bigwidth++; if (bigheight % 2) bigheight++; #endif + + width = bigwidth / 2; height = bigheight / 2; @@ -455,7 +466,7 @@ setup_X(Display * disp, Window win) gc = XCreateGC(display, window, gcflags, &gcv); - grab_screen_image(xwa.screen, window); + load_random_image (xwa.screen, window, window); orig_map = XGetImage(display, window, 0, 0, xwa.width, xwa.height, ~0L, ZPixmap);