]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - contrib/brushexport/export.cpp
argh :P 20 was intentional
[xonotic/netradiant.git] / contrib / brushexport / export.cpp
index 6b680c9ed472ca1488a4096247cb9b05f4d435df..0407432e35d6c4b56589b07d9c1b72b64ac3dc4a 100644 (file)
@@ -11,6 +11,9 @@
 // this is very evil, but right now there is no better way
 #include "../../radiant/brush.h"
 
+// for limNames
+#define MAX_MATERIAL_NAME 20
+
 /*
        Abstract baseclass for modelexporters
        the class collects all the data which then gets
@@ -149,7 +152,7 @@ void ExportData::GetShaderNameFromShaderPath(const char* path, std::string& name
                name = tmp.substr(last_slash + 1, tmp.length() - last_slash);
 
 #ifdef _DEBUG
-       globalOutputStream() << "Last: " << last_slash << " " << "length: " << (const unsigned int)tmp.length() << "Name: " << name.c_str() << "\n";
+       globalOutputStream() << "Last: " << (const unsigned int) last_slash << " " << "length: " << (const unsigned int)tmp.length() << "Name: " << name.c_str() << "\n";
 #endif
 }
 
@@ -279,9 +282,9 @@ bool ExportDataAsWavefront::WriteToFile(const std::string& path, collapsemode mo
 
                                if(mat != lastMat)
                                {
-                                       if(limNames && mat.size() > 20)
+                                       if(limNames && mat.size() > MAX_MATERIAL_NAME)
                                        {
-                                               out << "\nusemtl " << mat.substr(mat.size() - 20, mat.size()).c_str();
+                                               out << "\nusemtl " << mat.substr(mat.size() - MAX_MATERIAL_NAME, mat.size()).c_str();
                                        } else {
                                                out << "\nusemtl " << mat.c_str();
                                        }
@@ -308,9 +311,9 @@ bool ExportDataAsWavefront::WriteToFile(const std::string& path, collapsemode mo
                outMtl << "# Material Count: " << (const Unsigned)materials.size() << "\n\n";
                for(std::set<std::string>::const_iterator it(materials.begin()); it != materials.end(); ++it)
                {
-                       if(limNames && it->size() > 20)
+                       if(limNames && it->size() > MAX_MATERIAL_NAME)
                        {
-                               outMtl << "newmtl " << it->substr(it->size() - 20, it->size()).c_str() << "\n";
+                               outMtl << "newmtl " << it->substr(it->size() - MAX_MATERIAL_NAME, it->size()).c_str() << "\n";
                        } else {
                                outMtl << "newmtl " << it->c_str() << "\n";
                        }