From e29ba7c49abef0ed594623f29e54d8a142cd0987 Mon Sep 17 00:00:00 2001 From: Mio Nilsson Date: Tue, 11 May 2021 11:50:35 +0200 Subject: [PATCH 1/3] :bug: Store scene extras and exteions on the scene This was being stored in the wrong place --- tiny_gltf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 0aa9b76..2d3625f 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -5832,13 +5832,13 @@ bool TinyGLTF::LoadFromString(Model *model, std::string *err, std::string *warn, { json_const_iterator it; if (FindMember(o, "extensions", it)) { - model->extensions_json_string = JsonToString(GetValue(it)); + scene.extensions_json_string = JsonToString(GetValue(it)); } } { json_const_iterator it; if (FindMember(o, "extras", it)) { - model->extras_json_string = JsonToString(GetValue(it)); + scene.extras_json_string = JsonToString(GetValue(it)); } } } From 8a35b8f6fe5b8eaf002879fafea45fa6724808a0 Mon Sep 17 00:00:00 2001 From: zz Date: Fri, 14 May 2021 13:49:33 +0800 Subject: [PATCH 2/3] Fix comment on minFilter --- tiny_gltf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 2d3625f..1069c49 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -604,7 +604,7 @@ struct Sampler { // `magFilter`. Set -1 in TinyGLTF(issue #186) int minFilter = -1; // optional. -1 = no filter defined. ["NEAREST", "LINEAR", - // "NEAREST_MIPMAP_LINEAR", "LINEAR_MIPMAP_NEAREST", + // "NEAREST_MIPMAP_NEAREST", "LINEAR_MIPMAP_NEAREST", // "NEAREST_MIPMAP_LINEAR", "LINEAR_MIPMAP_LINEAR"] int magFilter = -1; // optional. -1 = no filter defined. ["NEAREST", "LINEAR"] From 425195bf9ce6eb7a023d17947e5cd21cc8fbc935 Mon Sep 17 00:00:00 2001 From: Idriss Chaouch <62848804+CppProgrammer23@users.noreply.github.com> Date: Thu, 20 May 2021 12:11:00 +0100 Subject: [PATCH 3/3] update enum Type the first element in an enum is 0, so it's not necessarily to affect values from 0 to 7. --- tiny_gltf.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 1069c49..c5fa225 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -191,14 +191,14 @@ AAssetManager *asset_manager = nullptr; #endif typedef enum { - NULL_TYPE = 0, - REAL_TYPE = 1, - INT_TYPE = 2, - BOOL_TYPE = 3, - STRING_TYPE = 4, - ARRAY_TYPE = 5, - BINARY_TYPE = 6, - OBJECT_TYPE = 7 + NULL_TYPE, + REAL_TYPE, + INT_TYPE, + BOOL_TYPE, + STRING_TYPE, + ARRAY_TYPE, + BINARY_TYPE, + OBJECT_TYPE } Type; static inline int32_t GetComponentSizeInBytes(uint32_t componentType) {