Esempio n. 1
0
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
}
Esempio n. 2
0
void CServerList::Update()
{
	//	browser().Update();
	
	if (m_need_refresh_fr<Device.dwFrame+10)
		RefreshList_internal();

	if (m_bAnimation)
	{
		m_pAnimation->Update();

		m_frame[LST_SRV_PROP].SetColor(subst_alpha(0xffffffff, color_get_A(m_pAnimation->GetColor())));
		m_frame[LST_PLAYERS].SetColor(subst_alpha(0xffffffff, color_get_A(m_pAnimation->GetColor())));


		if (m_pAnimation->Done())
		{
			m_bAnimation = false;
			if (m_bShowServerInfo)
				AfterAppear();
			else
				AfterDisappear();
		}
	}
	CUIWindow::Update();
}
Esempio n. 3
0
IC u32 it_height_rev	(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)	);				// height
}
Esempio n. 4
0
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)		);
}
Esempio n. 5
0
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
}
Esempio n. 6
0
void ELightAnimLibrary::Load()
{
	string_path fn;
    FS.update_path(fn,_game_data_,"lanims.xr");
	IReader* fs=FS.r_open(fn);
    if (fs){
    	u16 version	= 0;
    	if (fs->find_chunk(CHUNK_VERSION)){
        	version	= fs->r_u16();
        }
        IReader* OBJ = fs->open_chunk(CHUNK_ITEM_LIST);
        if (OBJ){
	        IReader* O   = OBJ->open_chunk(0);
    	    for (int count=1; O; count++) {
        	    CLAItem* I = xr_new<CLAItem>();
                I->Load(*O);
                if (version==0){
                    for (CLAItem::KeyPairIt it=I->Keys.begin(); it!=I->Keys.end(); it++)
                        it->second	= subst_alpha(bgr2rgb(it->second),color_get_A(it->second));
                }
                Items.push_back(I);
            	O->close();
	            O = OBJ->open_chunk(count);
    	    }
	        OBJ->close();
        }

		FS.r_close(fs);
    }
}
Esempio n. 7
0
void CUIActorStaticticHeader::Init	(CUIXml* xml, LPCSTR path, int idx_in_xml)
{
	XML_NODE* _stored_root				= xml->GetLocalRoot();

	CUIXmlInit							xml_init;
	xml_init.InitWindow					(*xml, path, idx_in_xml, this);

	xml->SetLocalRoot					(xml->NavigateToNode(path,idx_in_xml));

	m_text1								= xr_new<CUIStatic>(); m_text1->SetAutoDelete(true);
	AttachChild							(m_text1);
	xml_init.InitStatic					(*xml, "text_1", 0, m_text1);

	m_text2								= xr_new<CUIStatic>(); m_text2->SetAutoDelete(true);
	AttachChild							(m_text2);
	xml_init.InitStatic					(*xml, "text_2", 0, m_text2);

	xml_init.InitAutoStaticGroup		(*xml, "auto", 0, this);
	LPCSTR _id							= strstr(path,"master_part_")+xr_strlen("master_part_");
	m_id								= _id;

	m_stored_alpha						= color_get_A(m_text1->GetTextColor());
	xml->SetLocalRoot					(_stored_root);

}
void CUIStalkerRankingInfoItem::Init	(CUIXml* xml, LPCSTR path, int idx)
{
	XML_NODE* _stored_root					= xml->GetLocalRoot();

	CUIXmlInit								xml_init;
	xml_init.InitWindow						(*xml, path, idx, this);

	xml->SetLocalRoot						(xml->NavigateToNode(path,idx));

	m_text1									= xr_new<CUIStatic>(); m_text1->SetAutoDelete(true);
	AttachChild								(m_text1);
	xml_init.InitStatic						(*xml, "text_1", 0, m_text1);

	m_text2									= xr_new<CUIStatic>(); m_text2->SetAutoDelete(true);
	AttachChild								(m_text2);
	xml_init.InitStatic						(*xml, "text_2", 0, m_text2);

	m_text3									= xr_new<CUIStatic>(); m_text3->SetAutoDelete(true);
	AttachChild								(m_text3);
	xml_init.InitStatic						(*xml, "text_3", 0, m_text3);

	xml_init.InitAutoStaticGroup			(*xml, "auto", 0, this);

	m_stored_alpha							= color_get_A(m_text2->GetTextColor());
	xml->SetLocalRoot						(_stored_root);
}
Esempio n. 9
0
BOOL GetPointColor(SPickQuery::SResult* R, u32& alpha)
{
    CSurface* surf			= R->e_mesh->GetSurfaceByFaceID(R->tag); VERIFY(surf);
    Shader_xrLC* c_sh		= EDevice.ShaderXRLC.Get(surf->_ShaderXRLCName());
    if (!c_sh->flags.bRendering) return FALSE;
    const Fvector2*			cuv[3];
    R->e_mesh->GetFaceTC	(R->tag,cuv);

    // barycentric coords
    // note: W,U,V order
    Fvector B;
    B.set	(1.0f - R->u - R->v,R->u,R->v);

    // calc UV
    Fvector2	uv;
    uv.x = cuv[0]->x*B.x + cuv[1]->x*B.y + cuv[2]->x*B.z;
    uv.y = cuv[0]->y*B.x + cuv[1]->y*B.y + cuv[2]->y*B.z;

    int U = iFloor(uv.x*float(surf->m_ImageData->w) + .5f);
    int V = iFloor(uv.y*float(surf->m_ImageData->h)+ .5f);
    U %= surf->m_ImageData->w;	if (U<0) U+=surf->m_ImageData->w;
    V %= surf->m_ImageData->h;	if (V<0) V+=surf->m_ImageData->h;

    alpha = color_get_A(surf->m_ImageData->layers.back()[V*surf->m_ImageData->w+U]);
    return TRUE;
}
Esempio n. 10
0
IC float getLastRP_Scale(CDB::COLLIDER* DB, RayCache& C)
{
	u32	tris_count		= DB->r_count();
	float	scale		= 1.f;
	Fvector B;

	//	X_TRY 
	{
		for (u32 I=0; I<tris_count; I++)
		{
			CDB::RESULT& rpinf = DB->r_begin()[I];
			// Access to texture
//			CDB::TRI& clT								= 
				Level.get_tris()	[rpinf.id];
			b_rc_face& F								= g_rc_faces		[rpinf.id];

			b_material& M	= g_materials				[F.dwMaterial];
			b_texture&	T	= g_textures				[M.surfidx];
			Shader_xrLCVec&	LIB = 		g_shaders_xrlc->Library	();
			if (M.shader_xrlc>=LIB.size()) return		0;		//. hack
			Shader_xrLC& SH	= LIB						[M.shader_xrlc];
			if (!SH.flags.bLIGHT_CastShadow)			continue;

			if (0==T.pSurface)	T.bHasAlpha = FALSE;
			if (!T.bHasAlpha)	{
				// Opaque poly - cache it
				C[0].set	(rpinf.verts[0]);
				C[1].set	(rpinf.verts[1]);
				C[2].set	(rpinf.verts[2]);
				return		0;
			}

			// barycentric coords
			// note: W,U,V order
			B.set	(1.0f - rpinf.u - rpinf.v,rpinf.u,rpinf.v);

			// calc UV
			Fvector2*	cuv = F.t;
			Fvector2	uv;
			uv.x = cuv[0].x*B.x + cuv[1].x*B.y + cuv[2].x*B.z;
			uv.y = cuv[0].y*B.x + cuv[1].y*B.y + cuv[2].y*B.z;

			int U = iFloor(uv.x*float(T.dwWidth) + .5f);
			int V = iFloor(uv.y*float(T.dwHeight)+ .5f);
			U %= T.dwWidth;		if (U<0) U+=T.dwWidth;
			V %= T.dwHeight;	if (V<0) V+=T.dwHeight;

			u32 pixel		= T.pSurface[V*T.dwWidth+U];
			u32 pixel_a		= color_get_A(pixel);
			float opac		= 1.f - float(pixel_a)/255.f;
			scale			*= opac;
		}
	} 
	//	X_CATCH
	//	{
	//		clMsg("* ERROR: getLastRP_Scale");
	//	}

	return scale;
}
Esempio n. 11
0
void SGrenadeMark::Draw( float cam_dir )
{
	int frame;
	u32 clr = m_LightAnim->CalculateRGB( 2.0f*(Device.fTimeGlobal - m_LastTime), frame );
	m_UIStaticItem->SetTextureColor( subst_alpha( m_UIStaticItem->GetTextureColor(), color_get_A(clr) ) );

	m_UIStaticItem->Render( cam_dir + m_Angle );
}
Esempio n. 12
0
void SHitMark::Draw( float cam_dir )
{
	int frame;
	u32 clr	= m_lanim->CalculateRGB( Device.fTimeGlobal - m_StartTime,frame );
	m_UIStaticItem->SetTextureColor( subst_alpha( m_UIStaticItem->GetTextureColor(), color_get_A(clr) ) );

	m_UIStaticItem->Render( cam_dir + m_HitDirection );
}
Esempio n. 13
0
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;
    }
}
Esempio n. 14
0
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)
            );
}
Esempio n. 15
0
void CUIEditKeyBind::Update()
{
	CUILabel::Update();

	m_bTextureAvailable = m_bCursorOverWindow;
	if (m_bEditMode)
	{
		m_pAnimation->Update();
		m_lines.SetTextColor((subst_alpha(m_lines.GetTextColor(), color_get_A(m_pAnimation->GetColor()))));
	}
	
}
Esempio n. 16
0
void CDrawUtilities::DrawIdentBox(BOOL bSolid, BOOL bWire, u32 clr_s, u32 clr_w)
{
    if (bWire){
        DU_DRAW_SH_C	(dxRenderDeviceRender::Instance().m_WireShader,clr_w);
    	m_WireBox.Render	();
    }
    if (bSolid){
        DU_DRAW_SH_C	(color_get_A(clr_s)>=254?dxRenderDeviceRender::Instance().m_WireShader:dxRenderDeviceRender::Instance().m_SelectionShader,clr_s);
    	m_SolidBox.Render	();
    }
	DU_DRAW_RS	(D3DRS_TEXTUREFACTOR,	0xffffffff);
}
Esempio n. 17
0
void ESceneObjectTools::HighlightTexture(LPCSTR tex_name, bool allow_ratio, u32 t_width, u32 t_height, BOOL mark)
{
	if (tex_name&&tex_name[0]){
        for (ObjectIt a_it=m_Objects.begin(); a_it!=m_Objects.end(); a_it++){
            CSceneObject* s_obj		= dynamic_cast<CSceneObject*>(*a_it);
            CEditableObject* e_obj	= s_obj->GetReference(); VERIFY(e_obj);
            SurfaceVec& s_vec		= e_obj->Surfaces();
            for (SurfaceIt it=s_vec.begin(); it!=s_vec.end(); it++){
                if (0==stricmp((*it)->_Texture(),tex_name)){
					Fvector 		verts[3];
					for (EditMeshIt mesh_it=e_obj->FirstMesh(); mesh_it!=e_obj->LastMesh(); mesh_it++){
                    	SurfFaces& 		surf_faces	= (*mesh_it)->GetSurfFaces();
                    	SurfFacesPairIt sf_it 		= surf_faces.find(*it);
                        if (sf_it!=surf_faces.end()){
                            IntVec& lst				= sf_it->second;
                            for (IntIt i_it=lst.begin(); i_it!=lst.end(); i_it++){
                                e_obj->GetFaceWorld	(s_obj->_Transform(),*mesh_it,*i_it,verts);
                                u32 clr	= 0x80FFFFFF;
                                if (allow_ratio){
                                	// select color
                                    const Fvector2* tc[3];
                                    Fvector 		c,e01,e02;
                                    e01.sub			(verts[1],verts[0]);
                                    e02.sub			(verts[2],verts[0]);
                                    float area		= c.crossproduct(e01,e02).magnitude()/2.f;
                                    (*mesh_it)->GetFaceTC(*i_it,tc);
                                    e01.sub			(Fvector().set(tc[1]->x,tc[1]->y,0),Fvector().set(tc[0]->x,tc[0]->y,0));
                                    e02.sub			(Fvector().set(tc[2]->x,tc[2]->y,0),Fvector().set(tc[0]->x,tc[0]->y,0));
                                    float p_area	= c.crossproduct(e01,e02).magnitude()/2.f;
                                    float ratio		= _sqrt((p_area*t_width*t_height)/area);
                                    int idx_clr		= 4;
                                    float w			= 0.f;
                                    if (ratio>=0.f && ratio<50.f) 			{idx_clr=0; w=ratio/30.f;}
                                    else if (ratio>=50.f && ratio<150.f) 	{idx_clr=1; w=(ratio-30.f)/150.f;}
                                    else if (ratio>=150.f && ratio<250.f) 	{idx_clr=2; w=(ratio-150.f)/250.f;}
                                    else if (ratio>=250.f && ratio<500.f) 	{idx_clr=3; w=(ratio-250.f)/500.f;}
                                    float inv_w		= 1.f-w;
                                    clr				= color_rgba(color_get_R(ratio_colors[idx_clr+0])*inv_w+color_get_R(ratio_colors[idx_clr+1])*w,
                                    							 color_get_G(ratio_colors[idx_clr+0])*inv_w+color_get_G(ratio_colors[idx_clr+1])*w,
                                                                 color_get_B(ratio_colors[idx_clr+0])*inv_w+color_get_B(ratio_colors[idx_clr+1])*w,
                                                                 color_get_A(ratio_colors[idx_clr+0])*inv_w+color_get_A(ratio_colors[idx_clr+1])*w);
                                }
                                Tools->m_DebugDraw.AppendSolidFace(verts[0],verts[1],verts[2],clr,false);
                                if (mark)	Tools->m_DebugDraw.AppendWireFace(verts[0],verts[1],verts[2],clr,false);
                            }
                        }
                    }
                }
            }
        }
    }
}
Esempio n. 18
0
void blit			(u32* dest, u32 ds_x, u32 ds_y, u32* src, u32 ss_x, u32 ss_y, u32 px, u32 py, u32 aREF)
{
	R_ASSERT(ds_x>=(ss_x+px));
	R_ASSERT(ds_y>=(ss_y+py));
	for (u32 y=0; y<ss_y; y++)
		for (u32 x=0; x<ss_x; x++)
		{
			u32 dx = px+x;
			u32 dy = py+y;
			u32 sc = src[y*ss_x+x];
			if (color_get_A(sc)>=aREF) dest[dy*ds_x+dx] = sc;
		}
}
Esempio n. 19
0
void __fastcall TfrmEditLightAnim::OnIdle()
{
	if (form){
		if (form->m_CurrentItem){
        	int 	frame;
            u32 C 	= form->m_CurrentItem->CalculateBGR(Device.fTimeGlobal,frame);
			form->paColor->Color		= TColor(subst_alpha(C,0));
            form->lbCurFrame->Caption	= AnsiString().sprintf("%d",frame);
            form->lbAlpha->Caption		= AnsiString().sprintf("[%d]",color_get_A(C));
        }
        UI->RedrawScene();
    }
}
Esempio n. 20
0
CUILine* CUILines::ParseTextToColoredLine(const xr_string& str) {
    CUILine* line = xr_new<CUILine>();
    xr_string tmp = str;
    xr_string entry;
    u32 color;

    do
    {
        CutFirstColoredTextEntry(entry, color, tmp);
        line->AddSubLine(entry, subst_alpha(color, color_get_A(GetTextColor())));
    }
    while (tmp.size()>0);

    return line;
}
Esempio n. 21
0
void CEditShape::Render(int priority, bool strictB2F)
{
	inherited::Render(priority, strictB2F);
    if (1==priority){
        if (strictB2F){
	        Device.SetShader			(Device.m_WireShader);
            Device.SetRS				(D3DRS_CULLMODE,D3DCULL_NONE);
            u32 clr 					= Selected()?subst_alpha(m_DrawTranspColor, color_get_A(m_DrawTranspColor)*2):m_DrawTranspColor;
                
            Fvector zero				={0.f,0.f,0.f};
            for (ShapeIt it=shapes.begin(); it!=shapes.end(); ++it)
            {
                switch(it->type)
                {
                case cfSphere:
                {
                    Fsphere& S			= it->data.sphere;
                    Fmatrix B;
                    B.scale				(S.R,S.R,S.R);
                    B.translate_over	(S.P);
                    B.mulA_43			(_Transform());
                    RCache.set_xform_world(B);
                    Device.SetShader	(Device.m_WireShader);
                    DU_impl.DrawCross	(zero,1.f,m_DrawEdgeColor,false);
                    DU_impl.DrawIdentSphere	(true,true,clr,m_DrawEdgeColor);
                }break;
                case cfBox:
                {
                    Fmatrix B			= it->data.box;
                    B.mulA_43			(_Transform());
                    RCache.set_xform_world(B);
                    DU_impl.DrawIdentBox(true,true,clr,m_DrawEdgeColor);
                }break;
                }
            }
            Device.SetRS(D3DRS_CULLMODE,D3DCULL_CCW);
        }else{
            if( Selected()&&m_Box.is_valid() ){
		        Device.SetShader		(Device.m_SelectionShader);
                RCache.set_xform_world	(_Transform());
                u32 clr 				= 0xFFFFFFFF;
                Device.SetShader		(Device.m_WireShader);
                DU_impl.DrawSelectionBox(m_Box,&clr);
            }
        }
    }
}
Esempio n. 22
0
u32 SSceneSummary::SelectPMColor(float pm)
{
	VERIFY			(!s_summary.pm_colors.empty());
    u32 from;
    u32 to;
    float w			= 0.f;
    if (pm<s_summary.pm_colors[0].pm){
    	from		= s_summary.pm_colors[0].color;
	    to	 		= s_summary.pm_colors[0].color;
    }else if (pm>=s_summary.pm_colors[s_summary.pm_colors.size()-1].pm){
    	from		= s_summary.pm_colors.back().color;
	    to	 		= s_summary.pm_colors.back().color;
    }else{
	    u32 idx_clr	= 0;
        for (; idx_clr<s_summary.pm_colors.size()-1; ++idx_clr)
            if (pm>=s_summary.pm_colors[idx_clr].pm && pm<s_summary.pm_colors[idx_clr+1].pm) break;
        w			= (pm-s_summary.pm_colors[idx_clr].pm)/float(s_summary.pm_colors[idx_clr+1].pm);
        from		= s_summary.pm_colors[idx_clr+0].color;
        to			= s_summary.pm_colors[idx_clr+1].color;
    }
    float inv_w		= 1.f-w;
    return color_rgba	(color_get_R(from)*inv_w+color_get_R(to)*w, color_get_G(from)*inv_w+color_get_G(to)*w,
                         color_get_B(from)*inv_w+color_get_B(to)*w, color_get_A(from)*inv_w+color_get_A(to)*w);
}
void CUIColorAnimatorWrapper::Update()
{
	if (colorAnimation && !isDone)
	{
		if (!isCyclic)
		{
			if (animationTime < (colorAnimation->iFrameCount / colorAnimation->fFPS))
			{
				currColor		= colorAnimation->CalculateBGR(std::abs(animationTime - kRev), currFrame);
				//Msg("name: %s, color: %x, frame: %d", *colorAnimation->cName,currColor, currFrame);
				currColor		= color_rgba(color_get_B(currColor), color_get_G(currColor), color_get_R(currColor), color_get_A(currColor));
				// обновим время
				animationTime	+= Device.dwTimeContinual/1000.0f - prevGlobalTime;
			}
			else
			{
				// В любом случае (при любом ФПС) последним кадром должен быть последний кадр анимации
				currColor	= colorAnimation->CalculateBGR((colorAnimation->iFrameCount - 1) / colorAnimation->fFPS - kRev, currFrame);
				currColor	= color_rgba(color_get_B(currColor), color_get_G(currColor), color_get_R(currColor), color_get_A(currColor));
				// Индицируем конец анимации
				isDone = true;
			}
		}
		else
		{
			currColor	= colorAnimation->CalculateBGR(Device.dwTimeContinual/1000.0f, currFrame);
			currColor	= color_rgba(color_get_B(currColor), color_get_G(currColor), color_get_R(currColor), color_get_A(currColor));
		}

		if (color)
		{
			*color		= currColor;
		}
	}

	prevGlobalTime = Device.dwTimeContinual/1000.0f;
}
Esempio n. 24
0
void	CInifile::w_color		( LPCSTR S, LPCSTR L, u32				V, LPCSTR comment )
{
    string128 temp;
    sprintf_s		(temp,sizeof(temp),"%d,%d,%d,%d", color_get_R(V), color_get_G(V), color_get_B(V), color_get_A(V));
    w_string	(S,L,temp,comment);
}
Esempio n. 25
0
void CUIEditKeyBind::OnFocusLost()
{
	CUILabel::OnFocusLost		();
	m_bEditMode					= false;
	m_lines.SetTextColor		((subst_alpha(m_lines.GetTextColor(), color_get_A(0xffffffff))));
}
Esempio n. 26
0
void CGameFont::OnRender()
{
	VERIFY				(g_bRendering);
	if (pShader)		RCache.set_Shader	(pShader);

	if (!(uFlags&fsValid)){
		CTexture* T		= RCache.get_ActiveTexture(0);
		vTS.set			((int)T->get_Width(),(int)T->get_Height());
/*
		vHalfPixel.set	(0.5f/float(vTS.x),0.5f/float(vTS.y));
		for (int i=0; i<256; i++){
			Fvector& tc	= TCMap[i];
			tc.x		/= float(vTS.x);
			tc.y		/= float(vTS.y);
			tc.z		/= float(vTS.x);
		}
		fTCHeight		= fHeight/float(vTS.y);
		uFlags			|= fsValid;
*/
		fTCHeight		= fHeight/float(vTS.y);
		uFlags			|= fsValid;
	}

	for (u32 i=0; i<strings.size(); ){
		// calculate first-fit
		int		count	=	1;
		int		length	=	xr_strlen(strings[i].string);
		while	((i+count)<strings.size()) {
			int	L	=	xr_strlen(strings[i+count].string);
			if ((L+length)<MAX_CHARS){
				count	++;
				length	+=	L;
			}
			else		break;
		}

		// lock AGP memory
		u32	vOffset;
		FVF::TL* v		= (FVF::TL*)RCache.Vertex.Lock	(length*4,pGeom.stride(),vOffset);
		FVF::TL* start	= v;

		// fill vertices
		u32 last		= i+count;
		for (; i<last; i++) {
			String		&PS	= strings[i];
			int			len	= xr_strlen(PS.string);
			if (len) {
				float	X	= float(iFloor(PS.x));
				float	Y	= float(iFloor(PS.y));
				float	S	= PS.height*g_current_font_scale.y;
				float	Y2	= Y+S;

				switch(PS.align)
				{
				case alCenter:	
						X	-= ( iFloor(SizeOf_(PS.string,PS.height)*.5f) ) * g_current_font_scale.x;	
						break;
				case alRight:	
						X	-=	iFloor(SizeOf_(PS.string,PS.height));		
						break;
				}

				u32	clr,clr2;
				clr2 = clr	= PS.c;
				if (uFlags&fsGradient){
					u32	_R	= color_get_R	(clr)/2;
					u32	_G	= color_get_G	(clr)/2;
					u32	_B	= color_get_B	(clr)/2;
					u32	_A	= color_get_A	(clr);
					clr2	= color_rgba	(_R,_G,_B,_A);
				}

				float	tu,tv;
				for (int j=0; j<len; j++)
				{
					int c			= GetCharRM	(PS.string[j]);
					
					Fvector l		= GetCharTC	(PS.string[j]);
					float scw		= l.z * g_current_font_scale.x;
					
//.					float scw		= vTS.x * l.z * g_current_font_scale.x;
					
					float fTCWidth	= l.z/vTS.x;

					if ((c>=0)&&!fis_zero(l.z))
					{
						tu			= l.x/vTS.x;//+vHalfPixel.x;
						tv			= l.y/vTS.y;//+vHalfPixel.y;
						v->set		(X-0.5f,		Y2-0.5f,	clr2,tu,			tv+fTCHeight);	v++;
						v->set		(X-0.5f,		Y-0.5f,		clr, tu,			tv);			v++;
						v->set		(X+scw-0.5f,	Y2-0.5f,	clr2,tu+fTCWidth,	tv+fTCHeight);	v++;
						v->set		(X+scw-0.5f,	Y-0.5f,		clr, tu+fTCWidth,	tv);			v++;
					}
					X+=scw*vInterval.x;
				}
			}
		}

		// Unlock and draw
		u32 vCount = (u32)(v-start);
		RCache.Vertex.Unlock		(vCount,pGeom.stride());
		if (vCount){
			RCache.set_Geometry		(pGeom);
			RCache.Render			(D3DPT_TRIANGLELIST,vOffset,0,vCount,0,vCount/2);
		}
	}
	strings.clear_not_free			();
}
Esempio n. 27
0
u32 CLAItem::InterpolateBGR(int frame)
{
	u32 c 	= InterpolateRGB(frame);
    return color_rgba(color_get_B(c),color_get_G(c),color_get_R(c),color_get_A(c));
}