From cf50fdefc93a06662f1e335273ea244f61571d6a Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 13 Jan 2023 21:24:58 +0100 Subject: [PATCH 1/2] - Added godot-cpp submodule --- .gitmodules | 3 +++ godot-cpp | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 godot-cpp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..29bd727 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "godot-cpp"] + path = godot-cpp + url = https://github.com/godotengine/godot-cpp.git diff --git a/godot-cpp b/godot-cpp new file mode 160000 index 0000000..151ea35 --- /dev/null +++ b/godot-cpp @@ -0,0 +1 @@ +Subproject commit 151ea35c5fbb0254e0d3d29e230270b60852915f From 6c869b884ee1491f5d62375ff7c9a460048dbaba Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 16 Jan 2023 19:55:54 +0100 Subject: [PATCH 2/2] - Alignment fix --- CHANGELOG.MD | 3 +++ gdnative/lib/src/Exporters/glTF/GLTFExporter.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index c1eada2..117960f 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,3 +1,6 @@ +# Version 0.0.6-Alpha (16.01.2023) +- Bugfix: GLB format alignment was wrong. Thanks to 2indy for report. + # Version 0.0.5-Alpha (20.12.2021) - Added QBCL importer - Added QB importer diff --git a/gdnative/lib/src/Exporters/glTF/GLTFExporter.cpp b/gdnative/lib/src/Exporters/glTF/GLTFExporter.cpp index 8cc413d..5ddaa9d 100644 --- a/gdnative/lib/src/Exporters/glTF/GLTFExporter.cpp +++ b/gdnative/lib/src/Exporters/glTF/GLTFExporter.cpp @@ -191,7 +191,7 @@ namespace VoxelOptimizer emission = textures[TextureType::EMISSION]->AsPNG(); size_t Size = Binary.size(); - int Padding = (Binary.size() + diffuse.size() + emission.size()) % 4; + int Padding = 4 - ((Binary.size() + diffuse.size() + emission.size()) % 4); Binary.resize(Binary.size() + diffuse.size() + emission.size() + Padding, '\0'); memcpy(Binary.data() + Size, diffuse.data(), diffuse.size()); @@ -262,7 +262,7 @@ namespace VoxelOptimizer // Padding for the binary format if(m_Settings->Binary) { - int Padding = JS.size() % 4; + int Padding = 4 - (JS.size() % 4); for (int i = 0; i < Padding; i++) JS += ' '; }