From 03c3621bb4d06547317985ea892c5ab6099f685c Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 22 Apr 2015 22:13:49 -0500 Subject: [PATCH] Use a different var to track unset DTA_FillColor instead of a default value - If palette index 255 happens to be white (e.g. as in Hexen), trying to use white with DTA_FillColor would treat it as if you had never passed it to DrawTexture(). --- src/v_draw.cpp | 4 +++- src/v_video.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/v_draw.cpp b/src/v_draw.cpp index e2890841b..ce502c772 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -333,6 +333,7 @@ bool DCanvas::ParseDrawTextureTags (FTexture *img, double x, double y, DWORD tag int intval; bool translationset = false; bool virtBottom; + bool fillcolorset = false; if (img == NULL || img->UseType == FTexture::TEX_Null) { @@ -539,6 +540,7 @@ bool DCanvas::ParseDrawTextureTags (FTexture *img, double x, double y, DWORD tag case DTA_FillColor: parms->fillcolor = va_arg(tags, uint32); + fillcolorset = true; break; case DTA_Translation: @@ -711,7 +713,7 @@ bool DCanvas::ParseDrawTextureTags (FTexture *img, double x, double y, DWORD tag if (parms->style.BlendOp == 255) { - if (parms->fillcolor != ~0u) + if (fillcolorset) { if (parms->alphaChannel) { diff --git a/src/v_video.h b/src/v_video.h index 5250cdaa9..7593b7b4b 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -74,7 +74,7 @@ enum DTA_DestWidth, // width of area to draw to DTA_DestHeight, // height of area to draw to DTA_Alpha, // alpha value for translucency - DTA_FillColor, // color to stencil onto the destination + DTA_FillColor, // color to stencil onto the destination (RGB is the color for truecolor drawers, A is the palette index for paletted drawers) DTA_Translation, // translation table to recolor the source DTA_AlphaChannel, // bool: the source is an alpha channel; used with DTA_FillColor DTA_Clean, // bool: scale texture size and position by CleanXfac and CleanYfac