diff -urN xlife-6.7.3/main.c xlife-6.7.4/main.c --- xlife-6.7.3/main.c 2013-08-04 15:10:25.000000000 +0400 +++ xlife-6.7.4/main.c 2013-09-29 22:21:44.000000000 +0400 @@ -25,7 +25,7 @@ /* * A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com * (C) This version of XLife may be used under the same conditions as mentioned above - * $Id: main.c 241 2013-08-04 10:00:07Z micro $ + * $Id: main.c 253 2013-09-29 18:39:43Z teacher $ */ #include @@ -1135,7 +1135,7 @@ convmode++; for (i = 1; i < argc; i++) if (*argv[i] == '-') - if (strchr("ACDIMPRSpv?lg", argv[i][1])) + if (strchr("ACDIMPRSpv?lg4", argv[i][1])) switch (argv[i][1]) { case '?': le: fatal("Usage: lifeconv -ACDIMPRSpv? [-l pattern-lib] [-g n] filename\n"); @@ -1381,6 +1381,7 @@ break; case ConfigureNotify: DoResize(); + redraw_lifew(); break; case Expose: DoExpose(event.xexpose.window); diff -urN xlife-6.7.3/patchlevel.h xlife-6.7.4/patchlevel.h --- xlife-6.7.3/patchlevel.h 2013-08-04 15:10:25.000000000 +0400 +++ xlife-6.7.4/patchlevel.h 2013-09-29 20:55:50.000000000 +0400 @@ -23,9 +23,9 @@ /* * Several modifications were added at 2011-13 by Vladimir Lidovski vol.litwr@gmail.com * (C) This version of XLife may be used under the same conditions as mentioned above - * $Id: patchlevel.h 227 2013-07-30 04:15:35Z micro $ + * $Id: patchlevel.h 251 2013-09-29 17:13:49Z teacher $ */ static int majorversion = 6; static int minorversion = 7; -static int patchlevel = 3; +static int patchlevel = 4; diff -urN xlife-6.7.3/tile.c xlife-6.7.4/tile.c --- xlife-6.7.3/tile.c 2013-08-04 15:10:25.000000000 +0400 +++ xlife-6.7.4/tile.c 2013-09-29 22:21:44.000000000 +0400 @@ -23,7 +23,7 @@ /* * A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com * (C) This version of XLife may be used under the same conditions as mentioned above - * $Id: tile.c 241 2013-08-04 10:00:07Z micro $ + * $Id: tile.c 253 2013-09-29 18:39:43Z teacher $ */ /* @@ -877,6 +877,26 @@ coord_t x = 0, y; cellcount_t cellcount; pattern *pp = tentative.tiles ? &tentative : &active; +/* + * Determine the bounding box of the live cells. + */ + cellcount = bounding_box(pp); + if (mode == '4') { + if (ev_mode != VALENCE_DRIVEN || (born&1) || pp->xmax - pp->xmin >= 192 + || pp->ymax - pp->ymin >= 192 + || pp->xmax - pp->xmin >= 160 && pp->ymax - pp->ymin >= 160) { + fprintf(stderr, "can't convert this pattern\n"); + return; + } + fwrite(&live, 2, 1, ofp); + fwrite(&born, 2, 1, ofp); + fprintf(ofp, "%c%c", pp->xmax - pp->xmin + 1, pp->ymax - pp->ymin + 1); + FOR_CELLS(pp, ptr, dx, dy) + if (val = getcell(&ptr->cells, dx, dy)) + fprintf(ofp, "%c%c", + ptr->x + dx - pp->xmin, ptr->y + dy - pp->ymin); + return; + } fprintf(ofp, "##XLife\n"); if (fname[0]) fprintf(ofp, "#N %s\n", fname); @@ -910,10 +930,6 @@ if (*colorfile) fprintf(ofp, "#X %s\n", strrchr(colorfile, '/') + 1); buf[0] = 0; -/* - * Determine the bounding box of the live cells. - */ - cellcount = bounding_box(pp); /* caller may want save to shortest format */ if (mode == '\0') if ((pp->ymax - pp->ymin + 1)*(pp->xmax - pp->xmin + 1) > cellcount * 8) @@ -942,11 +958,11 @@ FOR_CELLS(pp, ptr, dx, dy) if (val = getcell(&ptr->cells, dx, dy)) if (maxstates > 2) - fprintf(ofp, "%d %d %d\n", + fprintf(ofp, "%d %d %d\n", ptr->x + dx - pp->xmin, ptr->y + dy - pp->ymin, val); - else - fprintf(ofp, "%d %d\n", + else + fprintf(ofp, "%d %d\n", ptr->x + dx - pp->xmin, ptr->y + dy - pp->ymin); return;