mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 17:22:12 +00:00
Add fadestart/fadeend/fog to R_AddColormaps
This commit is contained in:
parent
5e59b8c55a
commit
8754268abe
2 changed files with 32 additions and 1 deletions
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,
|
||||
boolean subR, boolean subG, boolean subB, boolean subA,
|
||||
boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA,
|
||||
boolean subFadeStart, boolean subFadeEnd, boolean ignoreFog,
|
||||
boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha,
|
||||
boolean lighttable)
|
||||
{
|
||||
|
@ -1917,7 +1918,10 @@ extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *ex
|
|||
|
||||
INT16 red, green, blue, alpha;
|
||||
|
||||
///////////////////
|
||||
// base rgba
|
||||
///////////////////
|
||||
|
||||
red = max(min(
|
||||
R_GetRgbaR(exc_augend->rgba)
|
||||
+ (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);
|
||||
|
||||
// fade rgba
|
||||
///////////////////
|
||||
// fade/dark rgba
|
||||
///////////////////
|
||||
|
||||
red = max(min(
|
||||
R_GetRgbaR(exc_augend->fadergba)
|
||||
+ (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);
|
||||
|
||||
///////////////////
|
||||
// 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)))
|
||||
{
|
||||
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,
|
||||
boolean subR, boolean subG, boolean subB, boolean subA,
|
||||
boolean subFadeR, boolean subFadeG, boolean subFadeB, boolean subFadeA,
|
||||
boolean subFadeStart, boolean subFadeEnd, boolean ignoreFog,
|
||||
boolean useAltAlpha, INT16 altAlpha, INT16 altFadeAlpha,
|
||||
boolean lighttable);
|
||||
#ifdef EXTRACOLORMAPLUMPS
|
||||
|
|
Loading…
Reference in a new issue