From 6ec644e2bacb3b7799e4b69c212cfc9dcbd01787 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 8 Oct 2014 09:31:13 +0200 Subject: [PATCH] Fix rendering of specially sized window highlights --- code/nel/include/nel/gui/interface_options.h | 16 ++++++++-------- code/nel/src/gui/group_container.cpp | 18 ++++++++---------- code/nel/src/gui/interface_options.cpp | 8 ++++++++ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/code/nel/include/nel/gui/interface_options.h b/code/nel/include/nel/gui/interface_options.h index 6501cd2b0..da0ea7de8 100644 --- a/code/nel/include/nel/gui/interface_options.h +++ b/code/nel/include/nel/gui/interface_options.h @@ -150,14 +150,14 @@ namespace NLGUI sint32 TxId_E_Open, W_E_Open, H_E_Open; sint32 TxId_M_Open, W_M_Open, H_M_Open; - sint32 TxId_TL_HighLight; - sint32 TxId_T_HighLight; - sint32 TxId_TR_HighLight; - sint32 TxId_L_HighLight; - sint32 TxId_R_HighLight; - sint32 TxId_BL_HighLight; - sint32 TxId_B_HighLight; - sint32 TxId_BR_HighLight; + sint32 TxId_TL_HighLight, W_TL_HighLight, H_TL_HighLight; + sint32 TxId_T_HighLight, W_T_HighLight, H_T_HighLight; + sint32 TxId_TR_HighLight, W_TR_HighLight, H_TR_HighLight; + sint32 TxId_L_HighLight, W_L_HighLight, H_L_HighLight; + sint32 TxId_R_HighLight, W_R_HighLight, H_R_HighLight; + sint32 TxId_BL_HighLight, W_BL_HighLight, H_BL_HighLight; + sint32 TxId_B_HighLight, W_B_HighLight, H_B_HighLight; + sint32 TxId_BR_HighLight, W_BR_HighLight, H_BR_HighLight; sint32 HeaderH; sint32 InsetT; // Offset height of top texture diff --git a/code/nel/src/gui/group_container.cpp b/code/nel/src/gui/group_container.cpp index c7d3227e8..5c3a29e8b 100644 --- a/code/nel/src/gui/group_container.cpp +++ b/code/nel/src/gui/group_container.cpp @@ -3003,18 +3003,16 @@ namespace NLGUI col.A = nInverted; else col.A = max(_HighLightedAlpha, nInverted); - sint32 hw, hh; // size of highlight texture - rVR.getTextureSizeFromId(pLayer->TxId_TL_HighLight, hw, hh); // corners - rVR.drawRotFlipBitmap (_RenderLayer, x, y + h - hh, hw, hh, 0, false, pLayer->TxId_TL_HighLight, col); - rVR.drawRotFlipBitmap (_RenderLayer, x + _WReal - hw, y + h - hh, hw, hh, 0, false, pLayer->TxId_TR_HighLight, col); - rVR.drawRotFlipBitmap (_RenderLayer, x, _YReal, hw, hh, 0, false, pLayer->TxId_BL_HighLight, col); - rVR.drawRotFlipBitmap (_RenderLayer, x + _WReal - hw, _YReal, hw, hh, 0, false, pLayer->TxId_BR_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x, y + h - pLayer->H_T_HighLight, pLayer->W_TL_HighLight, pLayer->H_TL_HighLight, 0, false, pLayer->TxId_TL_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x + _WReal - pLayer->W_TR_HighLight, y + h - pLayer->H_T_HighLight, pLayer->W_TR_HighLight, pLayer->H_TR_HighLight, 0, false, pLayer->TxId_TR_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x, _YReal, pLayer->W_BL_HighLight, pLayer->H_BL_HighLight, 0, false, pLayer->TxId_BL_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x + _WReal - pLayer->W_BR_HighLight, _YReal, pLayer->W_BR_HighLight, pLayer->H_BR_HighLight, 0, false, pLayer->TxId_BR_HighLight, col); // border - rVR.drawRotFlipBitmap (_RenderLayer, x + hw, y + h - hh, _WReal - 2 * hw, hh, 0, false, pLayer->TxId_T_HighLight, col); - rVR.drawRotFlipBitmap (_RenderLayer, x + hw, _YReal, _WReal - 2 * hw, hh, 0, false, pLayer->TxId_B_HighLight, col); - rVR.drawRotFlipBitmap (_RenderLayer, x, _YReal + hh, hw, _HReal - 2 * hh, 0, false, pLayer->TxId_L_HighLight, col); - rVR.drawRotFlipBitmap (_RenderLayer, x + _WReal - hw, _YReal + hh, hw, _HReal - 2 * hh, 0, false, pLayer->TxId_R_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x + pLayer->W_TL_HighLight, y + h - pLayer->H_T_HighLight, _WReal - pLayer->W_TL_HighLight - pLayer->W_TR_HighLight, pLayer->H_T_HighLight, 0, false, pLayer->TxId_T_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x + pLayer->W_BL_HighLight, _YReal, _WReal - pLayer->W_BL_HighLight - pLayer->W_BR_HighLight, pLayer->H_B_HighLight, 0, false, pLayer->TxId_B_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x, _YReal + pLayer->H_B_HighLight, pLayer->W_L_HighLight, _HReal - pLayer->H_T_HighLight - pLayer->H_B_HighLight, 0, false, pLayer->TxId_L_HighLight, col); + rVR.drawRotFlipBitmap (_RenderLayer, x + _WReal - pLayer->W_R_HighLight, _YReal + pLayer->H_B_HighLight, pLayer->W_R_HighLight, _HReal - pLayer->H_T_HighLight - pLayer->H_B_HighLight, 0, false, pLayer->TxId_R_HighLight, col); } diff --git a/code/nel/src/gui/interface_options.cpp b/code/nel/src/gui/interface_options.cpp index 70141e0a3..3de015d65 100644 --- a/code/nel/src/gui/interface_options.cpp +++ b/code/nel/src/gui/interface_options.cpp @@ -271,13 +271,21 @@ namespace NLGUI // TxId_TL_HighLight = rVR.getTextureIdFromName (getValStr("tx_tl_highlight")); + rVR.getTextureSizeFromId(TxId_TL_HighLight, W_TL_HighLight, H_TL_HighLight); TxId_T_HighLight = rVR.getTextureIdFromName (getValStr("tx_t_highlight")); + rVR.getTextureSizeFromId(TxId_T_HighLight, W_T_HighLight, H_T_HighLight); TxId_TR_HighLight = rVR.getTextureIdFromName (getValStr("tx_tr_highlight")); + rVR.getTextureSizeFromId(TxId_TR_HighLight, W_TR_HighLight, H_TR_HighLight); TxId_L_HighLight = rVR.getTextureIdFromName (getValStr("tx_l_highlight")); + rVR.getTextureSizeFromId(TxId_L_HighLight, W_L_HighLight, H_L_HighLight); TxId_R_HighLight = rVR.getTextureIdFromName (getValStr("tx_r_highlight")); + rVR.getTextureSizeFromId(TxId_R_HighLight, W_R_HighLight, H_R_HighLight); TxId_BL_HighLight = rVR.getTextureIdFromName (getValStr("tx_bl_highlight")); + rVR.getTextureSizeFromId(TxId_BL_HighLight, W_BL_HighLight, H_BL_HighLight); TxId_B_HighLight = rVR.getTextureIdFromName (getValStr("tx_b_highlight")); + rVR.getTextureSizeFromId(TxId_B_HighLight, W_B_HighLight, H_B_HighLight); TxId_BR_HighLight = rVR.getTextureIdFromName (getValStr("tx_br_highlight")); + rVR.getTextureSizeFromId(TxId_BR_HighLight, W_BR_HighLight, H_BR_HighLight); // HeaderH = getValSInt32("header_h");