summaryrefslogtreecommitdiffstats
path: root/libraries/libdraco/gltf_decoder_cc.patch
blob: 8d0e52e78fbba8d08629f5f78b5059c014c6183c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- ./src/draco/io/gltf_decoder.cc
+++ ./src/draco/io/gltf_decoder.cc
@@ -438,6 +438,12 @@
   return WriteBufferToFile(contents.data(), contents.size(), filepath);
 }
 
+bool GetFileSizeInBytes(size_t *out, std::string * /*err*/,
+                     const std::string &filepath, void * /*user_data*/) {
+  *out = GetFileSize(filepath);
+  return true;
+}
+
 }  // namespace
 
 GltfDecoder::GltfDecoder()
@@ -497,6 +497,7 @@
       // TinyGLTF's ExpandFilePath does not do filesystem i/o, so it's safe to
       // use in all environments.
       &tinygltf::ExpandFilePath, &ReadWholeFile, &WriteWholeFile,
+      &GetFileSizeInBytes,
       reinterpret_cast<void *>(input_files)};
 
   loader.SetFsCallbacks(fs_callbacks);