http://www.jwz.org/xscreensaver/xscreensaver-5.13.tar.gz
[xscreensaver] / hacks / glx / endgame.c
index 0ccf2a3d5cee5c43dba803de404053cb49ed8e63..d0ae2f39befef30e165cca41f48800619ee7d6a1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * version 1.0 - June 6, 2002
  *
- * Copyright (C) 2002-2007 Blair Tennessy (tennessb@unbc.ca)
+ * Copyright (C) 2002-2008 Blair Tennessy (tennessb@unbc.ca)
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
 #undef countof
 #define countof(x) (sizeof((x))/sizeof((*x)))
 
+#define DEF_ROTATE      "True"
+#define DEF_REFLECTIONS "True"
+#define DEF_SHADOWS     "True"
+#define DEF_SMOOTH      "True"
+#define DEF_CLASSIC     "False"
+
+
 static XrmOptionDescRec opts[] = {
   {"+rotate", ".chess.rotate", XrmoptionNoArg, "false" },
   {"-rotate", ".chess.rotate", XrmoptionNoArg, "true" },
@@ -55,11 +62,11 @@ static XrmOptionDescRec opts[] = {
 static int rotate, reflections, smooth, shadows, classic;
 
 static argtype vars[] = {
-  {&rotate,      "rotate",      "Rotate",      "True", t_Bool},
-  {&reflections, "reflections", "Reflections", "True", t_Bool},
-  {&shadows, "shadows", "Shadows", "True", t_Bool},
-  {&smooth,      "smooth",      "Smooth",      "True", t_Bool},
-  {&classic,     "classic",     "Classic",     "False", t_Bool},
+  {&rotate,      "rotate",      "Rotate",      DEF_ROTATE, t_Bool},
+  {&reflections, "reflections", "Reflections", DEF_REFLECTIONS, t_Bool},
+  {&shadows,    "shadows",      "Shadows",    DEF_SHADOWS, t_Bool},
+  {&smooth,      "smooth",      "Smooth",      DEF_SMOOTH, t_Bool},
+  {&classic,     "classic",     "Classic",     DEF_CLASSIC, t_Bool},
 };
 
 ENTRYPOINT ModeSpecOpt chess_opts = {countof(opts), opts, countof(vars), vars, NULL};
@@ -122,7 +129,7 @@ static const GLfloat whites[WHITES][3] =
     {1.0, 0.55, 0.1},
     {0.8, 0.52, 0.8},
     {0.43, 0.54, 0.76},
-    {0.8, 0.8, 0.8},
+    {0.2, 0.2, 0.2},
     {0.35, 0.60, 0.35},
   };
 
@@ -211,7 +218,9 @@ ENTRYPOINT Bool chess_handle_event (ModeInfo *mi, XEvent *event)
   }
   else if (event->xany.type == ButtonPress &&
            (event->xbutton.button == Button4 ||
-            event->xbutton.button == Button5))
+            event->xbutton.button == Button5 ||
+            event->xbutton.button == Button6 ||
+            event->xbutton.button == Button7))
     {
       gltrackball_mousewheel (cs->trackball, event->xbutton.button, 5,
                               !event->xbutton.state);
@@ -775,8 +784,6 @@ ENTRYPOINT void init_chess(ModeInfo *mi)
   else
     MI_CLEARWINDOW(mi);
 
-  glClearColor(0.0, 0.0, 0.0, 0.0);
-
   if (!cs->wire) {
     glDepthFunc(GL_LEQUAL);
     glClearStencil(0);