Exemplo n.º 1
0
CTextureHandle CTexelGenerator::GenerateAO(bool bInMedias)
{
	for (size_t i = 0; i < m_apMethods.size(); i++)
	{
		CTextureHandle hAO = m_apMethods[i]->GenerateAO(bInMedias);
		if (hAO)
			return hAO;
	}

	return CTextureHandle();
}
Exemplo n.º 2
0
CTextureHandle CTexelGenerator::GenerateNormal(bool bInMedias)
{
	for (size_t i = 0; i < m_apMethods.size(); i++)
	{
		CTextureHandle hNormal = m_apMethods[i]->GenerateNormal(bInMedias);
		if (hNormal.IsValid())
			return hNormal;
	}

	return CTextureHandle();
}
Exemplo n.º 3
0
CTextureHandle CTexelGenerator::GenerateDiffuse(bool bInMedias)
{
	for (size_t i = 0; i < m_apMethods.size(); i++)
	{
		CTextureHandle hTexture = m_apMethods[i]->GenerateDiffuse(bInMedias);
		if (hTexture.IsValid())
			return hTexture;
	}

	return CTextureHandle();
}
Exemplo n.º 4
0
// simple uncompressed RGBA loaders
IGraphics::CTextureHandle CGraphics_Threaded::LoadTexture(const char *pFilename, int StorageType, int StoreFormat, int Flags)
{
	int l = str_length(pFilename);
	IGraphics::CTextureHandle ID;
	CImageInfo Img;

	if(l < 3)
		return CTextureHandle();
	if(LoadPNG(&Img, pFilename, StorageType))
	{
		if (StoreFormat == CImageInfo::FORMAT_AUTO)
			StoreFormat = Img.m_Format;

		ID = LoadTextureRaw(Img.m_Width, Img.m_Height, Img.m_Format, Img.m_pData, StoreFormat, Flags);
		mem_free(Img.m_pData);
		if(ID.Id() != m_InvalidTexture.Id() && g_Config.m_Debug)
			dbg_msg("graphics/texture", "loaded %s", pFilename);
		return ID;
	}

	return m_InvalidTexture;
}