diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 39b44e19e..e10bcb43d 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,8 +1,7 @@ October 29, 2009 +- Fixed: Sprites and decals that are drawn with addition must fade to black. - Make TranslateToStartSpot() set the new sector references for a polyobj's walls so that P_CheckSwitchRange() will work with them. -- Fixed: If P_ActivateLine() failed in P_UseTraverse() it would not play - the *usefail sound. - Fixed: An unspecified save_dir will now save to the program directory on Windows. (Other operating systems already use the user's home directory instead.) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 139167c5b..b654c4779 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -2432,14 +2432,21 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper, // Prepare lighting calclighting = false; + FDynamicColormap *usecolormap = basecolormap; + + // Decals that are added to the scene must fade to black. + if (decal->RenderStyle.BlendOp == STYLEOP_Add && usecolormap->Fade != 0) + { + usecolormap = GetSpecialLights(usecolormap->Color, 0, usecolormap->Desaturate); + } rw_light = rw_lightleft + (x1 - WallSX1) * rw_lightstep; if (fixedlightlev >= 0) - dc_colormap = basecolormap->Maps + fixedlightlev; + dc_colormap = usecolormap->Maps + fixedlightlev; else if (fixedcolormap != NULL) dc_colormap = fixedcolormap; else if (!foggy && (decal->RenderFlags & RF_FULLBRIGHT)) - dc_colormap = basecolormap->Maps; + dc_colormap = usecolormap->Maps; else calclighting = true; @@ -2486,7 +2493,7 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper, { if (calclighting) { // calculate lighting - dc_colormap = basecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT); + dc_colormap = usecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT); } WallSpriteColumn (R_DrawMaskedColumn); @@ -2497,7 +2504,7 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper, { if (calclighting) { // calculate lighting - dc_colormap = basecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT); + dc_colormap = usecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT); } rt_initcols(); for (int zz = 4; zz; --zz) @@ -2512,7 +2519,7 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper, { if (calclighting) { // calculate lighting - dc_colormap = basecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT); + dc_colormap = usecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT); } WallSpriteColumn (R_DrawMaskedColumn); diff --git a/src/r_things.cpp b/src/r_things.cpp index 5f88793e6..2eb5bdafd 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -1432,6 +1432,12 @@ void R_ProjectSprite (AActor *thing, int fakeside) FDynamicColormap *mybasecolormap = basecolormap; + // Sprites that are added to the scene must fade to black. + if (vis->RenderStyle.BlendOp == STYLEOP_Add && mybasecolormap->Fade != 0) + { + mybasecolormap = GetSpecialLights(mybasecolormap->Color, 0, mybasecolormap->Desaturate); + } + if (vis->RenderStyle.Flags & STYLEF_FadeToBlack) { if (invertcolormap)