Mail Archives: djgpp/1999/02/04/18:42:42
> dat = load_datafile("spill.dat");
> if (!dat) {
> return; }
Yout should load the datafile _after_ calling set_color_depth() and
set_gfx_mode(). Otherwise, Allegro will not know what format to convert the
loaded images into.
> allegro_init();
allegro_init() should be the first function you call, even before
load_datafile().
> set_color_depth(16);
> set_gfx_mode(GFX_AUTODETECT, 800, 600, 0, 0);
It's a good idea to check the return value of set_gfx_mode() here to ensure
that the resolution was set correctly.
>
> set_palette(dat[palette001].dat);
set_palette() has no meaning in 15-bit modes and above... I'm not sure if
it's a bad thing to call it anyways? To be safe, you should only call
set_palette() if you are using an 8-bit color depth.
> destroy_bitmap(bmp);
This is not what you want. bmp was loaded with the datafile, so you should
call destroy_datafile(dat) instead.
- Raw text -