From 63f1fb73dd2b10ad87987f7b866b6dc1869c1be2 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Wed, 2 Jun 2021 15:03:08 +0300 Subject: [PATCH] Fix table background color and image draw order --- nel/src/gui/group_table.cpp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/nel/src/gui/group_table.cpp b/nel/src/gui/group_table.cpp index 2144d0020..6b1d320aa 100644 --- a/nel/src/gui/group_table.cpp +++ b/nel/src/gui/group_table.cpp @@ -514,7 +514,24 @@ namespace NLGUI { CViewRenderer &rVR = *CViewRenderer::getInstance(); + // flush draw queue to force correct draw order for color+image + rVR.flush(); + 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()) { CRGBA col = CRGBA::White; @@ -540,19 +557,6 @@ namespace NLGUI 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) rVR.flush(); } @@ -1502,6 +1506,10 @@ namespace NLGUI bool flush = false; 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) { CRGBA finalColor = BgColor; @@ -1539,7 +1547,6 @@ namespace NLGUI flush = true; } - // flush background color and image if (flush) rVR.flush();