mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Convert UDMF colormap light/fade alpha to new 0-255 range
This commit is contained in:
parent
78b8f5851b
commit
1756fabef0
1 changed files with 10 additions and 6 deletions
|
@ -2976,22 +2976,26 @@ static void P_LoadTextmap(void)
|
|||
P_InitializeSector(sc);
|
||||
if (textmap_colormap.used)
|
||||
{
|
||||
INT32 rgba = P_ColorToRGBA(textmap_colormap.lightcolor, textmap_colormap.lightalpha);
|
||||
INT32 fadergba = P_ColorToRGBA(textmap_colormap.fadecolor, textmap_colormap.fadealpha);
|
||||
// Convert alpha values from old 0-25 (A-Z) range to 0-255 range
|
||||
UINT8 lightalpha = (textmap_colormap.lightalpha * 102) / 10;
|
||||
UINT8 fadealpha = (textmap_colormap.fadealpha * 102) / 10;
|
||||
|
||||
INT32 rgba = P_ColorToRGBA(textmap_colormap.lightcolor, lightalpha);
|
||||
INT32 fadergba = P_ColorToRGBA(textmap_colormap.fadecolor, fadealpha);
|
||||
sc->extra_colormap = sc->spawn_extra_colormap = R_CreateColormap(rgba, fadergba, textmap_colormap.fadestart, textmap_colormap.fadeend, textmap_colormap.flags);
|
||||
}
|
||||
|
||||
if (textmap_planefloor.defined == (PD_A|PD_B|PD_C|PD_D))
|
||||
{
|
||||
{
|
||||
sc->f_slope = MakeViaEquationConstants(textmap_planefloor.a, textmap_planefloor.b, textmap_planefloor.c, textmap_planefloor.d);
|
||||
sc->hasslope = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (textmap_planeceiling.defined == (PD_A|PD_B|PD_C|PD_D))
|
||||
{
|
||||
{
|
||||
sc->c_slope = MakeViaEquationConstants(textmap_planeceiling.a, textmap_planeceiling.b, textmap_planeceiling.c, textmap_planeceiling.d);
|
||||
sc->hasslope = true;
|
||||
}
|
||||
}
|
||||
|
||||
TextmapFixFlatOffsets(sc);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue