1diff -urN xlife-6.7.2/colors.c xlife-6.7.3/colors.c
2--- xlife-6.7.2/colors.c	2013-03-21 21:19:56.000000000 +0400
3+++ xlife-6.7.3/colors.c	2013-08-04 15:10:25.000000000 +0400
4@@ -1,6 +1,6 @@
5 /*
6  * XLife Copyright 2011-13 Vladimir Lidovski vol.litwr@gmail.com
7- * $Id: colors.c 168 2013-03-21 17:19:56Z micro $
8+ * $Id: colors.c 241 2013-08-04 10:00:07Z micro $
9  *
10  * Permission to use, copy, modify, distribute, and sell this software and its
11  * documentation for any purpose is hereby granted without fee, provided that
12@@ -340,7 +340,7 @@
13       XChangeGC(disp, cellgc[i], GCForeground, &xgcv);
14    }
15    XSetWindowBackground(disp, lifew, bcolor);
16-   do_expose_lifew();
17+   redraw_lifew();
18    showstates();
19 }
20
21@@ -353,6 +353,6 @@
22       XChangeGC(disp, cellgc[k], GCForeground, &xgcv);
23    }
24    XSetWindowBackground(disp, lifew, cellcolor->pixel);
25-   do_expose_lifew();
26+   redraw_lifew();
27    showstates();
28 }
29diff -urN xlife-6.7.2/defs.h xlife-6.7.3/defs.h
30--- xlife-6.7.2/defs.h	2013-06-16 02:25:05.000000000 +0400
31+++ xlife-6.7.3/defs.h	2013-08-04 15:10:25.000000000 +0400
32@@ -23,7 +23,7 @@
33 /*
34 A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
35 (C) This version of XLife may be used under the same conditions as mentioned above
36-$Id: defs.h 212 2013-06-15 22:25:05Z micro $
37+$Id: defs.h 241 2013-08-04 10:00:07Z micro $
38 */
39
40 #ifdef __GNUCC__
41@@ -91,9 +91,9 @@
42 #define STARTY 2147483648U
43
44 /* the program's run states */
45-#define STOP 	0x0	/* single-stepping */
46-#define HIDE	0x1	/* evolving, no per-generation display */
47-#define RUN	0x2	/* evolving with per-generation display */
48+#define STOP 	0x1	/* single-stepping */
49+#define HIDE	0x2	/* evolving, no per-generation display */
50+#define RUN	0x4	/* evolving with per-generation display */
51
52 /* time-delays for generation evolution */
53 #define DELAY_FAST 0
54@@ -278,7 +278,7 @@
55 void Button(void), Release(void);
56 void ResizeLW(int);
57 void alloc_states(unsigned, unsigned);
58-void do_expose_lifew(void);
59+void redraw_lifew(void);
60 void fixpatterntopology(void);
61 void make_delay(long, long);
62 int rules_changed(void);
63diff -urN xlife-6.7.2/file.c xlife-6.7.3/file.c
64--- xlife-6.7.2/file.c	2013-07-26 14:20:36.000000000 +0400
65+++ xlife-6.7.3/file.c	2013-08-04 15:10:25.000000000 +0400
66@@ -28,7 +28,7 @@
67 /*
68 A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
69 (C) This version of XLife may be used under the same conditions as mentioned above
70-$Id: file.c 215 2013-07-26 10:20:36Z micro $
71+$Id: file.c 241 2013-08-04 10:00:07Z micro $
72 */
73
74 /*
75@@ -433,7 +433,7 @@
76    return 0;
77 }
78
79-static void err_rules(void) { //uses inpbuf as input data
80+static void err_rules(void) { /* uses inpbuf as input data */
81    announce_and_wait(RED_EVER);
82    if (*pathtorules)
83       use_rules(pathtorules, 0);
84@@ -1066,10 +1066,8 @@
85 int loadfile_req(char *fn) {
86    char tmp[PATNAMESIZ], loaddir[PATNAMESIZ];
87    LoadReq *loadqueue = 0;
88-   int scale_save = scale;
89    if (!stashed[0])
90       strcpy(stashed, fn);
91-   do_expose_lifew();
92 /* redefine user load directory (but not pattern library) */
93    strcpy(loaddir, fn);
94    seppatdir(loaddir, tmp);
95@@ -1099,8 +1097,8 @@
96       }
97       setscale(scale);
98    }
99-   if (scale_save != scale)
100-      XClearWindow(disp, lifew);
101+   adjhash(&tentative);
102+   redraw_lifew();
103    showstates();
104    showrules();
105    return 1;
106diff -urN xlife-6.7.2/framebuffer.c xlife-6.7.3/framebuffer.c
107--- xlife-6.7.2/framebuffer.c	2013-06-11 18:25:57.000000000 +0400
108+++ xlife-6.7.3/framebuffer.c	2013-08-04 15:10:25.000000000 +0400
109@@ -1,6 +1,6 @@
110 /*
111  * XLife Copyright 2013 Vladimir Lidovski vol.litwr@gmail.com
112- * $Id: framebuffer.c 211 2013-06-11 14:25:57Z micro $
113+ * $Id: framebuffer.c 237 2013-07-31 10:46:48Z micro $
114  *
115  * Permission to use, copy, modify, distribute, and sell this software and its
116  * documentation for any purpose is hereby granted without fee, provided that
117@@ -48,6 +48,7 @@
118       if (truehistory && c == 0) return;
119 #endif
120       p->cur = c;
121+      //if (!p->checked || c) p->cur = c;
122       p->checked = 1;
123    }
124 }
125@@ -180,3 +181,12 @@
126       p->is = 0;
127    first = 0;
128 }
129+
130+void fb_flush_rep(void) {
131+   register struct FB *p;
132+   for (p = first; p; p = p->next)
133+      if (p->old)
134+         putcell(p, p->old);
135+   fb_close(maxstates + 2*(pseudocolor && ev_mode == VALENCE_DRIVEN));
136+}
137+
138diff -urN xlife-6.7.2/framebuffer.h xlife-6.7.3/framebuffer.h
139--- xlife-6.7.2/framebuffer.h	2013-06-11 18:25:57.000000000 +0400
140+++ xlife-6.7.3/framebuffer.h	2013-08-04 15:10:25.000000000 +0400
141@@ -1,6 +1,6 @@
142 /*
143  * XLife Copyright 2013 Vladimir Lidovski vol.litwr@gmail.com
144- * $Id: framebuffer.h 211 2013-06-11 14:25:57Z micro $
145+ * $Id: framebuffer.h 237 2013-07-31 10:46:48Z micro $
146  *
147  * Permission to use, copy, modify, distribute, and sell this software and its
148  * documentation for any purpose is hereby granted without fee, provided that
149@@ -31,4 +31,6 @@
150 void fb_ins(unsigned, unsigned, unsigned);
151 void fb_ins_old(unsigned, unsigned, unsigned);
152 void fb_flush(void);
153+void fb_flush_rep(void);
154 void fb_clear(void);
155+
156diff -urN xlife-6.7.2/generate.c xlife-6.7.3/generate.c
157--- xlife-6.7.2/generate.c	2013-06-07 17:44:42.000000000 +0400
158+++ xlife-6.7.3/generate.c	2013-08-04 15:10:25.000000000 +0400
159@@ -25,7 +25,7 @@
160 /*
161 A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
162 (C) This version of XLife may be used under the same conditions as mentioned above
163-$Id: generate.c 209 2013-06-07 13:44:42Z micro $
164+$Id: generate.c 241 2013-08-04 10:00:07Z micro $
165 */
166
167 /*
168@@ -1467,7 +1467,7 @@
169               center();
170               if (bounding_box(&active))
171                    make_tentative(active.xmin, active.ymin, active.xmax, active.ymax);
172-              do_expose_lifew();
173+              redraw_lifew();
174        }
175 }
176
177@@ -2234,7 +2234,7 @@
178       if ((!memcmp(oscillator_check.cellcount + 1, active.cellcount + 1, maxstates - 1))
179             && comparepatterns(&active, &oscillator_check)) {
180          state = STOP;
181-         do_expose_lifew();
182+         redraw_lifew();
183          sprintf(inpbuf, "Period-%d oscillator is found", active.generations - oscillator_check.generations);
184          announce_and_wait(GREEN_EVER);
185          oscillators = 0;
186diff -urN xlife-6.7.2/help.c xlife-6.7.3/help.c
187--- xlife-6.7.2/help.c	2013-05-28 08:06:55.000000000 +0400
188+++ xlife-6.7.3/help.c	2013-08-04 15:10:25.000000000 +0400
189@@ -23,7 +23,7 @@
190 /*
191 A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
192 (C) This version of XLife may be used under the same conditions as mentioned above
193-$Id: help.c 197 2013-05-28 04:06:55Z micro $
194+$Id: help.c 239 2013-07-31 17:35:09Z micro $
195 */
196
197 #include "defs.h"
198@@ -169,7 +169,7 @@
199                                                                strlen(inpbuf));
200    sprintf(inpbuf, "Wireframe tentative pattern mode: %s", yesno(wireframe));
201    XDrawString(disp, helpw, itextgc, 10, ++k*FONTHEIGHT, inpbuf,
202-                                                               strlen(inpbuf));
203+                                                               strlen(inpbuf));
204    sprintf(inpbuf, "Oscillator check mode: %s", yesno(oscillators));
205    XDrawString(disp, helpw, itextgc, 10, ++k*FONTHEIGHT, inpbuf,
206                                                                strlen(inpbuf));
207diff -urN xlife-6.7.2/Imakefile xlife-6.7.3/Imakefile
208--- xlife-6.7.2/Imakefile	2013-06-09 23:44:31.000000000 +0400
209+++ xlife-6.7.3/Imakefile	2013-08-04 15:10:25.000000000 +0400
210@@ -1,5 +1,5 @@
211 XCOMM Imakefile for xlife 6.7
212-XCOMM tested with various Linuxes (Debian 6, Raspbian, Slackware 14, Mandriva 2010,
213+XCOMM tested with various Linuxes (Debian 7, Raspbian, Slackware 14, Mandriva 2010,
214 XCOMM   ZenWalk 6.4, OpenSUSE 12.3), OpenBSD 5.3, NetBSD 6.1, FreeBSD 9.1, Cygwin NT 5.1
215
216 #ifdef CygxVersionMajor
217@@ -16,7 +16,7 @@
218
219 XLIFEPATSDIR	= xpatsdir_root/patterns
220 CCOPTIONS	= -DLIFEDIR=\"$(XLIFEPATSDIR)\" -DHASHBITS=20 -DVFREQ=50
221-CDEBUGFLAGS	= -g -O5
222+CDEBUGFLAGS	= -O5
223 EXTRA_LIBRARIES	= -lm
224 DOCDIR		= /usr/share/doc/xlife/
225 INSTBINFLAGS	= -m 0755
226diff -urN xlife-6.7.2/main.c xlife-6.7.3/main.c
227--- xlife-6.7.2/main.c	2013-06-16 02:25:06.000000000 +0400
228+++ xlife-6.7.3/main.c	2013-08-04 15:10:25.000000000 +0400
229@@ -25,7 +25,7 @@
230 /*
231  * A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
232  * (C) This version of XLife may be used under the same conditions as mentioned above
233- * $Id: main.c 212 2013-06-15 22:25:05Z micro $
234+ * $Id: main.c 241 2013-08-04 10:00:07Z micro $
235  */
236
237 #include <X11/Xlib.h>
238@@ -46,38 +46,32 @@
239 #include "topology.h"
240
241 /*#define	char	unsigned char*/
242-//#include "icon.h"
243 #include "icon.h"
244 #include "cursor.h"
245 /*#undef char*/
246
247-extern char *getenv();
248-
249 #ifndef GRAB_FRACTION
250-#define GRAB_FRACTION	0.8	/* fraction of screen to seize */
251+#define GRAB_FRACTION	0.8	/* fraction of screen to size */
252 #endif /* GRAB_FRACTION */
253
254 coord_t savex, savey;	/* last point seen during boxing */
255 static coord_t xmarker[3], ymarker[3], linex, liney;
256-static int clrscn;
257
258-void do_expose_lifew() {
259+void redraw_lifew() {
260    XClearWindow(disp, lifew);
261    pivot = 0;
262    fb_clear();
263    drawboundedgrid();
264-   redisplay(1);
265+   redisplay(MESH);
266 }
267
268 void DoExpose(Window win) {
269    if (convmode) return;
270    if (win == lifew) {
271-      if (clrscn) {
272-         do_expose_lifew();
273-         clrscn = 0;
274-      }
275-      else
276-         redisplay(1);
277+      XClearWindow(disp, lifew);
278+      pivot = 0;
279+      drawboundedgrid();
280+      redisplay(MESH + EXPOSE);
281    }
282    else if (win == inputw) {
283       XClearWindow(disp, inputw);
284@@ -311,7 +305,7 @@
285       setscale(++scale);
286       xpos += SCALE(event.xmotion.x);
287       ypos += SCALE(event.xmotion.y);
288-      do_expose_lifew();
289+      redraw_lifew();
290    }
291 }
292
293@@ -320,7 +314,7 @@
294       xpos -= SCALE(event.xmotion.x);
295       ypos -= SCALE(event.xmotion.y);
296       setscale(--scale);
297-      do_expose_lifew();
298+      redraw_lifew();
299    }
300 }
301
302@@ -373,8 +367,10 @@
303       clipboard_copy(&tentative);
304       clipboard.x -= tentative.xmin - STARTX;
305       clipboard.y -= tentative.ymin - STARTY;
306+      if (!wireframe) boxpattern(0);
307       clear_pattern(&tentative);
308       clipboard_flush(&tentative, maxstates);
309+      if (!wireframe) boxpattern(CYAN_EVER);
310    }
311 }
312
313@@ -385,7 +381,7 @@
314        return;
315
316     case 'r':
317-        do_expose_lifew();
318+        redraw_lifew();
319         displaystats();
320         break;
321
322@@ -405,7 +401,7 @@
323     case 'Z':
324         InitCurrentColors();
325         DefaultPalette();
326-        redisplay(1);
327+        redisplay(MESH);
328         break;
329
330     case 'F':
331@@ -434,7 +430,7 @@
332         state = state == RUN ? STOP : RUN;
333         lastx--;
334         bounding_box(&active);
335-        do_expose_lifew();
336+        redraw_lifew();
337         break;
338
339     case '@':
340@@ -526,7 +522,7 @@
341         }
342         else
343            announce("Pseudocolor mode is off");
344-        redisplay(1);
345+        redisplay(MESH);
346         break;
347
348     case 'o':
349@@ -576,7 +572,7 @@
350 	for (num = 0; kbuf[0] != ")]}"[num]; num++);
351 	xpos += xmarker[num] - XPOS(event.xmotion.x);
352 	ypos += ymarker[num] - XPOS(event.xmotion.y);
353-	do_expose_lifew();
354+	redraw_lifew();
355         break;
356
357    case 'J':
358@@ -588,7 +584,7 @@
359          if (sscanf(inpbuf + 13, "%d, %d", &x, &y) == 2) {
360             xpos += x + xorigin - XPOS(event.xmotion.x);
361             ypos += y + yorigin - YPOS(event.xmotion.y);
362-            do_expose_lifew();
363+            redraw_lifew();
364          }
365          displaystats();
366       }
367@@ -611,7 +607,7 @@
368          }
369       }
370       fixpatterntopology();
371-      do_expose_lifew();
372+      redraw_lifew();
373       showrules();
374 exit_T:
375       displaystats();
376@@ -645,7 +641,7 @@
377            clear_pattern(&active);
378            copy_tentative();
379            clear_pattern(&tentative);
380-           do_expose_lifew();
381+           redraw_lifew();
382            displaystats();
383         }
384         break;
385@@ -663,7 +659,7 @@
386            displaystats();
387            center();
388         }
389-        do_expose_lifew();
390+        redraw_lifew();
391 	break;
392
393     case 'S':
394@@ -689,7 +685,7 @@
395         numcomments = outcome[0] = 0;
396 	if (tentative.tiles) {
397 	    clear_pattern(&tentative);
398-	    do_expose_lifew();
399+	    redraw_lifew();
400 	    announce("Load script (and latest load) discarded");
401 	}
402 	else
403@@ -739,7 +735,7 @@
404 	confirmload();
405 	if (state == HIDE) {
406             state = RUN;
407-	    do_expose_lifew();
408+	    redraw_lifew();
409 	}
410 	else
411 	    state = HIDE;
412@@ -819,12 +815,12 @@
413            strcat(inpbuf, "ff");
414         DoExpose(inputw);
415         if (tentative.tiles)
416-             do_expose_lifew();
417+             redraw_lifew();
418         break;
419
420     case 'M': /* toggle gridmode */
421         dispmesh ^= 1;
422-        do_expose_lifew();
423+        redraw_lifew();
424         break;
425
426     case '^': {
427@@ -877,7 +873,7 @@
428     case 'U': /* Get rid of loaded pattern */
429         if (stashed[0]) {
430            clear_pattern(&tentative);
431-           do_expose_lifew();
432+           redraw_lifew();
433         }
434         break;
435
436@@ -1363,7 +1359,6 @@
437     griddisplay(1);
438 #endif
439     for (;;) {
440-        clrscn = 1;
441 	while (XCheckMaskEvent(disp, KeyPressMask|ButtonPressMask|Button1MotionMask
442 	        |PointerMotionMask|Button3MotionMask|ButtonReleaseMask|ExposureMask
443 	        |StructureNotifyMask, &event)) {
444@@ -1385,7 +1380,6 @@
445 		Release();
446 		break;
447 	      case ConfigureNotify:
448-                clrscn = 1;
449 		DoResize();
450 		break;
451 	      case Expose:
452diff -urN xlife-6.7.2/patchlevel.h xlife-6.7.3/patchlevel.h
453--- xlife-6.7.2/patchlevel.h	2013-07-26 14:20:36.000000000 +0400
454+++ xlife-6.7.3/patchlevel.h	2013-08-04 15:10:25.000000000 +0400
455@@ -23,9 +23,9 @@
456 /*
457  * Several modifications were added at 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
458  * (C) This version of XLife may be used under the same conditions as mentioned above
459- * $Id: patchlevel.h 215 2013-07-26 10:20:36Z micro $
460+ * $Id: patchlevel.h 227 2013-07-30 04:15:35Z micro $
461  */
462
463 static int majorversion = 6;
464 static int minorversion = 7;
465-static int patchlevel = 2;
466+static int patchlevel = 3;
467diff -urN xlife-6.7.2/tentative.c xlife-6.7.3/tentative.c
468--- xlife-6.7.2/tentative.c	2013-04-04 19:45:52.000000000 +0400
469+++ xlife-6.7.3/tentative.c	2013-08-04 15:10:25.000000000 +0400
470@@ -23,7 +23,7 @@
471 /*
472  * A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
473  * (C) This version of XLife may be used under the same conditions as mentioned above
474- * $Id: tentative.c 178 2013-03-24 10:39:47Z micro $
475+ * $Id: tentative.c 241 2013-08-04 10:00:07Z micro $
476  */
477
478 #include <stddef.h>     /* we need offsetof() */
479@@ -39,11 +39,11 @@
480
481 static void tentative_move(void) {
482    if (topology != 'Q' || scale == 1 && wireframe)
483-      do_expose_lifew();
484+      redraw_lifew();
485    else {
486       if  (scale > 1 && !dispmesh && wireframe)
487          griddisplay(0);
488-      redisplay(1);
489+      redisplay(MESH);
490    }
491 }
492
493@@ -174,7 +174,7 @@
494                if ((state = getcell(&ptr->cells, dx, dy)) == 1)
495                   setcell(&ptr->cells, dx, dy, paintcolor);
496    }
497-   redisplay(1);
498+   redisplay(MESH);
499 }
500
501 /* tentative.c ends here */
502diff -urN xlife-6.7.2/tile.c xlife-6.7.3/tile.c
503--- xlife-6.7.2/tile.c	2013-06-05 17:23:03.000000000 +0400
504+++ xlife-6.7.3/tile.c	2013-08-04 15:10:25.000000000 +0400
505@@ -23,7 +23,7 @@
506 /*
507  * A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
508  * (C) This version of XLife may be used under the same conditions as mentioned above
509- * $Id: tile.c 205 2013-06-05 13:23:03Z micro $
510+ * $Id: tile.c 241 2013-08-04 10:00:07Z micro $
511  */
512
513 /*
514@@ -41,9 +41,9 @@
515  *
516  * void center()                  -- center viewport on barycenter of pattern
517  *
518- * void clear_all()                   -- clear the universe, freeing all storage
519+ * void clear_all()               -- clear the universe, freeing all storage
520  *
521- * void redisplay(int showgrid)   -- update visible display of active board
522+ * void redisplay(int mode)        -- update visible display of active board
523  *
524  * void drawboundedgrid(void)
525  *
526@@ -201,7 +201,7 @@
527 	}
528 	freep = 0;
529 	tilesize = offsetof(tile, cells) + newsize;
530-        do_expose_lifew();
531+        redraw_lifew();
532     }
533 }
534
535@@ -331,20 +331,25 @@
536
537 void display_move(int force, int dx, int dy) {
538    if ((tentative.tiles || force) && wireframe && scale == 1)
539-      do_expose_lifew();
540+      redraw_lifew();
541    else if ((tentative.tiles || force) && wireframe && scale > 1 && !dispmesh) {
542       griddisplay(0);
543-      redisplay(1);
544+      redisplay(MESH);
545    }
546    else if (topology != 'Q' && (dx || dy)) {
547-     adjust_topology(dx, dy, 0);
548-     redisplay(0);
549-     adjust_topology(dx, dy, 1);
550-     if (dispmesh && scale > 1) {
551-        griddisplay(1);
552-        if (tentative.tiles)
553-           boxpattern(CYAN_EVER);
554-     }
555+      adjust_topology(dx, dy, 0);
556+      if (tentative.tiles && wireframe)
557+         redisplay(MESH);
558+      else
559+         redisplay(0);
560+      adjust_topology(dx, dy, 1);
561+      if (!tentative.tiles || !wireframe) {
562+         if (dispmesh && scale > 1) {
563+            griddisplay(1);
564+            if (tentative.tiles && !wireframe)
565+               boxpattern(CYAN_EVER);
566+         }
567+      }
568    }
569    else
570       redisplay(tentative.tiles || force);
571@@ -441,7 +446,6 @@
572       ptr = nptr;
573    }
574    initcells(pp);
575-   if (pp == &active) fb_clear();
576 }
577
578 void clear_all(void) {
579@@ -449,7 +453,7 @@
580    if (tentative.tiles)
581       clear_pattern(&tentative);
582    clear_pattern(&active);
583-   do_expose_lifew();
584+   redraw_lifew();
585 }
586
587 static int fb_sync() {
588@@ -477,7 +481,7 @@
589    return 5;
590 }
591
592-static int onscreen(coord_t x, coord_t y) {
593+int onscreen(coord_t x, coord_t y) {
594    /*this is a bit complicated due to the big torus calculations */
595    int px_min = x > xpos - ascale(), py_min = y > ypos - ascale(),
596       px_max = x < xpos + SCALE(width), py_max = y < ypos + SCALE(height);
597@@ -503,14 +507,10 @@
598    }
599 }
600
601-void redisplay(int showgrid) {
602-/* re-display the visible part of the board */
603+void tile_fb_update(void) {
604    tile *ptr;
605    coord_t x, y, tentx, tenty;
606    int curstate, q = 0;
607-   if (state == HIDE) return;
608-   if (dispmesh && scale > 1 && showgrid) griddisplay(1);
609-   if (!fb_sync()) return;
610    if (truehistory) {
611       historytile *ptr;
612       for (curstate = 1; curstate >= 0; curstate--) {
613@@ -588,12 +588,26 @@
614             trdisplaybox(ptr->x - STARTX, ptr->y - STARTY, &ptr->cells);
615          q = 0;
616    }
617-   /* remove pivot of tentative points */
618-   if (tentative.tiles && pivot) {
619+}
620+
621+void redisplay(int mode) {
622+/* re-display the visible part of the board*/
623+   tile *ptr;
624+   coord_t x, y, tentx, tenty;
625+   int curstate, q = 0;
626+   if (state == HIDE) return;
627+   if (dispmesh && scale > 1 && (mode & MESH)) griddisplay(1);
628+   if (!fb_sync()) return;
629+   if (tentative.tiles && pivot) { /* remove pivot of tentative points */
630       if (!wireframe) boxpattern(CYAN_EVER);
631       drawpivot();
632    }
633-   fb_flush();
634+   if (mode & EXPOSE)
635+      fb_flush_rep();
636+   else {
637+      tile_fb_update();
638+      fb_flush();
639+   }
640    if (tentative.tiles && wireframe && scale >= 1)
641       /* draw tentative points with appropriate transformation */
642       for (ptr = tentative.tiles; ptr; ptr = ptr->next) {
643diff -urN xlife-6.7.2/tile.h xlife-6.7.3/tile.h
644--- xlife-6.7.2/tile.h	2013-03-26 13:19:17.000000000 +0400
645+++ xlife-6.7.3/tile.h	2013-08-04 15:10:25.000000000 +0400
646@@ -23,12 +23,16 @@
647 /*
648  * A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
649  * (C) This version of XLife may be used under the same conditions as mentioned above
650- * $Id: tile.h 181 2013-03-26 09:19:17Z micro $
651+ * $Id: tile.h 240 2013-08-01 12:11:59Z micro $
652  */
653
654 #define XMASK 0xfffffff8
655 #define YMASK 0xfffffff8
656
657+/* redisplay() modes */
658+#define MESH 1
659+#define EXPOSE 2
660+
661 extern pattern active, tentative, oscillator_check;       /* the two+1 pattern layers */
662
663 void adjhash(pattern*);
664@@ -51,6 +55,7 @@
665 int lookcell(pattern*, coord_t, coord_t);
666 tile *maketile(pattern*, coord_t, coord_t);
667 void median(void);
668+int onscreen(coord_t, coord_t);
669 void redisplay(int);
670 char* rlestr(int);
671 void saveall(FILE*, char);
672diff -urN xlife-6.7.2/topology.c xlife-6.7.3/topology.c
673--- xlife-6.7.2/topology.c	2013-05-30 23:35:57.000000000 +0400
674+++ xlife-6.7.3/topology.c	2013-08-04 15:10:25.000000000 +0400
675@@ -1,6 +1,6 @@
676 /*
677  * XLife Copyright 2012, 2013 Vladimir Lidovski vol.litwr@gmail.com
678- * $Id: topology.c 200 2013-05-30 19:35:57Z micro $
679+ * $Id: topology.c 216 2013-07-28 18:06:27Z micro $
680  *
681  * Permission to use, copy, modify, distribute, and sell this software and its
682  * documentation for any purpose is hereby granted without fee, provided that
683diff -urN xlife-6.7.2/utils.c xlife-6.7.3/utils.c
684--- xlife-6.7.2/utils.c	2013-04-22 20:33:59.000000000 +0400
685+++ xlife-6.7.3/utils.c	2013-08-04 15:10:25.000000000 +0400
686@@ -23,7 +23,7 @@
687 /*
688  * A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
689  * (C) This version of XLife may be used under the same conditions as mentioned above
690- * $Id: utils.c 192 2013-04-22 16:33:59Z micro $
691+ * $Id: utils.c 241 2013-08-04 10:00:07Z micro $
692  */
693
694 #include <pwd.h>
695@@ -280,7 +280,7 @@
696    dispchanges = save_dispchanges;
697    if ((dispboxes = save_dispboxes) || dispchanges) bounding_box(&active);
698    tm = end.tv_sec - start.tv_sec + (end.tv_usec - start.tv_usec)/1000000.0;
699-   do_expose_lifew();
700+   redraw_lifew();
701    sprintf(inpbuf, "Time: %fs, Speed: %u", tm,
702                                            tm > 0 ? speed = count/tm + .5 : 0);
703    announce_and_wait(0);
704@@ -372,7 +372,7 @@
705          XSetWindowBackground(disp, lifew, cellcolor->pixel);
706          XClearWindow(disp, lifew);
707       }
708-      redisplay(1);
709+      redisplay(MESH);
710       showstates();
711    }
712    displaystats();
713diff -urN xlife-6.7.2/xwidget.c xlife-6.7.3/xwidget.c
714--- xlife-6.7.2/xwidget.c	2013-03-26 13:19:17.000000000 +0400
715+++ xlife-6.7.3/xwidget.c	2013-08-04 15:10:25.000000000 +0400
716@@ -1,6 +1,6 @@
717 /*
718  * XLife Copyright 2011-13 Vladimir Lidovski vol.litwr@gmail.com
719- * $Id: xwidget.c 181 2013-03-26 09:19:17Z micro $
720+ * $Id: xwidget.c 241 2013-08-04 10:00:07Z micro $
721  *
722  * Permission to use, copy, modify, distribute, and sell this software and its
723  * documentation for any purpose is hereby granted without fee, provided that
724@@ -405,7 +405,6 @@
725    strcpy(saved_rules, active_rules);
726    if (!loadfile_req(fn))
727       return;
728-   adjhash(&tentative);
729    if (rules_changed())
730       free_loadscript();
731    sprintf(inpbuf, "%d lines of comments", numcomments);
732