Mail Archives: djgpp/1997/12/10/16:46:36
Julia/Christopher Webb writes:
>I am loading the data file in a constructor:
>
>imgSource=load_datafile("striker.dat");
Are you checking this to make sure the load function is successful?
>bmp=(BITMAP*) imgSource[inf.idx[i]].dat;
That looks basically plausible. Try stepping through it and examining
these variables in a debugger, or adding some printf statements to see
what the values are. Make sure that imgSource is pointing somewhere
sensible, and check that the contents of i and inf.idx[i] are correct...
>load_datafile is called before the graphics mode is
>set -- I'm using a 640x480x15bit mode. Is there something I
>overlooked, or should I have set the mode first?
You _must_ always set the video mode before loading any truecolor
graphics. Otherwise Allegro will have no idea what format to return them
in (some video cards use RGB pixel layouts, while others use a BGR
ordering). That probably isn't your problem, though: at worst it could
result in your images having swapped red and blue components, or being
in the wrong color depth.
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa
- Raw text -