loadmodel->Draw = R_DrawQ1Q2AliasModel;
loadmodel->DrawSky = NULL;
loadmodel->DrawShadow = NULL;
+
+ loadmodel->mdlmd2data_triangleneighbors = Mem_Alloc(loadmodel->mempool, loadmodel->numtris * sizeof(int[3]));
+ Mod_BuildTriangleNeighbors(loadmodel->mdlmd2data_triangleneighbors, loadmodel->mdlmd2data_indices, loadmodel->numtris);
}
static void Mod_MD2_ConvertVerts (vec3_t scale, vec3_t translate, trivertx_t *v, trivertx_t *out, int *vertremap)
loadmodel->yawmins[0] = loadmodel->yawmins[1] = -(loadmodel->yawmaxs[0] = loadmodel->yawmaxs[1] = modelyawradius);
loadmodel->yawmins[2] = loadmodel->normalmins[2];
loadmodel->yawmaxs[2] = loadmodel->normalmaxs[2];
+
+ loadmodel->mdlmd2data_triangleneighbors = Mem_Alloc(loadmodel->mempool, loadmodel->numtris * sizeof(int[3]));
+ Mod_BuildTriangleNeighbors(loadmodel->mdlmd2data_triangleneighbors, loadmodel->mdlmd2data_indices, loadmodel->numtris);
}
static void zymswapintblock(int *m, int size)
loadmodel->DrawSky = NULL;
loadmodel->DrawShadow = NULL;
}
-
return -1;
}
-int *Mod_BuildTriangleNeighbors(int *neighbors, int *elements, int numtriangles)
+void Mod_BuildTriangleNeighbors(int *neighbors, int *elements, int numtriangles)
{
int i, *e, *n;
for (i = 0, e = elements, n = neighbors;i < numtriangles;i++, e += 3, n += 3)
n[1] = Mod_FindTriangleWithEdge(elements, numtriangles, e[2], e[1]);
n[2] = Mod_FindTriangleWithEdge(elements, numtriangles, e[0], e[2]);
}
- return neighbors;
}
float *mdlmd2data_texcoords;
md2frame_t *mdlmd2data_frames;
trivertx_t *mdlmd2data_pose;
+ int *mdlmd2data_triangleneighbors;
// for Zymotic models
void *zymdata_header;
extern char loadname[32]; // for hunk tags
int Mod_FindTriangleWithEdge(int *elements, int numtriangles, int start, int end);
-int *Mod_BuildTriangleNeighbors(int *neighbors, int *elements, int numtriangles);
+void Mod_BuildTriangleNeighbors(int *neighbors, int *elements, int numtriangles);
#endif // __MODEL__