engine: imagelib: add common definitions for 16-bit images

This commit is contained in:
Alibek Omarov 2021-11-23 03:58:47 +03:00
parent 8ab97fbbf0
commit f045103abb
2 changed files with 6 additions and 1 deletions

View File

@ -10,6 +10,7 @@ NOTE: number at end of pixelformat name it's a total bitscount e.g. PF_RGB_24 ==
*/
#define ImageRAW( type ) (type == PF_RGBA_32 || type == PF_BGRA_32 || type == PF_RGB_24 || type == PF_BGR_24 || type == PF_LUMINANCE)
#define ImageDXT( type ) (type == PF_DXT1 || type == PF_DXT3 || type == PF_DXT5 || type == PF_ATI2)
#define Image16( type ) (type == PF_RGBA_64 || type == PF_RGB_48)
typedef enum
{
@ -25,6 +26,8 @@ typedef enum
PF_DXT3, // s3tc DXT3 format
PF_DXT5, // s3tc DXT5 format
PF_ATI2, // latc ATI2N format
PF_RGBA_64, // 16-bit RGBA
PF_RGB_48, // 16-bit RGB
PF_TOTALCOUNT, // must be last
} pixformat_t;

View File

@ -71,7 +71,7 @@ static const cubepack_t load_cubemap[] =
};
// soul of ImageLib - table of image format constants
const bpc_desc_t PFDesc[] =
const bpc_desc_t PFDesc[PF_TOTALCOUNT] =
{
{ PF_UNKNOWN, "raw", 0x1908, 0 },
{ PF_INDEXED_24, "pal 24", 0x1908, 1 },
@ -85,6 +85,8 @@ const bpc_desc_t PFDesc[] =
{ PF_DXT3, "DXT 3", 0x83F2, 4 },
{ PF_DXT5, "DXT 5", 0x83F3, 4 },
{ PF_ATI2, "ATI 2", 0x8837, 4 },
{ PF_RGBA_64, "RGBA 64", 0x1908, 8 },
{ PF_RGB_48, "RGB 48", 0x1908, 6 },
};
void Image_Reset( void )