X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fimsmap.c;h=6e1f31dded435a8f7bbc437cc2dead2c62546155;hp=e0449f9b3c66ae735b678ce98a97b5b9b9233bd2;hb=6b1c86cf395f59389e4ece4ea8f4bea2c332745b;hpb=488f2fa8fbdbc77e91a70da2962d73af49e6cace diff --git a/hacks/imsmap.c b/hacks/imsmap.c index e0449f9b..6e1f31dd 100644 --- a/hacks/imsmap.c +++ b/hacks/imsmap.c @@ -1,4 +1,4 @@ -/* imsmap, Copyright (c) 1992 Juergen Nickelsen +/* imsmap, Copyright (c) 1992-2008 Juergen Nickelsen and Jamie Zawinski. * Derived from code by Markus Schirmer, TU Berlin. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -162,22 +162,19 @@ init_map (struct state *st) if (mono_p) st->flip_xy = 0; - if (!st->ncolors) - { - st->ncolors = get_integer_resource (st->dpy, "ncolors", "Integer"); - st->delay = get_integer_resource (st->dpy, "delay", "Integer"); - st->delay2 = get_integer_resource (st->dpy, "delay2", "Integer"); - st->iterations = get_integer_resource (st->dpy, "iterations", "Integer"); - if (st->iterations < 0) st->iterations = 0; - else if (st->iterations > 7) st->iterations = 7; - - if (st->ncolors <= 2) st->ncolors = 0; - if (st->ncolors == 0) mono_p = True; - if (st->ncolors > 255) st->ncolors = 255; /* too many look bad */ - - st->gc = XCreateGC (st->dpy, st->window, 0, &gcv); - st->gc2 = XCreateGC (st->dpy, st->window, 0, &gcv); - } + st->ncolors = get_integer_resource (st->dpy, "ncolors", "Integer"); + st->delay = get_integer_resource (st->dpy, "delay", "Integer"); + st->delay2 = get_integer_resource (st->dpy, "delay2", "Integer"); + st->iterations = get_integer_resource (st->dpy, "iterations", "Integer"); + if (st->iterations < 0) st->iterations = 0; + else if (st->iterations > 7) st->iterations = 7; + + if (st->ncolors <= 2) st->ncolors = 0; + if (st->ncolors == 0) mono_p = True; + if (st->ncolors > 255) st->ncolors = 255; /* too many look bad */ + + if (!st->gc) st->gc = XCreateGC (st->dpy, st->window, 0, &gcv); + if (!st->gc2) st->gc2 = XCreateGC (st->dpy, st->window, 0, &gcv); if (mono_p) st->extra_krinkly_p = !(random() % 15); @@ -218,7 +215,8 @@ init_map (struct state *st) } XSetForeground (st->dpy, st->gc, st->colors[1].pixel); - XFillRectangle (st->dpy, st->window, st->gc, 0, 0, st->xgwa.width, st->xgwa.height); + XFillRectangle (st->dpy, st->window, st->gc, 0, 0, + st->xgwa.width, st->xgwa.height); if (st->flip_xy) {