Jump to content
Miloch

BMP file format

Recommended Posts

The BMP page doesn't have the offsets for the data elements like the other formats do. I know the info is from another site, but I added the offsets for easier reference.

Header (54 bytes)
Offset  Size  Description
0x00	2	 Signature ('BM')
0x02	8	 File size in bytes
0x0a	4	 Data offset (0x36)
0x0e	4	 Info header size (40)
0x12	4	 Width in pixels
0x16	4	 Height in pixels
0x1a	2	 Planes (usually 1)
0x1c	2	 Bit count
0x1e	4	 Compression (0 if not compressed)
0x22	4	 Data size
0x26	4	 Horizontal pixels/meter (default=0)
0x2a	4	 Vertical pixels/meter (default=0)
0x2e	4	 Colors used (0 if not indexed)
0x32	4	 Colors important
0x36	x	 Image data (where x = data size)

The point of this was to try to translate other image formats to BMPs for use as possible maps (like the .frm16 or .way files in Lionheart - we could use some help with figuring those out if any of you IESDP gurus can lend a hand).

Share this post


Link to post

I'll get them added in for the next update.

 

we could use some help with figuring those out if any of you IESDP gurus can lend a hand).

 

It's easier to work out a file format if you have more than one example to hand - i.e. post the bmp, frm and way from another area as well as the one you've put up.

 

I had a look in a few shops at the end of last week for the game, but I couldn't find it anywhere. I'm hoping to pick it up tomorrow. Failing that, I guess the demo would have files to study.

Share this post


Link to post

The BMP fileformat is well documented in many places.

It is so widespread, it wasn't removed from wikipedia :)

Share this post


Link to post
It's easier to work out a file format if you have more than one example to hand - i.e. post the bmp, frm and way from another area as well as the one you've put up.
Done.
I had a look in a few shops at the end of last week for the game, but I couldn't find it anywhere. I'm hoping to pick it up tomorrow. Failing that, I guess the demo would have files to study.
If you can't find it in the cheap software bins, you can order it used fairly cheaply.
The BMP fileformat is well documented in many places.
I don't know if I'd call it "well documented" - compared to proprietary formats, maybe. Still, I had to combine info from several sources and translate decimal offsets to hex. And I'm still not sure what pixels/meter is supposed to represent - something tied to printing maybe. Seems to make no difference whatever value you put there.

Share this post


Link to post

Mulling over possibility of byte-patching .bmp files with Weidu recently, I found out much like Miloch that .bmp file format was documented in IESDP much worse than native BG file formats. I believe it would be handy addition to IESDP if .bmp format will be described as well and exhaustively as, say, .are format.

 

P.S. Did anyone know how to PATCH_HALFBYTE with Weidu? :)

Share this post


Link to post
Mulling over possibility of byte-patching .bmp files with Weidu recently, I found out much like Miloch that .bmp file format was documented in IESDP much worse than native BG file formats. I believe it would be handy addition to IESDP if .bmp format will be described as well and exhaustively as, say, .are format.

 

P.S. Did anyone know how to PATCH_HALFBYTE with Weidu? :(

Shoo. WSM already patches BMP files, so you came late to the party :)

Share this post


Link to post
Shoo. WSM already patches BMP files, so you came late to the party :)
Not having played BG for like 2 years I'm pretty sure I missed many great things... errm, I mean, what is WSM? :(

Share this post


Link to post
Wide-Screen-Mod.

 

Icen

Seriously? You mean, this mode has theoretical potential to non-overwritingly modify search map, for example? Thank you, I'll try to dissect it tomorrow :) Edited by Creepin

Share this post


Link to post
I found out much like Miloch that .bmp file format was documented in IESDP much worse than native BG file formats

 

I'll take that as a compliment. I think.

 

I'm loathe to spend much time on the BMP format (or the WAV format) as there are generic formats. They can be read by several programs, and are documented all over the web (in varying degrees of quality). I'd rather spend time on things specific to the IE. Otherwise we could end up discussing the thoery of two's complement and tweaking NTFS.

 

However, if someone would care to write up a better BMP description (or even find a better one to link to) I'd include that.

Share this post


Link to post

I just went to the appropriate .h file from the windows SDK when I made my BMP code. That's wingdi.h and is not perfectly documented (there - the full documentation is online at microsofts dev.net) but is the actual definition.

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...