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]
Other format: [Raw text]

Re: IMFApp Office


>With the Linux/X11 Imfapp, the images from 'wreckreation.imf' appear
>strangely in the 32x32 menu tiles, but the closeup views seem to be
>fine. Any idea why that might be?

This is because your images have non-standard sizes.

Xconq assumes by default that images fit within a 32x32 box (the "unit"
box). I found that rather restrictive a few years ago, when I added the
images for the advances and lord-rings games. These images were from
various Civ2 scenarios, and all fit within a 44x48 box (or to be more
precise, I made sure that they would fit within a hexagon of that size,
which is what the basic Xconq cell is.

The point of staying within one cell is that it makes the graphics much
more complicated (and time-consuming) if an image covers adjacent cells,
since these adjacent cells also must be redrawn when the unit moves.

To handle these bigger 44x48 images, I hacked the interface code, and added
a global flag big_unit_images, which is set to true if any image in the
game has a width of more than 32 pixels.

Now, what you have in wreckreation.gif are two images with completely
non-standard sizes: 38x64 and 30x64. There is no support for this in the
current interface code. The first image is wider than 32 pixels, and would
therefore be interpreted as a 44x48 images and set the big_unit_images
flag. the second image would be interpreted as a 32x32 image.

However, a further complication is during actual drawing, when best_image
checks that no image is greater than 32x32 (or 44x48) and scales the image
in that is the case. Your images, if used in Xconq, would therefore be cut
to half-size before they are drawn. In practice, this happens only to the
wider of the two images in the tcltk interface, but to both of them in the
Mac interface.

In IMFApp, the initial drawing just uses the real size of the images
without any scaling. After an image has been selected, however, all image
sizes have been inited, and the code then uses the "best" of them. You may
have noticed that some B/W emblems are initially drawn at their correct
(small) size but at twice that size after being cliked on.  What you now
see is essentially the reverse of this, and indeed, if you click on one of
the images, click on the other, and then click on the first one, it is
redrawn at a smaller size which will fit within the 32x32 box.

My advice would be to try to keep images within the bounds Xconq expect,
i.e. either 32x32 or 44x48. I always scale images to that size when I make
gifs. In addititon, it is a good idea to keep the 44x48 images within a
hexagon. I use this magenta/green background grid that you may have noticed
in my gifs to ensure that this is the case.

Hans

P.S. Another strange thing that you may have noticed is that your new gif
appears (distorted) when you select wreckreation in the new game list. The
same thing also happens with Elijah's "cil" game. This is because of a
hidden but fully functional feature that I added last year (ported from the
mac interface), which makes it possible to have preview images for each
game. Right now, all of them load the same image, which is the old popup
screen. However if you give a gif the same name as a game, that gif is
loaded instead. I have prepared gifs for a number of the games but have not
had time to finish the job yet.

So it is also a good idea not to name gifs exactly as an existing game
(unless you do want that gif to appear in the preview window, of course).

P.P.S. Preview gifs should be exactly 240 x 160 pixels. That is why your
iamge is distorted.









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