X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Ftunnel_draw.c;h=2299cfb8d30354ff396a9ab6d8aa2f2c44db3fc2;hp=94e7bc0e661837d2f3499406ad97238d45b6f04a;hb=ffd8c0873576a9e3065696a624dce6b766b77062;hpb=9c9d475ff889ed8be02e8ce8c17da28b93278fca diff --git a/hacks/glx/tunnel_draw.c b/hacks/glx/tunnel_draw.c index 94e7bc0e..2299cfb8 100644 --- a/hacks/glx/tunnel_draw.c +++ b/hacks/glx/tunnel_draw.c @@ -2,10 +2,10 @@ /* atunnels --- OpenGL Advanced Tunnel Demo */ #if 0 -static const char sccsid[] = "@(#)tunnel_draw.c 5.02 2002/03/16 xlockmore"; +static const char sccsid[] = "@(#)tunnel_draw.c 5.13 2004/05/25 xlockmore"; #endif -/* Copyright (c) E. Lassauge, 2002. */ +/* Copyright (c) E. Lassauge, 2002-2004. */ /* * Permission to use, copy, modify, and distribute this software and its @@ -24,10 +24,13 @@ static const char sccsid[] = "@(#)tunnel_draw.c 5.02 2002/03/16 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 + * - random texture init * */ @@ -46,6 +49,12 @@ static const char sccsid[] = "@(#)tunnel_draw.c 5.02 2002/03/16 xlockmore"; #include "tunnel_draw.h" +#ifdef STANDALONE /* For NRAND() */ +#include "xlockmoreI.h" /* in xscreensaver distribution */ +#else /* STANDALONE */ +#include "xlock.h" /* in xlockmore distribution */ +#endif /* STANDALONE */ + typedef struct { float x, y, z; /* Point coordinates */ @@ -207,7 +216,7 @@ static void LoadPath(void) void InitTunnel(void) { LoadPath(); - current_texture = 0; + current_texture = NRAND(MAX_TEXTURE); } void DrawTunnel(int do_texture, int do_light, GLuint *textures) @@ -425,7 +434,7 @@ void SplashScreen(int do_wire, int do_texture, int do_light) tFlag = 0; ModeXFlag = 1; current_texture++; - if (current_texture > 2) current_texture = 0; + if (current_texture >= MAX_TEXTURE) current_texture = 0; } /* Now we want to draw splash screen */ glLoadIdentity();