-#define MAX_MAZE_SIZE_X 500
-#define MAX_MAZE_SIZE_Y 500
+/* #include <X11/bitmaps/gray1> */
+#define gray1_width 2
+#define gray1_height 2
+static char gray1_bits[] = { 0x01, 0x02 };
+
+
+#define MAX_MAZE_SIZE_X 1000
+#define MAX_MAZE_SIZE_Y 1000
Window r;
int x, y;
unsigned int w, h, bw, d;
Window r;
int x, y;
unsigned int w, h, bw, d;
XGetGeometry (dpy, logo_map, &r, &x, &y, &w, &h, &bw, &d);
XGetGeometry (dpy, logo_map, &r, &x, &y, &w, &h, &bw, &d);
+
+# ifdef XSCREENSAVER_LOGO
+ /* kludge: if the logo "hole" is around the same size as the logo,
+ don't center it (since the xscreensaver logo image is a little
+ off center... But do center if if the hole/gridsize is large. */
+ if (ww < logo_width + 5) ww = w;
+ if (hh < logo_height + 5) hh = h;
+# endif /* XSCREENSAVER_LOGO */
+
if (d == 1)
XCopyPlane (dpy, logo_map, win, logo_gc,
0, 0, w, h,
if (d == 1)
XCopyPlane (dpy, logo_map, win, logo_gc,
0, 0, w, h,
- border_x + 3 + grid_width * logo_x,
- border_y + 3 + grid_height * logo_y, 1);
+ border_x + 3 + grid_width * logo_x + ((ww - w) / 2),
+ border_y + 3 + grid_height * logo_y + ((hh - h) / 2),
+ 1);
else
XCopyArea (dpy, logo_map, win, logo_gc,
0, 0, w, h,
else
XCopyArea (dpy, logo_map, win, logo_gc,
0, 0, w, h,
- border_x + 3 + grid_width * logo_x,
- border_y + 3 + grid_height * logo_y);
+ border_x + 3 + grid_width * logo_x + ((ww - w) / 2),
+ border_y + 3 + grid_height * logo_y + ((hh - h) / 2));
}
draw_solid_square (start_x, start_y, WALL_TOP >> start_dir, tgc);
draw_solid_square (end_x, end_y, WALL_TOP >> end_dir, tgc);
}
draw_solid_square (start_x, start_y, WALL_TOP >> start_dir, tgc);
draw_solid_square (end_x, end_y, WALL_TOP >> end_dir, tgc);
switch (dir) {
case WALL_TOP:
XFillRectangle(dpy, win, gc,
switch (dir) {
case WALL_TOP:
XFillRectangle(dpy, win, gc,
- border_x + bw + grid_width * i,
- border_y - bw + grid_height * j,
- grid_width - (bw+bw), grid_height);
+ border_x + bw+(bw==0?1:0) + grid_width * i,
+ border_y - bw-(bw==0?1:0) + grid_height * j,
+ grid_width - (bw+bw+(bw==0?1:0)), grid_height);
break;
case WALL_RIGHT:
XFillRectangle(dpy, win, gc,
break;
case WALL_RIGHT:
XFillRectangle(dpy, win, gc,
- border_x + bw + grid_width * i,
- border_y + bw + grid_height * j,
- grid_width, grid_height - (bw+bw));
+ border_x + bw+(bw==0?1:0) + grid_width * i,
+ border_y + bw+(bw==0?1:0) + grid_height * j,
+ grid_width, grid_height - (bw+bw+(bw==0?1:0)));
break;
case WALL_BOTTOM:
XFillRectangle(dpy, win, gc,
break;
case WALL_BOTTOM:
XFillRectangle(dpy, win, gc,
- border_x + bw + grid_width * i,
- border_y + bw + grid_height * j,
- grid_width - (bw+bw), grid_height);
+ border_x + bw+(bw==0?1:0) + grid_width * i,
+ border_y + bw+(bw==0?1:0) + grid_height * j,
+ grid_width - (bw+bw+(bw==0?1:0)), grid_height);
break;
case WALL_LEFT:
XFillRectangle(dpy, win, gc,
break;
case WALL_LEFT:
XFillRectangle(dpy, win, gc,
- border_x - bw + grid_width * i,
- border_y + bw + grid_height * j,
- grid_width, grid_height - (bw+bw));
+ border_x - bw-(bw==0?1:0) + grid_width * i,
+ border_y + bw+(bw==0?1:0) + grid_height * j,
+ grid_width, grid_height - (bw+bw+(bw==0?1:0)));
if((x < logo_x || x > logo_x + logo_width / grid_width) ||
(y < logo_y || y > logo_y + logo_height / grid_height))
{
if((x < logo_x || x > logo_x + logo_width / grid_width) ||
(y < logo_y || y > logo_y + logo_height / grid_height))
{
XFillRectangle(dpy, win, ugc,
border_x + bw + grid_width * x,
border_y + bw + grid_height * y,
XFillRectangle(dpy, win, ugc,
border_x + bw + grid_width * x,
border_y + bw + grid_height * y,
{ "-solve-delay", ".solveDelay", XrmoptionSepArg, 0 },
{ "-pre-delay", ".preDelay", XrmoptionSepArg, 0 },
{ "-post-delay", ".postDelay", XrmoptionSepArg, 0 },
{ "-solve-delay", ".solveDelay", XrmoptionSepArg, 0 },
{ "-pre-delay", ".preDelay", XrmoptionSepArg, 0 },
{ "-post-delay", ".postDelay", XrmoptionSepArg, 0 },
+ { "-bg-color", ".background", XrmoptionSepArg, 0 },
+ { "-fg-color", ".foreground", XrmoptionSepArg, 0 },
{ "-live-color", ".liveColor", XrmoptionSepArg, 0 },
{ "-dead-color", ".deadColor", XrmoptionSepArg, 0 },
{ "-skip-color", ".skipColor", XrmoptionSepArg, 0 },
{ "-live-color", ".liveColor", XrmoptionSepArg, 0 },
{ "-dead-color", ".deadColor", XrmoptionSepArg, 0 },
{ "-skip-color", ".skipColor", XrmoptionSepArg, 0 },
}
gc = XCreateGC(dpy, win, 0, 0);
}
gc = XCreateGC(dpy, win, 0, 0);
- int w, h;
- /* round up to grid size */
- w = ((logo_width / grid_width) + 1) * grid_width;
- h = ((logo_height / grid_height) + 1) * grid_height;
- logo_map = XCreatePixmap (dpy, win, w, h, xgwa.depth);
- xscreensaver_logo (dpy, logo_map, xgwa.colormap, False);
+ unsigned long *pixels; /* ignored - unfreed */
+ int npixels;
+ logo_map = xscreensaver_logo (xgwa.screen, xgwa.visual, win,
+ xgwa.colormap, bg,
+ &pixels, &npixels, 0,
+ logo_width > 150);
}
#else
if (!(logo_map = XCreateBitmapFromData (dpy, win, logo_bits,
}
#else
if (!(logo_map = XCreateBitmapFromData (dpy, win, logo_bits,