]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/texwindow.cpp
make dependencies check work even with -j make invocation
[xonotic/netradiant.git] / radiant / texwindow.cpp
index efbbaca875afe974509ca38c3aa2fdd240cfc81f..95d490ab0725770460aa4139431a177d6bc27359 100644 (file)
@@ -370,7 +370,7 @@ const char* TextureBrowser_getComonShadersDir()
 
 inline int TextureBrowser_fontHeight(TextureBrowser& textureBrowser)
 {
-  return GlobalOpenGL().m_fontHeight;
+  return GlobalOpenGL().m_font->getPixelHeight();
 }
 
 const char* TextureBrowser_GetSelectedShader(TextureBrowser& textureBrowser)
@@ -685,17 +685,37 @@ NOTE: for texture window layout:
   ( the GL textures are not flushed though)
 ==============
 */
+
+bool endswith(const char *haystack, const char *needle)
+{
+       size_t lh = strlen(haystack);
+       size_t ln = strlen(needle);
+       if(lh < ln)
+               return false;
+       return !memcmp(haystack + (lh - ln), needle, ln);
+}
+
 bool texture_name_ignore(const char* name)
 {
   StringOutputStream strTemp(string_length(name));
   strTemp << LowerCase(name);
 
-  return strstr(strTemp.c_str(), ".specular") != 0 ||
-    strstr(strTemp.c_str(), ".glow") != 0 ||
-    strstr(strTemp.c_str(), ".bump") != 0 ||
-    strstr(strTemp.c_str(), ".diffuse") != 0 ||
-    strstr(strTemp.c_str(), ".blend") != 0 ||
-         strstr(strTemp.c_str(), ".alpha") != 0;
+  return
+         endswith(strTemp.c_str(), ".specular") ||
+         endswith(strTemp.c_str(), ".glow") ||
+         endswith(strTemp.c_str(), ".bump") ||
+         endswith(strTemp.c_str(), ".diffuse") ||
+         endswith(strTemp.c_str(), ".blend") ||
+         endswith(strTemp.c_str(), ".alpha") ||
+         endswith(strTemp.c_str(), "_norm") ||
+         endswith(strTemp.c_str(), "_bump") ||
+         endswith(strTemp.c_str(), "_glow") ||
+         endswith(strTemp.c_str(), "_gloss") ||
+         endswith(strTemp.c_str(), "_pants") ||
+         endswith(strTemp.c_str(), "_shirt") ||
+         endswith(strTemp.c_str(), "_reflect") ||
+         endswith(strTemp.c_str(), "_alpha") ||
+         0;
 }
 
 class LoadShaderVisitor : public Archive::Visitor