summaryrefslogtreecommitdiff
path: root/gfx/models
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/models')
-rw-r--r--gfx/models/tga.h9
1 files changed, 5 insertions, 4 deletions
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 <cstdint>
#include <glm/vec2.hpp>
-struct TGAHead {
+template<glm::length_t Channels> struct TGAHead {
using XY = glm::vec<2, uint16_t>;
+ using PixelType = glm::vec<Channels, uint8_t>;
+
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);