- gcv.foreground = mi.white;
- gcv.background = mi.black;
- mi.gc = XCreateGC(dpy, window, GCForeground|GCBackground, &gcv);
-
- mi.fullrandom = True;
-
- mi.pause = get_integer_resource ("delay", "Usecs");
-
- mi.cycles = get_integer_resource ("cycles", "Int");
- mi.batchcount = get_integer_resource ("count", "Int");
- mi.size = get_integer_resource ("size", "Int");
-
-#if 0
- decay = get_boolean_resource ("decay", "Boolean");
- if (decay) mi.fullrandom = False;
-
- trail = get_boolean_resource ("trail", "Boolean");
- if (trail) mi.fullrandom = False;
-
- grow = get_boolean_resource ("grow", "Boolean");
- if (grow) mi.fullrandom = False;
+ gcv.foreground = mi->white;
+ gcv.background = mi->black;
+ mi->gc = XCreateGC (dpy, window, GCForeground|GCBackground, &gcv);
+
+ mi->fullrandom = True;
+
+ mi->pause = get_integer_resource (dpy, "delay", "Usecs");
+
+ mi->cycles = get_integer_resource (dpy, "cycles", "Int");
+ mi->batchcount = get_integer_resource (dpy, "count", "Int");
+ mi->size = get_integer_resource (dpy, "size", "Int");
+
+ mi->threed = get_boolean_resource (dpy, "use3d", "Boolean");
+ mi->threed_delta = get_float_resource (dpy, "delta3d", "Float");
+ mi->threed_right_color = get_pixel_resource (dpy,
+ mi->xgwa.colormap, "right3d", "Color");
+ mi->threed_left_color = get_pixel_resource (dpy,
+ mi->xgwa.colormap, "left3d", "Color");
+ mi->threed_both_color = get_pixel_resource (dpy,
+ mi->xgwa.colormap, "both3d", "Color");
+ mi->threed_none_color = get_pixel_resource (dpy,
+ mi->xgwa.colormap, "none3d", "Color");
+
+ mi->wireframe_p = get_boolean_resource (dpy, "wireframe", "Boolean");
+ mi->root_p = root_p;
+ mi->fps_p = get_boolean_resource (dpy, "showFPS", "Boolean");
+#ifdef HAVE_XSHM_EXTENSION
+ mi->use_shm = get_boolean_resource (dpy, "useSHM", "Boolean");
+#endif /* !HAVE_XSHM_EXTENSION */
+
+ if (mi->pause < 0)
+ mi->pause = 0;
+ else if (mi->pause > 100000000)
+ mi->pause = 100000000;
+ orig_pause = mi->pause;
+
+ /* If this hack uses fonts (meaning, mentioned "font" in DEFAULTS)
+ then load it. */
+ {
+ char *name = get_string_resource (dpy, "font", "Font");
+ if (name)
+ {
+ XFontStruct *f = XLoadQueryFont (dpy, name);
+ const char *def1 = "-*-times-bold-r-normal-*-180-*";
+ const char *def2 = "fixed";
+ if (!f)
+ {
+ fprintf (stderr, "%s: font %s does not exist, using %s\n",
+ progname, name, def1);
+ f = XLoadQueryFont (dpy, def1);
+ }
+ if (!f)
+ {
+ fprintf (stderr, "%s: font %s does not exist, using %s\n",
+ progname, def1, def2);
+ f = XLoadQueryFont (dpy, def2);
+ }
+ if (f) XSetFont (dpy, mi->gc, f->fid);
+ if (f) XFreeFont (dpy, f);
+ free (name);
+ }
+ }