]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - misc/source/netradiant-src/libs/picomodel/picomodel.c
Latest fteqcc and netradiant sources
[voretournament/voretournament.git] / misc / source / netradiant-src / libs / picomodel / picomodel.c
index aed467cacd49edbe0005ff2852dbb8a3d8bf6a26..86ec08bde5d001fb2e43caa8e57b3f605b3760ea 100644 (file)
@@ -912,7 +912,7 @@ void PicoSetSurfaceType( picoSurface_t *surface, picoSurfaceType_t type )
 
 
 
-void PicoSetSurfaceName( picoSurface_t *surface, char *name )
+void PicoSetSurfaceName( picoSurface_t *surface, const char *name )
 {
        if( surface == NULL || name == NULL )
                return;
@@ -2214,7 +2214,7 @@ Chooses an appropriate surface based on the shader, or adds a new surface if nec
 
 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;
@@ -2224,6 +2224,7 @@ void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t**
        for ( i = 0 ; i < model->numSurfaces ; i++ )
        {
                workSurface = model->surface[i];
+               if ( !name || !strcmp(workSurface->name, name) )
                if ( workSurface->shader == shader )
                {                       
                        break;
@@ -2243,7 +2244,7 @@ void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t**
 
                /* do surface setup */
                PicoSetSurfaceType( workSurface, PICO_TRIANGLES );
-               PicoSetSurfaceName( workSurface, shader->name );
+               PicoSetSurfaceName( workSurface, name ? name : shader->name );
                PicoSetSurfaceShader( workSurface, shader );
        }