mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
Merge branch 'colormap_flags_refactor' into 'next'
Clean up the mess that is extracolormap_t::fog See merge request STJr/SRB2!790
This commit is contained in:
commit
fb66691991
9 changed files with 66 additions and 89 deletions
|
@ -5022,12 +5022,7 @@ void HWR_AddTransparentFloor(levelflat_t *levelflat, extrasubsector_t *xsub, boo
|
|||
|
||||
planeinfo[numplanes].isceiling = isceiling;
|
||||
planeinfo[numplanes].fixedheight = fixedheight;
|
||||
|
||||
if (planecolormap && (planecolormap->fog & 1))
|
||||
planeinfo[numplanes].lightlevel = lightlevel;
|
||||
else
|
||||
planeinfo[numplanes].lightlevel = 255;
|
||||
|
||||
planeinfo[numplanes].lightlevel = (planecolormap && (planecolormap->flags & CMF_FOG)) ? lightlevel : 255;
|
||||
planeinfo[numplanes].levelflat = levelflat;
|
||||
planeinfo[numplanes].xsub = xsub;
|
||||
planeinfo[numplanes].alpha = alpha;
|
||||
|
@ -5059,12 +5054,7 @@ void HWR_AddTransparentPolyobjectFloor(levelflat_t *levelflat, polyobj_t *polyse
|
|||
|
||||
polyplaneinfo[numpolyplanes].isceiling = isceiling;
|
||||
polyplaneinfo[numpolyplanes].fixedheight = fixedheight;
|
||||
|
||||
if (planecolormap && (planecolormap->fog & 1))
|
||||
polyplaneinfo[numpolyplanes].lightlevel = lightlevel;
|
||||
else
|
||||
polyplaneinfo[numpolyplanes].lightlevel = 255;
|
||||
|
||||
polyplaneinfo[numpolyplanes].lightlevel = (planecolormap && (planecolormap->flags & CMF_FOG)) ? lightlevel : 255;
|
||||
polyplaneinfo[numpolyplanes].levelflat = levelflat;
|
||||
polyplaneinfo[numpolyplanes].polysector = polysector;
|
||||
polyplaneinfo[numpolyplanes].alpha = alpha;
|
||||
|
|
|
@ -609,7 +609,7 @@ static void P_NetArchiveColormaps(void)
|
|||
|
||||
WRITEUINT8(save_p, exc->fadestart);
|
||||
WRITEUINT8(save_p, exc->fadeend);
|
||||
WRITEUINT8(save_p, exc->fog);
|
||||
WRITEUINT8(save_p, exc->flags);
|
||||
|
||||
WRITEINT32(save_p, exc->rgba);
|
||||
WRITEINT32(save_p, exc->fadergba);
|
||||
|
@ -639,7 +639,7 @@ static void P_NetUnArchiveColormaps(void)
|
|||
|
||||
for (exc = net_colormaps; i < num_net_colormaps; i++, exc = exc_next)
|
||||
{
|
||||
UINT8 fadestart, fadeend, fog;
|
||||
UINT8 fadestart, fadeend, flags;
|
||||
INT32 rgba, fadergba;
|
||||
#ifdef EXTRACOLORMAPLUMPS
|
||||
char lumpname[9];
|
||||
|
@ -647,7 +647,7 @@ static void P_NetUnArchiveColormaps(void)
|
|||
|
||||
fadestart = READUINT8(save_p);
|
||||
fadeend = READUINT8(save_p);
|
||||
fog = READUINT8(save_p);
|
||||
flags = READUINT8(save_p);
|
||||
|
||||
rgba = READINT32(save_p);
|
||||
fadergba = READINT32(save_p);
|
||||
|
@ -679,7 +679,7 @@ static void P_NetUnArchiveColormaps(void)
|
|||
|
||||
exc->fadestart = fadestart;
|
||||
exc->fadeend = fadeend;
|
||||
exc->fog = fog;
|
||||
exc->flags = flags;
|
||||
|
||||
exc->rgba = rgba;
|
||||
exc->fadergba = fadergba;
|
||||
|
@ -689,7 +689,7 @@ static void P_NetUnArchiveColormaps(void)
|
|||
exc->lumpname[0] = 0;
|
||||
#endif
|
||||
|
||||
existing_exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, fog);
|
||||
existing_exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, flags);
|
||||
|
||||
if (existing_exc)
|
||||
exc->colormap = existing_exc->colormap;
|
||||
|
|
17
src/p_spec.c
17
src/p_spec.c
|
@ -3516,7 +3516,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
false, // subtract FadeA (no flag for this, just pass negative alpha)
|
||||
false, // subtract FadeStart (we ran out of flags)
|
||||
false, // subtract FadeEnd (we ran out of flags)
|
||||
false, // ignore Fog (we ran out of flags)
|
||||
false, // ignore Flags (we ran out of flags)
|
||||
line->flags & ML_DONTPEGBOTTOM,
|
||||
(line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].textureoffset >> FRACBITS) : 0,
|
||||
(line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].rowoffset >> FRACBITS) : 0,
|
||||
|
@ -3883,7 +3883,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
false, // subtract FadeA (no flag for this, just pass negative alpha)
|
||||
false, // subtract FadeStart (we ran out of flags)
|
||||
false, // subtract FadeEnd (we ran out of flags)
|
||||
false, // ignore Fog (we ran out of flags)
|
||||
false, // ignore Flags (we ran out of flags)
|
||||
line->flags & ML_DONTPEGBOTTOM,
|
||||
(line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].textureoffset >> FRACBITS) : 0,
|
||||
(line->flags & ML_DONTPEGBOTTOM) ? (sides[line->sidenum[0]].rowoffset >> FRACBITS) : 0,
|
||||
|
@ -7081,10 +7081,9 @@ void P_SpawnSpecials(boolean fromnetsave)
|
|||
case 202: // Fog
|
||||
ffloorflags = FF_EXISTS|FF_RENDERALL|FF_FOG|FF_BOTHPLANES|FF_INVERTPLANES|FF_ALLSIDES|FF_INVERTSIDES|FF_CUTEXTRA|FF_EXTRA|FF_DOUBLESHADOW|FF_CUTSPRITES;
|
||||
sec = sides[*lines[i].sidenum].sector - sectors;
|
||||
// SoM: Because it's fog, check for an extra colormap and set
|
||||
// the fog flag...
|
||||
// SoM: Because it's fog, check for an extra colormap and set the fog flag...
|
||||
if (sectors[sec].extra_colormap)
|
||||
sectors[sec].extra_colormap->fog = 1;
|
||||
sectors[sec].extra_colormap->flags = CMF_FOG;
|
||||
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
|
||||
break;
|
||||
|
||||
|
@ -8472,7 +8471,7 @@ void T_FadeColormap(fadecolormap_t *d)
|
|||
extracolormap_t *exc;
|
||||
INT32 duration = d->ticbased ? d->duration : 256;
|
||||
fixed_t factor = min(FixedDiv(duration - d->timer, duration), 1*FRACUNIT);
|
||||
INT16 cr, cg, cb, ca, fadestart, fadeend, fog;
|
||||
INT16 cr, cg, cb, ca, fadestart, fadeend, flags;
|
||||
INT32 rgba, fadergba;
|
||||
|
||||
// NULL failsafes (or intentionally set to signify default)
|
||||
|
@ -8521,7 +8520,7 @@ void T_FadeColormap(fadecolormap_t *d)
|
|||
|
||||
fadestart = APPLYFADE(d->dest_exc->fadestart, d->source_exc->fadestart, d->sector->extra_colormap->fadestart);
|
||||
fadeend = APPLYFADE(d->dest_exc->fadeend, d->source_exc->fadeend, d->sector->extra_colormap->fadeend);
|
||||
fog = abs(factor) > FRACUNIT/2 ? d->dest_exc->fog : d->source_exc->fog; // set new fog flag halfway through fade
|
||||
flags = abs(factor) > FRACUNIT/2 ? d->dest_exc->flags : d->source_exc->flags; // set new flags halfway through fade
|
||||
|
||||
#undef APPLYFADE
|
||||
|
||||
|
@ -8529,12 +8528,12 @@ void T_FadeColormap(fadecolormap_t *d)
|
|||
// setup new colormap
|
||||
//////////////////
|
||||
|
||||
if (!(d->sector->extra_colormap = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, fog)))
|
||||
if (!(d->sector->extra_colormap = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, flags)))
|
||||
{
|
||||
exc = R_CreateDefaultColormap(false);
|
||||
exc->fadestart = fadestart;
|
||||
exc->fadeend = fadeend;
|
||||
exc->fog = (boolean)fog;
|
||||
exc->flags = flags;
|
||||
exc->rgba = rgba;
|
||||
exc->fadergba = fadergba;
|
||||
exc->colormap = R_CreateLightTable(exc);
|
||||
|
|
48
src/r_data.c
48
src/r_data.c
|
@ -1799,7 +1799,7 @@ extracolormap_t *R_CreateDefaultColormap(boolean lighttable)
|
|||
extracolormap_t *exc = Z_Calloc(sizeof (*exc), PU_LEVEL, NULL);
|
||||
exc->fadestart = 0;
|
||||
exc->fadeend = 31;
|
||||
exc->fog = 0;
|
||||
exc->flags = 0;
|
||||
exc->rgba = 0;
|
||||
exc->fadergba = 0x19000000;
|
||||
exc->colormap = lighttable ? R_CreateLightTable(exc) : NULL;
|
||||
|
@ -1903,17 +1903,17 @@ void R_AddColormapToList(extracolormap_t *extra_colormap)
|
|||
//
|
||||
#ifdef EXTRACOLORMAPLUMPS
|
||||
boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams,
|
||||
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog, lumpnum_t lump)
|
||||
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags, lumpnum_t lump)
|
||||
#else
|
||||
boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams,
|
||||
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog)
|
||||
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags)
|
||||
#endif
|
||||
{
|
||||
return (
|
||||
(!checkparams ? true :
|
||||
(fadestart == 0
|
||||
&& fadeend == 31
|
||||
&& !fog)
|
||||
&& !flags)
|
||||
)
|
||||
&& (!checkrgba ? true : rgba == 0)
|
||||
&& (!checkfadergba ? true : fadergba == 0x19000000)
|
||||
|
@ -1930,9 +1930,9 @@ boolean R_CheckDefaultColormap(extracolormap_t *extra_colormap, boolean checkrgb
|
|||
return true;
|
||||
|
||||
#ifdef EXTRACOLORMAPLUMPS
|
||||
return R_CheckDefaultColormapByValues(checkrgba, checkfadergba, checkparams, extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->fog, extra_colormap->lump);
|
||||
return R_CheckDefaultColormapByValues(checkrgba, checkfadergba, checkparams, extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->flags, extra_colormap->lump);
|
||||
#else
|
||||
return R_CheckDefaultColormapByValues(checkrgba, checkfadergba, checkparams, extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->fog);
|
||||
return R_CheckDefaultColormapByValues(checkrgba, checkfadergba, checkparams, extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->flags);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1952,7 +1952,7 @@ boolean R_CheckEqualColormaps(extracolormap_t *exc_a, extracolormap_t *exc_b, bo
|
|||
(!checkparams ? true :
|
||||
(exc_a->fadestart == exc_b->fadestart
|
||||
&& exc_a->fadeend == exc_b->fadeend
|
||||
&& exc_a->fog == exc_b->fog)
|
||||
&& exc_a->flags == exc_b->flags)
|
||||
)
|
||||
&& (!checkrgba ? true : exc_a->rgba == exc_b->rgba)
|
||||
&& (!checkfadergba ? true : exc_a->fadergba == exc_b->fadergba)
|
||||
|
@ -1968,9 +1968,9 @@ boolean R_CheckEqualColormaps(extracolormap_t *exc_a, extracolormap_t *exc_b, bo
|
|||
// NOTE: Returns NULL if no match is found
|
||||
//
|
||||
#ifdef EXTRACOLORMAPLUMPS
|
||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog, lumpnum_t lump)
|
||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags, lumpnum_t lump)
|
||||
#else
|
||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog)
|
||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags)
|
||||
#endif
|
||||
{
|
||||
extracolormap_t *exc;
|
||||
|
@ -1982,7 +1982,7 @@ extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8
|
|||
&& fadergba == exc->fadergba
|
||||
&& fadestart == exc->fadestart
|
||||
&& fadeend == exc->fadeend
|
||||
&& fog == exc->fog
|
||||
&& flags == exc->flags
|
||||
#ifdef EXTRACOLORMAPLUMPS
|
||||
&& (lump != LUMPERROR && lump == exc->lump)
|
||||
#endif
|
||||
|
@ -2001,9 +2001,9 @@ extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8
|
|||
extracolormap_t *R_GetColormapFromList(extracolormap_t *extra_colormap)
|
||||
{
|
||||
#ifdef EXTRACOLORMAPLUMPS
|
||||
return R_GetColormapFromListByValues(extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->fog, extra_colormap->lump);
|
||||
return R_GetColormapFromListByValues(extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->flags, extra_colormap->lump);
|
||||
#else
|
||||
return R_GetColormapFromListByValues(extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->fog);
|
||||
return R_GetColormapFromListByValues(extra_colormap->rgba, extra_colormap->fadergba, extra_colormap->fadestart, extra_colormap->fadeend, extra_colormap->flags);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -2035,7 +2035,7 @@ extracolormap_t *R_ColormapForName(char *name)
|
|||
// is no real way to tell how GL should handle a colormap lump anyway..
|
||||
exc->fadestart = 0;
|
||||
exc->fadeend = 31;
|
||||
exc->fog = 0;
|
||||
exc->flags = 0;
|
||||
exc->rgba = 0;
|
||||
exc->fadergba = 0x19000000;
|
||||
|
||||
|
@ -2192,7 +2192,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
|||
// default values
|
||||
UINT8 cr = 0, cg = 0, cb = 0, ca = 0, cfr = 0, cfg = 0, cfb = 0, cfa = 25;
|
||||
UINT32 fadestart = 0, fadeend = 31;
|
||||
UINT8 fog = 0;
|
||||
UINT8 flags = 0;
|
||||
INT32 rgba = 0, fadergba = 0x19000000;
|
||||
|
||||
#define HEX2INT(x) (UINT32)(x >= '0' && x <= '9' ? x - '0' : x >= 'a' && x <= 'f' ? x - 'a' + 10 : x >= 'A' && x <= 'F' ? x - 'A' + 10 : 0)
|
||||
|
@ -2241,12 +2241,12 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
|||
|
||||
#define NUMFROMCHAR(c) (c >= '0' && c <= '9' ? c - '0' : 0)
|
||||
|
||||
// Get parameters like fadestart, fadeend, and the fogflag
|
||||
// Get parameters like fadestart, fadeend, and flags
|
||||
if (p2[0] == '#')
|
||||
{
|
||||
if (p2[1])
|
||||
{
|
||||
fog = NUMFROMCHAR(p2[1]);
|
||||
flags = NUMFROMCHAR(p2[1]);
|
||||
if (p2[2] && p2[3])
|
||||
{
|
||||
fadestart = NUMFROMCHAR(p2[3]) + (NUMFROMCHAR(p2[2]) * 10);
|
||||
|
@ -2313,18 +2313,18 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
|||
|
||||
// Did we just make a default colormap?
|
||||
#ifdef EXTRACOLORMAPLUMPS
|
||||
if (R_CheckDefaultColormapByValues(true, true, true, rgba, fadergba, fadestart, fadeend, fog, LUMPERROR))
|
||||
if (R_CheckDefaultColormapByValues(true, true, true, rgba, fadergba, fadestart, fadeend, flags, LUMPERROR))
|
||||
return NULL;
|
||||
#else
|
||||
if (R_CheckDefaultColormapByValues(true, true, true, rgba, fadergba, fadestart, fadeend, fog))
|
||||
if (R_CheckDefaultColormapByValues(true, true, true, rgba, fadergba, fadestart, fadeend, flags))
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
// Look for existing colormaps
|
||||
#ifdef EXTRACOLORMAPLUMPS
|
||||
exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, fog, LUMPERROR);
|
||||
exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, flags, LUMPERROR);
|
||||
#else
|
||||
exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, fog);
|
||||
exc = R_GetColormapFromListByValues(rgba, fadergba, fadestart, fadeend, flags);
|
||||
#endif
|
||||
if (exc)
|
||||
return exc;
|
||||
|
@ -2336,7 +2336,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
|||
|
||||
extra_colormap->fadestart = (UINT16)fadestart;
|
||||
extra_colormap->fadeend = (UINT16)fadeend;
|
||||
extra_colormap->fog = fog;
|
||||
extra_colormap->flags = flags;
|
||||
|
||||
extra_colormap->rgba = rgba;
|
||||
extra_colormap->fadergba = fadergba;
|
||||
|
@ -2363,7 +2363,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
|||
extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend,
|
||||
boolean subR, boolean subG, boolean subB, boolean subA,
|
||||
boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA,
|
||||
boolean subFadeStart, boolean subFadeEnd, boolean ignoreFog,
|
||||
boolean subFadeStart, boolean subFadeEnd, boolean ignoreFlags,
|
||||
boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha,
|
||||
boolean lighttable)
|
||||
{
|
||||
|
@ -2451,8 +2451,8 @@ extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *ex
|
|||
// HACK: fadeend defaults to 31, so don't add anything in this case
|
||||
, 31), 0);
|
||||
|
||||
if (!ignoreFog) // overwrite fog with new value
|
||||
exc_augend->fog = exc_addend->fog;
|
||||
if (!ignoreFlags) // overwrite flags with new value
|
||||
exc_augend->flags = exc_addend->flags;
|
||||
|
||||
///////////////////
|
||||
// put it together
|
||||
|
|
10
src/r_data.h
10
src/r_data.h
|
@ -135,12 +135,12 @@ void R_AddColormapToList(extracolormap_t *extra_colormap);
|
|||
|
||||
#ifdef EXTRACOLORMAPLUMPS
|
||||
boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams,
|
||||
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog, lumpnum_t lump);
|
||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog, lumpnum_t lump);
|
||||
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags, lumpnum_t lump);
|
||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags, lumpnum_t lump);
|
||||
#else
|
||||
boolean R_CheckDefaultColormapByValues(boolean checkrgba, boolean checkfadergba, boolean checkparams,
|
||||
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog);
|
||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 fog);
|
||||
INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags);
|
||||
extracolormap_t *R_GetColormapFromListByValues(INT32 rgba, INT32 fadergba, UINT8 fadestart, UINT8 fadeend, UINT8 flags);
|
||||
#endif
|
||||
boolean R_CheckDefaultColormap(extracolormap_t *extra_colormap, boolean checkrgba, boolean checkfadergba, boolean checkparams);
|
||||
boolean R_CheckEqualColormaps(extracolormap_t *exc_a, extracolormap_t *exc_b, boolean checkrgba, boolean checkfadergba, boolean checkparams);
|
||||
|
@ -151,7 +151,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3);
|
|||
extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend,
|
||||
boolean subR, boolean subG, boolean subB, boolean subA,
|
||||
boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA,
|
||||
boolean subFadeStart, boolean subFadeEnd, boolean ignoreFog,
|
||||
boolean subFadeStart, boolean subFadeEnd, boolean ignoreFlags,
|
||||
boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha,
|
||||
boolean lighttable);
|
||||
#ifdef EXTRACOLORMAPLUMPS
|
||||
|
|
|
@ -53,11 +53,14 @@ typedef struct
|
|||
// Could even use more than 32 levels.
|
||||
typedef UINT8 lighttable_t;
|
||||
|
||||
#define CMF_FADEFULLBRIGHTSPRITES 1
|
||||
#define CMF_FOG 4
|
||||
|
||||
// ExtraColormap type. Use for extra_colormaps from now on.
|
||||
typedef struct extracolormap_s
|
||||
{
|
||||
UINT8 fadestart, fadeend;
|
||||
UINT8 fog; // categorical value, not boolean
|
||||
UINT8 flags;
|
||||
|
||||
// store rgba values in combined bitwise
|
||||
// also used in OpenGL instead lighttables
|
||||
|
|
|
@ -44,9 +44,6 @@
|
|||
// Quincunx antialiasing of flats!
|
||||
//#define QUINCUNX
|
||||
|
||||
// good night sweet prince
|
||||
#define SHITPLANESPARENCY
|
||||
|
||||
//SoM: 3/23/2000: Use Boom visplane hashing.
|
||||
|
||||
visplane_t *visplanes[MAXVISPLANES];
|
||||
|
@ -995,11 +992,7 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
else // Opaque, but allow transparent flat pixels
|
||||
spanfunctype = SPANDRAWFUNC_SPLAT;
|
||||
|
||||
#ifdef SHITPLANESPARENCY
|
||||
if ((spanfunctype == SPANDRAWFUNC_SPLAT) != (pl->extra_colormap && (pl->extra_colormap->fog & 4)))
|
||||
#else
|
||||
if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2))
|
||||
#endif
|
||||
if ((spanfunctype == SPANDRAWFUNC_SPLAT) || (pl->extra_colormap && (pl->extra_colormap->flags & CMF_FOG)))
|
||||
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
else
|
||||
light = LIGHTLEVELS-1;
|
||||
|
@ -1053,11 +1046,7 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
else // Opaque, but allow transparent flat pixels
|
||||
spanfunctype = SPANDRAWFUNC_SPLAT;
|
||||
|
||||
#ifdef SHITPLANESPARENCY
|
||||
if ((spanfunctype == SPANDRAWFUNC_SPLAT) != (pl->extra_colormap && (pl->extra_colormap->fog & 4)))
|
||||
#else
|
||||
if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2))
|
||||
#endif
|
||||
if ((spanfunctype == SPANDRAWFUNC_SPLAT) || (pl->extra_colormap && (pl->extra_colormap->flags & CMF_FOG)))
|
||||
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
else
|
||||
light = LIGHTLEVELS-1;
|
||||
|
|
30
src/r_segs.c
30
src/r_segs.c
|
@ -418,14 +418,14 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
|||
rlight->extra_colormap = *light->extra_colormap;
|
||||
rlight->flags = light->flags;
|
||||
|
||||
if (rlight->flags & FF_FOG || (rlight->extra_colormap && rlight->extra_colormap->fog))
|
||||
if ((colfunc != colfuncs[COLDRAWFUNC_FUZZY])
|
||||
|| (rlight->flags & FF_FOG)
|
||||
|| (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG)))
|
||||
lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
|
||||
else if (colfunc == colfuncs[COLDRAWFUNC_FUZZY])
|
||||
lightnum = LIGHTLEVELS - 1;
|
||||
else
|
||||
lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
|
||||
lightnum = LIGHTLEVELS - 1;
|
||||
|
||||
if (rlight->extra_colormap && rlight->extra_colormap->fog)
|
||||
if (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG))
|
||||
;
|
||||
else if (curline->v1->y == curline->v2->y)
|
||||
lightnum--;
|
||||
|
@ -437,18 +437,14 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (colfunc == colfuncs[COLDRAWFUNC_FUZZY])
|
||||
{
|
||||
if (frontsector->extra_colormap && frontsector->extra_colormap->fog)
|
||||
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
|
||||
else
|
||||
lightnum = LIGHTLEVELS - 1;
|
||||
}
|
||||
else
|
||||
if ((colfunc != colfuncs[COLDRAWFUNC_FUZZY])
|
||||
|| frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG))
|
||||
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
|
||||
else
|
||||
lightnum = LIGHTLEVELS - 1;
|
||||
|
||||
if (colfunc == colfuncs[COLDRAWFUNC_FOG]
|
||||
|| (frontsector->extra_colormap && frontsector->extra_colormap->fog))
|
||||
|| (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)))
|
||||
;
|
||||
else if (curline->v1->y == curline->v2->y)
|
||||
lightnum--;
|
||||
|
@ -947,7 +943,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
|||
else
|
||||
rlight->lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
|
||||
|
||||
if (pfloor->flags & FF_FOG || rlight->flags & FF_FOG || (rlight->extra_colormap && rlight->extra_colormap->fog))
|
||||
if (pfloor->flags & FF_FOG || rlight->flags & FF_FOG || (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG)))
|
||||
;
|
||||
else if (curline->v1->y == curline->v2->y)
|
||||
rlight->lightnum--;
|
||||
|
@ -962,7 +958,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
|||
else
|
||||
{
|
||||
// Get correct light level!
|
||||
if ((frontsector->extra_colormap && frontsector->extra_colormap->fog))
|
||||
if ((frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)))
|
||||
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
|
||||
else if (pfloor->flags & FF_FOG)
|
||||
lightnum = (pfloor->master->frontsector->lightlevel >> LIGHTSEGSHIFT);
|
||||
|
@ -972,7 +968,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
|||
lightnum = R_FakeFlat(frontsector, &tempsec, &templight, &templight, false)
|
||||
->lightlevel >> LIGHTSEGSHIFT;
|
||||
|
||||
if (pfloor->flags & FF_FOG || (frontsector->extra_colormap && frontsector->extra_colormap->fog));
|
||||
if (pfloor->flags & FF_FOG || (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)));
|
||||
else if (curline->v1->y == curline->v2->y)
|
||||
lightnum--;
|
||||
else if (curline->v1->x == curline->v2->x)
|
||||
|
|
|
@ -1094,8 +1094,8 @@ static void R_SplitSprite(vissprite_t *sprite)
|
|||
|
||||
newsprite->extra_colormap = *sector->lightlist[i].extra_colormap;
|
||||
|
||||
if (!((newsprite->cut & SC_FULLBRIGHT)
|
||||
&& (!newsprite->extra_colormap || !(newsprite->extra_colormap->fog & 1))))
|
||||
if (!(newsprite->cut & SC_FULLBRIGHT)
|
||||
|| (newsprite->extra_colormap && (newsprite->extra_colormap->flags & CMF_FADEFULLBRIGHTSPRITES)))
|
||||
{
|
||||
lindex = FixedMul(sprite->xscale, FixedDiv(640, vid.width))>>(LIGHTSCALESHIFT);
|
||||
|
||||
|
@ -1882,7 +1882,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
vis->cut |= SC_FULLBRIGHT;
|
||||
|
||||
if (vis->cut & SC_FULLBRIGHT
|
||||
&& (!vis->extra_colormap || !(vis->extra_colormap->fog & 1)))
|
||||
&& (!vis->extra_colormap || !(vis->extra_colormap->flags & CMF_FADEFULLBRIGHTSPRITES)))
|
||||
{
|
||||
// full bright: goggles
|
||||
vis->colormap = colormaps;
|
||||
|
|
Loading…
Reference in a new issue