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.38.tar.gz
[xscreensaver]
/
hacks
/
vermiculate.c
diff --git
a/hacks/vermiculate.c
b/hacks/vermiculate.c
index b96d3dc8e4b84f585b47dc761b7f899543df9a57..936479161bcee3032fedbc83e36f102e2177a17c 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;
@@
-439,10
+438,6
@@
maininit (struct state *st)
st->instring = sampleStrings[n].str;
st->speed = sampleStrings[n].speed;
}
st->instring = sampleStrings[n].str;
st->speed = sampleStrings[n].speed;
}
- if (st->speed == 0)
- {
- st->speed = 200;
- }
st->boxh = 10;
st->boxw = 10;
st->gridden = 0;
st->boxh = 10;
st->boxw = 10;
st->gridden = 0;
@@
-774,12
+769,8
@@
vermiculate_init (Display *d, Window w)
st->instring = 0;
st->max_ticks = get_integer_resource (st->dpy, "ticks", "Integer");
st->instring = 0;
st->max_ticks = get_integer_resource (st->dpy, "ticks", "Integer");
- {
- int temp = get_integer_resource (st->dpy, "speed", "Speed");
- if (temp != 0)
- st->speed = temp;
- }
-
+ st->speed = get_integer_resource (st->dpy, "speed", "Speed");
+ if (st->speed <= 0) st->speed = 1;
st->mycolors[0].pixel = BlackPixel (st->dpy, DefaultScreen (st->dpy));
XSetWindowBackground (st->dpy, st->window,
st->mycolors[0].pixel = BlackPixel (st->dpy, DefaultScreen (st->dpy));
XSetWindowBackground (st->dpy, st->window,
@@
-807,11
+798,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
+880,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');
}
@@
-1196,11
+1199,15
@@
vermiculate_free (Display *dpy, Window window, void *closure)
static const char *vermiculate_defaults[] = {
static const char *vermiculate_defaults[] = {
+ ".lowrez: true",
".background: Black",
"*ticks: 20000",
"*fpsSolid: true",
".background: Black",
"*ticks: 20000",
"*fpsSolid: true",
- "*speed:
0
",
+ "*speed:
1
",
"*instring: ",
"*instring: ",
+#ifdef HAVE_MOBILE
+ "*ignoreRotation: True",
+#endif
0
};
0
};