mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 18:59:09 +00:00
Modulate text shadow opacity by the alpha of the text color to make the player lists fade properly.
Also, the text of the faded-out player list is re-rendered with alpha == 0 every time the mouse enters its area, do a little less needless work in that case.
This commit is contained in:
@ -1119,6 +1119,8 @@ void plFont::IRenderChar8To32AlphaPremShadow( const plFont::plCharacter &c )
|
|||||||
xstart = -2;
|
xstart = -2;
|
||||||
|
|
||||||
srcA = (UInt8)(( fRenderInfo.fColor >> 24 ) & 0x000000ff);
|
srcA = (UInt8)(( fRenderInfo.fColor >> 24 ) & 0x000000ff);
|
||||||
|
if (srcA == 0)
|
||||||
|
return;
|
||||||
srcR = (UInt8)(( fRenderInfo.fColor >> 16 ) & 0x000000ff);
|
srcR = (UInt8)(( fRenderInfo.fColor >> 16 ) & 0x000000ff);
|
||||||
srcG = (UInt8)(( fRenderInfo.fColor >> 8 ) & 0x000000ff);
|
srcG = (UInt8)(( fRenderInfo.fColor >> 8 ) & 0x000000ff);
|
||||||
srcB = (UInt8)(( fRenderInfo.fColor ) & 0x000000ff);
|
srcB = (UInt8)(( fRenderInfo.fColor ) & 0x000000ff);
|
||||||
@ -1160,7 +1162,10 @@ void plFont::IRenderChar8To32AlphaPremShadow( const plFont::plCharacter &c )
|
|||||||
sa = clamp;
|
sa = clamp;
|
||||||
UInt32 a = IGetCharPixel(c, x, y);
|
UInt32 a = IGetCharPixel(c, x, y);
|
||||||
if (srcA != 0xff)
|
if (srcA != 0xff)
|
||||||
|
{
|
||||||
a = (srcA * a + 127) / 255;
|
a = (srcA * a + 127) / 255;
|
||||||
|
sa = (srcA * sa + 127) / 255;
|
||||||
|
}
|
||||||
UInt32 ta = a + sa - ((a*sa + 127) / 255);
|
UInt32 ta = a + sa - ((a*sa + 127) / 255);
|
||||||
if (ta > (destPtr[ x ] >> 24))
|
if (ta > (destPtr[ x ] >> 24))
|
||||||
destPtr[ x ] = ( ta << 24 ) | (((srcR * a + 127) / 255) << 16) |
|
destPtr[ x ] = ( ta << 24 ) | (((srcR * a + 127) / 255) << 16) |
|
||||||
|
Reference in New Issue
Block a user