From: "Tim Nicholson" 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" 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 { > 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 > > >