Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Custom Graphic Format

I'm running into a problem and it's driving me nuts. Any help in this regard would be greatly appreciated.

I'm writing an app in to parse some information out of another company's data files. I can open up the MPQ and siphon out the files, but I can't display them as they're in a custom graphics type (.blp). I know there's several converters out there, but I'd rather not export the files, convert them and then load them into my program when it would be much simpler to reference them from the MPQ directly.

So here's what I know about .blp files:

[italic]struct BLP2Header
FourCC ID; // Always 'BLP2'
UInt32 Type;
UInt8 Encoding;
UInt8 AlphaDepth;
UInt8 AlphaEncoding;
UInt8 HasMips;
UInt32 Width;
UInt32 Height;
UInt32 Offsets[16];
UInt32 Lengths[16];
RGBAColor8 Palette[256];

0: JPEG compression
1: Uncompressed or DirectX compression

1: Uncompressed
2: DirectX compression

0: No alpha channel
1: 1 bit alpha
8: 8 bit alpha

0: DXT1 alpha (0 or 1 bit alpha)
1: DXT2/3 alpha (4 bit alpha)
7: DXT4/5 alpha (interpolated alpha)

0: No mip levels
1: Mip levels present (the number of levels is determined by the image size)

Width, Height: Dimensions of the image in pixels (always a power of two)

Offsets[0]: Offset from the start of the file to the image data
Lengths[0]: Length in bytes of the image data
Palette: 4-byte BGRA color values for paletted textures (this field is present regardless of whether the texture actually uses palettes)[/italic]

Now... my question becomes is there a way to tell VB how to handle these files and display them, and if so... how would I do that?
Sign In or Register to comment.