vk: put barney back together

Fixes computing total vertices/indices count. Were referencing the same `pmesh` for all meshes.

Floating and missing heads issue seems to be due to incorrect fixed animation frames. I.e. animation frames contain offsets to the correct positions. Should be fixed when animations are done.
This commit is contained in:
Ivan 'provod' Avdeev 2023-06-03 12:10:56 -07:00
parent df102994c4
commit a2b0164e03
1 changed files with 4 additions and 1 deletions

View File

@ -2171,7 +2171,7 @@ static const r_studio_model_cache_entry_t *buildCachedStudioSubModel( const mstu
int vertex_count = 0, index_count = 0;
for( int i = 0; i < submodel->nummesh; i++ ) {
const short* const ptricmds = (short *)((byte *)m_pStudioHeader + pmesh->triindex);
const short* const ptricmds = (short *)((byte *)m_pStudioHeader + pmesh[i].triindex);
addVerticesIndicesCounts(ptricmds, &vertex_count, &index_count);
}
@ -2383,6 +2383,9 @@ static const r_studio_model_cache_entry_t *buildCachedStudioSubModel( const mstu
.out_indices_count = &indices_offset,
});
ASSERT(vertices_offset <= vertex_count);
ASSERT(indices_offset <= index_count);
/* FIXME VK
if( FBitSet( g_nFaceFlags, STUDIO_NF_MASKED ))
{