www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/25/04:37:25

From: G DOT DegliEsposti AT ads DOT it
To: tackmast AT aol DOT com (TackMast)
cc: djgpp AT delorie DOT com
Message-ID: <C12565D2.0033C6F8.00@vega.ads.it>
Date: Wed, 25 Mar 1998 10:32:54 +0100
Subject: Re: even more graphics problems with allegro
Mime-Version: 1.0




>i posted another message, and took some suggestions. after i'd changed my
code
>a bit, i compiled it. it had one error about argument 1 of blit having an
>incorrect pointer type, but ignored it and compiled the .exe. then, after
i ran
>the program i got this weird error:
It is not generally a good behaviour to ignore warnings, expecially about
wrong types of pointers! :-)

[...]
>data = load_datafile("bmps.dat");
>set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0);
>blit("bmps[selecto].dat", screen, 0, 0, 0, 0, 320, 200);

In effect the problem is here: you are passing a string while blit needs
a pointer to a BITMAP structure.

Probably you made confusion between ".dat" extension
of the datafile file name and .dat field of the DATAFILE structure.

I guess what you wanted was something like this:
  blit((BITMAP *)data[selecto].dat, screen, 0, 0, 0, 0, 320, 200);

without the <">s.

BTW. you shouldn't need do #define selecto in your program. If you build
the .dat file with the allegro grabber it can generate also .h files
with all the #define you need...

ciao
  Giacomo


- Raw text -


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