mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-12 14:56:53 +02:00
Library for compressing and decompressing 3D geometric meshes and point clouds https://google.github.io/draco/
33 lines
1.1 KiB
Diff
33 lines
1.1 KiB
Diff
From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
|
|
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<void *>(input_files)};
|
|
|
|
loader.SetFsCallbacks(fs_callbacks);
|