- fixed: The software 2D drawer expected its translation pointer to be initialized by ParseDrawTextureTags. Removed the variable from DrawParms and made it and its initialization local to the software rendering code.

This commit is contained in:
Christoph Oelckers 2016-04-09 22:56:12 +02:00
parent c79a1b6a45
commit 9a48adf81a
3 changed files with 9 additions and 13 deletions

View file

@ -127,6 +127,7 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms)
FTexture::Span unmaskedSpan[2]; FTexture::Span unmaskedSpan[2];
const FTexture::Span **spanptr, *spans; const FTexture::Span **spanptr, *spans;
static short bottomclipper[MAXWIDTH], topclipper[MAXWIDTH]; static short bottomclipper[MAXWIDTH], topclipper[MAXWIDTH];
const BYTE *translation = NULL;
if (parms.masked) if (parms.masked)
{ {
@ -155,12 +156,16 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms)
// Note that this overrides DTA_Translation in software, but not in hardware. // Note that this overrides DTA_Translation in software, but not in hardware.
FDynamicColormap *colormap = GetSpecialLights(MAKERGB(255,255,255), FDynamicColormap *colormap = GetSpecialLights(MAKERGB(255,255,255),
parms.colorOverlay & MAKEARGB(0,255,255,255), 0); parms.colorOverlay & MAKEARGB(0,255,255,255), 0);
parms.translation = &colormap->Maps[(APART(parms.colorOverlay)*NUMCOLORMAPS/255)*256]; translation = &colormap->Maps[(APART(parms.colorOverlay)*NUMCOLORMAPS/255)*256];
}
else if (parms.remap != NULL)
{
translation = parms.remap->Remap;
} }
if (parms.translation != NULL) if (translation != NULL)
{ {
dc_colormap = (lighttable_t *)parms.translation; dc_colormap = (lighttable_t *)translation;
} }
else else
{ {
@ -421,6 +426,7 @@ bool DCanvas::SetTextureParms(DrawParms *parms, FTexture *img, double xx, double
parms->virtWidth, parms->virtHeight, parms->virtBottom, !parms->keepratio); parms->virtWidth, parms->virtHeight, parms->virtBottom, !parms->keepratio);
} }
} }
return false; return false;
} }
@ -461,7 +467,6 @@ bool DCanvas::ParseDrawTextureTags (FTexture *img, double x, double y, DWORD tag
parms->Alpha = 1.f; parms->Alpha = 1.f;
parms->fillcolor = -1; parms->fillcolor = -1;
parms->remap = NULL; parms->remap = NULL;
parms->translation = NULL;
parms->colorOverlay = 0; parms->colorOverlay = 0;
parms->alphaChannel = false; parms->alphaChannel = false;
parms->flipX = false; parms->flipX = false;
@ -826,11 +831,6 @@ bool DCanvas::ParseDrawTextureTags (FTexture *img, double x, double y, DWORD tag
} }
} }
if (parms->remap != NULL)
{
parms->translation = parms->remap->Remap;
}
if (parms->style.BlendOp == 255) if (parms->style.BlendOp == 255)
{ {
if (fillcolorset) if (fillcolorset)

View file

@ -86,9 +86,6 @@ void STACK_ARGS DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, B
// //
void STACK_ARGS DCanvas::DrawText(FFont *font, int normalcolor, int x, int y, const char *string, int tag_first, ...) void STACK_ARGS DCanvas::DrawText(FFont *font, int normalcolor, int x, int y, const char *string, int tag_first, ...)
{ {
INTBOOL boolval;
uint32 tag;
int w; int w;
const BYTE *ch; const BYTE *ch;
int c; int c;

View file

@ -158,7 +158,6 @@ struct DrawParms
float Alpha; float Alpha;
uint32 fillcolor; uint32 fillcolor;
FRemapTable *remap; FRemapTable *remap;
const BYTE *translation;
uint32 colorOverlay; uint32 colorOverlay;
INTBOOL alphaChannel; INTBOOL alphaChannel;
INTBOOL flipX; INTBOOL flipX;