void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** normals,
int numSTs, picoVec2_t **st, int numColors, picoColor_t **colors,
- picoShader_t* shader, picoIndex_t* smoothingGroup )
+ picoShader_t* shader, const char *name, picoIndex_t* smoothingGroup )
{
int i,j;
int vertDataIndex;
for ( i = 0 ; i < model->numSurfaces ; i++ )
{
workSurface = model->surface[i];
+ if ( !name || !strcmp(workSurface->name, name) )
if ( workSurface->shader == shader )
{
break;
/* do surface setup */
PicoSetSurfaceType( workSurface, PICO_TRIANGLES );
- PicoSetSurfaceName( workSurface, shader->name );
+ PicoSetSurfaceName( workSurface, name ? name : shader->name );
PicoSetSurfaceShader( workSurface, shader );
}
#endif
-static void _ase_submit_triangles( picoModel_t* model , aseMaterial_t* materials , aseVertex_t* vertices, aseTexCoord_t* texcoords, aseColor_t* colors, aseFace_t* faces, int numFaces )
+static void _ase_submit_triangles( picoModel_t* model , aseMaterial_t* materials , aseVertex_t* vertices, aseTexCoord_t* texcoords, aseColor_t* colors, aseFace_t* faces, int numFaces, const char *name )
{
aseFacesIter_t i = faces, end = faces + numFaces;
for(; i != end; ++i)
}
/* submit the triangle to the model */
- PicoAddTriangleToModel ( model , xyz , normal , 1 , st , 1 , color , subMtl->shader, smooth );
+ PicoAddTriangleToModel ( model , xyz , normal , 1 , st , 1 , color , subMtl->shader, name, smooth );
}
}
}
else if (!_pico_stricmp(p->token,"*mesh"))
{
/* finish existing surface */
- _ase_submit_triangles(model, materials, vertices, texcoords, colors, faces, numFaces);
+ _ase_submit_triangles(model, materials, vertices, texcoords, colors, faces, numFaces, lastNodeName);
_pico_free(faces);
_pico_free(vertices);
_pico_free(texcoords);
}
/* ydnar: finish existing surface */
- _ase_submit_triangles(model, materials, vertices, texcoords, colors, faces, numFaces);
+ _ase_submit_triangles(model, materials, vertices, texcoords, colors, faces, numFaces, lastNodeName);
_pico_free(faces);
_pico_free(vertices);
_pico_free(texcoords);