Browse Source

Added missing cmd writting.

Marc-Antoine Lortie 5 years ago
parent
commit
5f30d4c0f8

+ 7 - 1
code/Assbin/AssbinExporter.cpp

@@ -55,7 +55,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 namespace Assimp {
 namespace Assimp {
 
 
 void ExportSceneAssbin(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/) {
 void ExportSceneAssbin(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/) {
-    DumpSceneToAssbin(pFile, pIOSystem, pScene, false, false);
+    DumpSceneToAssbin(
+        pFile,
+        "\0", // no command(s).
+        pIOSystem,
+        pScene,
+        false, // shortened?
+        false); // compressed?
 }
 }
 } // end of namespace Assimp
 } // end of namespace Assimp
 
 

+ 3 - 4
code/Assbin/AssbinFileWriter.cpp

@@ -754,7 +754,7 @@ public:
 
 
     // -----------------------------------------------------------------------------------
     // -----------------------------------------------------------------------------------
     // Write a binary model dump
     // Write a binary model dump
-    void WriteBinaryDump(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene)
+    void WriteBinaryDump(const char* pFile, const char* cmd, IOSystem* pIOSystem, const aiScene* pScene)
     {
     {
         IOStream * out = pIOSystem->Open( pFile, "wb" );
         IOStream * out = pIOSystem->Open( pFile, "wb" );
         if (!out)
         if (!out)
@@ -799,7 +799,6 @@ public:
             strncpy(buff, pFile, 256);
             strncpy(buff, pFile, 256);
             out->Write(buff, sizeof(char), 256);
             out->Write(buff, sizeof(char), 256);
 
 
-            char cmd[] = "\0";
             strncpy(buff, cmd, 128);
             strncpy(buff, cmd, 128);
             out->Write(buff, sizeof(char), 128);
             out->Write(buff, sizeof(char), 128);
 
 
@@ -849,10 +848,10 @@ public:
 };
 };
 
 
 void DumpSceneToAssbin(
 void DumpSceneToAssbin(
-    const char* pFile, IOSystem* pIOSystem,
+    const char* pFile, const char* cmd, IOSystem* pIOSystem,
     const aiScene* pScene, bool shortened, bool compressed) {
     const aiScene* pScene, bool shortened, bool compressed) {
     AssbinFileWriter fileWriter(shortened, compressed);
     AssbinFileWriter fileWriter(shortened, compressed);
-    fileWriter.WriteBinaryDump(pFile, pIOSystem, pScene);
+    fileWriter.WriteBinaryDump(pFile, cmd, pIOSystem, pScene);
 }
 }
 
 
 } // end of namespace Assimp
 } // end of namespace Assimp

+ 1 - 0
code/Assbin/AssbinFileWriter.h

@@ -55,6 +55,7 @@ namespace Assimp {
 
 
 void ASSIMP_API DumpSceneToAssbin(
 void ASSIMP_API DumpSceneToAssbin(
     const char* pFile,
     const char* pFile,
+    const char* cmd,
     IOSystem* pIOSystem,
     IOSystem* pIOSystem,
     const aiScene* pScene,
     const aiScene* pScene,
     bool shortened,
     bool shortened,

+ 1 - 1
tools/assimp_cmd/WriteDumb.cpp

@@ -746,7 +746,7 @@ int Assimp_Dump (const char* const* params, unsigned int num)
 	if (binary) {
 	if (binary) {
 		try {
 		try {
 			std::unique_ptr<IOSystem> pIOSystem(new DefaultIOSystem());
 			std::unique_ptr<IOSystem> pIOSystem(new DefaultIOSystem());
-			DumpSceneToAssbin(out.c_str(), pIOSystem.get(),
+			DumpSceneToAssbin(out.c_str(), cmd.c_str(), pIOSystem.get(),
 				scene, shortened, compressed);
 				scene, shortened, compressed);
 		}
 		}
 		catch (const std::exception& e) {
 		catch (const std::exception& e) {