#define DEF_TEXTURE "True"
#define DEF_FOG "True"
-#define DEFAULTS "*delay: 10000 \n" \
- "*holdtime: " DEF_HOLDTIME "\n" \
- "*changetime: " DEF_CHANGETIME "\n" \
- "*wireframe: False \n" \
- "*texture: " DEF_TEXTURE "\n" \
- "*fog: " DEF_FOG "\n" \
+#define DEFAULTS "*delay: 40000 \n" \
+ "*wireframe: False \n" \
"*showFPS: False \n" \
#undef countof
#include <GL/glu.h>
-#if defined( USE_XPM ) || defined( USE_XPMINC ) || defined( HAVE_XPM )
+#if defined(USE_XPM) || defined(USE_XPMINC) || defined(HAVE_XPM) || defined (HAVE_GDK_PIXBUF)
/* USE_XPM & USE_XPMINC in xlock mode ; HAVE_XPM in xscreensaver mode */
#include "xpm-ximage.h"
#define I_HAVE_XPM
static XrmOptionDescRec opts[] = {
{ "-holdtime", ".holdtime", XrmoptionSepArg, 0 },
{ "-changetime", ".changetime", XrmoptionSepArg, 0 },
- {"-texture", ".texture", XrmoptionNoArg, (caddr_t) "True" },
- {"+texture", ".texture", XrmoptionNoArg, (caddr_t) "False" },
- {"-fog", ".fog", XrmoptionNoArg, (caddr_t) "True" },
- {"+fog", ".fog", XrmoptionNoArg, (caddr_t) "False" },
+ {"-texture", ".texture", XrmoptionNoArg, "True" },
+ {"+texture", ".texture", XrmoptionNoArg, "False" },
+ {"-fog", ".fog", XrmoptionNoArg, "True" },
+ {"+fog", ".fog", XrmoptionNoArg, "False" },
};
static argtype vars[] = {
- {(caddr_t *) &holdtime, "holdtime", "Hold Time", DEF_HOLDTIME, t_Int},
- {(caddr_t *) &changetime, "changetime", "Change Time", DEF_CHANGETIME, \
+ {&holdtime, "holdtime", "Hold Time", DEF_HOLDTIME, t_Int},
+ {&changetime, "changetime", "Change Time", DEF_CHANGETIME, \
t_Int},
- {(caddr_t *) &do_texture, "texture", "Texture", DEF_TEXTURE, t_Bool},
- {(caddr_t *) &do_fog, "fog", "Fog", DEF_FOG, t_Bool},
+ {&do_texture, "texture", "Texture", DEF_TEXTURE, t_Bool},
+ {&do_fog, "fog", "Fog", DEF_FOG, t_Bool},
};
static OptionStruct desc[] = {
ModStruct blocktube_description =
{"blocktube", "init_blocktube", "draw_blocktube", "release_blocktube",
"draw_blocktube", "init_blocktube", (char *)NULL, &blocktube_opts,
- 10000, 30, 1, 1, 64, 1.0, "",
+ 40000, 30, 1, 1, 64, 1.0, "",
"A shifting tunnel of reflective blocks", 0, NULL};
#endif /* USE_MODULES */
+#if defined( I_HAVE_XPM )
static Bool LoadGLTextures(ModeInfo *mi)
{
Bool status;
glGenTextures(1, &envTexture);
glBindTexture(GL_TEXTURE_2D, envTexture);
texti = xpm_to_ximage(MI_DISPLAY(mi), MI_VISUAL(mi), MI_COLORMAP(mi),
- envImage_xpm);
+ blocktube_xpm);
if (!texti) {
status = False;
} else {
}
return status;
}
+#endif
static void newTargetColor(void)
{
- targetR = random() % 256;
- targetG = random() % 256;
- targetB = random() % 256;
- deltaR = (targetR - currentR) / changetime;
- deltaG = (targetG - currentG) / changetime;
- deltaB = (targetB - currentB) / changetime;
+ int luminance = 0;
+
+ while (luminance <= 150) {
+ targetR = random() % 256;
+ targetG = random() % 256;
+ targetB = random() % 256;
+ deltaR = (targetR - currentR) / changetime;
+ deltaG = (targetG - currentG) / changetime;
+ deltaB = (targetB - currentB) / changetime;
+ luminance = 0.3 * targetR + 0.59 * targetG + 0.11 * targetB;
+ }
}
static void randomize_entity (entity *ent)