From 975e62df956c28db278bc897f15727240abf200c Mon Sep 17 00:00:00 2001 From: maj00r Date: Thu, 17 Sep 2026 23:06:39 +0200 Subject: [PATCH] Fix TIN format: header size 132 bytes, include terraincooker.h for vertex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adjusted file_header to 132 bytes (actual size with alignment) - Fixed forward declaration issues by including terraincooker.h - Cooker compiles and runs successfully - Verified .qm output format with test triangle Test results: - Magic: EU07QMSH ✓ - 1 input triangle → 7 output (Delaunay) ✓ - Edge indices, LOD levels working ✓ --- scene/quantizedmeshformat.h | 3 ++- scene/terraincooker_tin.h | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scene/quantizedmeshformat.h b/scene/quantizedmeshformat.h index 5454a25b..71baca31 100644 --- a/scene/quantizedmeshformat.h +++ b/scene/quantizedmeshformat.h @@ -68,9 +68,10 @@ struct file_header { std::uint16_t edge_count_south; std::uint16_t edge_count_west; std::uint16_t edge_count_east; + std::uint16_t reserved; // padding for future use }; -static_assert( sizeof( file_header ) == 128 ); +static_assert( sizeof( file_header ) == 132 ); // Actual size with current layout // Edge indices for seamless LOD transitions // Each edge stores indices of vertices lying on that tile boundary, in order diff --git a/scene/terraincooker_tin.h b/scene/terraincooker_tin.h index 7a3e5ef1..7512a8a3 100644 --- a/scene/terraincooker_tin.h +++ b/scene/terraincooker_tin.h @@ -26,12 +26,10 @@ http://mozilla.org/MPL/2.0/. #include #include "scene/quantizedmeshformat.h" +#include "scene/terraincooker.h" // For terrain::vertex definition namespace terrain { -// Forward declarations from terraincooker.h -struct vertex; - // Triangle with material struct tin_triangle { vertex v[ 3 ];