mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- 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:
parent
c79a1b6a45
commit
9a48adf81a
3 changed files with 9 additions and 13 deletions
|
@ -127,6 +127,7 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms)
|
|||
FTexture::Span unmaskedSpan[2];
|
||||
const FTexture::Span **spanptr, *spans;
|
||||
static short bottomclipper[MAXWIDTH], topclipper[MAXWIDTH];
|
||||
const BYTE *translation = NULL;
|
||||
|
||||
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.
|
||||
FDynamicColormap *colormap = GetSpecialLights(MAKERGB(255,255,255),
|
||||
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
|
||||
{
|
||||
|
@ -421,6 +426,7 @@ bool DCanvas::SetTextureParms(DrawParms *parms, FTexture *img, double xx, double
|
|||
parms->virtWidth, parms->virtHeight, parms->virtBottom, !parms->keepratio);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -461,7 +467,6 @@ bool DCanvas::ParseDrawTextureTags (FTexture *img, double x, double y, DWORD tag
|
|||
parms->Alpha = 1.f;
|
||||
parms->fillcolor = -1;
|
||||
parms->remap = NULL;
|
||||
parms->translation = NULL;
|
||||
parms->colorOverlay = 0;
|
||||
parms->alphaChannel = 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 (fillcolorset)
|
||||
|
|
|
@ -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, ...)
|
||||
{
|
||||
INTBOOL boolval;
|
||||
uint32 tag;
|
||||
|
||||
int w;
|
||||
const BYTE *ch;
|
||||
int c;
|
||||
|
|
|
@ -158,7 +158,6 @@ struct DrawParms
|
|||
float Alpha;
|
||||
uint32 fillcolor;
|
||||
FRemapTable *remap;
|
||||
const BYTE *translation;
|
||||
uint32 colorOverlay;
|
||||
INTBOOL alphaChannel;
|
||||
INTBOOL flipX;
|
||||
|
|
Loading…
Reference in a new issue