port: fix surfacetypes in g_Textures

This commit is contained in:
fgsfds committed 2023-09-22 21:26:02 +02:00
1 parent 54842f50db
commit 7d5f33d033
1 file changed
+5 -1
+5 -1
View File
@@ -1104,9 +1104,13 @@ void preprocessTexturesList(u8 *data, u32 size)
const u32 count = size / sizeof(*tex);
for (u32 i = 0; i < count; ++i, ++tex) {
// TODO: it sure looks like none of the fields except soundsurfacetype, surfacetype and dataoffset are set
// just swap the last 3 bytes of the first word
// just swap the last 3 bytes of the first word...
const u32 dofs = (u32)tex->dataoffset << 8;
tex->dataoffset = PD_BE32(dofs);
// ...and the surface types in the first byte
const u8 tmp = tex->soundsurfacetype;
tex->soundsurfacetype = tex->surfacetype;
tex->surfacetype = tmp;
}
}