فهرست منبع

Search for .gltf extension at end of file name for buffer prefix.

Previously the code assumed that there would be only one '.' in the file
name, which is not a valid assumption. This patch fixes this issue, but
still assumes that the only occurrence of the string ".gltf" is at the
end of the file name. In particular, it will fail on a file name like
"/path/to/a.gltf/my_gltf.wrong_extension".
John Senneker 8 سال پیش
والد
کامیت
d6e8fd34f0
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      code/glTFExporter.cpp

+ 1 - 1
code/glTFExporter.cpp

@@ -511,7 +511,7 @@ void glTFExporter::ExportMeshes()
     // Variables needed for compression. END.
 
     std::string fname = std::string(mFilename);
-    std::string bufferIdPrefix = fname.substr(0, fname.find("."));
+    std::string bufferIdPrefix = fname.substr(0, fname.rfind(".gltf"));
     std::string bufferId = mAsset->FindUniqueID("", bufferIdPrefix.c_str());
 
     Ref<Buffer> b = mAsset->GetBodyBuffer();