]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/picomodel/pm_ase.c
* picomodel: do some guessings about shader paths to handle more cases out of the...
[xonotic/netradiant.git] / libs / picomodel / pm_ase.c
index 21c8e0801a78f8b742e9854fbb292233dce6e0db..1244eb353d4417569ceac257f0680e4c94130d47 100644 (file)
@@ -456,17 +456,6 @@ static void _ase_submit_triangles( picoModel_t* model, aseMaterial_t* materials,
        }
 }
 
-static void shadername_convert( char* shaderName ){
-       /* unix-style path separators */
-       char* s = shaderName;
-       for (; *s != '\0'; ++s )
-       {
-               if ( *s == '\\' ) {
-                       *s = '/';
-               }
-       }
-}
-
 
 /* _ase_load:
  *  loads a 3dsmax ase model file.
@@ -883,7 +872,7 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ){
                                if ( level == subMaterialLevel ) {
                                        /* set material name */
                                        _pico_first_token( materialName );
-                                       shadername_convert( materialName );
+                                       _pico_unixify( materialName );
                                        PicoSetShaderName( shader, materialName );
 
                                        /* set shader's transparency */
@@ -1073,7 +1062,7 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ){
                                }
 
                                /* set material name */
-                               shadername_convert( materialName );
+                               _pico_unixify( materialName );
                                PicoSetShaderName( shader,materialName );
 
                                /* set shader's transparency */
@@ -1097,34 +1086,6 @@ static picoModel_t *_ase_load( PM_PARAMS_LOAD ){
                                /* set material map name */
                                PicoSetShaderMapName( shader, mapname );
 
-                               /* extract shadername from bitmap path */
-                               if ( mapname != NULL ) {
-                                       char* p = mapname;
-
-                                       /* convert to shader-name format */
-                                       shadername_convert( mapname );
-                                       {
-                                               /* remove extension */
-                                               char* last_period = strrchr( p, '.' );
-                                               if ( last_period != NULL ) {
-                                                       *last_period = '\0';
-                                               }
-                                       }
-
-                                       /* find shader path */
-                                       for (; *p != '\0'; ++p )
-                                       {
-                                               if ( _pico_strnicmp( p, "models/", 7 ) == 0 || _pico_strnicmp( p, "textures/", 9 ) == 0 ) {
-                                                       break;
-                                               }
-                                       }
-
-                                       if ( *p != '\0' ) {
-                                               /* set material name */
-                                               PicoSetShaderName( shader,p );
-                                       }
-                               }
-
                                /* this is just a material with 1 submaterial */
                                subMaterial = _ase_add_submaterial( &materials, index, 0, shader );
                        }