From 57b27dada7e6968a6081207d9b466bf7e842039b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 9 Mar 2026 12:17:41 +0000 Subject: Specialise glTexture::savePosition Normalises the range of position information into the range 0-255 so the resulting image is remotely useful. --- gfx/models/tga.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gfx/models') diff --git a/gfx/models/tga.h b/gfx/models/tga.h index 3d072fb..955e5e1 100644 --- a/gfx/models/tga.h +++ b/gfx/models/tga.h @@ -3,14 +3,15 @@ #include #include -struct TGAHead { +template struct TGAHead { using XY = glm::vec<2, uint16_t>; + using PixelType = glm::vec; + uint8_t idLength {}, colorMapType {}, format {}; uint16_t __attribute__((packed)) colorMapFirst {}, colorMapLength {}; uint8_t colorMapEntrySize {}; XY origin {}, size {}; - uint8_t pixelDepth {}; + uint8_t pixelDepth {8 * Channels}; uint8_t descriptor {}; + PixelType data[1] {}; }; - -static_assert(sizeof(TGAHead) == 18); -- cgit v1.3