コード例 #1
0
Fonte* GerenciadorDeRecursos::carregarFonte(const string& nome, const string& caminho, int tamanho, EstiloFonte estilo)
{
	Fonte* fonte = new Fonte;
	if(fonte->carregar(caminho, tamanho, estilo))
	{
		mFontes.insert(pair<string, Fonte*>(nome, fonte));
	}
	else
	{
		delete fonte;
		fonte = NULL;
	}

	return fonte;
}
コード例 #2
0
Fonte* GerenciadorDeRecursos::carregarFonte(const string& nome, const string& caminho, int tamanho, int estilo)
{
	if(carregouFonte(nome))
	{
		uniErro("Recurso '" + nome + "' nao pode ser carregado, pois uma Fonte com esse nome ja existe.");
		return NULL;
	}

	Fonte* fonte = new Fonte;
	if(fonte->carregar(caminho, tamanho, estilo))
	{
		mFontes.insert(pair<string, Fonte*>(nome, fonte));
	}
	else
	{
		delete fonte;
		fonte = NULL;
	}

	return fonte;
}