Exemplo n.º 1
0
bool psCharAppearance::Dequip(csString& slotname,
                              csString& mesh,
                              csString& part,
                              csString& subMesh,
                              csString& texture)
{
    
    //look Equip() for more informations on this: bracers must be managed separately
    
    if (slotname == "bracers")
    {
        for(unsigned int position = 0; position < bracersSlotCount; position++)
            Dequip(BracersSlots[position], mesh, part, subMesh, texture);
        return true;
    }

    if ( slotname == "helm" )
    {
         ShowHair(true);
    }

    if ( mesh.Length() )
    {
        ClearEquipment(slotname);
        Detach(slotname);
    }

    // This is a part mesh (ie Mesh) set default mesh for that part.

    if ( subMesh.Length() )
    {
        DefaultMesh(part);
    }

    if ( part.Length() )
    {
        if ( texture.Length() )
        {
            ChangeMaterial(part, texture);
        }
        else
        {
            DefaultMaterial(part);
        }
        DefaultMaterial(part);
    }

    ClearEquipment(slotname);

    return true;
}
Exemplo n.º 2
0
void CRenderer::RenderText( CIwGxFont * font, const CIwRect & rect, const CIwColour & color, const CIwStringS & txt, IwGxFontAlignHor hAlign, IwGxFontAlignVer vAlign )
{
	iwsfixed scale = IW_SFIXED(mDeviceParams.scale);
	iwsfixed offX  = mDeviceParams.offsetX;
	iwsfixed offY  = mDeviceParams.offsetY;

	CIwRect r;
	r.x = IW_FIXED_MUL(rect.x, scale) + offX;
	r.y = IW_FIXED_MUL(rect.y, scale) + offY;
	r.w = IW_FIXED_MUL(rect.w, scale);
	r.h = IW_FIXED_MUL(rect.h, scale);

	Flush();
	
	DefaultMaterial();

	IwGxFontClearFlags(0xffffffff);
	IwGxLightingOn();	
	IwGxFontSetFont( font );
	IwGxFontSetCol( color );
	//IwGxFontSetScale( scale );

	//Set the formatting rect - this controls where the text appears and what it is formatted against
	IwGxFontSetRect(r);
	IwGxFontSetAlignmentVer(vAlign);
	IwGxFontSetAlignmentHor(hAlign);

	//Draw the text
	IwGxFontDrawText(txt.c_str());
	IwGxLightingOff();
	IwGxFontFreeBuffers();
	Flush();

}
Exemplo n.º 3
0
void Screen3D::SetMaterial(D3DMATERIAL9* Mat)
{
	if(!D3DDevice)
		return;

	if(Mat == NULL)
	{
		DefaultMaterial();
		return;
	}


	D3DDevice->SetMaterial( Mat);
}
DefaultMaterial::DefaultMaterial(){
    DefaultMaterial(glm::vec3(.9f,.9f,.9f));
}