I compile my programs on win32 with delphi, and kylix on other platforms, since so far, delphi still leads the performance for code execution on win32.Originally Posted by cragwolf
I compile my programs on win32 with delphi, and kylix on other platforms, since so far, delphi still leads the performance for code execution on win32.Originally Posted by cragwolf
This is my game project - Top Down City:
http://www.pascalgamedevelopment.com...y-Topic-Reboot
My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
http://www.pascalgamedevelopment.com...source+manager
Correct me if I'm wrong, but neither Delphi nor Kylix work on MacOS X. So I think I made a reasonable assumption in concentrating the discussion on Free Pascal, which does work on MacOS X. Also I just noticed that this is the Free Pascal forum. I should read more carefully. ops:
Anyway, I did some testing with the fpImage unit, and found that while it does support the reading of alpha channel information from PNG files, it crashes when you try to write such information. Writing is fine when you don't have an alpha channel. I submitted it as a bug to the FPC guys.
Personally, I stick with TGA files. This image format is so simple that even someone as dumb as me can create a reader/writer class for it. Compression tends to be 2 or 3 times worse than PNG but I can live with that.
[size=10px]"In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it's the exact opposite." -- Paul Dirac[/size]
The paszlib in the Free Pascal SVN is maintained, but not actively developed. But it works very well, is definately usable to read png graphics.Originally Posted by savage
Hi Cragwold, have you tried TPngImage ( pngdelphi.sf.net )? I have tested it across the wholes PNG test suite and it's the only Pascal solution that seems to handle 99% of PNG images. I say 99, but I have actually never seen it mess up an image yet. If we can convince Gustavo to remove his dependency from *.o file and use paszlib for example, it would be a great portable Pascal PNG library.
I tried TPngImage years ago in my Delphi/Win32 days. It was great then, too. This was after I had written my own very inefficient and restricted PNG writer (blood, sweat and tears included). I could never properly understand the Adam7 interlacing business, so I never got quite as far as a reader.
[size=10px]"In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it's the exact opposite." -- Paul Dirac[/size]
I also love the TGA format.. it reads in Delphi, lazarus without problems and full transperency.
Marmin^.Style
Do RLE-compressed TGA's work on Lazarus? I think Lazarus just uses Free Pascal's fpImage unit, and I recall that unit having trouble with RLE-compressed TGA files.
[size=10px]"In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it's the exact opposite." -- Paul Dirac[/size]
Hmm I tried to compile TPngObject on MacOS X and it throws up a few too many errors. Looks like it needs a fair amount of work to allow FreePascal to compile it.
I've sent emails to Gustavo Daud about making TPngObject more portable, but he is not responding to his email at the moment.
After further investigation I think getting libpng support via a binding will be the most cross-platform way to handle PNG file. It would be great to have a pure Pascal implementation, but the work involved in decoupling GDI specifics from the Gustavo Daud's work, make it prohibitive due to my limited time.
OK I have created a more up to date version of libpng.pas which works with a Win32 DLL called lpng-px.dll. Does anyone else have libpng.so installed on their Linux box that would be able to test my header file?
I tried to past the code into here, but something is causing it to kill phpBB.
So you'll have to download the unit from http://jedi-sdl.pascalgamedevelopmen...les/libpng.zip.
Any feedback/corrections welcome.
Bookmarks