Slightly improve getUnicolorTexture

This commit is contained in:
Vincent Lejeune 2014-09-18 00:53:09 +02:00
parent 24cd727899
commit 39c56dcb78
2 changed files with 7 additions and 4 deletions

View File

@ -16,7 +16,7 @@ namespace HardwareStats
void initGL();
GLuint LoadTFBProgram(const char * vertex_file_path, const char **varyings, unsigned varyingscount);
video::ITexture* getUnicolorTexture(video::SColor c);
video::ITexture* getUnicolorTexture(const video::SColor &c);
void setTexture(unsigned TextureUnit, GLuint TextureId, GLenum MagFilter, GLenum MinFilter, bool allowAF = false);
GLuint LoadShader(const char * file, unsigned type);

View File

@ -169,10 +169,13 @@ void saveCompressedTexture(const std::string& compressed_tex)
static unsigned colorcount = 0;
video::ITexture* getUnicolorTexture(video::SColor c)
video::ITexture* getUnicolorTexture(const video::SColor &c)
{
video::SColor tmp[4] = {
c, c, c, c
unsigned tmp[4] = {
c.color,
c.color,
c.color,
c.color
};
video::IImage *img = irr_driver->getVideoDriver()->createImageFromData(video::ECF_A8R8G8B8, core::dimension2d<u32>(2, 2), tmp);
img->grab();