X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fcrystal.c;h=3acd7caee386f3e211f6e9803ffdf16365d66d0e;hb=4ade52359b6eba3621566dac79793a33aa4c915f;hp=5ceb91f6f2a2f29d2b1a862c8fe2703fe3d14f9e;hpb=07faf451b99879183ed7e909e43a0e065be1ee7f;p=xscreensaver diff --git a/hacks/crystal.c b/hacks/crystal.c index 5ceb91f6..3acd7cae 100644 --- a/hacks/crystal.c +++ b/hacks/crystal.c @@ -73,8 +73,10 @@ static const char sccsid[] = "@(#)crystal.c 4.12 98/09/10 xlockmore"; "*count: -500 \n" \ "*cycles: 200 \n" \ "*size: -15 \n" \ - "*ncolors: 100 \n" -# define reshape_crystal 0 + "*ncolors: 100 \n" \ + "*fpsSolid: True \n" \ + "*ignoreRotation: True \n" \ + # define crystal_handle_event 0 # include "xlockmore.h" /* in xscreensaver distribution */ #else /* STANDALONE */ @@ -581,7 +583,8 @@ draw_crystal(ModeInfo * mi) /* Rotate colours */ if (cryst->cycle_p) { - rotate_colors(display, cryst->cmap, cryst->colors, cryst->ncolors, + rotate_colors(mi->xgwa.screen, cryst->cmap, + cryst->colors, cryst->ncolors, cryst->direction); if (!(LRAND() % 1000)) cryst->direction = -cryst->direction; @@ -807,7 +810,8 @@ release_crystal(ModeInfo * mi) MI_BG_PIXEL(mi) = cryst->bg; #endif if (cryst->colors && cryst->ncolors && !cryst->no_colors) - free_colors(display, cryst->cmap, cryst->colors, cryst->ncolors); + free_colors(mi->xgwa.screen, cryst->cmap, cryst->colors, + cryst->ncolors); if (cryst->colors) (void) free((void *) cryst->colors); #if 0 /* #### wrong! -jwz */ @@ -1174,7 +1178,8 @@ init_crystal(ModeInfo * mi) if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) { /* Set up colour map */ if (cryst->colors && cryst->ncolors && !cryst->no_colors) - free_colors(display, cryst->cmap, cryst->colors, cryst->ncolors); + free_colors(mi->xgwa.screen, cryst->cmap, + cryst->colors, cryst->ncolors); if (cryst->colors) (void) free((void *) cryst->colors); cryst->colors = 0; @@ -1203,14 +1208,20 @@ init_crystal(ModeInfo * mi) } if (!cryst->mono_p) { if (!(LRAND() % 10)) - make_random_colormap(MI_DISPLAY(mi), MI_VISUAL(mi), cryst->cmap, cryst->colors, &cryst->ncolors, - True, True, &cryst->cycle_p, True); + make_random_colormap(mi->xgwa.screen, MI_VISUAL(mi), + cryst->cmap, cryst->colors, + &cryst->ncolors, + True, True, &cryst->cycle_p, True); else if (!(LRAND() % 2)) - make_uniform_colormap(MI_DISPLAY(mi), MI_VISUAL(mi), cryst->cmap, cryst->colors, &cryst->ncolors, - True, &cryst->cycle_p, True); + make_uniform_colormap(mi->xgwa.screen, MI_VISUAL(mi), + cryst->cmap, cryst->colors, + &cryst->ncolors, True, + &cryst->cycle_p, True); else - make_smooth_colormap(MI_DISPLAY(mi), MI_VISUAL(mi), cryst->cmap, cryst->colors, &cryst->ncolors, - True, &cryst->cycle_p, True); + make_smooth_colormap(mi->xgwa.screen, MI_VISUAL(mi), + cryst->cmap, cryst->colors, + &cryst->ncolors, + True, &cryst->cycle_p, True); } #if 0 /* #### wrong! -jwz */ XInstallColormap(display, cryst->cmap); @@ -1268,4 +1279,11 @@ init_crystal(ModeInfo * mi) XSetFunction(display, cryst->gc, GXcopy); } +ENTRYPOINT void +reshape_crystal(ModeInfo * mi, int width, int height) +{ + release_crystal(mi); + init_crystal(mi); +} + XSCREENSAVER_MODULE ("Crystal", crystal)