From 0370f774245a023f7acb5469c120ceef351a0455 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 21 Jun 2012 23:05:12 +0200 Subject: [PATCH] CHANGED: #1471 CViewBitmap no longer depends on CGroupContainer. --- .../nel/include/nel/gui/group_container_base.h | 7 ++++++- code/nel/src/gui/group_container_base.cpp | 2 ++ .../src/interface_v3/group_container.cpp | 2 -- .../client/src/interface_v3/group_container.h | 6 ------ .../client/src/interface_v3/view_bitmap.cpp | 18 ++++-------------- .../client/src/interface_v3/view_bitmap.h | 1 - 6 files changed, 12 insertions(+), 24 deletions(-) diff --git a/code/nel/include/nel/gui/group_container_base.h b/code/nel/include/nel/gui/group_container_base.h index 988050341..1d228f017 100644 --- a/code/nel/include/nel/gui/group_container_base.h +++ b/code/nel/include/nel/gui/group_container_base.h @@ -81,10 +81,15 @@ namespace NLGUI // Get the header color draw. NB: depends if grayed, and if active. virtual NLMISC::CRGBA getDrawnHeaderColor () const{ return NLMISC::CRGBA(); }; + + uint8 getCurrentContainerAlpha() const{ return _CurrentContainerAlpha; } + uint8 getCurrentContentAlpha() const{ return _CurrentContentAlpha; } protected: void triggerAlphaSettingsChangedAH(); - + + uint8 _CurrentContainerAlpha; + uint8 _CurrentContentAlpha; uint8 _ContainerAlpha; uint8 _ContentAlpha; uint8 _RolloverAlphaContainer; // Alpha for the window when mouse not over it diff --git a/code/nel/src/gui/group_container_base.cpp b/code/nel/src/gui/group_container_base.cpp index 7ef134c8a..315c03862 100644 --- a/code/nel/src/gui/group_container_base.cpp +++ b/code/nel/src/gui/group_container_base.cpp @@ -23,6 +23,8 @@ namespace NLGUI CGroupContainerBase::CGroupContainerBase( const CViewBase::TCtorParam ¶m ) : CInterfaceGroup( param ) { + _CurrentContainerAlpha = 255; + _CurrentContentAlpha = 255; _ContentAlpha = 255; _ContainerAlpha = 255; _RolloverAlphaContainer = 0; diff --git a/code/ryzom/client/src/interface_v3/group_container.cpp b/code/ryzom/client/src/interface_v3/group_container.cpp index 6876c66a8..707e85588 100644 --- a/code/ryzom/client/src/interface_v3/group_container.cpp +++ b/code/ryzom/client/src/interface_v3/group_container.cpp @@ -1201,8 +1201,6 @@ CGroupContainer::CGroupContainer(const TCtorParam ¶m) // faster than a virual call _IsGroupContainer = true; - _CurrentContainerAlpha = 255; - _CurrentContentAlpha = 255; _CurrentRolloverAlphaContainer = 0.f; _CurrentRolloverAlphaContent = 0.f; diff --git a/code/ryzom/client/src/interface_v3/group_container.h b/code/ryzom/client/src/interface_v3/group_container.h index 35c5a851e..731e9bcc7 100644 --- a/code/ryzom/client/src/interface_v3/group_container.h +++ b/code/ryzom/client/src/interface_v3/group_container.h @@ -31,7 +31,6 @@ namespace NLGUI class CViewText; } -class CInterfaceList; class COptionsContainerInsertion; class COptionsContainerMove; class CGroupContainer; @@ -366,9 +365,6 @@ public: sint32 getRefW() const { return _RefW; } - uint8 getCurrentContainerAlpha() const { return _CurrentContainerAlpha; } - uint8 getCurrentContentAlpha() const { return _CurrentContentAlpha; } - /** Increase the rollover alpha for the current frame. * Example of use : an edit box that has focus in a group container */ @@ -463,8 +459,6 @@ public: sint32 getTitleDeltaMaxW() const { return _TitleDeltaMaxW; } protected: - uint8 _CurrentContainerAlpha; - uint8 _CurrentContentAlpha; uint8 _ICurrentRolloverAlphaContainer; uint8 _HighLightedAlpha; float _CurrentRolloverAlphaContainer; diff --git a/code/ryzom/client/src/interface_v3/view_bitmap.cpp b/code/ryzom/client/src/interface_v3/view_bitmap.cpp index c2266bb3a..dfbd2c1c7 100644 --- a/code/ryzom/client/src/interface_v3/view_bitmap.cpp +++ b/code/ryzom/client/src/interface_v3/view_bitmap.cpp @@ -16,16 +16,11 @@ -// ---------------------------------------------------------------------------- - -#include "stdpch.h" - #include "view_bitmap.h" -#include "interface_manager.h" #include "nel/misc/xml_auto_ptr.h" -#include "group_container.h" - -// ---------------------------------------------------------------------------- +#include "nel/gui/widget_manager.h" +#include "nel/gui/interface_group.h" +#include "nel/gui/group_container_base.h" using namespace std; using namespace NLMISC; @@ -144,7 +139,6 @@ bool CViewBitmap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) // ---------------------------------------------------------------------------- void CViewBitmap::draw () { - CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance(); CRGBA col; @@ -166,7 +160,7 @@ void CViewBitmap::draw () { if (gr->isGroupContainer()) { - CGroupContainer *gc = static_cast(gr); + CGroupContainerBase *gc = static_cast(gr); col.A = (uint8)(((sint32)col.A*((sint32)gc->getCurrentContainerAlpha()+1))>>8); break; } @@ -208,7 +202,6 @@ void CViewBitmap::updateCoords() { if (!_Scale) { - CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance(); sint32 txw, txh; rVR.getTextureSizeFromId (_TextureId, txw, txh); @@ -230,7 +223,6 @@ void CViewBitmap::setTexture(const std::string & TxName) // ---------------------------------------------------------------------------- std::string CViewBitmap::getTexture () const { - CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance(); return rVR.getTextureNameFromId (_TextureId); } @@ -238,7 +230,6 @@ std::string CViewBitmap::getTexture () const // *************************************************************************** void CViewBitmap::fitTexture() { - CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance(); sint32 w, h; rVR.getTextureSizeFromId(_TextureId, w, h); @@ -286,7 +277,6 @@ NLMISC::CRGBA CViewBitmap::getColorRGBA() const sint32 CViewBitmap::getMaxUsedW() const { sint32 txw, txh; - CInterfaceManager *pIM = CInterfaceManager::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance(); rVR.getTextureSizeFromId (_TextureId, txw, txh); return txw; diff --git a/code/ryzom/client/src/interface_v3/view_bitmap.h b/code/ryzom/client/src/interface_v3/view_bitmap.h index 3d63cbfe8..cea94116b 100644 --- a/code/ryzom/client/src/interface_v3/view_bitmap.h +++ b/code/ryzom/client/src/interface_v3/view_bitmap.h @@ -133,7 +133,6 @@ protected: sint32 _TxtWidth; // Width of the single texture sint32 _TxtHeight; // Height of the single texture - friend class CInterfaceList; };