delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/04/18:42:42

From: "Chris Frolik" <spam AT dev DOT null DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Newbie
Date: Thu, 4 Feb 1999 18:17:47 -0500
Organization: Purdue University
Lines: 35
Message-ID: <79d9sg$3j4$1@mozo.cc.purdue.edu>
References: <79a5a4$2bk$1 AT romeo DOT dax DOT net> <01be5000$57bd5300$899260cb AT gnome> <79cntt$don$1 AT romeo DOT dax DOT net>
NNTP-Posting-Host: shrv-a-033.resnet.purdue.edu
X-Trace: mozo.cc.purdue.edu 918170320 3684 128.210.198.33 (4 Feb 1999 23:18:40 GMT)
X-Complaints-To: usenet AT mozo DOT cc DOT purdue DOT edu
NNTP-Posting-Date: 4 Feb 1999 23:18:40 GMT
X-Newsreader: Microsoft Outlook Express 4.72.3155.0
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

>      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 -


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