X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fatunnel.c;h=ea7a900431afaa7a06175101258c70b0926e5060;hp=74a64b5b93f55e57150ba779b440229984719243;hb=ffd8c0873576a9e3065696a624dce6b766b77062;hpb=2c902d6065f9856adf31e8540a94f1e42e68e905 diff --git a/hacks/glx/atunnel.c b/hacks/glx/atunnel.c index 74a64b5b..ea7a9004 100644 --- a/hacks/glx/atunnel.c +++ b/hacks/glx/atunnel.c @@ -1,11 +1,11 @@ /* -*- Mode: C; tab-width: 4 -*- */ /* atunnels --- OpenGL Advanced Tunnel Screensaver */ -#if !defined( lint ) && !defined( SABER ) -static const char sccsid[] = "@(#)atunnels.c 5.07 2003/02/12 xlockmore"; +#if 0 +static const char sccsid[] = "@(#)atunnels.c 5.13 2004/05/25 xlockmore"; #endif -/* Copyright (c) E. Lassauge, 2003. */ +/* Copyright (c) E. Lassauge, 2003-2004. */ /* * Permission to use, copy, modify, and distribute this software and its @@ -24,11 +24,13 @@ static const char sccsid[] = "@(#)atunnels.c 5.07 2003/02/12 xlockmore"; * Email: romka@ut.ee * WEB: http://romka.demonews.com * - * Eric Lassauge (March-16-2002) + * Eric Lassauge (May-25-2004) * http://lassauge.free.fr/linux.html * * REVISION HISTORY: * + * E.Lassauge - 25-May-2004: + * - added more texture ! * E.Lassauge - 16-Mar-2002: * - created based on the Roman demo. * - deleted all external file stuff to use xpm textures and @@ -61,8 +63,8 @@ static const char sccsid[] = "@(#)atunnels.c 5.07 2003/02/12 xlockmore"; #include #include "tunnel_draw.h" -#if defined( USE_XPM ) || defined( USE_XPMINC ) || defined( HAVE_XPM ) -/* USE_XPM & USE_XPMINC in xlock mode ; HAVE_XPM in xscreensaver mode */ +#if defined( USE_XPM ) || defined( USE_XPMINC ) || defined(STANDALONE) +/* USE_XPM & USE_XPMINC in xlock mode ; STANDALONE in xscreensaver mode */ #include "xpm-ximage.h" #define I_HAVE_XPM @@ -70,13 +72,20 @@ static const char sccsid[] = "@(#)atunnels.c 5.07 2003/02/12 xlockmore"; #include "../images/tunnel0.xpm" #include "../images/tunnel1.xpm" #include "../images/tunnel2.xpm" +#include "../images/tunnel3.xpm" +#include "../images/tunnel4.xpm" +#include "../images/tunnel5.xpm" #else /* !STANDALONE */ #include "pixmaps/tunnel0.xpm" #include "pixmaps/tunnel1.xpm" #include "pixmaps/tunnel2.xpm" +#include "pixmaps/tunnel3.xpm" +#include "pixmaps/tunnel4.xpm" +#include "pixmaps/tunnel5.xpm" #endif /* !STANDALONE */ #endif /* HAVE_XPM */ + #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -89,25 +98,25 @@ static Bool do_wire; static Bool do_texture; static XrmOptionDescRec opts[] = { - {(char *)"-light", (char *)".atunnels.light", XrmoptionNoArg, (caddr_t) "true" }, - {(char *)"+light", (char *)".atunnels.light", XrmoptionNoArg, (caddr_t) "false" }, - {(char *)"-wire", (char *)".atunnels.wire", XrmoptionNoArg, (caddr_t) "true" }, - {(char *)"+wire", (char *)".atunnels.wire", XrmoptionNoArg, (caddr_t) "false" }, - {(char *)"-texture", (char *)".atunnels.texture", XrmoptionNoArg, (caddr_t) "true" }, - {(char *)"+texture", (char *)".atunnels.texture", XrmoptionNoArg, (caddr_t) "false" }, + {"-light", ".atunnels.light", XrmoptionNoArg, "true" }, + {"+light", ".atunnels.light", XrmoptionNoArg, "false" }, + {"-wire", ".atunnels.wire", XrmoptionNoArg, "true" }, + {"+wire", ".atunnels.wire", XrmoptionNoArg, "false" }, + {"-texture", ".atunnels.texture", XrmoptionNoArg, "true" }, + {"+texture", ".atunnels.texture", XrmoptionNoArg, "false" }, }; static argtype vars[] = { - {(caddr_t *) &do_light, (char *)"light", (char *)"Light", DEF_LIGHT, t_Bool}, - {(caddr_t *) &do_wire, (char *)"wire", (char *)"Wire", DEF_WIRE, t_Bool}, - {(caddr_t *) &do_texture, (char *)"texture",(char *)"Texture", DEF_TEXTURE, t_Bool}, + {&do_light, "light", "Light", DEF_LIGHT, t_Bool}, + {&do_wire, "wire", "Wire", DEF_WIRE, t_Bool}, + {&do_texture, "texture", "Texture", DEF_TEXTURE, t_Bool}, }; static OptionStruct desc[] = { - {(char *)"-/+ light", (char *)"whether to do enable lighting (slower)"}, - {(char *)"-/+ wire", (char *)"whether to do use wireframe instead of filled (faster)"}, - {(char *)"-/+ texture", (char *)"whether to apply a texture (slower)"}, + {"-/+ light", "whether to do enable lighting (slower)"}, + {"-/+ wire", "whether to do use wireframe instead of filled (faster)"}, + {"-/+ texture", "whether to apply a texture (slower)"}, }; ModeSpecOpt atunnels_opts = {countof(opts), opts, countof(vars), vars, desc}; @@ -128,7 +137,8 @@ typedef struct { } atunnelsstruct; static atunnelsstruct *Atunnels = NULL; -static GLuint texture[3]; /* texture id: GL world */ + +static GLuint texture[MAX_TEXTURE]; /* texture id: GL world */ /*=================== Load Texture =========================================*/ static void LoadTexture(ModeInfo * mi, char **fn, int t_num) @@ -179,10 +189,13 @@ static void Init(ModeInfo * mi) glClearColor(0, 0, 0, 0); if (do_texture) { - glGenTextures(3, texture); + glGenTextures(MAX_TEXTURE, texture); LoadTexture(mi, texture0,0); LoadTexture(mi, texture1,1); LoadTexture(mi, texture2,2); + LoadTexture(mi, texture3,3); + LoadTexture(mi, texture4,4); + LoadTexture(mi, texture5,5); glEnable(GL_TEXTURE_2D); } InitTunnel();