mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-25 13:31:07 +00:00
Fix vid_hw2d 0 rendering glitch
This commit is contained in:
parent
49e890f212
commit
2534e80a19
2 changed files with 38 additions and 16 deletions
|
@ -2689,6 +2689,8 @@ ESPSResult R_SetPatchStyle (FRenderStyle style, fixed_t alpha, int translation,
|
|||
alpha = clamp<fixed_t> (alpha, 0, OPAQUE);
|
||||
}
|
||||
|
||||
if (translation != -1)
|
||||
{
|
||||
dc_translation = NULL;
|
||||
if (translation != 0)
|
||||
{
|
||||
|
@ -2701,6 +2703,7 @@ ESPSResult R_SetPatchStyle (FRenderStyle style, fixed_t alpha, int translation,
|
|||
dc_translation = table->Remap;
|
||||
}
|
||||
}
|
||||
}
|
||||
basecolormapsave = basecolormap;
|
||||
hcolfunc_pre = R_DrawColumnHoriz;
|
||||
|
||||
|
@ -2801,10 +2804,11 @@ bool R_GetTransMaskDrawers (fixed_t (**tmvline1)(), void (**tmvline4)())
|
|||
|
||||
void R_SetTranslationMap(lighttable_t *translation)
|
||||
{
|
||||
dc_fcolormap = nullptr;
|
||||
dc_colormap = translation;
|
||||
if (r_swtruecolor)
|
||||
{
|
||||
dc_fcolormap = nullptr;
|
||||
dc_colormap = nullptr;
|
||||
dc_translation = translation;
|
||||
dc_shade_constants.light_red = 256;
|
||||
dc_shade_constants.light_green = 256;
|
||||
dc_shade_constants.light_blue = 256;
|
||||
|
@ -2817,6 +2821,11 @@ void R_SetTranslationMap(lighttable_t *translation)
|
|||
dc_shade_constants.simple_shade = true;
|
||||
dc_light = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dc_fcolormap = nullptr;
|
||||
dc_colormap = translation;
|
||||
}
|
||||
}
|
||||
|
||||
void R_SetColorMapLight(FSWColormap *base_colormap, float light, int shade)
|
||||
|
|
|
@ -169,12 +169,18 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms)
|
|||
parms.colorOverlay = PalEntry(parms.colorOverlay).InverseColor();
|
||||
}
|
||||
// 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);
|
||||
translation = &colormap->Maps[(APART(parms.colorOverlay)*NUMCOLORMAPS/255)*256];
|
||||
if (!r_swtruecolor)
|
||||
{
|
||||
FDynamicColormap *colormap = GetSpecialLights(MAKERGB(255, 255, 255),
|
||||
parms.colorOverlay & MAKEARGB(0, 255, 255, 255), 0);
|
||||
translation = &colormap->Maps[(APART(parms.colorOverlay)*NUMCOLORMAPS / 255) * 256];
|
||||
}
|
||||
}
|
||||
else if (parms.remap != NULL)
|
||||
{
|
||||
if (r_swtruecolor)
|
||||
translation = (const BYTE*)parms.remap->Palette;
|
||||
else
|
||||
translation = parms.remap->Remap;
|
||||
}
|
||||
|
||||
|
@ -184,11 +190,18 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (r_swtruecolor)
|
||||
R_SetTranslationMap(nullptr);
|
||||
else
|
||||
R_SetTranslationMap(identitymap);
|
||||
}
|
||||
|
||||
fixedcolormap = dc_fcolormap;
|
||||
ESPSResult mode = R_SetPatchStyle (parms.style, parms.Alpha, 0, parms.fillcolor);
|
||||
ESPSResult mode;
|
||||
if (r_swtruecolor)
|
||||
mode = R_SetPatchStyle(parms.style, parms.Alpha, -1, parms.fillcolor);
|
||||
else
|
||||
mode = R_SetPatchStyle(parms.style, parms.Alpha, 0, parms.fillcolor);
|
||||
|
||||
BYTE *destorgsave = dc_destorg;
|
||||
dc_destorg = screen->GetBuffer();
|
||||
|
|
Loading…
Reference in a new issue