ftp://ftp.uni-heidelberg.de/pub/X11/contrib/applications/xscreensaver-1.27.tar.Z
[xscreensaver] / hacks / maze.c
old mode 100755 (executable)
new mode 100644 (file)
index c7e09fa..6d73796
@@ -1,7 +1,9 @@
 /******************************************************************************
  * [ maze ] ...
  *
- * modified:  [ 3-7-93 ]  Jamie Zawinski <jwz@mcom.com>
+ * modified:  [ 8-11-95 ] Ed James <james@mml.mmc.com>
+ *              added fill of dead-end box to solve_maze while loop.
+ * modified:  [ 3-7-93 ]  Jamie Zawinski <jwz@netscape.com>
  *             added the XRoger logo, cleaned up resources, made
  *             grid size a parameter.
  * modified:  [ 3-3-93 ]  Jim Randell <jmr@mddjmr.fc.hp.com>
@@ -52,11 +54,7 @@ static int solve_delay, pre_solve_delay, post_solve_delay;
 #include  <stdio.h>
 #include  <X11/Xlib.h>
 #include  <X11/Xutil.h>
-#ifndef VMS
 #include  <X11/bitmaps/gray1>
-#else
-#include "sys$common:[decw$include.bitmaps]gray1.xbm"
-#endif
 
 #define MAX_MAZE_SIZE_X        500
 #define MAX_MAZE_SIZE_Y        500
@@ -93,11 +91,7 @@ static int logo_x, logo_y;
 # define logo_width  128
 # define logo_height 128
 #else
-#ifndef VMS
 # include  <X11/bitmaps/xlogo64>
-#else
-# include "sys$common:[decw$include.bitmaps]xlogo64.xbm"
-#endif
 # define logo_width xlogo64_width
 # define logo_height xlogo64_height
 # define logo_bits xlogo64_bits
@@ -293,7 +287,7 @@ static void enter_square ();
 static void
 create_maze()             /* create a maze layout given the intiialized maze */
 {
-  register int i, newdoor;
+  register int i, newdoor = 0;
   
   do {
     move_list[sqnum].x = cur_sq_x;
@@ -572,6 +566,10 @@ solve_maze()                             /* solve it with graphical feedback */
   /* do it */
   while (1) {
     if ( ++path[i].dir >= 4 ) {
+      XFillRectangle(dpy, win, cgc,
+                    border_x + bw + grid_width * (int)(path[i].x),
+                    border_y + bw + grid_height * (int)(path[i].y),
+                    grid_width - (bw+bw), grid_height - (bw+bw));
       i--;
       draw_solid_square( (int)(path[i].x), (int)(path[i].y), 
                        (int)(path[i].dir), cgc);
@@ -621,7 +619,7 @@ enter_square(n)                            /* move into a neighboring square */
 
 
 /*
- *  jmr additions for Jamie Zawinski's <jwz@mcom.com> screensaver stuff,
+ *  jmr additions for Jamie Zawinski's <jwz@netscape.com> screensaver stuff,
  *  note that the code above this has probably been hacked about in some
  *  arbitrary way.
  */