mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-13 16:07:45 +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,16 +2689,19 @@ ESPSResult R_SetPatchStyle (FRenderStyle style, fixed_t alpha, int translation,
|
||||||
alpha = clamp<fixed_t> (alpha, 0, OPAQUE);
|
alpha = clamp<fixed_t> (alpha, 0, OPAQUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
dc_translation = NULL;
|
if (translation != -1)
|
||||||
if (translation != 0)
|
|
||||||
{
|
{
|
||||||
FRemapTable *table = TranslationToTable(translation);
|
dc_translation = NULL;
|
||||||
if (table != NULL && !table->Inactive)
|
if (translation != 0)
|
||||||
{
|
{
|
||||||
if (r_swtruecolor)
|
FRemapTable *table = TranslationToTable(translation);
|
||||||
dc_translation = (BYTE*)table->Palette;
|
if (table != NULL && !table->Inactive)
|
||||||
else
|
{
|
||||||
dc_translation = table->Remap;
|
if (r_swtruecolor)
|
||||||
|
dc_translation = (BYTE*)table->Palette;
|
||||||
|
else
|
||||||
|
dc_translation = table->Remap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
basecolormapsave = basecolormap;
|
basecolormapsave = basecolormap;
|
||||||
|
@ -2801,10 +2804,11 @@ bool R_GetTransMaskDrawers (fixed_t (**tmvline1)(), void (**tmvline4)())
|
||||||
|
|
||||||
void R_SetTranslationMap(lighttable_t *translation)
|
void R_SetTranslationMap(lighttable_t *translation)
|
||||||
{
|
{
|
||||||
dc_fcolormap = nullptr;
|
|
||||||
dc_colormap = translation;
|
|
||||||
if (r_swtruecolor)
|
if (r_swtruecolor)
|
||||||
{
|
{
|
||||||
|
dc_fcolormap = nullptr;
|
||||||
|
dc_colormap = nullptr;
|
||||||
|
dc_translation = translation;
|
||||||
dc_shade_constants.light_red = 256;
|
dc_shade_constants.light_red = 256;
|
||||||
dc_shade_constants.light_green = 256;
|
dc_shade_constants.light_green = 256;
|
||||||
dc_shade_constants.light_blue = 256;
|
dc_shade_constants.light_blue = 256;
|
||||||
|
@ -2817,6 +2821,11 @@ void R_SetTranslationMap(lighttable_t *translation)
|
||||||
dc_shade_constants.simple_shade = true;
|
dc_shade_constants.simple_shade = true;
|
||||||
dc_light = 0;
|
dc_light = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dc_fcolormap = nullptr;
|
||||||
|
dc_colormap = translation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void R_SetColorMapLight(FSWColormap *base_colormap, float light, int shade)
|
void R_SetColorMapLight(FSWColormap *base_colormap, float light, int shade)
|
||||||
|
|
|
@ -169,13 +169,19 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms)
|
||||||
parms.colorOverlay = PalEntry(parms.colorOverlay).InverseColor();
|
parms.colorOverlay = PalEntry(parms.colorOverlay).InverseColor();
|
||||||
}
|
}
|
||||||
// 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),
|
if (!r_swtruecolor)
|
||||||
parms.colorOverlay & MAKEARGB(0,255,255,255), 0);
|
{
|
||||||
translation = &colormap->Maps[(APART(parms.colorOverlay)*NUMCOLORMAPS/255)*256];
|
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)
|
else if (parms.remap != NULL)
|
||||||
{
|
{
|
||||||
translation = parms.remap->Remap;
|
if (r_swtruecolor)
|
||||||
|
translation = (const BYTE*)parms.remap->Palette;
|
||||||
|
else
|
||||||
|
translation = parms.remap->Remap;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (translation != NULL)
|
if (translation != NULL)
|
||||||
|
@ -184,11 +190,18 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
R_SetTranslationMap(identitymap);
|
if (r_swtruecolor)
|
||||||
|
R_SetTranslationMap(nullptr);
|
||||||
|
else
|
||||||
|
R_SetTranslationMap(identitymap);
|
||||||
}
|
}
|
||||||
|
|
||||||
fixedcolormap = dc_fcolormap;
|
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;
|
BYTE *destorgsave = dc_destorg;
|
||||||
dc_destorg = screen->GetBuffer();
|
dc_destorg = screen->GetBuffer();
|
||||||
|
|
Loading…
Reference in a new issue