Browse Source

Copy constructor ExportProperties
Fix name dummy node in PreTransformVertices

Madrich 10 years ago
parent
commit
56da80bc6e

+ 9 - 10
code/Exporter.cpp

@@ -492,18 +492,17 @@ void Exporter :: UnregisterExporter(const char* id)
 	}
 }
 
-ExportProperties :: ExportProperties()
-{
-
-}
+ExportProperties :: ExportProperties() {}
 
-ExportProperties :: ExportProperties(const ExportProperties* source)
+ExportProperties::ExportProperties(const ExportProperties &other)
 {
-	if (!source) return;
-	mIntProperties = IntPropertyMap(source->mIntProperties);
-	mFloatProperties = FloatPropertyMap(source->mFloatProperties);
-	mStringProperties = StringPropertyMap(source->mStringProperties);
-	mMatrixProperties = MatrixPropertyMap(source->mMatrixProperties);
+	new(this) ExportProperties();
+	
+	mIntProperties    = other.mIntProperties;
+	mFloatProperties  = other.mFloatProperties;
+	mStringProperties = other.mStringProperties;
+	mMatrixProperties = other.mMatrixProperties;
+	
 }
 
 

+ 1 - 1
code/PretransformVertices.cpp

@@ -625,7 +625,7 @@ void PretransformVertices::Execute( aiScene* pScene)
 		// flat node graph with a root node and some level 1 children
 		delete pScene->mRootNode;
 		pScene->mRootNode = new aiNode();
-		pScene->mRootNode->mName.Set("<dummy_root>");
+		pScene->mRootNode->mName.Set("dummy_root");
 
 		if (1 == pScene->mNumMeshes && !pScene->mNumLights && !pScene->mNumCameras)
 		{

+ 1 - 2
code/XFileExporter.cpp

@@ -79,11 +79,10 @@ void ExportSceneXFile(const char* pFile,IOSystem* pIOSystem, const aiScene* pSce
 	}
 
 	// create/copy Properties
-	ExportProperties props(pProperties);
+	ExportProperties props(*pProperties);
 
 	// set standard properties if not set
 	if (!props.HasPropertyBool(AI_CONFIG_EXPORT_XFILE_64BIT)) props.SetPropertyBool(AI_CONFIG_EXPORT_XFILE_64BIT, false);
-	if (!props.HasPropertyBool(AI_CONFIG_EXPORT_XFILE_BAKETRANSFORM)) props.SetPropertyBool(AI_CONFIG_EXPORT_XFILE_BAKETRANSFORM, false);
 
 	// invoke the exporter 
 	XFileExporter iDoTheExportThing( pScene, pIOSystem, path, file, &props);

+ 7 - 5
include/assimp/Exporter.hpp

@@ -334,11 +334,13 @@ public:
 
 	ExportProperties();
 
-	/** Copy constructor
-	* @see ExportProperties(const ExportProperties* source)
-	*/
-	ExportProperties(const ExportProperties* source);
-
+	// -------------------------------------------------------------------
+	/** Copy constructor.
+	 * 
+	 * This copies the configuration properties of another ExportProperties.
+	 * @see ExportProperties(const ExportProperties& other)
+	 */
+	ExportProperties(const ExportProperties& other);
 
 	// -------------------------------------------------------------------
 	/** Set an integer configuration property.

+ 0 - 6
include/assimp/config.h

@@ -889,11 +889,5 @@ enum aiComponent
 
 #define AI_CONFIG_EXPORT_XFILE_64BIT "EXPORT_XFILE_64BIT"
 
-/** @brief Specifies the xfile applies all transformations to the coordinates, normals
- * so all motions are identities
- * Property type: Bool. Default value: false.
- */
-
-#define AI_CONFIG_EXPORT_XFILE_BAKETRANSFORM "EXPORT_XFILE_BAKETRANSFORM"
 
 #endif // !! AI_CONFIG_H_INC