delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/02/17:36:36

From: "Tim Nicholson" <djgpp_mail AT gizzy DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: loading an array of filenames with load_bitmap
Date: Sat, 2 Dec 2000 22:31:20 -0000
Organization: Skyforce avionics Limited
Lines: 41
Message-ID: <90bt9a$7ra$1@uranium.btinternet.com>
References: <908r2a$50c$1 AT jake DOT esu DOT edu>
NNTP-Posting-Host: host62-7-23-120.btinternet.com
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Are you calling allegro_init()?

Are your PCX files 24 bit (true colour) - if so you must set the video mode
or call set_color_conversion() before loading it.

Regards

Tim


"Tom Hunt" <thunt1 AT falcon DOT lhup DOT edu> wrote in message
news:908r2a$50c$1 AT jake DOT esu DOT edu...
> I'm getting erratic behavior with this block of code.  Sometimes the
program
> crashes in load_pcx.  Sometimes it doesn't.
>
> #define NUM_IMAGES    3
>
> char *names[NUM_IMAGES] = {
>   "GRASS.PCX",
>   "WATER.PCX",
>   "FOREST.PCX"
> };
> ...
>   RGB *pal;
>   BITMAP *images[NUM_IMAGES];
> ...
>   for(int i=0; i<NUM_IMAGES; i++)
>     {
>       images[i] = load_bitmap(names[i], pal);
>     }
>
> When it does crash, I get a page fault from within load_pcx.  Would anyone
> have an idea as to why this is happening?
>
> Tom
>
>
>


- Raw text -


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