Fix rendering of specially sized window highlights

This commit is contained in:
kaetemi 2014-10-08 09:31:13 +02:00
parent d2e9352d4c
commit 6ec644e2ba
3 changed files with 24 additions and 18 deletions

View file

@ -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

View file

@ -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);
}

View file

@ -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");