Jump to content

Need info for a field in an MBM texture file.


Recommended Posts

Hi all,

MBM texture files contain several fields in the header, each one being 4 bytes (32 bits) in size, little-endian.

[B][FONT=lucida console]hex addr
00000000 [COLOR=#b22222]03 4B 53 50[/COLOR] [COLOR=#008000]00 02 00 00[/COLOR] [COLOR=#0000ff]00 04 00 00[/COLOR] [COLOR=#008080]01 00 00 00[/COLOR] [COLOR=#8b4513]20 00 00 00[/COLOR][/FONT][/B]

The first is the "Magic Number" (0x034B5350) or "3KSP".

The second is the texture bitmap width, in pixels. For example, 512 pixels is 0x00020000.

The third is the texture bitmap height, in pixels. For example, 1024 pixels is 0x00040000.

The fifth is the texture bitmap color depth, usually 24 or 32 (i.e. 0x18000000 or 0x20000000).

The FOURTH field is either a 0 or a 1. It seems as thought this field is a "1" in 32 bit color depth bitmaps and a "0" in 24 bit color depth bitmaps, but NOT ALWAYS. Once in a while, a 32 bit texture will have a "0" in this field.

Can anyone tell me what this field represents? Does it maybe mean "alpha layer yes/no"?

I currently have written an "MBM to PNG" file converter to allow easy editing of textures, but I also wish to write a companion "PNG to MBM" converter. The PNG to MBM converter is easy to do... all I need to do is correctly set the value of the "mystery field" correctly... but of course I need to know what it does in order to set it properly.

Using MBM files is much better because they are uncompressed and load fast. If all the game textures are converted to PNG files, the game loads a LOT slower because each PNG has to be decompressed at load time (this is why I want the companion PNG to MBM converter).

Anyone have any idea what field #4 is for?

Thanks!

-- Roger

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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