www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/12/00:46:16

Message-ID: <3802CB88.E3C@TU-Berlin.DE>
Date: Mon, 11 Oct 1999 22:47:52 -0700
From: Klaus Reinhardt <K DOT Rdt AT TU-Berlin DOT DE>
X-Mailer: Mozilla 3.04Gold (Win95; I; 16bit)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: bmp->screen function
References: <37FD56E5 DOT 17F8 AT TU-Berlin DOT DE> <7tluug$7nq$1 AT solomon DOT cs DOT rose-hulman DOT edu>
Reply-To: djgpp AT delorie DOT com

----------------- mailto:K DOT Rdt AT TU-Berlin DOT DE start -------------------
Hello!

Trying to understand the bmp-file-format I found in bmp.c(allegro) 
the following; perhaps a non-effective error - but why does the 
type of bfType isn't unsigned short?
                     ^^^^^^^^^^^^^^

typedef struct BITMAPFILEHEADER
{
   unsigned long  bfType;
   ^^^^^^^^^^^^^^^^^^^^^
   unsigned long  bfSize;
   unsigned short bfReserved1;
   unsigned short bfReserved2;
   unsigned long  bfOffBits;
} BITMAPFILEHEADER;
...
int save_bmp(char *filename, BITMAP *bmp, RGB *pal) 
{
...
   /* file_header */
   pack_iputw(0x4D42, f);              /* bfType ("BM") */
   ^^^^^^^^^^^^^^^^^                               ^^
   pack_iputl(bfSize, f);              /* bfSize */
   pack_iputw(0, f);                   /* bfReserved1 */
   pack_iputw(0, f);                   /* bfReserved2 */





		Klaus.
----------------- mailto:K DOT Rdt AT TU-Berlin DOT DE !end! -------------------

- Raw text -


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