Article View: comp.sources.d
Article #1668Re: xroach problems.
From: Edmund Stephen-Smith
Date: Sat, 30 Mar 1991 02:14
Date: Sat, 30 Mar 1991 02:14
37 lines
1851 bytes
1851 bytes
In article <1509@culhua.prg.ox.ac.uk> bush@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@comp.vuw.ac.nz
Technical Details
Message-ID:
<1991Mar30.021403.7505@comp.vuw.ac.nz>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!comp.vuw.ac.nz!crunchReferences:
<1509@culhua.prg.ox.ac.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!comp.vuw.ac.nz!crunch From: Edmund.Stephen-Smith@comp.vuw.ac.nz (Edmund Stephen-Smith) Newsgroups: comp.sources.d,comp.sources.bugs Subject: Re: xroach problems. Message-ID: <1991Mar30.021403.7505@comp.vuw.ac.nz> Date: 30 Mar 91 02:14:03 GMT References: <1509@culhua.prg.ox.ac.uk> Sender: crunch@comp.vuw.ac.nz Organization: Dept. of Comp. Sci., Victoria Uni. of Wellington, New Zealand. Lines: 37 Nntp-Posting-Host: embassy.comp.vuw.ac.nz