This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Multiple units tend to be displayed as one


Jim Kingdon wrote:
> 
> > Just committed the fix to CVS - was using a single flag to do two
> > different things, splitting them up did the trick.
> 
> OK this fix works for me.

Great, on to the next!
 
> Here's a new one:
> 
> When you load a saved game (using "xconq -f foo.xcq") the terrain uses
> the boring patterns rather than the textures.  If you start a new
> game, it works right.  Bizarre, huh?

I just committed the fix.  This one *was* bizarre, because if I
commented out all the (imf "sea" ...) forms in the saved game,
it restored OK.  Not only that, but running with GDB showed that
image data was being collected properly from the files and getting
filled in, but later on it the whole subimage array disappeared.
Didn't really seem like memory corruption, so I looked at all the
places that set it, and concluded that a later call to interp_image
must be clearing out the subimages.

As it happens, after all the terrain images are loaded, the program
asks for the "transition" image families that fuzz between cells.
That family is in terrain.imf, so most of the time it's already
available.  But in a saved game, the image families are picked up
from save.xcq, not terrain.imf, and they were set up during reading.
No biggie, all the interpreting code just goes through and either
adds new data or else puts the same values in the same places - except
for subimages, which were always overwritten with empty ones!

Fix was simple, but I took the chance to simplify the code a bit too.

(But then how the commenting-out in the saved game make it work right?
I'll leave that as an exercise for the reader...)

> I feel kind of guilty not sending in patches for any of these, I do
> often read the code looking for a fix but I usually get lost in the
> tcl.

Me too. :-)  Actually, this one had nothing to do with tcl, but
between the variety of image types and Mac/X11/Windows randomness,
there are an awful lot of pathways in the image code... each time
I tinker with it, I have to add more comments...

Stan

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]