ソースを参照

Update texture output format in AssxmlFileWriter (#6372)

* Update texture output format in AssxmlFileWriter
Kim Kulling 3 ヶ月 前
コミット
cc6ab1408f
1 ファイル変更5 行追加1 行削除
  1. 5 1
      code/AssetLib/Assxml/AssxmlFileWriter.cpp

+ 5 - 1
code/AssetLib/Assxml/AssxmlFileWriter.cpp

@@ -301,7 +301,11 @@ static void WriteDump(const char *pFile, const char *cmd, const aiScene *scene,
             bool compressed = (tex->mHeight == 0);
 
             // mesh header
-            ioprintf(io, "\t<Texture width=\"%u\" height=\"%u\" compressed=\"%s\"> \n",
+            std::string texName = "unknown";
+            if (tex->mFilename.length != 0u) {
+                texName = tex->mFilename.data;
+            }
+            ioprintf(io, "\t<Texture name=\"%s\" width=\"%u\" height=\"%u\" compressed=\"%s\"> \n", texName.c_str(),
                     (compressed ? -1 : tex->mWidth), (compressed ? -1 : tex->mHeight),
                     (compressed ? "true" : "false"));