CHANGED: #1471 CViewBitmap no longer depends on CGroupContainer.

This commit is contained in:
dfighter1985 2012-06-21 23:05:12 +02:00
parent 1854b8e33a
commit 0370f77424
6 changed files with 12 additions and 24 deletions

View file

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

View file

@ -23,6 +23,8 @@ namespace NLGUI
CGroupContainerBase::CGroupContainerBase( const CViewBase::TCtorParam &param ) :
CInterfaceGroup( param )
{
_CurrentContainerAlpha = 255;
_CurrentContentAlpha = 255;
_ContentAlpha = 255;
_ContainerAlpha = 255;
_RolloverAlphaContainer = 0;

View file

@ -1201,8 +1201,6 @@ CGroupContainer::CGroupContainer(const TCtorParam &param)
// faster than a virual call
_IsGroupContainer = true;
_CurrentContainerAlpha = 255;
_CurrentContentAlpha = 255;
_CurrentRolloverAlphaContainer = 0.f;
_CurrentRolloverAlphaContent = 0.f;

View file

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

View file

@ -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<CGroupContainer *>(gr);
CGroupContainerBase *gc = static_cast<CGroupContainerBase*>(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;

View file

@ -133,7 +133,6 @@ protected:
sint32 _TxtWidth; // Width of the single texture
sint32 _TxtHeight; // Height of the single texture
friend class CInterfaceList;
};