From 8e52d7b1f7146ab227a44c3913633c805792fd44 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Fri, 8 Jan 2016 01:33:25 +0000 Subject: [PATCH] Fix miscellaneous GL ES warnings git-svn-id: https://svn.eduke32.com/eduke32@5527 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/dxtfilter.c | 4 ++++ polymer/eduke32/build/src/texcache.c | 25 ++++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/build/src/dxtfilter.c b/polymer/eduke32/build/src/dxtfilter.c index c10147b3c..250856ea4 100644 --- a/polymer/eduke32/build/src/dxtfilter.c +++ b/polymer/eduke32/build/src/dxtfilter.c @@ -181,6 +181,10 @@ int32_t dxtfilter(int32_t fil, const texcachepicture *pict, const char *pic, voi dxt_handle_io(fil, tabledivide32(miplen, stride)<<2, midbuf, packbuf); +#if defined EDUKE32_GLES + UNREFERENCED_PARAMETER(pict); +#endif + return 0; } diff --git a/polymer/eduke32/build/src/texcache.c b/polymer/eduke32/build/src/texcache.c index fcd2774c8..f96f829ad 100644 --- a/polymer/eduke32/build/src/texcache.c +++ b/polymer/eduke32/build/src/texcache.c @@ -284,9 +284,16 @@ static void texcache_deletefiles(void) static int32_t texcache_enabled(void) { +#if defined EDUKE32_GLES || !defined USE_GLEXT + return 0; +#else if (!glusetexcompr || !glusetexcache) return 0; - if (!glinfo.texcompr || !bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB) + if (!glinfo.texcompr +# ifdef DYNAMIC_GLEXT + || !bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB +# endif + ) { // lacking the necessary extensions to do this OSD_Printf("Warning: the GL driver lacks necessary functions to use caching\n"); @@ -301,6 +308,7 @@ static int32_t texcache_enabled(void) } return 1; +#endif } void texcache_openfiles(void) @@ -533,13 +541,16 @@ failure: void texcache_writetex(const char *fn, int32_t len, int32_t dameth, char effect, texcacheheader *head) { - static GLint glGetTexLevelParameterivOK = GL_TRUE; char cachefn[BMAX_PATH]; char *pic = NULL, *packbuf = NULL; void *midbuf = NULL; - uint32_t alloclen=0, level=0; + uint32_t alloclen=0; +#ifndef EDUKE32_GLES + static GLint glGetTexLevelParameterivOK = GL_TRUE; + uint32_t level=0; uint32_t padx=0, pady=0; GLint gi; +#endif int32_t offset = 0; if (!texcache_enabled()) return; @@ -611,6 +622,7 @@ void texcache_writetex(const char *fn, int32_t len, int32_t dameth, char effect, pict.ydim = head->ydim; pict.border = 0; pict.depth = 16; + miplen = 0; #endif if (alloclen < miplen) { @@ -701,8 +713,6 @@ static int32_t texcache_loadmips(const texcacheheader *head, GLenum *glerr, int3 for (level = 0; level==0 || (pict.xdim > 1 || pict.ydim > 1); level++) #endif { - GLint format; - if (texcache_readdata(&pict, sizeof(texcachepicture))) { TEXCACHE_FREEBUFS(); @@ -748,6 +758,7 @@ static int32_t texcache_loadmips(const texcacheheader *head, GLenum *glerr, int3 #endif #ifndef EDUKE32_GLES + GLint format; bglGetTexLevelParameteriv(GL_TEXTURE_2D, level, GL_TEXTURE_INTERNAL_FORMAT, &format); if ((*glerr = bglGetError()) != GL_NO_ERROR) { @@ -764,6 +775,10 @@ static int32_t texcache_loadmips(const texcacheheader *head, GLenum *glerr, int3 #endif } +#if !defined USE_GLEXT && defined EDUKE32_GLES + UNREFERENCED_PARAMETER(glerr); +#endif + TEXCACHE_FREEBUFS(); return 0; }