xroach problems.

Edmund Stephen-Smith Edmund.Stephen-Smith at comp.vuw.ac.nz
Sat Mar 30 12:14:03 AEST 1991


In article <1509 at culhua.prg.ox.ac.uk> bush at ecs.ox.ac.uk (Mark Bush) writes:
[...]
>you'll find that the roach moves at a reasonable speed, but that most of the
>time it is un-painted.  It seems to flash on for a brief moment.  At least
>that's how it runs on all the Suns I've compiled it on.
>
>Anyone else seen this?  I've had only a quick glance at the source so far
>and I can't see yet what the problem is.

The problem seems to be that the roaches are undrawn and then redrawn 
in two separate loops.  First they are *all* deleted then *all* redrawn.  
By merging the loops, so that each roach in turn is deleted then redrawn, 
they appear much more solid.

Diff follows (ie. delete the five lines with minus signs at the front),

Ed.


*** xroach.c~   Sat Mar 30 13:51:26 1991
--- xroach.c    Sat Mar 30 13:55:28 1991
***************
*** 407,417 ****
        if (roach->intX >= 0) {
            XClearArea(display, rootWin, roach->intX, roach->intY,
                roach->rp->width, roach->rp->height, False);
-       }
-     }
-
-     for (rx=0; rx<curRoaches; rx++) {
-       roach = &roaches[rx];

        if (!roach->hidden) {
            roach->intX = roach->x;
--- 407,412 ----
-- 
Edmund Stephen-Smith               crunch at comp.vuw.ac.nz   



More information about the Comp.sources.bugs mailing list