From 04d181973a319762cfc4c894ee2418796206e9fc Mon Sep 17 00:00:00 2001 From: TimeServ Date: Mon, 18 Jan 2010 02:10:55 +0000 Subject: [PATCH] fix glerror for systems without gl_ext_shared_texture_palette git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3502 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_vidnt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/engine/gl/gl_vidnt.c b/engine/gl/gl_vidnt.c index 802e509d6..40bbeeaeb 100644 --- a/engine/gl/gl_vidnt.c +++ b/engine/gl/gl_vidnt.c @@ -1680,17 +1680,20 @@ qboolean GLVID_Is8bit() { return is8bit; } -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB void VID_Init8bitPalette() { +#ifdef GL_USE8BITTEX +#ifdef GL_EXT_paletted_texture +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + // Check for 8bit Extensions and initialize them. int i; char thePalette[256*3]; char *oldPalette, *newPalette; qglColorTableEXT = (void *)qwglGetProcAddress("glColorTableEXT"); - if (!qglColorTableEXT || strstr(gl_extensions, "GL_EXT_shared_texture_palette") || + if (!qglColorTableEXT || !strstr(gl_extensions, "GL_EXT_shared_texture_palette") || COM_CheckParm("-no8bit")) return; @@ -1707,6 +1710,9 @@ void VID_Init8bitPalette() qglColorTableEXT(GL_SHARED_TEXTURE_PALETTE_EXT, GL_RGB, 256, GL_RGB, GL_UNSIGNED_BYTE, (void *) thePalette); is8bit = TRUE; + +#endif +#endif } void GLVID_DeInit (void)