Add fadestart/fadeend/fog to R_AddColormaps
This commit is contained in:
parent
92a97fb1a6
commit
133c3598a7
32
src/r_data.c
32
src/r_data.c
|
@ -1901,6 +1901,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
|
||||||
extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend,
|
extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend,
|
||||||
boolean subR, boolean subG, boolean subB, boolean subA,
|
boolean subR, boolean subG, boolean subB, boolean subA,
|
||||||
boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA,
|
boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA,
|
||||||
|
boolean subFadeStart, boolean subFadeEnd, boolean ignoreFog,
|
||||||
boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha,
|
boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha,
|
||||||
boolean lighttable)
|
boolean lighttable)
|
||||||
{
|
{
|
||||||
|
@ -1917,7 +1918,10 @@ extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *ex
|
||||||
|
|
||||||
INT16 red, green, blue, alpha;
|
INT16 red, green, blue, alpha;
|
||||||
|
|
||||||
|
///////////////////
|
||||||
// base rgba
|
// base rgba
|
||||||
|
///////////////////
|
||||||
|
|
||||||
red = max(min(
|
red = max(min(
|
||||||
R_GetRgbaR(exc_augend->rgba)
|
R_GetRgbaR(exc_augend->rgba)
|
||||||
+ (subR ? -1 : 1) // subtract R
|
+ (subR ? -1 : 1) // subtract R
|
||||||
|
@ -1941,7 +1945,10 @@ extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *ex
|
||||||
|
|
||||||
exc_augend->rgba = R_PutRgbaRGBA(red, green, blue, alpha);
|
exc_augend->rgba = R_PutRgbaRGBA(red, green, blue, alpha);
|
||||||
|
|
||||||
// fade rgba
|
///////////////////
|
||||||
|
// fade/dark rgba
|
||||||
|
///////////////////
|
||||||
|
|
||||||
red = max(min(
|
red = max(min(
|
||||||
R_GetRgbaR(exc_augend->fadergba)
|
R_GetRgbaR(exc_augend->fadergba)
|
||||||
+ (subFadeR ? -1 : 1) // subtract R
|
+ (subFadeR ? -1 : 1) // subtract R
|
||||||
|
@ -1967,6 +1974,29 @@ extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *ex
|
||||||
|
|
||||||
exc_augend->fadergba = R_PutRgbaRGBA(red, green, blue, alpha);
|
exc_augend->fadergba = R_PutRgbaRGBA(red, green, blue, alpha);
|
||||||
|
|
||||||
|
///////////////////
|
||||||
|
// parameters
|
||||||
|
///////////////////
|
||||||
|
|
||||||
|
exc_augend->fadestart = max(min(
|
||||||
|
exc_augend->fadestart
|
||||||
|
+ (subFadeStart ? -1 : 1) // subtract fadestart
|
||||||
|
* exc_addend->fadestart
|
||||||
|
, 31), 0);
|
||||||
|
|
||||||
|
exc_augend->fadeend = max(min(
|
||||||
|
exc_augend->fadeend
|
||||||
|
+ (subFadeEnd ? -1 : 1) // subtract fadeend
|
||||||
|
* exc_addend->fadeend
|
||||||
|
, 31), 0);
|
||||||
|
|
||||||
|
if (!ignoreFog) // overwrite fog with new value
|
||||||
|
exc_augend->fog = exc_addend->fog;
|
||||||
|
|
||||||
|
///////////////////
|
||||||
|
// put it together
|
||||||
|
///////////////////
|
||||||
|
|
||||||
if (!(exc = R_GetColormapFromList(exc_augend)))
|
if (!(exc = R_GetColormapFromList(exc_augend)))
|
||||||
{
|
{
|
||||||
exc_augend->colormap = lighttable ? R_CreateLightTable(exc_augend) : NULL;
|
exc_augend->colormap = lighttable ? R_CreateLightTable(exc_augend) : NULL;
|
||||||
|
|
|
@ -128,6 +128,7 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3);
|
||||||
extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend,
|
extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *exc_addend,
|
||||||
boolean subR, boolean subG, boolean subB, boolean subA,
|
boolean subR, boolean subG, boolean subB, boolean subA,
|
||||||
boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA,
|
boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA,
|
||||||
|
boolean subFadeStart, boolean subFadeEnd, boolean ignoreFog,
|
||||||
boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha,
|
boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha,
|
||||||
boolean lighttable);
|
boolean lighttable);
|
||||||
#ifdef EXTRACOLORMAPLUMPS
|
#ifdef EXTRACOLORMAPLUMPS
|
||||||
|
|
Loading…
Reference in New Issue