From: =?utf-8?q?Timo_R=C3=B6hling?= Date: Fri, 14 Jul 2023 20:16:33 +0200 Subject: Fix tinygltf::FsCallbacks --- src/draco/io/gltf_decoder.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/draco/io/gltf_decoder.cc b/src/draco/io/gltf_decoder.cc index ebfd3ec..0f4852f 100644 --- a/src/draco/io/gltf_decoder.cc +++ b/src/draco/io/gltf_decoder.cc @@ -438,6 +438,12 @@ bool WriteWholeFile(std::string * /*err*/, const std::string &filepath, 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 +503,7 @@ Status GltfDecoder::LoadFile(const std::string &file_name, // 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(input_files)}; loader.SetFsCallbacks(fs_callbacks);