projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver]
/
hacks
/
vermiculate.c
diff --git
a/hacks/vermiculate.c
b/hacks/vermiculate.c
index 6387a42a4909d38c05ea00b11cead074e8186996..ca28c6bbfb7f2cbd542bd29e57c043e517f0be5d 100644
(file)
--- a/
hacks/vermiculate.c
+++ b/
hacks/vermiculate.c
@@
-209,9
+209,8
@@
static void
randpal (struct state *st)
{
int ncolors = tailmax - 1;
randpal (struct state *st)
{
int ncolors = tailmax - 1;
- make_random_colormap (st->dpy,
- st->xgwa.visual,
- st->mycmap, &st->mycolors[1], &ncolors, True, True, 0, True);
+ make_random_colormap (st->xgwa.screen, st->xgwa.visual, st->mycmap,
+ &st->mycolors[1], &ncolors, True, True, 0, True);
if (ncolors < tailmax - 1)
{
int c;
if (ncolors < tailmax - 1)
{
int c;
@@
-264,7
+263,7
@@
bordupdate (struct state *st)
for (x = xmin; x <= xmax; x++)
sp (st, x, ybord, st->bordcol);
for (y = ymin; y <= ymax; y++)
for (x = xmin; x <= xmax; x++)
sp (st, x, ybord, st->bordcol);
for (y = ymin; y <= ymax; y++)
- sp (st,
y
bord, y, st->bordcol);
+ sp (st,
x
bord, y, st->bordcol);
}
}
}
}
@@
-795,7
+794,7
@@
vermiculate_init (Display *d, Window w)
st->mygc = XCreateGC (st->dpy, st->window, 0, &mygcv);
}
st->mygc = XCreateGC (st->dpy, st->window, 0, &mygcv);
}
- st->point = (unsigned char *)
malloc (
st->wid * st->hei);
+ st->point = (unsigned char *)
calloc (1,
st->wid * st->hei);
maininit (st);
palupdate (st, True);
consume_instring(st);
maininit (st);
palupdate (st, True);
consume_instring(st);
@@
-807,11
+806,22
@@
static void
vermiculate_reshape (Display *dpy, Window window, void *closure,
unsigned int w, unsigned int h)
{
vermiculate_reshape (Display *dpy, Window window, void *closure,
unsigned int w, unsigned int h)
{
+ struct state *st = (struct state *) closure;
+ st->wid = w;
+ st->hei = h;
+ free (st->point);
+ st->point = (unsigned char *) calloc (1, st->wid * st->hei);
}
static Bool
vermiculate_event (Display *dpy, Window window, void *closure, XEvent *event)
{
}
static Bool
vermiculate_event (Display *dpy, Window window, void *closure, XEvent *event)
{
+ struct state *st = (struct state *) closure;
+ if (screenhack_event_helper (dpy, window, event))
+ {
+ st->reset_p = 1;
+ return True;
+ }
return False;
}
return False;
}
@@
-878,8
+888,9
@@
consume_instring(struct state *st)
block in which it's invoked, since it declares variables: */
#define forallinbank(LDP) linedata *LDP; int bankc; \
for (bankc = 1; \
block in which it's invoked, since it declares variables: */
#define forallinbank(LDP) linedata *LDP; int bankc; \
for (bankc = 1; \
- (LDP = &st->thread[st->bank[bankc - 1] - 1], \
- bankc <= st->bnkt); bankc++)
+ ((bankc <= st->bnkt) ? ( \
+ (LDP = &st->thread[st->bank[bankc - 1] - 1], 1) \
+ ) : 0) ; bankc++)
{
forallinbank (L) L->slice = degs / (st->ch - '0');
}
{
forallinbank (L) L->slice = degs / (st->ch - '0');
}
@@
-1201,6
+1212,9
@@
static const char *vermiculate_defaults[] = {
"*fpsSolid: true",
"*speed: 0",
"*instring: ",
"*fpsSolid: true",
"*speed: 0",
"*instring: ",
+#ifdef HAVE_MOBILE
+ "*ignoreRotation: True",
+#endif
0
};
0
};