From 872ea591603b5fd3e436aee694a3f826a4640519 Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 15 May 2013 02:20:08 +0000 Subject: [PATCH] Rename gltexinvalidateall to gltexinvalidatetype and add an enum for the two currently accepted values, INVALIDATE_ALL and INVALIDATE_ART git-svn-id: https://svn.eduke32.com/eduke32@3765 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/polymost.h | 7 ++++++- polymer/eduke32/build/src/engine.c | 4 ++-- polymer/eduke32/build/src/osd.c | 4 ++-- polymer/eduke32/build/src/polymost.c | 6 +++--- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/polymer/eduke32/build/include/polymost.h b/polymer/eduke32/build/include/polymost.h index 716216218..8f744d785 100644 --- a/polymer/eduke32/build/include/polymost.h +++ b/polymer/eduke32/build/include/polymost.h @@ -34,8 +34,13 @@ void polymost_drawrooms(void); void polymost_glinit(void); void polymost_glreset(void); +enum { + INVALIDATE_ALL, + INVALIDATE_ART +}; + void gltexinvalidate(int32_t dapicnum, int32_t dapalnum, int32_t dameth); -void gltexinvalidateall(int32_t artonly); +void gltexinvalidatetype(int32_t type); int32_t polymost_printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const char *name, char fontsize); extern float curpolygonoffset; diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index e5743e824..3302a5649 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -14309,9 +14309,9 @@ void setbrightness(char dabrightness, uint8_t dapalid, uint8_t flags) const int32_t doinvalidate = (paldidchange || (palsumdidchange && nohwgamma)); if (!(flags&2) && doinvalidate) - gltexinvalidateall(0); + gltexinvalidatetype(INVALIDATE_ALL); if (!(flags&8) && doinvalidate) - gltexinvalidateall(1); + gltexinvalidatetype(INVALIDATE_ART); #ifdef POLYMER if ((rendmode == 4) && doinvalidate) polymer_texinvalidate(); diff --git a/polymer/eduke32/build/src/osd.c b/polymer/eduke32/build/src/osd.c index be55163b3..60ff44719 100644 --- a/polymer/eduke32/build/src/osd.c +++ b/polymer/eduke32/build/src/osd.c @@ -2110,9 +2110,9 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm) osdcmd_restartvid(NULL); break; case CVAR_INVALIDATEALL: - gltexinvalidateall(0); + gltexinvalidatetype(INVALIDATE_ALL); case CVAR_INVALIDATEART: - gltexinvalidateall(1); + gltexinvalidatetype(INVALIDATE_ART); #ifdef POLYMER if (getrendermode() == REND_POLYMER) polymer_texinvalidate(); diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 1901d95a4..4eb9d7b7d 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -275,7 +275,7 @@ void gltexinvalidate(int32_t dapicnum, int32_t dapalnum, int32_t dameth) //Make all textures "dirty" so they reload, but not re-allocate //This should be much faster than polymost_glreset() //Use this for palette effects ... but not ones that change every frame! -void gltexinvalidateall(int32_t artonly) +void gltexinvalidatetype(int32_t type) { int32_t j; pthtyp *pth; @@ -284,7 +284,7 @@ void gltexinvalidateall(int32_t artonly) { for (pth=texcache_head[j]; pth; pth=pth->next) { - if (!artonly || (artonly && pth->hicr == NULL)) + if (type == INVALIDATE_ALL || (type == INVALIDATE_ART && pth->hicr == NULL)) { pth->flags |= 128; if (pth->flags & 16) @@ -293,7 +293,7 @@ void gltexinvalidateall(int32_t artonly) } } - if (!artonly) + if (type == INVALIDATE_ALL) clearskins(); #ifdef DEBUGGINGAIDS OSD_Printf("gltexinvalidateall()\n");