mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Add def "globalflags" bit 4, and for individual palettes the "tint" flag bit 512. This makes fog the same for all shades. Make fog behave normally with sector structure .fogpal.
Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@6559 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
2f98d759f6
commit
b6d7de7d27
5 changed files with 16 additions and 15 deletions
|
@ -864,6 +864,7 @@ EXTERN char *globalpalwritten;
|
|||
enum {
|
||||
GLOBAL_NO_GL_TILESHADES = 1<<0,
|
||||
GLOBAL_NO_GL_FULLBRIGHT = 1<<1,
|
||||
GLOBAL_NO_GL_FOGSHADE = 1<<2,
|
||||
};
|
||||
|
||||
extern int32_t globalflags;
|
||||
|
|
|
@ -110,6 +110,7 @@ enum
|
|||
HICTINT_BLENDMASK = 64|128,
|
||||
|
||||
HICTINT_ALWAYSUSEART = 256,
|
||||
HICTINT_NOFOGSHADE = 512,
|
||||
|
||||
HICTINT_PRECOMPUTED = HICTINT_COLORIZE | HICTINT_BLENDMASK,
|
||||
HICTINT_IN_MEMORY = HICTINT_PRECOMPUTED | HICTINT_GRAYSCALE | HICTINT_INVERT,
|
||||
|
|
|
@ -102,11 +102,10 @@ static FORCE_INLINE int32_t get_ceiling_fogpal(usectortype const * const sec)
|
|||
{
|
||||
return POLYMOST_CHOOSE_FOG_PAL(sec->fogpal, sec->ceilingpal);
|
||||
}
|
||||
static FORCE_INLINE int32_t fogpal_shade(usectortype const * const sec, int32_t const shade)
|
||||
static FORCE_INLINE int32_t fogshade(int32_t const shade, int32_t const pal)
|
||||
{
|
||||
// When fogging is due to sector[].fogpal, don't make the fog parameters
|
||||
// depend on the shade of the object.
|
||||
return sec->fogpal ? 0 : shade;
|
||||
polytintflags_t const tintflags = hictinting[pal].f;
|
||||
return (globalflags & GLOBAL_NO_GL_FOGSHADE || tintflags & HICTINT_NOFOGSHADE) ? 0 : shade;
|
||||
}
|
||||
|
||||
static FORCE_INLINE int check_nonpow2(int32_t const x)
|
||||
|
|
|
@ -1478,7 +1478,7 @@ void polymer_drawmaskwall(int32_t damaskwallcnt)
|
|||
if (searchit == 2) {
|
||||
polymer_drawsearchplane(&w->mask, oldcolor, 0x04, (GLubyte *)&maskwall[damaskwallcnt]);
|
||||
} else {
|
||||
calc_and_apply_fog(wal->picnum, fogpal_shade(sec, wal->shade), sec->visibility, get_floor_fogpal(sec));
|
||||
calc_and_apply_fog(wal->picnum, fogshade(wal->shade, wal->pal), sec->visibility, get_floor_fogpal(sec));
|
||||
polymer_drawplane(&w->mask);
|
||||
}
|
||||
|
||||
|
@ -1507,7 +1507,7 @@ void polymer_drawsprite(int32_t snum)
|
|||
DO_TILE_ANIM(tspr->picnum, tspr->owner+32768);
|
||||
|
||||
sec = (usectortype *)§or[tspr->sectnum];
|
||||
calc_and_apply_fog(tspr->picnum, fogpal_shade(sec, tspr->shade), sec->visibility,
|
||||
calc_and_apply_fog(tspr->picnum, fogshade(tspr->shade, tspr->pal), sec->visibility,
|
||||
get_floor_fogpal((usectortype *)§or[tspr->sectnum]));
|
||||
|
||||
if (usemodels && tile2model[Ptile2tile(tspr->picnum,tspr->pal)].modelid >= 0 &&
|
||||
|
@ -3009,7 +3009,7 @@ static void polymer_drawsector(int16_t sectnum, int32_t domasks)
|
|||
polymer_drawsearchplane(&s->floor, oldcolor, 0x02, (GLubyte *) §num);
|
||||
}
|
||||
else {
|
||||
calc_and_apply_fog(sec->floorpicnum, fogpal_shade(sec, sec->floorshade),
|
||||
calc_and_apply_fog(sec->floorpicnum, fogshade(sec->floorshade, sec->floorpal),
|
||||
sec->visibility, get_floor_fogpal(sec));
|
||||
polymer_drawplane(&s->floor);
|
||||
}
|
||||
|
@ -3037,7 +3037,7 @@ static void polymer_drawsector(int16_t sectnum, int32_t domasks)
|
|||
polymer_drawsearchplane(&s->ceil, oldcolor, 0x01, (GLubyte *) §num);
|
||||
}
|
||||
else {
|
||||
calc_and_apply_fog(sec->ceilingpicnum, fogpal_shade(sec, sec->ceilingshade),
|
||||
calc_and_apply_fog(sec->ceilingpicnum, fogshade(sec->ceilingshade, sec->ceilingpal),
|
||||
sec->visibility, get_ceiling_fogpal(sec));
|
||||
polymer_drawplane(&s->ceil);
|
||||
}
|
||||
|
@ -3571,7 +3571,7 @@ static void polymer_drawwall(int16_t sectnum, int16_t wallnum)
|
|||
(sector[wal->nextsector].ceilingstat & 1))
|
||||
parallaxedceiling = 1;
|
||||
|
||||
calc_and_apply_fog(wal->picnum, fogpal_shade(sec, wal->shade), sec->visibility, get_floor_fogpal(sec));
|
||||
calc_and_apply_fog(wal->picnum, fogshade(wal->shade, wal->pal), sec->visibility, get_floor_fogpal(sec));
|
||||
|
||||
if ((w->underover & 1) && (!parallaxedfloor || (searchit == 2)))
|
||||
{
|
||||
|
|
|
@ -2809,7 +2809,7 @@ static void polymost_internal_nonparallaxed(vec2f_t n0, vec2f_t n1, float ryp0,
|
|||
drawpoly_alpha = 0.f;
|
||||
drawpoly_blend = 0;
|
||||
|
||||
calc_and_apply_fog(globalpicnum, fogpal_shade(sec, global_cf_shade), sec->visibility,
|
||||
calc_and_apply_fog(globalpicnum, fogshade(global_cf_shade, global_cf_pal), sec->visibility,
|
||||
POLYMOST_CHOOSE_FOG_PAL(global_cf_fogpal, global_cf_pal));
|
||||
|
||||
if (have_floor)
|
||||
|
@ -3689,7 +3689,7 @@ static void polymost_drawalls(int32_t const bunch)
|
|||
}
|
||||
if (wal->cstat&256) { xtex.v = -xtex.v; ytex.v = -ytex.v; otex.v = -otex.v; } //yflip
|
||||
|
||||
calc_and_apply_fog(wal->picnum, fogpal_shade(sec, wal->shade), sec->visibility, get_floor_fogpal(sec));
|
||||
calc_and_apply_fog(wal->picnum, fogshade(wal->shade, wal->pal), sec->visibility, get_floor_fogpal(sec));
|
||||
|
||||
pow2xsplit = 1; polymost_domost(x1,ocy1,x0,ocy0);
|
||||
if (wal->cstat&8) { xtex.u = ogux; ytex.u = oguy; otex.u = oguo; }
|
||||
|
@ -3726,7 +3726,7 @@ static void polymost_drawalls(int32_t const bunch)
|
|||
}
|
||||
if (nwal->cstat&256) { xtex.v = -xtex.v; ytex.v = -ytex.v; otex.v = -otex.v; } //yflip
|
||||
|
||||
calc_and_apply_fog(nwal->picnum, fogpal_shade(sec, nwal->shade), sec->visibility, get_floor_fogpal(sec));
|
||||
calc_and_apply_fog(nwal->picnum, fogshade(nwal->shade, nwal->pal), sec->visibility, get_floor_fogpal(sec));
|
||||
|
||||
pow2xsplit = 1; polymost_domost(x0,ofy0,x1,ofy1);
|
||||
if (wal->cstat&(2+8)) { otex.u = oguo; xtex.u = ogux; ytex.u = oguy; }
|
||||
|
@ -3774,7 +3774,7 @@ static void polymost_drawalls(int32_t const bunch)
|
|||
}
|
||||
if (wal->cstat&256) { xtex.v = -xtex.v; ytex.v = -ytex.v; otex.v = -otex.v; } //yflip
|
||||
|
||||
calc_and_apply_fog(wal->picnum, fogpal_shade(sec, wal->shade), sec->visibility, get_floor_fogpal(sec));
|
||||
calc_and_apply_fog(wal->picnum, fogshade(wal->shade, wal->pal), sec->visibility, get_floor_fogpal(sec));
|
||||
pow2xsplit = 1; polymost_domost(x0, cy0, x1, cy1);
|
||||
} while (0);
|
||||
}
|
||||
|
@ -4296,7 +4296,7 @@ void polymost_drawmaskwall(int32_t damaskwallcnt)
|
|||
drawpoly_alpha = 0.f;
|
||||
drawpoly_blend = blend;
|
||||
|
||||
calc_and_apply_fog(wal->picnum, fogpal_shade(sec, wal->shade), sec->visibility, get_floor_fogpal(sec));
|
||||
calc_and_apply_fog(wal->picnum, fogshade(wal->shade, wal->pal), sec->visibility, get_floor_fogpal(sec));
|
||||
|
||||
float const csy[4] = { ((float)(cz[0] - globalposz)) * ryp0 + ghoriz,
|
||||
((float)(cz[1] - globalposz)) * ryp0 + ghoriz,
|
||||
|
@ -4517,7 +4517,7 @@ void polymost_drawsprite(int32_t snum)
|
|||
|
||||
sec = (usectortype *)§or[tspr->sectnum];
|
||||
|
||||
calc_and_apply_fog(tspr->picnum, fogpal_shade(sec, globalshade), sec->visibility, get_floor_fogpal(sec));
|
||||
calc_and_apply_fog(tspr->picnum, fogshade(globalshade, globalpal), sec->visibility, get_floor_fogpal(sec));
|
||||
|
||||
while (!(spriteext[spritenum].flags & SPREXT_NOTMD))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue