From b805367364746e159b9e863b33b25cde787628b1 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Sat, 22 May 2004 08:47:14 +0000 Subject: [PATCH] don't try to use paletted textures with mipmapping since gluBuild2DMipmaps can't handle it (d1x r1.39) --- ChangeLog | 3 +++ arch/ogl/ogl.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 258b4c1d..e94b8db2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-05-22 Matthew Mueller + * arch/ogl/ogl.c: don't try to use paletted textures with + mipmapping since gluBuild2DMipmaps can't handle it (d1x r1.39) + * arch/ogl/gr.c, arch/ogl/ogl.c, include/loadgl.h, include/ogl_init.h: add ogl paletted texture support (d1x r1.36, r1.38, r1.5, r1.24) diff --git a/arch/ogl/ogl.c b/arch/ogl/ogl.c index d1787c9c..dff9ef22 100644 --- a/arch/ogl/ogl.c +++ b/arch/ogl/ogl.c @@ -1,4 +1,4 @@ -/* $Id: ogl.c,v 1.26 2004-05-22 08:43:02 btb Exp $ */ +/* $Id: ogl.c,v 1.27 2004-05-22 08:47:14 btb Exp $ */ /* * * Graphics support functions for OpenGL. @@ -1598,7 +1598,9 @@ void ogl_loadtexture(unsigned char *data, int dxo, int dyo, ogl_texture *tex, in tex->v=(float)tex->h/(float)tex->th; #ifdef GL_EXT_paletted_texture - if (ogl_shared_palette_ok && tex->format == GL_RGBA) + if (ogl_shared_palette_ok && tex->format == GL_RGBA && + !(tex->wantmip && GL_needmipmaps) // gluBuild2DMipmaps doesn't support paletted textures.. this could be worked around be generating our own mipmaps, but thats too much trouble at the moment. + ) { // descent makes palette entries 254 and 255 both do double duty, depending upon the setting of BM_FLAG_SUPER_TRANSPARENT and BM_FLAG_TRANSPARENT. // So if the texture doesn't have BM_FLAG_TRANSPARENT set, yet uses index 255, we cannot use the palette for it since that color would be incorrect. (this case is much less common than transparent textures, hence why we don't exclude those instead.) -- 2.39.2