Complete.Org: Mailing Lists: Archives: freeciv-java: December 2001:
[FreeCiv-Java] Re: XPM versus PNG
Home

[FreeCiv-Java] Re: XPM versus PNG

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-java@xxxxxxxxxxx
Subject: [FreeCiv-Java] Re: XPM versus PNG
From: Brian Duff <BRIAN.DUFF@xxxxxxxxxx>
Date: Sun, 16 Dec 2001 18:14:52 -0800 (GMT-08:00)

As Ben spotted, Java's built in PNG support doesn't work with the city and road 
png files in trident :(... I've checked the latest version of the sixlegs png 
library in and switched over to using this instead of Java's built in PNG 
support....

Brian

--

Done, and checked in to CVS.

Brian

---
Hi Artur,

The reason I switched over to xpm was mainly that this seems to be the format 
the UNIX clients are using and I wanted to avoid having to convert the images. 
I didn't realize the win32 client is using png. I agree png is a far better 
image format (in particular, it supports alpha blending, which works like a 
charm in Java).

In addition, I was unable to get Java's built in image loaders to recognize xpm 
files: I know we discussed this a (long) while back. I ended up writing my own 
parser to support xpm.

It would be very easy for the client to support PNG in addition to XPM. All 
that's required is to write a class implementing the Sprite interface then 
alter TileSpec.loadImage( URL ) so that it recognizes the PNG / GIF / JPG 
extensions and uses this implementation... In fact, I might have a go at doing 
this after I'm through checking my email...

Brian


-----
I was trying to run jfreeciv client yesterday, but it turned out that 
data I have downloaded with win32 client is in png format and jfreeciv 
understands only xpm.

I know that there were some historical reasons, for from 1.3+, java 
itself understands gif,jpg,png and xpm. It is possible to support all 
these 4 formats using same code. How much work would it be to convert 
current loaders to use default java image toolkit ?

Artur












[Prev in Thread] Current Thread [Next in Thread]