X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fatunnel.c;h=8ee10aeb0b78549db06c8ca45c0f04b5927e3fb0;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hp=e13129cbbc52d19559f2b8fadd42177481f8c234;hpb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439;p=xscreensaver diff --git a/hacks/glx/atunnel.c b/hacks/glx/atunnel.c index e13129cb..8ee10aeb 100644 --- a/hacks/glx/atunnel.c +++ b/hacks/glx/atunnel.c @@ -41,8 +41,10 @@ static const char sccsid[] = "@(#)atunnel.c 5.13 2004/05/25 xlockmore"; #ifdef STANDALONE /* xscreensaver mode */ #define DEFAULTS "*delay: 10000 \n" \ "*showFPS: False \n" \ + "*suppressRotationAnimation: True\n" \ # define refresh_atunnel 0 +# define release_atunnel 0 # define atunnel_handle_event 0 #define MODE_atunnel # include "xlockmore.h" /* from the xscreensaver distribution */ @@ -84,7 +86,7 @@ static const char sccsid[] = "@(#)atunnel.c 5.13 2004/05/25 xlockmore"; #define countof(x) (sizeof((x))/sizeof((*x))) #define DEF_LIGHT "True" -#define DEF_WIRE "False" +#define DEF_WIRE "False" #define DEF_TEXTURE "True" static Bool do_light; @@ -117,7 +119,7 @@ ENTRYPOINT ModeSpecOpt atunnel_opts = {countof(opts), opts, countof(vars), vars, #ifdef USE_MODULES ModStruct atunnel_description = -{"atunnel", "init_atunnel", "draw_atunnel", "release_atunnel", +{"atunnel", "init_atunnel", "draw_atunnel", NULL, "draw_atunnel", "init_atunnel", NULL, &atunnel_opts, 1000, 1, 2, 1, 4, 1.0, "", "OpenGL advanced tunnel screensaver", 0, NULL}; @@ -185,7 +187,6 @@ static void Init(ModeInfo * mi) GLfloat light_position[] = {0.0, 0.0, 1.0, 0.0}; GLfloat fogColor[4] = {0.8, 0.8, 0.8, 1.0}; - glClearColor(0, 0, 0, 0); if (do_texture) { glGenTextures(MAX_TEXTURE, sa->texture); @@ -197,7 +198,7 @@ static void Init(ModeInfo * mi) LoadTexture(mi, texture5,5); glEnable(GL_TEXTURE_2D); } - sa->ts = InitTunnel(); + sa->ts = atunnel_InitTunnel(); /* Set lighting parameters */ if (do_light) @@ -213,6 +214,11 @@ static void Init(ModeInfo * mi) glEnable(GL_LIGHTING); } + +# ifdef HAVE_JWZGLES /* #### glPolygonMode other than GL_FILL unimplemented */ + do_wire = 0; +# endif + if (do_wire) { glDisable(GL_NORMALIZE); glDisable(GL_CULL_FACE); @@ -271,8 +277,8 @@ ENTRYPOINT void draw_atunnel(ModeInfo * mi) glLoadIdentity(); - DrawTunnel(sa->ts, do_texture, do_light, sa->texture); - SplashScreen(sa->ts, do_wire, do_texture, do_light); + atunnel_DrawTunnel(sa->ts, do_texture, do_light, sa->texture); + atunnel_SplashScreen(sa->ts, do_wire, do_texture, do_light); glFlush(); /* manage framerate display */ @@ -282,16 +288,15 @@ ENTRYPOINT void draw_atunnel(ModeInfo * mi) } +static void free_atunnel(ModeInfo * mi); + /* xscreensaver initialization routine */ ENTRYPOINT void init_atunnel(ModeInfo * mi) { int screen = MI_SCREEN(mi); atunnelstruct *sa; - if (Atunnel == NULL) { - if ((Atunnel = (atunnelstruct *) calloc(MI_NUM_SCREENS(mi), sizeof (atunnelstruct))) == NULL) - return; - } + MI_INIT(mi, Atunnel, free_atunnel); sa = &Atunnel[screen]; sa->window = MI_WINDOW(mi); @@ -305,18 +310,12 @@ ENTRYPOINT void init_atunnel(ModeInfo * mi) } /* all sorts of nice cleanup code should go here! */ -ENTRYPOINT void release_atunnel(ModeInfo * mi) +static void free_atunnel(ModeInfo * mi) { - int screen; - if (Atunnel != NULL) { - for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) { - atunnelstruct *sa = &Atunnel[screen]; - FreeTunnel(sa->ts); - } - (void) free((void *) Atunnel); - Atunnel = NULL; - } - FreeAllGL(mi); +#if 0 + atunnelstruct *sa = &Atunnel[MI_SCREEN(mi)]; + FreeTunnel(sa->ts); +#endif } XSCREENSAVER_MODULE ("Atunnel", atunnel)