Browse Source

Removed #ifdef USE_FBX from the encoder

Darryl Gough 12 years ago
parent
commit
c06d288c74

+ 22 - 22
tools/encoder/src/FBXSceneEncoder.cpp

@@ -1,5 +1,3 @@
-#ifdef USE_FBX
-
 #include <algorithm>
 #include <string>
 #include <sstream>
@@ -14,6 +12,9 @@ using std::vector;
 using std::map;
 using std::ostringstream;
 
+// Fix bad material names
+static void fixMaterialName(string& name);
+
 FBXSceneEncoder::FBXSceneEncoder()
     : _groupAnimation(NULL), _autoGroupAnimations(false)
 {
@@ -913,25 +914,6 @@ void FBXSceneEncoder::loadMaterials(FbxScene* fbxScene)
     }
 }
 
-// Fix bad material names
-void fixMaterialName(string& name)
-{
-    static int unnamedCount = 0;
-
-    for (string::size_type i = 0, len = name.length(); i < len; ++i)
-    {
-        if (!isalnum(name[i]))
-            name[i] = '_';
-    }
-
-    if (name.length() == 0)
-    {
-        ostringstream stream;
-        stream << "unnamed_" << (++unnamedCount);
-        name = stream.str();
-    }
-}
-
 void FBXSceneEncoder::loadMaterial(FbxNode* fbxNode)
 {
     Node* node = findNode(fbxNode);
@@ -1381,4 +1363,22 @@ void FBXSceneEncoder::triangulateRecursive(FbxNode* fbxNode)
     }
 }
 
-#endif
+// Functions
+
+void fixMaterialName(string& name)
+{
+    static int unnamedCount = 0;
+
+    for (string::size_type i = 0, len = name.length(); i < len; ++i)
+    {
+        if (!isalnum(name[i]))
+            name[i] = '_';
+    }
+
+    if (name.length() == 0)
+    {
+        ostringstream stream;
+        stream << "unnamed_" << (++unnamedCount);
+        name = stream.str();
+    }
+}

+ 0 - 3
tools/encoder/src/FBXSceneEncoder.h

@@ -1,8 +1,6 @@
 #ifndef FBXSCENEEENCODER_H_
 #define FBXSCENEEENCODER_H_
 
-#ifdef USE_FBX
-
 #define FBXSDK_NEW_API
 
 #include <iostream>
@@ -295,4 +293,3 @@ private:
 };
 
 #endif
-#endif

+ 0 - 4
tools/encoder/src/FBXUtil.cpp

@@ -1,5 +1,3 @@
-#ifdef USE_FBX
-
 #include <algorithm>
 #include <string>
 #include <sstream>
@@ -805,5 +803,3 @@ std::string toString(double value)
     stream << value;
     return stream.str();
 }
-
-#endif

+ 0 - 3
tools/encoder/src/FBXUtil.h

@@ -1,8 +1,6 @@
 #ifndef FBXUTIL_H_
 #define FBXUTIL_H_
 
-#ifdef USE_FBX
-
 #define FBXSDK_NEW_API
 
 #include <iostream>
@@ -203,4 +201,3 @@ std::string toString(const FbxDouble3& fbxDouble, double d);
 std::string toString(double value);
 
 #endif
-#endif

+ 0 - 5
tools/encoder/src/main.cpp

@@ -72,15 +72,10 @@ int main(int argc, const char** argv)
         }
     case EncoderArguments::FILEFORMAT_FBX:
         {
-#ifdef USE_FBX
             std::string realpath(arguments.getFilePath());
             FBXSceneEncoder fbxEncoder;
             fbxEncoder.write(realpath, arguments);
             break;
-#else
-            LOG(1, "Error: FBX not enabled. Install the FBX SDK and use the preprocessor definition USE_FBX.\n");
-            return -1;
-#endif
         }
     case EncoderArguments::FILEFORMAT_TTF:
         {