Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-11

GIF 87a/89a

12 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

James Mills

Hi,

I've been trying to port pascal code that loads gif files and displays them, using the svgalib (no problems there). However I cannot sucessfully port any of anyone's code to do this simple task.

Display a gif file.

Does anyone have a working program that'll display a gif image in linux please ?

thank you
James

Reply by email

Klaus Hartnegg
to James Mills
Does anyone have a working program that'll display a gif image in linux please ?

I have written borland pascal source to display a 256 color BMP image and usually run a batch conversion of the required images to BMP format. GIF contains compression and is thus more complex than BMP. My source should compile on Free Pascal. But if you find source for reading GIF files I would like to get a copy as well.

Klaus

Klaus Hartnegg, Brain Research Group, University Freiburg, Germany Hansa-strasse 9, D-79104 Freiburg, Tel: +49 (0)761 203 9514, Fax 9540 www.brain.uni-freiburg.de/~klaus/

Reply by email

Unknown author
Show quoted text 8 lines
> Does anyone have a working program that'll display a gif image in linux > please ? I have written borland pascal source to display a 256 color BMP image and usually run a batch conversion of the required images to BMP format. GIF contains compression and is thus more complex than BMP. My source should compile on Free Pascal. But if you find source for reading GIF files I would like to get a copy as well.

You also have the added problem that the algorythm used by GIF is something like LHZ which is patented and that the GIF format is also on dubious legal ground. You may find that a lot of open source projects will ignore the GIF format, and getting info on the format may be tricky. I know people like Eric Raymond support the 'Burn all gifs' campaign.

Matt

---------------------------------------------
This message was sent using Mistral WebMail.
http://www.mistral.co.uk/

Reply by email

James Mills
to Unknown author
Show quoted text 16 lines
> > Does anyone have a working program that'll display a gif image in linux > > please ? > > I have written borland pascal source to display a 256 color BMP image > and usually run a batch conversion of the required images to BMP format. > GIF contains compression and is thus more complex than BMP. > My source should compile on Free Pascal. But if you find source > for reading GIF files I would like to get a copy as well. You also have the added problem that the algorythm used by GIF is something like LHZ which is patented and that the GIF format is also on dubious legal ground. You may find that a lot of open source projects will ignore the GIF format, and getting info on the format may be tricky. I know people like Eric Raymond support the 'Burn all gifs' campaign. Matt

Well, someone please tell me then. I haven't developed games much in linux, let alone pascal. What's the best way to do graphics (sprites) for game development? I'm starting small, space invaders clone. But I need some help/ideas of what people generally do.

cheers
James

Show quoted text 10 lines
--------------------------------------------- This message was sent using Mistral WebMail. http://www.mistral.co.uk/ _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Cabuzel Thierry
Show quoted text 36 lines
-----Original Message----- From: James Mills On Tue, Nov 19, 2002 at 10:30:33AM +0000, wrote: > > > Does anyone have a working program that'll display a gif image in linux > > > please ? > > > > I have written borland pascal source to display a 256 color BMP image > > and usually run a batch conversion of the required images to BMP format. > > GIF contains compression and is thus more complex than BMP. > > My source should compile on Free Pascal. But if you find source > > for reading GIF files I would like to get a copy as well. > > You also have the added problem that the algorythm used by GIF is something > like LHZ which is patented and that the GIF format is also on dubious legal > ground. You may find that a lot of open source projects will ignore the GIF > format, and getting info on the format may be tricky. I know people like Eric > Raymond support the 'Burn all gifs' campaign. > > Matt Well, someone please tell me then. I haven't developed games much in linux, let alone pascal. What's the best way to do graphics (sprites) for game development? I'm starting small, space invaders clone. But I need some help/ideas of what people generally do. cheers James

Well, for games, prefer a plain bold BMP images. Why? The trick in games is to do a mix between space (memory/disk), speed, and simplicity. For Images BMP is very simple, very quicky but use a lot of space. For the majority of games BMP images are good and perhaps the best choice you can do. But If your game is graphics intensive in the sense of quantity (Gigs of images) then the best deal could be on the space... All depend of the kind of game you plan to write.

Thierry

Reply by email

Balogh, Karoly (Charlie/iNQ
to Cabuzel Thierry

Hi,

Cabuzel Thierry wrote 6 lines
> Well, someone please tell me then. I haven't developed games much in > linux, let alone pascal. What's the best way to do graphics (sprites) > for game development? I'm starting small, space invaders clone. But I > need some help/ideas of what people generally do. Well, for games, prefer a plain bold BMP images. Why? The trick in games is to do a mix between space (memory/disk), speed, and simplicity.

Of course, everyone uses plain raw or BMP images for Putimage and such routines. But i see no reason why you couldn't use some compressed image format to store pictures on the HDD, and convert to raw chunky or BMP 've a GIF87a-loader source, based on some old SWAG routines modified by myself to fit my own needs, and to work under FPC. I never tried these routines under Linux, but i see no reasons why it shouldn't work, since it uses standard Pascal I/O routines. Anyway, if you're thinking to support only Linux, i think you should use libpng or libgif, or anything like that, to load your files, since that's the most elegant way, IMO.

Anyway, if some of you still need my sources (small example included) please let me know, and then i'll put together my PC again (i'm on Amiga now:) tonight, and upload the stuff to somewhere on the net.

Bye,

Charlie/iNQ .:%[ Cybernetic Hydraulic Android Responsible for ]%:. .:%[ Logical Infiltration and Exploration ]%:. .:%[ Member of TeamOS/2 Hungary ]%:. .:%[ Member of Hungarian Amiga User Group ]%:.

Reply by email

Iván Montes
to James Mills: I've been trying to port pascal code that loads gif files and displays them, using the…

----- Original Message -----

Earlier message 23 lines
From: "James Mills" To: Sent: Tuesday, November 19, 2002 7:33 AM Subject: [fpc-pascal]GIF 87a/89a > Hi, > > I've been trying to port pascal code that loads gif files and displays > them, using the svgalib (no problems there). However I cannot > sucessfully port any of anyone's code to do this simple task. > > Display a gif file. > > Does anyone have a working program that'll display a gif image in linux > please ? > > thank you > James > Have you tried getting the format specs from www.wotsit.org? Once you have them, you just need a LZW uncompressor.

Reply by email

Cabuzel Thierry
Show quoted text 14 lines
-----Original Message----- From: Balogh, Karoly (Charlie/iNQ) Sent: mardi 19 novembre 2002 15:19 To: Subject: Re: [fpc-pascal]GIF 87a/89a Of course, everyone uses plain raw or BMP images for Putimage and such routines. But i see no reason why you couldn't use some compressed image format to store pictures on the HDD, and convert to raw chunky or BMP format at load-time.

If The game could load ALL images at the start (true for a space invader), there is not so much problem. But in the case of a very large 3D environment where textures are loaded as needed, it could be OK if LoadOfCompressedImage
+ TimeToDecompress <= LoadOfUncompressedImage.

Reply by email

Unknown author
If The game could load ALL images at the start (true for a space invader), there is not so much problem. But in the case of a very large 3D environment where textures are loaded as needed, it could be OK if LoadOfCompressedImage + TimeToDecompress <= LoadOfUncompressedImage.

This may be a good time to mention SDL. There is a Jedi port of it to Pascal. I used to work with Domonique Louis the guy who did the Windows side, and iirc he wanted to improve support FPC. That was 6 months ago, so I assume things may have moved on a tad by now. The URL to his site is http://www.savagesoftware.com.au/DelphiGamer/indexf.php There is good genearl gaming stuff there.

And looking at his site, it seems there is an SDL download for FPC at: http://www.grulic.org.ar/~dmoisset/files/SDL4Freepascal-1.2.0.0.tar.gz

Hope than helps you some. SDL is a far better solution.

Matt

---------------------------------------------
This message was sent using Mistral WebMail.
http://www.mistral.co.uk/

Reply by email

Balogh, Karoly (Charlie/iNQ
to Cabuzel Thierry: If The game could load ALL images at the start (true for a space invader), there is not…

Hi,

Cabuzel Thierry wrote 6 lines
> Of course, everyone uses plain raw or BMP images for Putimage > and such routines. But i see no reason why you couldn't use some > compressed image format to store pictures on the HDD, and convert > to raw chunky or BMP format at load-time. If The game could load ALL images at the start (true for a space invader), there is not so much problem.

And this is our case now, since we're talking about a space invader. :)

But in the case of a very large 3D environment where textures are loaded as needed, it could be OK if LoadOfCompressedImage + TimeToDecompress <= LoadOfUncompressedImage.

Not necessarily with a fast decompression routine. If you load from a slow device (eg. CD or such) loading a lot smaller compressed image might be a lot faster, since there is a plenty of free CPU bandwith, but not that much I/O bandwith...

Anyway, 3D is a complettely different thing, since most modern 3D-capable devices can texture using compressed textures, so in this case you don't need to implement your own compression, of course.

Bye,

Charlie/iNQ .:%[ Cybernetic Hydraulic Android Responsible for ]%:. .:%[ Logical Infiltration and Exploration ]%:. .:%[ Member of TeamOS/2 Hungary ]%:. .:%[ Member of Hungarian Amiga User Group ]%:.

Reply by email

Balogh, Karoly (Charlie/iNQ
to Balogh, Karoly (Charlie/iNQ

Hi,

Karoly wrote 6 lines
> But in the case of a very large 3D environment where textures are > loaded as needed, it could be OK if LoadOfCompressedImage + > TimeToDecompress <= LoadOfUncompressedImage. Not necessarily with a fast decompression routine. If you load from a slow device (eg. CD or such) loading a lot smaller compressed image might be a lot faster

Ooops... We're talking about the same case... :) My english really needs some refresh. Sorry.

Bye,

Charlie/iNQ .:%[ Cybernetic Hydraulic Android Responsible for ]%:. .:%[ Logical Infiltration and Exploration ]%:. .:%[ Member of TeamOS/2 Hungary ]%:. .:%[ Member of Hungarian Amiga User Group ]%:.

Reply by email

James Mills
to Unknown author: This may be a good time to mention SDL. There is a Jedi port of it to Pascal. I used to…
Show quoted text 20 lines
> If The game could load ALL images at the start (true for a space invader), > there is not so much problem. But in the case of a very large 3D environment > where textures are loaded as needed, it could be OK if LoadOfCompressedImage > + TimeToDecompress <= LoadOfUncompressedImage. This may be a good time to mention SDL. There is a Jedi port of it to Pascal. I used to work with Domonique Louis the guy who did the Windows side, and iirc he wanted to improve support FPC. That was 6 months ago, so I assume things may have moved on a tad by now. The URL to his site is http://www.savagesoftware.com.au/DelphiGamer/indexf.php There is good genearl gaming stuff there. And looking at his site, it seems there is an SDL download for FPC at: http://www.grulic.org.ar/~dmoisset/files/SDL4Freepascal-1.2.0.0.tar.gz Hope than helps you some. SDL is a far better solution. Matt

SDL, or OpenGL ? I've looked around a bit to see what'd be the best library to use. I've decided with SVGALib for now...

Oh and btw, thanks so much guys for all your input. The only couple of games I've made are in Intel Assembly on an old DOS machine I have lying next to this one :P

cheers
James

Show quoted text 10 lines
--------------------------------------------- This message was sent using Mistral WebMail. http://www.mistral.co.uk/ _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email