Archived

This topic is now archived and is closed to further replies.

Fundy Glostna

What's a PCX reader?

Recommended Posts

The tutorial on this site called "Smooth Scrolling A Tile Map" By Jim Adams suggests reading in a .PCX file with "a standard PCX reader", then using it''s pixel data to create a tile map. He uses loads a pcx file with pcx_loadimage(), then uses get_pixel() to read the palette entry of each pixel and use it as a tile ID. I am unfamiliar with the what a .pcx is, and the functions he uses with "pcx" in the name. I am wondering if reading the pixel data of another type of image file, like a bitmap or even a .pal, could serve the same purpose?

Share this post


Link to post
Share on other sites
PCX is an image format. Any image format will work so long as the loader does the same thing in the end. So, if you''re trying to load an image to a DirectDraw surface, then so long as your loader does that, it can use whatever image format it wants.

So, if you''d prefer to create a loader for BMP files, feel free. The advantage of PCXs is that they''re compressed, BMPs aren''t. And as for your .PAL files, if they''re image files (which, unless you invented it, I doubt) they''re usable too.

-Auron

Share this post


Link to post
Share on other sites
PCX is a standard image format, and a PCX-reader is basically a collection of routines for loading such an image.
The PCX format is quite simple and there are certainly lots of example code on the internet if you dont want to write your own reader/writer.

PCX format specification:
http://www.wotsit.org/search.asp?page=7&s=graphics

/ Tooon

Share this post


Link to post
Share on other sites
.PAL are pallette files usualy in the form of a bitmap with pallette data attached.

You can grab the pallette from any image file thats stored in 8 bit or less (although the pallettes may be different sizes with files other than 8 bit).

If you use 16, 24 or 32 bit colour depths you don''t need a pallette

,Jay

Share this post


Link to post
Share on other sites