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
This commit is contained in:
terminx 2013-05-15 02:20:08 +00:00
parent c717f9a7b5
commit 872ea59160
4 changed files with 13 additions and 8 deletions

View file

@ -34,8 +34,13 @@ void polymost_drawrooms(void);
void polymost_glinit(void); void polymost_glinit(void);
void polymost_glreset(void); void polymost_glreset(void);
enum {
INVALIDATE_ALL,
INVALIDATE_ART
};
void gltexinvalidate(int32_t dapicnum, int32_t dapalnum, int32_t dameth); 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); int32_t polymost_printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const char *name, char fontsize);
extern float curpolygonoffset; extern float curpolygonoffset;

View file

@ -14309,9 +14309,9 @@ void setbrightness(char dabrightness, uint8_t dapalid, uint8_t flags)
const int32_t doinvalidate = (paldidchange || (palsumdidchange && nohwgamma)); const int32_t doinvalidate = (paldidchange || (palsumdidchange && nohwgamma));
if (!(flags&2) && doinvalidate) if (!(flags&2) && doinvalidate)
gltexinvalidateall(0); gltexinvalidatetype(INVALIDATE_ALL);
if (!(flags&8) && doinvalidate) if (!(flags&8) && doinvalidate)
gltexinvalidateall(1); gltexinvalidatetype(INVALIDATE_ART);
#ifdef POLYMER #ifdef POLYMER
if ((rendmode == 4) && doinvalidate) if ((rendmode == 4) && doinvalidate)
polymer_texinvalidate(); polymer_texinvalidate();

View file

@ -2110,9 +2110,9 @@ int32_t osdcmd_cvar_set(const osdfuncparm_t *parm)
osdcmd_restartvid(NULL); osdcmd_restartvid(NULL);
break; break;
case CVAR_INVALIDATEALL: case CVAR_INVALIDATEALL:
gltexinvalidateall(0); gltexinvalidatetype(INVALIDATE_ALL);
case CVAR_INVALIDATEART: case CVAR_INVALIDATEART:
gltexinvalidateall(1); gltexinvalidatetype(INVALIDATE_ART);
#ifdef POLYMER #ifdef POLYMER
if (getrendermode() == REND_POLYMER) if (getrendermode() == REND_POLYMER)
polymer_texinvalidate(); polymer_texinvalidate();

View file

@ -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 //Make all textures "dirty" so they reload, but not re-allocate
//This should be much faster than polymost_glreset() //This should be much faster than polymost_glreset()
//Use this for palette effects ... but not ones that change every frame! //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; int32_t j;
pthtyp *pth; pthtyp *pth;
@ -284,7 +284,7 @@ void gltexinvalidateall(int32_t artonly)
{ {
for (pth=texcache_head[j]; pth; pth=pth->next) 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; pth->flags |= 128;
if (pth->flags & 16) if (pth->flags & 16)
@ -293,7 +293,7 @@ void gltexinvalidateall(int32_t artonly)
} }
} }
if (!artonly) if (type == INVALIDATE_ALL)
clearskins(); clearskins();
#ifdef DEBUGGINGAIDS #ifdef DEBUGGINGAIDS
OSD_Printf("gltexinvalidateall()\n"); OSD_Printf("gltexinvalidateall()\n");