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: PG-like game


>I've started to import some user-made graphics from Panzer
>General 2, and you can look how it looks like at:
>http://www.cyf-kr.edu.pl/~rrziobro/pgl.gif
>Its very preliminary, but I have not enough time to do it
>properly.

It looks very promising for something preliminary. If you send me the files
when you are happy with them I will check them in.

>The game is magnuszew, but the panzer game module was changed.
>The terrain is basically taken from advterr, some units do not
>fit their names, and I have no idea how to make larger icons
>(should I enlarge the gif file?).

The basic size of the map image (in pixels) is the same as in the gif file,
so if you make larger images in the file xconq will also draw them larger
on the map. However, you will run into problems if images extend outside
the hexes since parts of them will not be redrawn properly. That is what
the hex-shaped masks in the gif files are for.

That being said, there is also automatic scaling which has the effect on
unix (but not on the mac) that images with a bounding box bigger than 32X32
pixels are drawn at half the desired size. The reason for this is to ensure
that they will stay within one hex. This is probably why several of your
images appear to be drawn at half size.

I ran into exactly this problem with the Civ2 images, which have bounding
boxes of 44x44 pixels. The fix I implemented was a hack to draw_units in
tkmap.c, which now checks the gvar g_bigicons(). If it is true, a different
scaling code is used.

So to make a long answer short, you need to include the following line in
the game file if you want to use images larger than 32x32 pixels:

(set bigicons true)

>There's a problem with handling too many icons. I don't know
>what the exact limit is, but if I include too many icons
>the segmentation fault appears. Maybe it's the time to change
>icon handling by a programme- the dir.imf directory is not
>a very good idea if we have to use complicated graphics, I would
>like it more, if it would be possible to include .imf files
>just as .g files in a module.

The segfault happens if you exceed MAXIMAGEFAMILIES which is defined in
imf.c. I boosted it to 1200 two years ago when we got crashes in the civ2
game. I thought that would be enough for the foreseeable future :-).

I will increase MAXIMAGEFAMILIES next time I check something in. However, I
agree that it would be better to get rid of this limitation, and also
imf.dir. If you (or somebody else) want to take a look at this code, please
go ahead. We do need more hackers on this project.

Hans

Hans Ronne

hronne@pp.sbbs.se



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