Mail Archives: djgpp/1998/03/25/04:37:25
>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 -