delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/12/17:45:46

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problems using allegro
Date: Wed, 12 Mar 1997 19:13:49 +0000
Organization: None
Distribution: world
Message-ID: <d+PkYAAtBwJzEwcD@talula.demon.co.uk>
References: <19970312 DOT 054752 DOT 7495 DOT 0 DOT fwec AT juno DOT com>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 25
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019