set normals/sts as present in md2/dff

This commit is contained in:
h4570
2021-02-06 18:21:11 +01:00
parent bc41afdf89
commit a973c47321
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -244,6 +244,8 @@ void DffLoader::readGeometryExtension(MeshFrame *o_frame, char **materialNames,
{
u32 facesCount = readDwordFromArrayLE(t_buffer, t_ptrPos);
u32 materialIndex = readDwordFromArrayLE(t_buffer, t_ptrPos);
o_frame->getMaterial(i).setSTsPresent(true);
o_frame->getMaterial(i).setNormalsPresent(true);
o_frame->getMaterial(i).allocateFaces(facesCount);
o_frame->getMaterial(i).setName(materialNames[materialIndex]);
for (u32 j = 0; j < facesCount; j++)
+2
View File
@@ -138,6 +138,8 @@ MeshFrame *MD2Loader::load(u32 &o_framesCount, char *t_subpath, char *t_nameWith
{
for (u32 x = 0; x < framesCount; x++)
{
resultFrames[x].getMaterial(0).setSTsPresent(true);
resultFrames[x].getMaterial(0).setNormalsPresent(true);
resultFrames[x].getMaterial(0).setVertexFace((i * 3) + j, triangle->index_xyz[j]);
resultFrames[x].getMaterial(0).setSTFace((i * 3) + j, triangle->index_st[j]);
resultFrames[x].getMaterial(0).setNormalFace((i * 3) + j, triangle->index_xyz[j]);