diff --git a/inc/hgl/util/imgfmt/tga.h b/inc/hgl/util/imgfmt/tga.h index a716420..426a832 100644 --- a/inc/hgl/util/imgfmt/tga.h +++ b/inc/hgl/util/imgfmt/tga.h @@ -6,6 +6,13 @@ namespace hgl { namespace util { + constexpr const uint TGA_IMAGE_TYPE_COLOR_MAP =1; + constexpr const uint TGA_IMAGE_TYPE_TRUE_COLOR =2; + constexpr const uint TGA_IMAGE_TYPE_GRAYSCALE =3; + + constexpr const uint TGA_DIRECTION_LOWER_LEFT =0; + constexpr const uint TGA_DIRECTION_UPPER_LEFT =1; + #pragma pack(push,1) struct TGAHeader { diff --git a/src/imgfmt/tga.cpp b/src/imgfmt/tga.cpp index 60bdf73..9834ef7 100644 --- a/src/imgfmt/tga.cpp +++ b/src/imgfmt/tga.cpp @@ -15,6 +15,9 @@ namespace hgl memset(header,0,sizeof(TGAHeader)); + header->width=width; + header->height=height; + TGAImageDesc desc; desc.image_desc=0; @@ -33,6 +36,8 @@ namespace hgl desc.alpha_depth=8; } + desc.direction=TGA_DIRECTION_UPPER_LEFT; + header->image_desc=desc.image_desc; return(true); }