Mail Archives: djgpp/1997/03/12/17:45:46
Mark T Logan writes:
> if(findfirst(infile, &fileinfo, 0)) // make sure that the infile exists!
> {
> cout << "\nFile does not exist, or is a hidden or system file\n";
> return 0;
> }
>
> bitin = load_tga(infile, pal); // load the TGA file
>
> save_pcx(outfile, bitin, pal); // save it as a pcx file
I would guess that load_tga() is failing for some reason, and returning
a NULL pointer. You should check for this, and only call save_pcx() if
the bitmap was loaded succsesfully (if you do that, there is no need to
check that the file exists beforehand).
As to why it is failing, maybe your file is in the compressed TGA
format, or is a 16 bit image, which currently aren't supported by
Allegro.
/*
* Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
* Beauty is a French phonetic corruption of a short cloth neck ornament.
*/
- Raw text -