mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
portx64: fixes #1 - muzzle flashes broken on some weapons
This commit is contained in:
1 parent
ab514f39af
commit
3524ec73b7
1 file changed
+12
-5
@@ -33,6 +33,7 @@ enum contenttype {
|
|||||||
/*19*/ CT_RODATA_DL,
|
/*19*/ CT_RODATA_DL,
|
||||||
/*20*/ CT_RODATA_19,
|
/*20*/ CT_RODATA_19,
|
||||||
/*21*/ CT_VTXCOL4, // CT_VTXCOL but aligned to 4 bytes instead of 8
|
/*21*/ CT_VTXCOL4, // CT_VTXCOL but aligned to 4 bytes instead of 8
|
||||||
|
/*22*/ CT_SKIP, // to skip padding data
|
||||||
};
|
};
|
||||||
|
|
||||||
struct marker {
|
struct marker {
|
||||||
@@ -70,6 +71,7 @@ struct alignconfig m_AlignConfigs[] = {
|
|||||||
/*19*/ { 8, 4 }, // CT_RODATA_DL
|
/*19*/ { 8, 4 }, // CT_RODATA_DL
|
||||||
/*20*/ { 4, 4 },
|
/*20*/ { 4, 4 },
|
||||||
/*21*/ { 4, 4 },
|
/*21*/ { 4, 4 },
|
||||||
|
/*22*/ { 4, 4 }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct marker m_Markers[1024];
|
struct marker m_Markers[1024];
|
||||||
@@ -463,12 +465,15 @@ static void populateMarkers(u8 *src)
|
|||||||
break;
|
break;
|
||||||
case CT_RODATA_STARGUNFIRE:
|
case CT_RODATA_STARGUNFIRE:
|
||||||
struct src_rodata_stargunfire *src_stargunfire = src_thing;
|
struct src_rodata_stargunfire *src_stargunfire = src_thing;
|
||||||
colstart = srctoh32(src_stargunfire->unk00)*4*12;
|
colstart = srctoh32(src_stargunfire->unk00)*4*(sizeof(s16) * 6);
|
||||||
u32 vtxstart = srctoh32(src_stargunfire->ptr_vertices);
|
u32 vtxstart = srctoh32(src_stargunfire->ptr_vertices);
|
||||||
colstart = ALIGN(vtxstart + colstart, 8);
|
u32 vtxend = vtxstart + colstart;
|
||||||
|
colstart = ALIGN8(vtxstart + colstart);
|
||||||
set_marker(srctoh32(src_stargunfire->ptr_vertices), CT_VTXCOL4, marker->src_offset);
|
set_marker(vtxstart, CT_VTXCOL4, marker->src_offset);
|
||||||
set_marker(colstart, CT_VTXCOL4, marker->src_offset);
|
if (vtxend != colstart) {
|
||||||
|
set_marker(vtxend, CT_SKIP, marker->src_offset);
|
||||||
|
}
|
||||||
|
set_marker(colstart, CT_VTXCOL, marker->src_offset);
|
||||||
set_marker(srctoh32(src_stargunfire->ptr_gdl), CT_GDL, marker->src_offset);
|
set_marker(srctoh32(src_stargunfire->ptr_gdl), CT_GDL, marker->src_offset);
|
||||||
break;
|
break;
|
||||||
case CT_RODATA_DL:
|
case CT_RODATA_DL:
|
||||||
@@ -761,6 +766,8 @@ static u32 convertContent(u8 *dst, u8 *src, u32 src_file_len)
|
|||||||
dstpos += sizeof(u32) * 3;
|
dstpos += sizeof(u32) * 3;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case CT_SKIP:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dstpos = ALIGN(dstpos, m_AlignConfigs[marker->type].after);
|
dstpos = ALIGN(dstpos, m_AlignConfigs[marker->type].after);
|
||||||
|
|||||||
Reference in new issue
Block a user