-/* xscreensaver, Copyright (c) 1992-2008 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1992-2014 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
Bool xsym, ysym;
int sleep_time;
int xlim, ylim;
+ int scale;
XColor color;
int current_x, current_y, remaining_iterations;
eraser_state *eraser;
Colormap cmap;
XWindowAttributes xgwa;
XGetWindowAttributes (dpy, window, &xgwa);
+
+ st->scale = 1;
+ if (xgwa.width > 2560 || xgwa.height > 2560)
+ st->scale *= 3; /* Retina displays */
+
+
cmap = xgwa.colormap;
gcv.foreground = st->default_fg_pixel =
get_pixel_resource (dpy, cmap, "foreground", "Foreground");
rorschach_draw_step (Display *dpy, Window window, struct state *st)
{
# define ITER_CHUNK 300
- XPoint points [4 * ITER_CHUNK];
+ XRectangle points [4 * ITER_CHUNK];
int x = st->current_x;
int y = st->current_y;
int i, j = 0;
y += ((random () % (1 + (st->offset << 1))) - st->offset);
points [j].x = x;
points [j].y = y;
+ points[j].width = points[j].height = st->scale;
j++;
if (st->xsym)
{
points [j].x = st->xlim - x;
points [j].y = y;
+ points[j].width = points[j].height = st->scale;
j++;
}
if (st->ysym)
{
points [j].x = x;
points [j].y = st->ylim - y;
+ points[j].width = points[j].height = st->scale;
j++;
}
if (st->xsym && st->ysym)
{
points [j].x = st->xlim - x;
points [j].y = st->ylim - y;
+ points[j].width = points[j].height = st->scale;
j++;
}
}
- XDrawPoints (dpy, window, st->draw_gc, points, j, CoordModeOrigin);
+ XFillRectangles (dpy, window, st->draw_gc, points, j);
st->remaining_iterations -= this_iterations;
if (st->remaining_iterations < 0) st->remaining_iterations = 0;
st->current_x = x;
static Bool
rorschach_event (Display *dpy, Window window, void *closure, XEvent *event)
{
+ struct state *st = (struct state *) closure;
+ if (screenhack_event_helper (dpy, window, event))
+ {
+ st->remaining_iterations = 0;
+ return True;
+ }
return False;
}
rorschach_free (Display *dpy, Window window, void *closure)
{
struct state *st = (struct state *) closure;
+ XFreeGC (dpy, st->draw_gc);
free (st);
}
"*iterations: 4000",
"*offset: 7",
"*delay: 5",
-#ifdef USE_IPHONE
+#ifdef HAVE_MOBILE
"*ignoreRotation: True",
#endif
0