From fa6ff04c5ae5cc7b611abd69ffae15a62ecdd2ce Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 16 Jan 2021 15:39:16 +0900 Subject: [PATCH] [image] Use an enum for tex_t formats --- include/QF/image.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/include/QF/image.h b/include/QF/image.h index 106379bb7..396547f42 100644 --- a/include/QF/image.h +++ b/include/QF/image.h @@ -29,23 +29,26 @@ #ifndef __QF_image_h #define __QF_image_h -#include "QF/quakeio.h" +#include "QF/qtypes.h" + +typedef enum QFFormat { + tex_palette = 0, + tex_l = 0x1909, //GL_LUMINANCE + tex_a = 0x1906, //GL_ALPHA + tex_la = 2, + tex_rgb = 3, + tex_rgba = 4, +} QFFormat; // could not use texture_t as that is used for models. typedef struct tex_s { - int width; - int height; - int format; - unsigned char *palette; // 0 = 32 bit, otherwise 8 - unsigned char data[4]; // variable length + int width; + int height; + QFFormat format; + byte *palette; // 0 = 32 bit, otherwise 8 + byte data[4]; // variable length } tex_t; -#define tex_palette 0 -#define tex_l 0x1909 //GL_LUMINANCE -#define tex_a 0x1906 //GL_ALPHA -#define tex_la 2 -#define tex_rgb 3 -#define tex_rgba 4 tex_t *LoadImage (const char *imageFile);