X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fcrystal.c;h=a0907da867c353720e4a67d2bc9d57ae3a2c9cfd;hb=e4fa2ac140f7bc56571373a7b7eb585fa4500e38;hp=7041e5c4cccee352aca085963a35f2349d73d42a;hpb=f54438ea00f152166e68073e98000fd3a00f65cd;p=xscreensaver diff --git a/hacks/crystal.c b/hacks/crystal.c index 7041e5c4..a0907da8 100644 --- a/hacks/crystal.c +++ b/hacks/crystal.c @@ -1,9 +1,8 @@ /* -*- Mode: C; tab-width: 4 -*- */ /* crystal --- polygons moving according to plane group rules */ -#if !defined( lint ) && !defined( SABER ) +#if 0 static const char sccsid[] = "@(#)crystal.c 4.12 98/09/10 xlockmore"; - #endif /*- @@ -125,13 +124,13 @@ static XrmOptionDescRec opts[] = static argtype vars[] = { - {(caddr_t *) & nx, "nx", "nx", DEF_NX, t_Int}, - {(caddr_t *) & ny, "ny", "ny", DEF_NY, t_Int}, - {(caddr_t *) & centre, "centre", "Centre", DEF_CENTRE, t_Bool}, - {(caddr_t *) & maxsize, "maxsize", "Maxsize", DEF_MAXSIZE, t_Bool}, - {(caddr_t *) & unit_cell, "cell", "Cell", DEF_CELL, t_Bool}, - {(caddr_t *) & grid_cell, "grid", "Grid", DEF_GRID, t_Bool}, - {(caddr_t *) & cycle_p, "shift", "Shift", DEF_CYCLE, t_Bool} + {&nx, "nx", "nx", DEF_NX, t_Int}, + {&ny, "ny", "ny", DEF_NY, t_Int}, + {¢re, "centre", "Centre", DEF_CENTRE, t_Bool}, + {&maxsize, "maxsize", "Maxsize", DEF_MAXSIZE, t_Bool}, + {&unit_cell, "cell", "Cell", DEF_CELL, t_Bool}, + {&grid_cell, "grid", "Grid", DEF_GRID, t_Bool}, + {&cycle_p, "shift", "Shift", DEF_CYCLE, t_Bool} }; static OptionStruct desc[] = { @@ -588,6 +587,7 @@ draw_crystal(ModeInfo * mi) crystalatom *atom0; atom0 = &cryst->atom[i]; + if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) { XSetForeground(display, cryst->gc, cryst->colors[atom0->colour].pixel); } else { @@ -807,7 +807,9 @@ release_crystal(ModeInfo * mi) free_colors(display, cryst->cmap, cryst->colors, cryst->ncolors); if (cryst->colors) (void) free((void *) cryst->colors); +#if 0 /* #### wrong! -jwz */ XFreeColormap(display, cryst->cmap); +#endif } if (cryst->gc != NULL) XFreeGC(display, cryst->gc); @@ -851,9 +853,13 @@ init_crystal(ModeInfo * mi) #endif cryst->blackpixel = MI_BLACK_PIXEL(mi); cryst->whitepixel = MI_WHITE_PIXEL(mi); +#if 0 /* #### wrong! -jwz */ cryst->cmap = XCreateColormap(display, window, MI_VISUAL(mi), AllocNone); XSetWindowColormap(display, window, cryst->cmap); +#else + cryst->cmap = mi->xgwa.colormap; +#endif (void) XParseColor(display, cryst->cmap, "black", &color); (void) XAllocColor(display, cryst->cmap, &color); MI_BLACK_PIXEL(mi) = color.pixel; @@ -1200,7 +1206,9 @@ init_crystal(ModeInfo * mi) make_smooth_colormap(MI_DISPLAY(mi), MI_VISUAL(mi), cryst->cmap, cryst->colors, &cryst->ncolors, True, &cryst->cycle_p, True); } +#if 0 /* #### wrong! -jwz */ XInstallColormap(display, cryst->cmap); +#endif if (cryst->ncolors < 2) { cryst->ncolors = 2; cryst->no_colors = True;