2 * lockward.c: First attempt at an Xscreensaver.
4 * Leo L. Schwab 2007.08.17
6 * Copyright (c) 2007 Leo L. Schwab
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the
10 * "Software"), to deal in the Software without restriction, including
11 * without limitation the rights to use, copy, modify, merge, publish,
12 * distribute, sublicense, and/or sell copies of the Software, and to permit
13 * persons to whom the Software is furnished to do so, subject to the
14 * following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
22 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
23 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 * USE OR OTHER DEALINGS IN THE SOFTWARE.
30 #include "xlockmore.h"
34 /***************************************************************************
37 #ifdef USE_GL /* whole file */
39 #define DEFAULTS "*delay: 20000 \n"\
42 #define refresh_lockward 0
45 #define NUMOF(x) (sizeof ((x)) / sizeof ((*x)))
50 #define COLORIDX_SHF 4
53 /***************************************************************************
54 * Structure definitions.
56 struct lockward_context; /* Forward declaration. */
61 #define uint8_t unsigned char
62 #define uint16_t unsigned short
63 #define uint32_t unsigned int
65 typedef struct bladestate {
66 uint8_t outer, inner; /* Radii */
69 typedef struct spinnerstate {
70 GLfloat rot; /* Terminal rotation after count expires */
71 GLfloat rotinc; /* Per-frame increment to rot. */
74 int ncolors; /* n.4 fixed-point */
75 int ccolor; /* n.4 fixed-point */
76 int colorinc; /* n.4 fixed-point */
81 typedef struct blinkstate {
82 int (*drawfunc) (struct lockward_context *ctx,
83 struct blinkstate *bs);
84 uint32_t *noise; /* For draw_blink_segment_scatter() */
87 int16_t dwell; /* <0: sharp >0: decay */
96 BTYPE_RADIAL_SINGLE = 0,
99 BTYPE_RADIAL_DOUBLESEQ,
100 BTYPE_SEGMENT_SINGLE,
101 BTYPE_SEGMENT_RANDOM,
102 BTYPE_CONCENTRIC_SINGLE,
103 BTYPE_CONCENTRIC_RANDOM,
104 BTYPE_CONCENTRIC_SEQ,
105 BTYPE_SEGMENT_SCATTER,
109 typedef struct lockward_context {
110 GLXContext *glx_context;
112 spinnerstate spinners[NSPINNERS];
115 GLuint blades_outer, blades_inner;
123 /***************************************************************************
126 static void free_lockward (lockward_context *ctx);
129 /***************************************************************************
132 static lockward_context *g_ctx = NULL;
133 static Bool g_blink_p = True;
134 static int g_blades = NBLADES;
135 static int g_rotateidle_min,
137 static int g_blinkidle_min,
139 static int g_blinkdwell_min,
142 #define DEF_BLINK "True"
143 #define DEF_ROTATEIDLEMIN "1000"
144 #define DEF_ROTATEIDLEMAX "6000"
145 #define DEF_BLINKIDLEMIN "1000"
146 #define DEF_BLINKIDLEMAX "9000"
147 #define DEF_BLINKDWELLMIN "100"
148 #define DEF_BLINKDWELLMAX "600"
151 static XrmOptionDescRec opts[] = {
152 { "-blink", ".blink", XrmoptionNoArg, "on" },
153 { "+blink", ".blink", XrmoptionNoArg, "off" },
154 { "-rotateidle-min", ".rotateidlemin", XrmoptionSepArg, 0 },
155 { "-rotateidle-max", ".rotateidlemax", XrmoptionSepArg, 0 },
156 { "-blinkidle-min", ".blinkidlemin", XrmoptionSepArg, 0 },
157 { "-blinkidle-max", ".blinkidlemax", XrmoptionSepArg, 0 },
158 { "-blinkdwell-min", ".blinkdwellmin", XrmoptionSepArg, 0 },
159 { "-blinkdwell-max", ".blinkdwellmax", XrmoptionSepArg, 0 },
162 static argtype vars[] = {
163 { &g_blink_p, "blink", "Blink", DEF_BLINK, t_Bool },
164 { &g_rotateidle_min, "rotateidlemin", "Rotateidlemin", DEF_ROTATEIDLEMIN, t_Int },
165 { &g_rotateidle_max, "rotateidlemax", "Rotateidlemax", DEF_ROTATEIDLEMAX, t_Int },
166 { &g_blinkidle_min, "blinkidlemin", "Blinkidlemin", DEF_BLINKIDLEMIN, t_Int },
167 { &g_blinkidle_max, "blinkidlemax", "Blinkidlemax", DEF_BLINKIDLEMAX, t_Int },
168 { &g_blinkdwell_min, "blinkdwellmin", "Blinkdwellmin", DEF_BLINKDWELLMIN, t_Int },
169 { &g_blinkdwell_max, "blinkdwellmax", "Blinkdwellmax", DEF_BLINKDWELLMAX, t_Int },
172 static OptionStruct desc[] = {
173 { "-/+blink", "Turn on/off blinking effects." },
174 { "-rotateidle-min", "Minimum idle time for rotators, in milliseconds." },
175 { "-rotateidle-max", "Maximum idle time for rotators, in milliseconds." },
176 { "-blinkidle-min", "Minimum idle time between blink effects, in milliseconds." },
177 { "-blinkidle-max", "Maximum idle time between blink effects, in milliseconds." },
178 { "-blinkdwell-min", "Minimum dwell time for blink effects, in milliseconds." },
179 { "-blinkdwell-max", "Maximum dwell time for blink effects, in milliseconds." },
182 ENTRYPOINT ModeSpecOpt lockward_opts = {
183 NUMOF(opts), opts, NUMOF(vars), vars, desc
187 /***************************************************************************
191 reshape_lockward (ModeInfo *mi, int width, int height)
193 GLfloat h = (GLfloat) height / (GLfloat) width;
195 glViewport (0, 0, (GLint) width, (GLint) height);
197 glMatrixMode (GL_PROJECTION);
200 glOrtho (-8.0, 8.0, -8.0 * h, 8.0 * h, -1, 1);
202 glOrtho (-8.0 / h, 8.0 / h, -8.0, 8.0, -1, 1);
204 glMatrixMode (GL_MODELVIEW);
208 lockward_handle_event (ModeInfo *mi, XEvent *event)
210 lockward_context *ctx = &g_ctx[MI_SCREEN (mi)];
212 if (event->xany.type == KeyPress) {
216 XLookupString (&event->xkey, &c, 1, &keysym, 0);
227 /***************************************************************************
231 random_blade_rot (lockward_context *ctx, struct spinnerstate *ss)
234 * The circle is divided up in to g_blades divisions. The idea here
235 * is to rotate to an exact division point.
237 * The target rotation is computed via random numbers.
239 * The time it takes to get there is a maximum of six seconds per
240 * division, and a minimum of one second (no matter how far away it
241 * is), and is selected by random numbers.
243 * The time value is converted into frames, and a per-frame rotation
246 * During rendering, we approach the target rotation by subtracting
247 * from it the per-frame rotation times the number of outstanding
248 * ticks. Doing it this way means we'll hit the target rotation
249 * exactly, without low-order errors creeping in to the values (at
250 * least not nearly as quickly).
255 dist = random() % g_blades + 1;
257 ss->rotcount = random() % (6 * dist * ctx->fps - ctx->fps)
262 d = dist * 360.0 / (GLfloat) g_blades;
264 ss->rotinc = d / (GLfloat) ss->rotcount;
269 * A "blade" is pie-wedge shaped flat thing that is rotated around where the
270 * apex is/would be. Initially envisioned as 1/12th of a circle, but that
271 * could be configurable. The inner and outer edges are rounded off using
272 * six subdivisions so that, when multiple blades are assembled, it looks
273 * more like a circle and less like a polygon.
275 * The blade is assembled as a tri-fan. It is oriented centered at 3
276 * o'clock. The blade is composed of two display lists -- arcs, essentially
277 * -- the outer and the inner one. The outer one *must* be called before
278 * the inner one, or the blade clockwise-ness will be wrong, and become
279 * invisible. Arcs of various radii are compiled.
284 gen_blade_arcs (lockward_context *ctx)
286 GLfloat here, there, step;
290 there = M_PI * 2.0 / g_blades;
291 step = there / SUBDIV;
292 here -= SUBDIV * step / 2.0;
295 * Build outer blade arcs.
296 * Start at left side of outer radius. Strike all its vertices.
298 for (n = 0; n < NRADII; ++n) {
299 glNewList (ctx->blades_outer + n, GL_COMPILE);
300 for (i = SUBDIV; i >= 0; --i)
301 glVertex3f (cos (here + step * i) * (n + 1.0),
302 sin (here + step * i) * (n + 1.0), 0);
307 * Build inner blade arcs.
308 * Move to inner radius, strike all vertices in opposite order.
310 for (n = 0; n < NRADII; ++n) {
311 glNewList (ctx->blades_inner + n, GL_COMPILE);
312 for (i = 0; i <= SUBDIV; ++i)
313 glVertex3f (cos (here + step * i) * (n + 1.0),
314 sin (here + step * i) * (n + 1.0), 0);
320 gen_rings (lockward_context *ctx)
325 step = M_PI * 2.0 / (g_blades * SUBDIV);
327 for (n = 0; n < NRADII - 1; ++n) {
328 glNewList (ctx->rings + n, GL_COMPILE);
329 glBegin (GL_TRIANGLE_STRIP);
330 for (i = g_blades * SUBDIV; i >= 0; --i) {
331 glVertex3f (cos (step * i) * (n + 1.0),
332 sin (step * i) * (n + 1.0), 0);
333 glVertex3f (cos (step * i) * (n + 2.0),
334 sin (step * i) * (n + 2.0), 0);
342 /***************************************************************************
346 calc_interval_frames (lockward_context *ctx, int min, int max)
349 * Compute random interval between min and max milliseconds.
350 * Returned value is in frames.
356 i += random() % (max - min);
358 return i * ctx->fps / 1000;
362 set_alpha_by_dwell (struct blinkstate *bs)
365 bs->color[3] = (GLfloat) bs->dwellcnt / (GLfloat) bs->dwell;
367 bs->color[3] = bs->dwellcnt > (-bs->dwell >> 2) ? 1.0 : 0.0;
371 draw_blink_blade (lockward_context *ctx, int inner, int outer)
373 glBegin (GL_TRIANGLE_FAN);
374 glCallList (ctx->blades_outer + outer);
375 glCallList (ctx->blades_inner + inner);
380 draw_blink_radial_random (lockward_context *ctx, struct blinkstate *bs)
385 * There is no sense of direction in a random sweep, so re-use the
386 * 'direction' field to hold the current blade we're messing with.
388 if (bs->dwellcnt < 0) {
389 if (bs->counter <= 0) {
395 * Find available blade. Potentially very slow, depending on
396 * how unlucky we are.
399 i = random() % g_blades;
400 } while (bs->val & (1 << i));
401 bs->val |= (1 << i); /* Mark as used. */
403 if ((bs->dwellcnt = bs->dwell) < 0)
404 bs->dwellcnt = -bs->dwellcnt;
406 if ( bs->type == BTYPE_SEGMENT_SINGLE
407 || bs->type == BTYPE_SEGMENT_RANDOM)
408 bs->radius = random() % (NRADII - 1);
413 set_alpha_by_dwell (bs);
414 glBlendFunc (GL_DST_COLOR, GL_SRC_ALPHA);
415 glColor4fv (bs->color);
416 glRotatef (bs->direction * 360.0 / (GLfloat) g_blades, 0, 0, 1);
418 draw_blink_blade (ctx, bs->radius, bs->radius + 1);
420 draw_blink_blade (ctx, 0, NRADII - 1);
424 return SUBDIV + SUBDIV;
428 draw_blink_radial_sequential (lockward_context *ctx, struct blinkstate *bs)
430 if (bs->dwellcnt < 0) {
431 if (bs->counter <= 0) {
435 if ((bs->dwellcnt = bs->dwell) < 0)
436 bs->dwellcnt = -bs->dwellcnt;
440 set_alpha_by_dwell (bs);
441 glBlendFunc (GL_DST_COLOR, GL_SRC_ALPHA);
442 glColor4fv (bs->color);
443 glRotatef ((bs->counter * bs->direction + (int) bs->val)
444 * 360.0 / (GLfloat) g_blades,
446 draw_blink_blade (ctx, 0, NRADII - 1);
450 return SUBDIV + SUBDIV;
454 draw_blink_radial_doubleseq (lockward_context *ctx, struct blinkstate *bs)
458 if (bs->dwellcnt < 0) {
459 if (bs->counter <= 0) {
463 if ((bs->dwellcnt = bs->dwell) < 0)
464 bs->dwellcnt = -bs->dwellcnt;
468 set_alpha_by_dwell (bs);
469 glBlendFunc (GL_DST_COLOR, GL_SRC_ALPHA);
470 glColor4fv (bs->color);
473 glRotatef (((int) bs->val + bs->counter) * 360.0 / (GLfloat) g_blades,
475 draw_blink_blade (ctx, 0, NRADII - 1);
477 polys = SUBDIV + SUBDIV;
479 if (bs->counter && bs->counter < g_blades / 2) {
480 glRotatef (((int) bs->val - bs->counter)
481 * 360.0 / (GLfloat) g_blades,
483 draw_blink_blade (ctx, 0, NRADII - 1);
484 polys += SUBDIV + SUBDIV;
493 draw_blink_concentric_random (lockward_context *ctx, struct blinkstate *bs)
497 if (bs->dwellcnt < 0) {
498 if (bs->counter <= 0) {
504 i = random() % (NRADII - 1);
505 } while (bs->val & (1 << i));
508 if ((bs->dwellcnt = bs->dwell) < 0)
509 bs->dwellcnt = -bs->dwellcnt;
514 set_alpha_by_dwell (bs);
515 glBlendFunc (GL_DST_COLOR, GL_SRC_ALPHA);
516 glColor4fv (bs->color);
517 glCallList (ctx->rings + bs->direction);
521 return g_blades * SUBDIV * 2;
525 draw_blink_concentric_sequential (lockward_context *ctx, struct blinkstate *bs)
527 if (bs->dwellcnt < 0) {
528 if (bs->counter <= 0) {
532 if ((bs->dwellcnt = bs->dwell) < 0)
533 bs->dwellcnt = -bs->dwellcnt;
537 set_alpha_by_dwell (bs);
538 glBlendFunc (GL_DST_COLOR, GL_SRC_ALPHA);
539 glColor4fv (bs->color);
540 if (bs->direction > 0)
541 glCallList (ctx->rings + (NRADII - 2) - bs->counter);
543 glCallList (ctx->rings + bs->counter);
547 return g_blades * SUBDIV * 2;
551 draw_blink_segment_scatter (lockward_context *ctx, struct blinkstate *bs)
555 if (bs->dwellcnt < 0) {
556 if (bs->counter <= 0) {
562 * Init random noise array. On average, 1/4 of the bits will
563 * be set, which should look nice. (1/2 looks too busy.)
565 for (i = g_blades; --i >= 0; )
566 bs->noise[i] = random() & random()
567 & ((1 << (NRADII - 1)) - 1);
569 if ((bs->dwellcnt = bs->dwell) < 0)
570 bs->dwellcnt = -bs->dwellcnt;
574 set_alpha_by_dwell (bs);
575 glBlendFunc (GL_DST_COLOR, GL_SRC_ALPHA);
576 glColor4fv (bs->color);
578 for (i = g_blades; --i >= 0; ) {
579 register uint32_t bits;
583 * Find consecutive runs of 1 bits. Keep going until we run
586 for (bits = bs->noise[i]; bits; ) {
587 inner = ffs (bits) - 1;
588 bits = ~bits & ~((1 << inner) - 1);
589 outer = ffs (bits) - 1;
590 bits = ~bits & ~((1 << outer) - 1);
593 glRotatef (i * 360.0 / (GLfloat) g_blades, 0, 0, 1);
594 draw_blink_blade (ctx, inner, outer);
597 polys += SUBDIV + SUBDIV;
607 random_blink (lockward_context *ctx, struct blinkstate *bs)
615 bs->dwell = calc_interval_frames
616 (ctx, g_blinkdwell_min, g_blinkdwell_max);
618 bs->dwell = -bs->dwell;
620 bs->type = random() % MAX_BTYPE;
623 case BTYPE_RADIAL_SINGLE:
624 case BTYPE_SEGMENT_SINGLE:
625 bs->drawfunc = draw_blink_radial_random;
629 case BTYPE_RADIAL_RANDOM:
630 case BTYPE_SEGMENT_RANDOM:
631 bs->drawfunc = draw_blink_radial_random;
633 bs->counter = g_blades;
635 case BTYPE_RADIAL_SEQ:
636 bs->drawfunc = draw_blink_radial_sequential;
637 bs->val = random() % g_blades; /* Initial offset */
638 bs->direction = random() & 8 ? 1 : -1;
639 bs->counter = g_blades;
641 case BTYPE_RADIAL_DOUBLESEQ:
642 bs->drawfunc = draw_blink_radial_doubleseq;
643 bs->val = random() % g_blades; /* Initial offset */
644 bs->counter = g_blades / 2 + 1;
646 case BTYPE_CONCENTRIC_SINGLE:
647 bs->drawfunc = draw_blink_concentric_random;
651 case BTYPE_CONCENTRIC_RANDOM:
652 bs->drawfunc = draw_blink_concentric_random;
654 bs->counter = NRADII - 1;
656 case BTYPE_CONCENTRIC_SEQ:
657 bs->drawfunc = draw_blink_concentric_sequential;
658 bs->direction = random() & 8 ? 1 : -1;
659 bs->counter = NRADII - 1;
661 case BTYPE_SEGMENT_SCATTER:
662 bs->drawfunc = draw_blink_segment_scatter;
663 bs->counter = random() % (g_blades / 2) + (g_blades / 2) + 1;
669 /***************************************************************************
670 * Main rendering routine.
673 draw_lockward (ModeInfo *mi)
675 lockward_context *ctx = &g_ctx[MI_SCREEN (mi)];
677 Display *dpy = MI_DISPLAY(mi);
678 Window window = MI_WINDOW(mi);
681 GLfloat scolor[4] = {0.0, 0.0, 0.0, 0.5};
683 if (!ctx->glx_context)
686 glXMakeCurrent (MI_DISPLAY (mi), MI_WINDOW (mi), *(ctx->glx_context));
689 glClear (GL_COLOR_BUFFER_BIT);
692 glBlendFunc (GL_ONE, GL_ONE);
694 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
699 mi->polygon_count = 0;
701 for (n = NSPINNERS; --n >= 0; ) {
702 ss = &ctx->spinners[n];
705 i = ss->ccolor >> COLORIDX_SHF;
706 scolor[0] = ss->colors[i].red / 65535.0;
707 scolor[1] = ss->colors[i].green / 65535.0;
708 scolor[2] = ss->colors[i].blue / 65535.0;
712 glRotatef (ss->rot - ss->rotcount * ss->rotinc, 0, 0, 1);
713 for (i = ss->nblades; --i >= 0; ) {
715 glRotatef (360.0 * i / ss->nblades, 0, 0, 1);
717 glBegin (GL_TRIANGLE_FAN);
718 glCallList (ctx->blades_outer + ss->bladeidx[i].outer);
719 glCallList (ctx->blades_inner + ss->bladeidx[i].inner);
723 mi->polygon_count += SUBDIV + SUBDIV;
727 /* Advance rotation. */
729 if (ss->rotcount > 0)
732 if (ss->rotinc == 0.0)
733 random_blade_rot (ctx, ss);
735 /* Compute # of ticks to sit idle. */
738 calc_interval_frames (ctx,
744 /* Advance colors. */
745 if ((ss->ccolor += ss->colorinc) >= ss->ncolors)
746 ss->ccolor -= ss->ncolors;
747 else if (ss->ccolor < 0)
748 ss->ccolor += ss->ncolors;
752 if (ctx->blink.drawfunc) {
754 ctx->blink.drawfunc (ctx, &ctx->blink);
756 if (ctx->nextblink > 0)
759 /* Compute # of frames for blink idle time. */
761 calc_interval_frames (ctx,
764 random_blink (ctx, &ctx->blink);
770 if (MI_IS_FPS (mi)) do_fps (mi);
773 glXSwapBuffers (dpy, window);
777 /***************************************************************************
778 * Initialization/teardown.
781 init_lockward (ModeInfo *mi)
783 lockward_context *ctx;
787 g_ctx = (lockward_context *) calloc (MI_NUM_SCREENS (mi),
788 sizeof (lockward_context));
790 fprintf (stderr, "%s: can't allocate context.\n",
795 ctx = &g_ctx[MI_SCREEN (mi)];
797 ctx->glx_context = init_GL (mi);
799 reshape_lockward (mi, MI_WIDTH (mi), MI_HEIGHT (mi));
801 glEnable (GL_CULL_FACE);
803 glDisable (GL_DEPTH_TEST);
805 glShadeModel (GL_FLAT);
808 ctx->blades_outer = glGenLists (NRADII);
809 ctx->blades_inner = glGenLists (NRADII);
810 ctx->rings = glGenLists (NRADII - 1);
812 ctx->fps = 1000000 / MI_DELAY (mi);
813 ctx->nextblink = calc_interval_frames
814 (ctx, g_blinkidle_min, g_blinkidle_max);
815 ctx->blink.drawfunc = NULL;
816 ctx->blink.noise = malloc (sizeof (uint32_t) * g_blades);
817 if (!ctx->blink.noise) {
818 fprintf (stderr, "Can't allocate noise array.\n");
822 gen_blade_arcs (ctx);
825 for (i = NSPINNERS; --i >= 0; ) {
826 spinnerstate *ss = &ctx->spinners[i];
831 /* Establish rotation */
832 random_blade_rot (ctx, ss);
835 * Establish color cycling path and rate. Rate avoids zero.
838 ss->colorinc = (random() & ((2 << COLORIDX_SHF) - 1))
839 - (1 << COLORIDX_SHF);
840 if (ss->colorinc >= 0)
843 ss->colors = (XColor *) calloc (ss->ncolors, sizeof (XColor));
846 "Can't allocate XColors for spinner %d.\n",
850 make_smooth_colormap (0, 0, 0,
851 ss->colors, &ss->ncolors,
853 ss->ncolors <<= COLORIDX_SHF;
858 ss->nblades = g_blades;
859 ss->bladeidx = malloc (sizeof (bladestate) * g_blades);
861 fprintf (stderr, "Can't allocate blades.\n");
864 for (n = g_blades; --n >= 0; ) {
866 * Establish blade radii. Can't be equal. Ensure
870 ss->bladeidx[n].outer = random() & 7;
871 ss->bladeidx[n].inner = random() & 7;
872 } while (ss->bladeidx[n].outer ==
873 ss->bladeidx[n].inner);
875 if (ss->bladeidx[n].outer < ss->bladeidx[n].inner) {
878 tmp = ss->bladeidx[n].outer;
879 ss->bladeidx[n].outer = ss->bladeidx[n].inner;
880 ss->bladeidx[n].inner = tmp;
887 free_lockward (lockward_context *ctx)
891 if (ctx->blink.noise)
892 free (ctx->blink.noise);
893 if (glIsList (ctx->rings))
894 glDeleteLists (ctx->rings, NRADII - 1);
895 if (glIsList (ctx->blades_outer))
896 glDeleteLists (ctx->blades_outer, NRADII);
897 if (glIsList (ctx->blades_inner))
898 glDeleteLists (ctx->blades_inner, NRADII);
900 for (i = NSPINNERS; --i >= 0; ) {
901 spinnerstate *ss = &ctx->spinners[i];
911 release_lockward (ModeInfo *mi)
918 for (i = MI_NUM_SCREENS (mi); --i >= 0; ) {
919 if (g_ctx[i].glx_context)
920 glXMakeCurrent (MI_DISPLAY (mi), MI_WINDOW (mi),
921 *(g_ctx[i].glx_context));
922 free_lockward (&g_ctx[i]);
926 free (g_ctx); g_ctx = NULL;
930 XSCREENSAVER_MODULE ("Lockward", lockward)
934 /* vim:se ts=8 sts=8 sw=8: */