X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=hacks%2Fsphere.c;h=edeaa8f7597b8df6d2f4eb7090dcd700604e80f6;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hp=c8ca46caa7ee1092cc4ab9c633c52a3d7f3a3535;hpb=a94197e76a5dea5cb60542840809d6c20d0abbf3;p=xscreensaver diff --git a/hacks/sphere.c b/hacks/sphere.c index c8ca46ca..edeaa8f7 100644 --- a/hacks/sphere.c +++ b/hacks/sphere.c @@ -1,9 +1,8 @@ /* -*- Mode: C; tab-width: 4 -*- */ /* sphere --- a bunch of shaded spheres */ -#if !defined( lint ) && !defined( SABER ) +#if 0 static const char sccsid[] = "@(#)sphere.c 5.00 2000/11/01 xlockmore"; - #endif /*- @@ -58,24 +57,24 @@ static const char sccsid[] = "@(#)sphere.c 5.00 2000/11/01 xlockmore"; */ #ifdef STANDALONE -#define MODE_sphere -#define PROGCLASS "Sphere" -#define HACK_INIT init_sphere -#define HACK_DRAW draw_sphere -#define sphere_opts xlockmore_opts -#define DEFAULTS "*delay: 1000 \n" \ - "*cycles: 20 \n" \ - "*size: 0 \n" \ - "*ncolors: 64 \n" -#define BRIGHT_COLORS -#include "xlockmore.h" /* from the xscreensaver distribution */ +# define MODE_sphere +#define DEFAULTS "*delay: 20000 \n" \ + "*cycles: 20 \n" \ + "*size: 0 \n" \ + "*ncolors: 64 \n" \ + "*fpsSolid: true \n" \ + +# define BRIGHT_COLORS +# define reshape_sphere 0 +# define sphere_handle_event 0 +# include "xlockmore.h" /* from the xscreensaver distribution */ #else /* !STANDALONE */ -#include "xlock.h" /* from the xlockmore distribution */ +# include "xlock.h" /* from the xlockmore distribution */ #endif /* !STANDALONE */ #ifdef MODE_sphere -ModeSpecOpt sphere_opts = +ENTRYPOINT ModeSpecOpt sphere_opts = {0, (XrmOptionDescRec *) NULL, 0, (argtype *) NULL, (OptionStruct *) NULL}; #ifdef USE_MODULES @@ -111,16 +110,12 @@ typedef struct { static spherestruct *spheres = (spherestruct *) NULL; -void +ENTRYPOINT void init_sphere(ModeInfo * mi) { spherestruct *sp; - if (spheres == NULL) { - if ((spheres = (spherestruct *) calloc(MI_NUM_SCREENS(mi), - sizeof (spherestruct))) == NULL) - return; - } + MI_INIT (mi, spheres, 0); sp = &spheres[MI_SCREEN(mi)]; if (sp->points != NULL) { @@ -142,7 +137,7 @@ init_sphere(ModeInfo * mi) sp->shadowy = (LRAND() & 1) ? 1 : -1; } -void +ENTRYPOINT void draw_sphere(ModeInfo * mi) { Display *display = MI_DISPLAY(mi); @@ -271,7 +266,7 @@ draw_sphere(ModeInfo * mi) } } -void +ENTRYPOINT void release_sphere(ModeInfo * mi) { if (spheres != NULL) { @@ -290,7 +285,7 @@ release_sphere(ModeInfo * mi) } } -void +ENTRYPOINT void refresh_sphere(ModeInfo * mi) { spherestruct *sp; @@ -304,4 +299,6 @@ refresh_sphere(ModeInfo * mi) sp->x = -sp->radius; } +XSCREENSAVER_MODULE ("Sphere", sphere) + #endif /* MODE_sphere */