- implemented desaturation for the legacy GL renderer's 2D.
A lot of work that's only needed to be able to use the hardware renderer's 2D code with the software renderer.
This commit is contained in:
parent
811d96e07e
commit
832df6d43a
11 changed files with 168 additions and 60 deletions
|
|
@ -180,22 +180,8 @@ bool F2DDrawer::SetStyle(FTexture *tex, DrawParms &parms, PalEntry &vertexcolor,
|
|||
|
||||
if (parms.specialcolormap != nullptr)
|
||||
{ // Emulate an invulnerability or similar colormap.
|
||||
float *start, *end;
|
||||
start = parms.specialcolormap->ColorizeStart;
|
||||
end = parms.specialcolormap->ColorizeEnd;
|
||||
if (quad.mDrawMode == DTM_Invert)
|
||||
{
|
||||
quad.mDrawMode = DTM_Normal;
|
||||
std::swap(start, end);
|
||||
}
|
||||
quad.mFlags |= DTF_SpecialColormap;
|
||||
// SpecialColormap uses the two color uniforms to set its ramp.
|
||||
quad.mColor1.r = (uint8_t)(start[0] * (255 / 2));
|
||||
quad.mColor1.g = (uint8_t)(start[1] * (255 / 2));
|
||||
quad.mColor1.b = (uint8_t)(start[2] * (255 / 2));
|
||||
quad.mColor2.r = (uint8_t)(end[0] * (255 / 2));
|
||||
quad.mColor2.g = (uint8_t)(end[1] * (255 / 2));
|
||||
quad.mColor2.b = (uint8_t)(end[2] * (255 / 2));
|
||||
quad.mSpecialColormap = parms.specialcolormap;
|
||||
quad.mColor1 = 0; // this disables the color overlay.
|
||||
}
|
||||
quad.mDesaturate = parms.desaturate;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue