Fix table background color and image draw order

develop
Nimetu 4 years ago
parent a040f7a2a8
commit 63f1fb73dd

@ -514,7 +514,24 @@ namespace NLGUI
{ {
CViewRenderer &rVR = *CViewRenderer::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance();
// flush draw queue to force correct draw order for color+image
rVR.flush();
bool flush = false; bool flush = false;
if (BgColor.A > 0)
{
CRGBA finalColor = BgColor;
if (_ModulateGlobalColor)
finalColor.modulateFromColor (finalColor, CWidgetManager::getInstance()->getGlobalColor());
finalColor.A = (uint8) (((uint16) CurrentAlpha * (uint16) finalColor.A) >> 8);
if (finalColor.A > 0)
rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, _WReal, _HReal, 0, false, rVR.getBlankTextureId(), finalColor);
flush = true;
}
if (CurrentAlpha > 0 && !_TextureId.empty()) if (CurrentAlpha > 0 && !_TextureId.empty())
{ {
CRGBA col = CRGBA::White; CRGBA col = CRGBA::White;
@ -540,19 +557,6 @@ namespace NLGUI
flush = true; flush = true;
} }
if (BgColor.A > 0)
{
CRGBA finalColor = BgColor;
if (_ModulateGlobalColor)
finalColor.modulateFromColor (finalColor, CWidgetManager::getInstance()->getGlobalColor());
finalColor.A = (uint8) (((uint16) CurrentAlpha * (uint16) finalColor.A) >> 8);
if (finalColor.A > 0)
rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, _WReal, _HReal, 0, false, rVR.getBlankTextureId(), finalColor);
flush = true;
}
if (flush) if (flush)
rVR.flush(); rVR.flush();
} }
@ -1502,6 +1506,10 @@ namespace NLGUI
bool flush = false; bool flush = false;
CViewRenderer &rVR = *CViewRenderer::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance();
// flush draw queue to force correct draw order for color+image
if (BgColor.A >0 || !_TextureId.empty())
rVR.flush();
if (BgColor.A > 0) if (BgColor.A > 0)
{ {
CRGBA finalColor = BgColor; CRGBA finalColor = BgColor;
@ -1539,7 +1547,6 @@ namespace NLGUI
flush = true; flush = true;
} }
// flush background color and image
if (flush) if (flush)
rVR.flush(); rVR.flush();

Loading…
Cancel
Save