]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
filter non-shader texture paths at the same place
authorThomas Debesse <dev@illwieckz.net>
Sat, 5 May 2018 01:23:14 +0000 (03:23 +0200)
committerThomas Debesse <dev@illwieckz.net>
Sat, 5 May 2018 23:07:01 +0000 (01:07 +0200)
also filter more known suffixes

libs/shaderlib.h
radiant/texwindow.cpp

index 1d9f5e0a7983216b7660f698ae2e28980b829701..ee972437befeb934fbfb06c11862af6873d6329b 100644 (file)
@@ -50,25 +50,6 @@ bool operator()( const CopiedString& shader, const CopiedString& other ) const {
 }
 };
 
-static inline bool shader_is_diffuse( const char *shader ){
-       return
-               /* Quetoo */
-               !string_equal_suffix( shader, "_h" )
-               && !string_equal_suffix( shader, "_local" )
-               && !string_equal_suffix( shader, "_nm" )
-               && !string_equal_suffix( shader, "_s" )
-               /* DarkPlaces */
-               && !string_equal_suffix( shader, "_bump" )
-               && !string_equal_suffix( shader, "_glow" )
-               && !string_equal_suffix( shader, "_gloss" )
-               && !string_equal_suffix( shader, "_luma" )
-               && !string_equal_suffix( shader, "_norm" )
-               && !string_equal_suffix( shader, "_pants" )
-               && !string_equal_suffix( shader, "_shirt" )
-               && !string_equal_suffix( shader, "_reflect" )
-               ;
-}
-
 inline bool shader_valid( const char* shader ){
        return string_is_ascii( shader )
                   && strchr( shader, ' ' ) == 0
@@ -76,8 +57,7 @@ inline bool shader_valid( const char* shader ){
                   && strchr( shader, '\r' ) == 0
                   && strchr( shader, '\t' ) == 0
                   && strchr( shader, '\v' ) == 0
-                  && strchr( shader, '\\' ) == 0
-                  && shader_is_diffuse( shader );
+                  && strchr( shader, '\\' ) == 0;
 }
 
 inline const char* GlobalTexturePrefix_get(){
index e6afb71df3fd16eeae61d3b577ae76d33b6060c7..d088c0da665c5dcea9eafbef0b3fda48547a490f 100644 (file)
@@ -775,14 +775,27 @@ bool texture_name_ignore(const char *name)
             endswith(strTemp.c_str(), ".diffuse") ||
             endswith(strTemp.c_str(), ".blend") ||
             endswith(strTemp.c_str(), ".alpha") ||
-            endswith(strTemp.c_str(), "_norm") ||
+            endswith(strTemp.c_str(), "_alpha") ||
+            /* Quetoo */
+            endswith(strTemp.c_str(), "_h") ||
+            endswith(strTemp.c_str(), "_local") ||
+            endswith(strTemp.c_str(), "_nm") ||
+            endswith(strTemp.c_str(), "_s") ||
+            /* DarkPlaces */
             endswith(strTemp.c_str(), "_bump") ||
             endswith(strTemp.c_str(), "_glow") ||
             endswith(strTemp.c_str(), "_gloss") ||
+            endswith(strTemp.c_str(), "_luma") ||
+            endswith(strTemp.c_str(), "_norm") ||
             endswith(strTemp.c_str(), "_pants") ||
             endswith(strTemp.c_str(), "_shirt") ||
             endswith(strTemp.c_str(), "_reflect") ||
-            endswith(strTemp.c_str(), "_alpha") ||
+            /* Unvanquished */
+            endswith(strTemp.c_str(), "_d") ||
+            endswith(strTemp.c_str(), "_n") ||
+            endswith(strTemp.c_str(), "_p") ||
+            endswith(strTemp.c_str(), "_g") ||
+            endswith(strTemp.c_str(), "_a") ||
             0;
 }