当前位置: 首页>>代码示例>>C++>>正文


C++ color_rgba函数代码示例

本文整理汇总了C++中color_rgba函数的典型用法代码示例。如果您正苦于以下问题:C++ color_rgba函数的具体用法?C++ color_rgba怎么用?C++ color_rgba使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了color_rgba函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DestroyDragItem

void CUIDragDropReferenceList::ReloadReferences(CInventoryOwner* pActor)
{
	if (!pActor)
		return;

	if(m_drag_item)
		DestroyDragItem();

	m_container->ClearAll(true);
	m_selected_item	= NULL;

	for(u8 i=0; i<m_container->CellsCapacity().x; i++)
	{
		CUIStatic* ref = m_references[i];
		LPCSTR item_name = ACTOR_DEFS::g_quick_use_slots[i];
		if(item_name && xr_strlen(item_name))
		{
			PIItem itm = pActor->inventory().GetAny(item_name);
			if(itm)
			{
				SetItem(create_cell_item(itm), Ivector2().set(i, 0));
			}
			else
			{
				LoadItemTexture(item_name, Ivector2().set(i, 0));
				ref->SetTextureColor(color_rgba(255,255,255,100));
			}
		}
		else
		{
			ref->SetTextureColor(color_rgba(255,255,255,0));
		}
	}
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:34,代码来源:UIDragDropReferenceList.cpp

示例2: switch

void			CGameObject::dbg_DrawSkeleton	()
{
	CCF_Skeleton* Skeleton = smart_cast<CCF_Skeleton*>(collidable.model);
	if (!Skeleton) return;
	Skeleton->_dbg_refresh();

	const CCF_Skeleton::ElementVec& Elements = Skeleton->_GetElements();
	for (CCF_Skeleton::ElementVec::const_iterator I=Elements.begin(); I!=Elements.end(); I++){
		if (!I->valid())		continue;
		switch (I->type){
			case SBoneShape::stBox:{
				Fmatrix M;
				M.invert			(I->b_IM);
				Fvector h_size		= I->b_hsize;
				Level().debug_renderer().draw_obb	(M, h_size, color_rgba(0, 255, 0, 255));
								   }break;
			case SBoneShape::stCylinder:{
				Fmatrix M;
				M.c.set				(I->c_cylinder.m_center);
				M.k.set				(I->c_cylinder.m_direction);
				Fvector				h_size;
				h_size.set			(I->c_cylinder.m_radius,I->c_cylinder.m_radius,I->c_cylinder.m_height*0.5f);
				Fvector::generate_orthonormal_basis(M.k,M.j,M.i);
				Level().debug_renderer().draw_obb	(M, h_size, color_rgba(0, 127, 255, 255));
										}break;
			case SBoneShape::stSphere:{
				Fmatrix				l_ball;
				l_ball.scale		(I->s_sphere.R, I->s_sphere.R, I->s_sphere.R);
				l_ball.translate_add(I->s_sphere.P);
				Level().debug_renderer().draw_ellipse(l_ball, color_rgba(0, 255, 0, 255));
									  }break;
		};
	};	
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:34,代码来源:GameObject.cpp

示例3: Level

void CGameObject::OnRender			()
{
	if (!ai().get_level_graph())
		return;

	CDebugRenderer					&renderer = Level().debug_renderer();
	if (/**bDebug && /**/Visual()) {
		float						half_cell_size = 1.f*ai().level_graph().header().cell_size()*.5f;
		Fvector						additional = Fvector().set(half_cell_size,half_cell_size,half_cell_size);

		render_box					(Visual(),XFORM(),Fvector().set(0.f,0.f,0.f),true,color_rgba(0,0,255,255));
		render_box					(Visual(),XFORM(),additional,false,color_rgba(0,255,0,255));
	}

	if (0) {
		Fvector						bc,bd; 
		Visual()->getVisData().box.get_CD	(bc,bd);
		Fmatrix						M = Fidentity;
		float						half_cell_size = ai().level_graph().header().cell_size()*.5f;
		bd.add						(Fvector().set(half_cell_size,half_cell_size,half_cell_size));
		M.scale						(bd);
		Fmatrix						T = XFORM();
		T.c.add						(bc);
		renderer.draw_obb			(T,bd,color_rgba(255,255,255,255));
	}
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:26,代码来源:GameObject.cpp

示例4: color_rgba

void CUIActorMenu::ColorizeItem(CUICellItem* itm, bool colorize)
{
	if( colorize )
	{
		itm->SetColor( color_rgba(255,100,100,255) );
	}
	else
	{
		itm->SetColor( color_rgba(255,255,255,255) );
	}
}
开发者ID:2asoft,项目名称:xray,代码行数:11,代码来源:UIActorMenuTrade.cpp

示例5: UpdateActiveItemInfo

void CUIHudStatesWnd::UpdateActiveItemInfo( CActor* actor )
{
	PIItem item = actor->inventory().ActiveItem();
	if ( item )
	{
		if(m_b_force_update)
		{
			if(item->cast_weapon())
				item->cast_weapon()->ForceUpdateAmmo();
			m_b_force_update		= false;
		}

		item->GetBriefInfo			( m_item_info );

//		UIWeaponBack.SetText		( str_name.c_str() );
		m_fire_mode->SetText		( m_item_info.fire_mode.c_str() );
		SetAmmoIcon					( m_item_info.icon.c_str() );
		
		m_ui_weapon_cur_ammo->Show	( true );
		m_ui_weapon_fmj_ammo->Show	( true );
		m_ui_weapon_ap_ammo->Show	( true );
		m_fire_mode->Show			( true );
		m_ui_grenade->Show			( true );

		m_ui_weapon_cur_ammo->SetText	( m_item_info.cur_ammo.c_str() );
		m_ui_weapon_fmj_ammo->SetText	( m_item_info.fmj_ammo.c_str() );
		m_ui_weapon_ap_ammo->SetText	( m_item_info.ap_ammo.c_str() );
		
		m_ui_grenade->SetText	( m_item_info.grenade.c_str() );

		CWeaponMagazinedWGrenade* wpn = smart_cast<CWeaponMagazinedWGrenade*>(item);
		if(wpn && wpn->m_bGrenadeMode)
		{
			m_ui_weapon_fmj_ammo->SetTextColor(color_rgba(238,155,23,150));
			m_ui_grenade->SetTextColor(color_rgba(238,155,23,255));
		}
		else
		{
			m_ui_weapon_fmj_ammo->SetTextColor(color_rgba(238,155,23,255));
			m_ui_grenade->SetTextColor(color_rgba(238,155,23,150));
		}
	}
	else
	{
		m_ui_weapon_icon->Show		( false );

		m_ui_weapon_cur_ammo->Show	( false );
		m_ui_weapon_fmj_ammo->Show	( false );
		m_ui_weapon_ap_ammo->Show	( false );
		m_fire_mode->Show			( false );
		m_ui_grenade->Show			( false );
	}
}
开发者ID:zcaliptium,项目名称:xray-16,代码行数:53,代码来源:UIHudStatesWnd.cpp

示例6: color_rgba

void CUIFactionWarWnd::set_amount_enemy_bonus( int value )
{
	for ( u32 i = 0; i < max_bonuce; ++i )
	{
		m_enemy_bonuces[i]->SetColor( color_rgba( 255, 255, 255, 70) );
	}
	u32 cr = color_rgba( 0, 255, 0, 255);
	for ( int i = 0; i < value; ++i )
	{
		m_enemy_bonuces[i]->SetColor( cr );
	}
}
开发者ID:2asoft,项目名称:xray,代码行数:12,代码来源:UIFactionWarWnd.cpp

示例7:

IC u32 it_gloss_rev		(u32 d, u32 s)	{
    return	color_rgba	(
                color_get_A(s),		// gloss
                color_get_B(d),
                color_get_G(d),
                color_get_R(d)		);
}
开发者ID:awdavies,项目名称:cop,代码行数:7,代码来源:Texture.cpp

示例8: r_string

u32 CInifile::r_color( LPCSTR S, LPCSTR L )
{
    LPCSTR		C = r_string(S,L);
    u32			r=0,g=0,b=0,a=255;
    sscanf		(C,"%d,%d,%d,%d",&r,&g,&b,&a);
    return color_rgba(r,g,b,a);
}
开发者ID:vasilenkomike,项目名称:xray,代码行数:7,代码来源:Xr_ini.cpp

示例9: color_rgba

IC u32 it_difference	(u32 d, u32 orig, u32 ucomp)	{
    return	color_rgba(
                128+(int(color_get_R(orig))-int(color_get_R(ucomp)))*2,		// R-error
                128+(int(color_get_G(orig))-int(color_get_G(ucomp)))*2,		// G-error
                128+(int(color_get_B(orig))-int(color_get_B(ucomp)))*2,		// B-error
                128+(int(color_get_A(orig))-int(color_get_A(ucomp)))*2	);	// A-error
}
开发者ID:awdavies,项目名称:cop,代码行数:7,代码来源:Texture.cpp

示例10: it_height_rev_base

IC u32 it_height_rev_base(u32 d, u32 s)	{
    return	color_rgba	(
                color_get_A(d),					// diff x
                color_get_B(d),					// diff y
                color_get_G(d),					// diff z
                (color_get_R(s)+color_get_G(s)+color_get_B(s))/3	);	// height
}
开发者ID:awdavies,项目名称:cop,代码行数:7,代码来源:Texture.cpp

示例11:

void CRenderTarget::accum_direct_blend	()
{
	// blend-copy
	if (!RImplementation.o.fp16_blend)	{
		u_setrt						(rt_Accumulator,NULL,NULL,HW.pBaseZB);

		// Common calc for quad-rendering
		u32		Offset;
		u32		C					= color_rgba	(255,255,255,255);
		float	_w					= float			(Device.dwWidth);
		float	_h					= float			(Device.dwHeight);
		Fvector2					p0,p1;
		p0.set						(.5f/_w, .5f/_h);
		p1.set						((_w+.5f)/_w, (_h+.5f)/_h );
		float	d_Z	= EPS_S, d_W = 1.f;

		// Fill vertex buffer
		FVF::TL2uv* pv				= (FVF::TL2uv*) RCache.Vertex.Lock	(4,g_combine_2UV->vb_stride,Offset);
		pv->set						(EPS,			float(_h+EPS),	d_Z,	d_W, C, p0.x, p1.y, p0.x, p1.y);	pv++;
		pv->set						(EPS,			EPS,			d_Z,	d_W, C, p0.x, p0.y, p0.x, p0.y);	pv++;
		pv->set						(float(_w+EPS),	float(_h+EPS),	d_Z,	d_W, C, p1.x, p1.y, p1.x, p1.y);	pv++;
		pv->set						(float(_w+EPS),	EPS,			d_Z,	d_W, C, p1.x, p0.y, p1.x, p0.y);	pv++;
		RCache.Vertex.Unlock		(4,g_combine_2UV->vb_stride);
		RCache.set_Geometry			(g_combine_2UV);
		RCache.set_Element			(s_accum_mask->E[SE_MASK_ACCUM_2D]	);
		RCache.set_Stencil			(TRUE,D3DCMP_LESSEQUAL,dwLightMarkerID,0xff,0x00);
		RCache.Render				(D3DPT_TRIANGLELIST,Offset,0,4,0,2	);
	}
	dwLightMarkerID				+= 2;
}
开发者ID:OLR-xray,项目名称:XRay-NEW,代码行数:30,代码来源:r2_rendertarget_accum_direct.cpp

示例12: float

void CRenderTarget::reset_light_marker( bool bResetStencil)
{
    dwLightMarkerID = 5;
    if (bResetStencil)
    {
        u32		Offset;
        float	_w					= float(Device.dwWidth);
        float	_h					= float(Device.dwHeight);
        u32		C					= color_rgba	(255,255,255,255);
        float	eps					= 0;
        float	_dw					= 0.5f;
        float	_dh					= 0.5f;
        FVF::TL* pv					= (FVF::TL*) RCache.Vertex.Lock	(4,g_combine->vb_stride,Offset);
        pv->set						(-_dw,		_h-_dh,		eps,	1.f, C, 0, 0);
        pv++;
        pv->set						(-_dw,		-_dh,		eps,	1.f, C, 0, 0);
        pv++;
        pv->set						(_w-_dw,	_h-_dh,		eps,	1.f, C, 0, 0);
        pv++;
        pv->set						(_w-_dw,	-_dh,		eps,	1.f, C, 0, 0);
        pv++;
        RCache.Vertex.Unlock		(4,g_combine->vb_stride);
        RCache.set_Element			(s_occq->E[2]	);
        RCache.set_Geometry			(g_combine		);
        RCache.Render				(D3DPT_TRIANGLELIST,Offset,0,4,0,2);
    }
}
开发者ID:Zen13L,项目名称:xray-16,代码行数:27,代码来源:r3_rendertarget.cpp

示例13: color_rgba

void CEnvironment::RenderClouds			()
{
#ifndef _EDITOR
	if (0==g_pGameLevel)		return	;
#endif
	// draw clouds
	if (fis_zero(CurrentEnv.clouds_color.w,EPS_L))	return;

	::Render->rmFar				();

	Fmatrix						mXFORM, mScale;
	mScale.scale				(10,0.4f,10);
	mXFORM.rotateY				(CurrentEnv.sky_rotation);
	mXFORM.mulB_43				(mScale);
	mXFORM.translate_over		(Device.vCameraPosition);

	Fvector wd0,wd1;
	Fvector4 wind_dir;
	wd0.setHP					(PI_DIV_4,0);
	wd1.setHP					(PI_DIV_4+PI_DIV_8,0);
	wind_dir.set				(wd0.x,wd0.z,wd1.x,wd1.z).mul(0.5f).add(0.5f).mul(255.f);
	u32		i_offset,v_offset;
	u32		C0					= color_rgba(iFloor(wind_dir.x),iFloor(wind_dir.y),iFloor(wind_dir.w),iFloor(wind_dir.z));
	u32		C1					= color_rgba(iFloor(CurrentEnv.clouds_color.x*255.f),iFloor(CurrentEnv.clouds_color.y*255.f),iFloor(CurrentEnv.clouds_color.z*255.f),iFloor(CurrentEnv.clouds_color.w*255.f));

	// Fill index buffer
	u16*	pib					= RCache.Index.Lock	(CloudsIndices.size(),i_offset);
	CopyMemory					(pib,&CloudsIndices.front(),CloudsIndices.size()*sizeof(u16));
	RCache.Index.Unlock			(CloudsIndices.size());

	// Fill vertex buffer
	v_clouds* pv				= (v_clouds*)	RCache.Vertex.Lock	(CloudsVerts.size(),clouds_geom.stride(),v_offset);
	for (FvectorIt it=CloudsVerts.begin(); it!=CloudsVerts.end(); it++,pv++)
		pv->set					(*it,C0,C1);
	RCache.Vertex.Unlock		(CloudsVerts.size(),clouds_geom.stride());

	// Render
	RCache.set_xform_world		(mXFORM);
	RCache.set_Geometry			(clouds_geom);
	RCache.set_Shader			(clouds_sh);
	RCache.set_Textures			(&CurrentEnv.clouds_r_textures);
	RCache.Render				(D3DPT_TRIANGLELIST,v_offset,0,CloudsVerts.size(),i_offset,CloudsIndices.size()/3);

	::Render->rmNormal			();
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:45,代码来源:Environment_render.cpp

示例14:

void CUIButtonHint::OnRender	()
{
    if(m_enabledOnFrame) {
        m_text->Update		();
        m_border->Update	();
        m_border->SetColor	(color_rgba(255,255,255,color_get_A(m_text->GetTextColor())));
        Draw				();
        m_enabledOnFrame	= false;
    }
}
开发者ID:vasilenkomike,项目名称:xray,代码行数:10,代码来源:UIBtnHint.cpp

示例15: it_gloss_rev_base

IC u32 it_gloss_rev_base(u32 d, u32 s)	{
    u32		occ		= color_get_A(d)/3;
    u32		def		= 8;
    u32		gloss	= (occ*1+def*3)/4;
    return	color_rgba	(
                gloss,			// gloss
                color_get_B(d),
                color_get_G(d),
                color_get_R(d)
            );
}
开发者ID:awdavies,项目名称:cop,代码行数:11,代码来源:Texture.cpp


注:本文中的color_rgba函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。