Halo 2 bitmap data
Halo 2 bitmap data
How is the information about the raw bitmap data stored inside the bitmap tags? I think I found where the offset is kept, but how can I tell, just from looking at the hex:
that the map is kept internal/shared,
the size of the raw data,
and what the dxt version is.
I've checked the insolence website, they have a section for it, but there isn't anything there yet.
that the map is kept internal/shared,
the size of the raw data,
and what the dxt version is.
I've checked the insolence website, they have a section for it, but there isn't anything there yet.
-
- Posts: 357
- Joined: Sun Mar 07, 2004 4:34 pm
![]() |
![]() |
![]() |
this structure of the bitmap tags is defined in the whitepaper
just follow the reflexive 0x44 bytes in the meta
struct bitmMeta {
byte[68] data;
struct image {
char[4] bitm;
ushort width;
ushort height;
ushort depth;
ushort type;
ushort format;
ushort flags;
ushort regPointX;
ushort regPointY;
ushort mipMapCount;
ushort pixelOffset;
uint zero;
uint[6] offset;
uint[6] size;
uint identifier;
byte[36] unknown;
}
}
just follow the reflexive 0x44 bytes in the meta
struct bitmMeta {
byte[68] data;
struct image {
char[4] bitm;
ushort width;
ushort height;
ushort depth;
ushort type;
ushort format;
ushort flags;
ushort regPointX;
ushort regPointY;
ushort mipMapCount;
ushort pixelOffset;
uint zero;
uint[6] offset;
uint[6] size;
uint identifier;
byte[36] unknown;
}
}


EDIT:
ok, just so I can make sure, concerning the below:
Code: Select all
struct bitmMeta {
byte[68] data;
struct image {
char[4] bitm;
ushort width;
ushort height;
ushort depth;
ushort type;
ushort format;
ushort flags;
ushort regPointX;
ushort regPointY;
ushort mipMapCount;
ushort pixelOffset;
uint zero;
uint[6] offset;
uint[6] size;
uint identifier;
byte[36] unknown;
}
}
-
- Posts: 357
- Joined: Sun Mar 07, 2004 4:34 pm
![]() |
![]() |
![]() |
yes.
unsigned shorts are the same as shorts, but unsigned shorts can represent 0 to +65,535 (shorts represent −32,768 to +32,767)
unsigned intergers represent 0 to +4,294,967,295. intergers represent −2,147,483,648 to +2,147,483,647.
byte[68] means that there is a byte with an array that has 68 "slots" of byte.
unsigned shorts are the same as shorts, but unsigned shorts can represent 0 to +65,535 (shorts represent −32,768 to +32,767)
unsigned intergers represent 0 to +4,294,967,295. intergers represent −2,147,483,648 to +2,147,483,647.
byte[68] means that there is a byte with an array that has 68 "slots" of byte.

-
- Posts: 357
- Joined: Sun Mar 07, 2004 4:34 pm
![]() |
![]() |
![]() |
Thanks 
EDIT: Sorry, I have a couple more questions,
1. Do I need to do anything to the offset, or does it point to the right place already?
2. Size needs to be rounded to the nearest 512, right?
3. Can I just extract the raw data at the offset and save that to a file, and that would be the bitmap? Or do I need to do anything to it?
Thanks for putting up with me.

EDIT: Sorry, I have a couple more questions,
1. Do I need to do anything to the offset, or does it point to the right place already?
2. Size needs to be rounded to the nearest 512, right?
3. Can I just extract the raw data at the offset and save that to a file, and that would be the bitmap? Or do I need to do anything to it?
Thanks for putting up with me.
- Iron_Forge
- Posts: 532
- Joined: Sat Sep 20, 2003 9:21 pm
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
The offset is a pure offset...Nothing needs to be done to it, unless of course it points to one of the shared files...
The size does not need to be rounded to 512 for the purposes of extracting...They are padded to 512 bytes when stored in the map file should you want to add them/etc...
The raw data is simply that, the raw data...No header is given...For the most part, a DDS header (with the correct values entered) can be tossed at the front to get a valid DXT image, since DDS supports pretty much all of the images used in Halo...There are a few formats that can be extracted without conversion to other image formats given the correct headers for those formats...
The size does not need to be rounded to 512 for the purposes of extracting...They are padded to 512 bytes when stored in the map file should you want to add them/etc...
The raw data is simply that, the raw data...No header is given...For the most part, a DDS header (with the correct values entered) can be tossed at the front to get a valid DXT image, since DDS supports pretty much all of the images used in Halo...There are a few formats that can be extracted without conversion to other image formats given the correct headers for those formats...
Ok, sorry for being a noob, but I don't fully understand the link. I can probably figure out the width, height, depth, and mipmap count, but other than that, I don't understand. Also, do I just write these values directly to the beginning of the dds? If you could, relate the values from that link to the values in the picture above. And thanks for replying guys.
-
- Posts: 357
- Joined: Sun Mar 07, 2004 4:34 pm
![]() |
![]() |
![]() |
if you want to view the raw data that you extracted from the map in say photoshop (with the plugin), you would have to write the .DDS header and attach it to the raw data.
it would be best to take a bitmap meta, its raw data, and the .dds version of the raw data, and the link Aequitas gave to you to write your own .dds header.
for example, the first member or your .dds header is "DWORD dwSize" (referencing the link). and you would write "Size of structure. This member must be set to 124." in dwSize (again, referencing the link).
it would be best to take a bitmap meta, its raw data, and the .dds version of the raw data, and the link Aequitas gave to you to write your own .dds header.
for example, the first member or your .dds header is "DWORD dwSize" (referencing the link). and you would write "Size of structure. This member must be set to 124." in dwSize (again, referencing the link).
