Ejemplo n.º 1
0
	void Txtr::load(const fschar *colorsFileName, const fschar *alphaFileName)
	{
		removeImage();
		if (colorsFileName) loadColors(colorsFileName);
		if (alphaFileName && hasImage()) loadAlpha(alphaFileName, 255);
		else setAlpha(255);
	}
Ejemplo n.º 2
0
// ============================================================================
// TexAlpha::init()                                                            
// re-scale texture's size and load alpha channel                              
void TexAlpha::init(const QImage * texture,const int _size)
{  
  size = _size;                            // news texture's size 
  half_size = size >> 1;                   // half size           
  QImage new_texture;                      // temporary texture   
  new_texture = texture->scale(size,size); // rescale with size   
  alpha_array = new float[size*size];       // array to store alpha
  loadAlpha(&new_texture);
}
Ejemplo n.º 3
0
void PTexture::loadAlpha(const std::string &filename, bool genMipmaps, bool clamp)
{
  PImage image (filename);
  loadAlpha (image, genMipmaps, clamp);
  name = filename;
}
Ejemplo n.º 4
0
	void Txtr::load(Pixel3 color, const fschar *alphaFileName)
	{
		removeImage();
		loadAlpha(alphaFileName, 255, true);
		fillColor3(color);
	}