uint16_t v4 = swap16(a1->unk_neg40);
if (a1->unk_neg28) {
uint16_t v3 = swap16(a1->unk_neg38);
// Get width and height as POT
int v6 = sub_445C90(v4);
int v7 = sub_445C90(v3);
// Process texture data
sub_445EE0(
a1->unk_neg44, // ?
a1->unk_neg43, // ?
v4, // NPOT Width
v3, // NPOT Height
v6, // POT Width
v7, // POT Height
_a1, // Texture data
_a2, // Optional texture data
1, // ?
a1->unk_neg28->unk3); // ?
}
The new research reveals the following
Section5.offset_Section5_b[0] = Must exist or texture data will not be parsed correctly(?)
Section5.offset_Section5_b[0]->unk3 = Flags of some sort, only 0x10 and 0x01 are used. They seem to double the resolution vertically and horizontally (maybe to mirror / unfold textures while loading?).
Section5.unk16 = NPOT Width
Section5.unk18 = NPOT Height
Section5.unk12[0] = Something to do with texture, seems to control pixel format
Section5.unk12[1] = Something to do with texture, seems to control pixel format
Section5.textureMaskAndIndex = Index to texture and pointer to pixel data (section a) at load-time (unsure: might be replaced with other data later)
Section5.unk60 = Pointer to pixel data (section b) at load-time, presumably garbage if b == 0 (unsure: might be replaced with other data later)
(Where section a and b refer to the first and second section in the out_textureblock table)
This is the original SWR_MODEL_Section5 (Note the broken offsets - please fix):
I found that it's addressed relative in the texture loader:
How it is used in the texture loader:
The new research reveals the following
b == 0
(unsure: might be replaced with other data later)(Where section a and b refer to the first and second section in the out_textureblock table)