Пример #1
0
HRESULT CTextObject::GetClipboard()
{
	IDataObject* pDataObject;
	HRESULT hRes = OleGetClipboard(&pDataObject);
	if (SUCCEEDED(hRes))
	{
		if (! SetObjectText(pDataObject))
			hRes = E_FAIL;
		pDataObject->Release();
	}
	return hRes;
}
void psEntityLabels::CreateLabelOfObject(GEMClientObject *object)
{
    if (!object)
    {
        Debug1( LOG_ANY, 0, "NULL object passed to psEntityLabels::CreateLabelOfObject" );
        return;
    }

    // Don't make labels for the player or action locations
    if (object == celClient->GetMainPlayer() || object->GetObjectType() == GEM_ACTION_LOC)
        return;

    csRef<iMeshWrapper> mesh = object->GetMesh();

    // Has it got a mesh to attach to?
    if (!mesh || !mesh->GetMeshObject())
        return;

    DeleteLabelOfObject(object); // make sure the old label is gone

    // Get the height of the model
    const csBox3& boundBox = object->GetBBox();

    psEffectManager* effectMgr = psengine->GetEffectManager();

    // Create the effect
    unsigned int id = effectMgr->RenderEffect( "label", 
                                               csVector3(0.0f,boundBox.Max(1) + 0.25f,0.0f),
                                               mesh );

    psEffect* effect = effectMgr->FindEffect(id);

    object->SetEntityLabel(effect);

    // Update text
    SetObjectText(object);

    // Set to invisible by default.
    ShowLabelOfObject(object, false);
}
void psEntityLabels::RepaintObjectLabel(GEMClientObject* object)
{
    if (object && object->GetObjectType() != GEM_ACTION_LOC)
        SetObjectText(object);
}