コード例 #1
0
ファイル: view_bitmap.cpp プロジェクト: AzyxWare/ryzom
// ----------------------------------------------------------------------------
void CViewBitmap::draw ()
{
	CInterfaceManager *pIM = CInterfaceManager::getInstance();
	CViewRenderer &rVR = pIM->getViewRenderer();

	CRGBA col;
	if(getModulateGlobalColor())
	{
		col.modulateFromColor (_Color, pIM->getGlobalColorForContent());
	}
	else
	{
		col= _Color;
		col.A = (uint8)(((sint32)col.A*((sint32)pIM->getGlobalColorForContent().A+1))>>8);
	}

	if (_InheritGCAlpha)
	{
		// search a parent container
		CInterfaceGroup *gr = getParent();
		while (gr)
		{
			if (gr->isGroupContainer())
			{
				CGroupContainer *gc = static_cast<CGroupContainer *>(gr);
				col.A = (uint8)(((sint32)col.A*((sint32)gc->getCurrentContainerAlpha()+1))>>8);
				break;
			}
			gr = gr->getParent();
		}
	}
コード例 #2
0
	// ------------------------------------------------------------------------------------------------
	CInterfaceGroup* CInterfaceElement::getParentContainer()
	{
		CInterfaceElement *parent = this;
		while (parent)
		{
			CInterfaceGroup *gc = dynamic_cast< CInterfaceGroup* >( parent );
			if( ( gc != NULL ) && gc->isGroupContainer() )
				return gc;

			parent = parent->getParent();
		}
		return NULL;
	}