mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
Polymodes: Explicitly opt out of hicfindsubst falling back to pal 0 instead of checking against the reserved palnum range.
git-svn-id: https://svn.eduke32.com/eduke32@6217 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a032b829bf
commit
986a545ff5
4 changed files with 12 additions and 12 deletions
|
@ -43,8 +43,8 @@ typedef struct texcachepic_t
|
|||
int border, depth;
|
||||
} texcachepicture;
|
||||
|
||||
hicreplctyp * hicfindsubst(int picnum, int palnum);
|
||||
hicreplctyp * hicfindskybox(int picnum, int palnum);
|
||||
hicreplctyp * hicfindsubst(int picnum, int palnum, int nozero = 0);
|
||||
hicreplctyp * hicfindskybox(int picnum, int palnum, int nozero = 0);
|
||||
|
||||
static inline int have_basepal_tint(void)
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ int32_t hicinitcounter = 0;
|
|||
//
|
||||
// find the index into hicreplc[] which contains the replacement tile particulars
|
||||
//
|
||||
hicreplctyp *hicfindsubst(int32_t picnum, int32_t palnum)
|
||||
hicreplctyp *hicfindsubst(int picnum, int palnum, int nozero)
|
||||
{
|
||||
if (!hicreplc[picnum] || !hicinitcounter) return NULL;
|
||||
|
||||
|
@ -32,7 +32,7 @@ hicreplctyp *hicfindsubst(int32_t picnum, int32_t palnum)
|
|||
if (hr->palnum == palnum)
|
||||
return hr;
|
||||
|
||||
if (!palnum || palnum >= (MAXPALOOKUPS - RESERVEDPALS))
|
||||
if (!palnum || nozero)
|
||||
return NULL;
|
||||
|
||||
palnum = 0;
|
||||
|
@ -45,7 +45,7 @@ hicreplctyp *hicfindsubst(int32_t picnum, int32_t palnum)
|
|||
// this is separate because it's not worth passing an extra parameter which is "0" in 99.9999% of cases
|
||||
// to the regular hicfindsubst() function
|
||||
//
|
||||
hicreplctyp *hicfindskybox(int32_t picnum, int32_t palnum)
|
||||
hicreplctyp *hicfindskybox(int picnum, int palnum, int nozero)
|
||||
{
|
||||
if (!hicreplc[picnum] || !hicinitcounter) return NULL;
|
||||
|
||||
|
@ -56,7 +56,7 @@ hicreplctyp *hicfindskybox(int32_t picnum, int32_t palnum)
|
|||
if (hr->skybox && hr->palnum == palnum)
|
||||
return hr;
|
||||
|
||||
if (!palnum || palnum >= (MAXPALOOKUPS - RESERVEDPALS))
|
||||
if (!palnum || nozero)
|
||||
return NULL;
|
||||
|
||||
palnum = 0;
|
||||
|
|
|
@ -5015,7 +5015,7 @@ static _prbucket* polymer_getbuildmaterial(_prmaterial* material, int16_t tile
|
|||
}
|
||||
|
||||
// PR_BIT_DIFFUSE_DETAIL_MAP
|
||||
if (hicfindsubst(tilenum, DETAILPAL) && (pth = texcache_fetch(tilenum, DETAILPAL, 0, DAMETH_NOMASK)) &&
|
||||
if (hicfindsubst(tilenum, DETAILPAL, 1) && (pth = texcache_fetch(tilenum, DETAILPAL, 0, DAMETH_NOMASK)) &&
|
||||
pth->hicr && (pth->hicr->palnum == DETAILPAL))
|
||||
{
|
||||
material->detailmap = pth->glpic;
|
||||
|
@ -5024,17 +5024,17 @@ static _prbucket* polymer_getbuildmaterial(_prmaterial* material, int16_t tile
|
|||
}
|
||||
|
||||
// PR_BIT_GLOW_MAP
|
||||
if (hicfindsubst(tilenum, GLOWPAL) && (pth = texcache_fetch(tilenum, GLOWPAL, 0, DAMETH_MASK)) &&
|
||||
if (hicfindsubst(tilenum, GLOWPAL, 1) && (pth = texcache_fetch(tilenum, GLOWPAL, 0, DAMETH_MASK)) &&
|
||||
pth->hicr && (pth->hicr->palnum == GLOWPAL))
|
||||
material->glowmap = pth->glpic;
|
||||
|
||||
// PR_BIT_SPECULAR_MAP
|
||||
if (hicfindsubst(tilenum, SPECULARPAL) && (pth = texcache_fetch(tilenum, SPECULARPAL, 0, DAMETH_NOMASK)) &&
|
||||
if (hicfindsubst(tilenum, SPECULARPAL, 1) && (pth = texcache_fetch(tilenum, SPECULARPAL, 0, DAMETH_NOMASK)) &&
|
||||
pth->hicr && (pth->hicr->palnum == SPECULARPAL))
|
||||
material->specmap = pth->glpic;
|
||||
|
||||
// PR_BIT_NORMAL_MAP
|
||||
if (hicfindsubst(tilenum, NORMALPAL) && (pth = texcache_fetch(tilenum, NORMALPAL, 0, DAMETH_NOMASK)) &&
|
||||
if (hicfindsubst(tilenum, NORMALPAL, 1) && (pth = texcache_fetch(tilenum, NORMALPAL, 0, DAMETH_NOMASK)) &&
|
||||
pth->hicr && (pth->hicr->palnum == NORMALPAL))
|
||||
{
|
||||
material->normalmap = pth->glpic;
|
||||
|
|
|
@ -1755,7 +1755,7 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
|
|||
{
|
||||
pthtyp *detailpth = NULL;
|
||||
|
||||
if (usehightile && !drawingskybox && hicfindsubst(globalpicnum, DETAILPAL) &&
|
||||
if (usehightile && !drawingskybox && hicfindsubst(globalpicnum, DETAILPAL, 1) &&
|
||||
(detailpth = texcache_fetch(globalpicnum, DETAILPAL, 0, method & ~DAMETH_MASKPROPS)) &&
|
||||
detailpth->hicr && detailpth->hicr->palnum == DETAILPAL)
|
||||
{
|
||||
|
@ -1779,7 +1779,7 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
|
|||
{
|
||||
pthtyp *glowpth = NULL;
|
||||
|
||||
if (usehightile && !drawingskybox && hicfindsubst(globalpicnum, GLOWPAL) &&
|
||||
if (usehightile && !drawingskybox && hicfindsubst(globalpicnum, GLOWPAL, 1) &&
|
||||
(glowpth = texcache_fetch(globalpicnum, GLOWPAL, 0, (method & ~DAMETH_MASKPROPS) | DAMETH_MASK)) &&
|
||||
glowpth->hicr && (glowpth->hicr->palnum == GLOWPAL))
|
||||
polymost_setupglowtexture(++texunits, glowpth ? glowpth->glpic : 0);
|
||||
|
|
Loading…
Reference in a new issue