diff --git a/src/graphics/glwrap.hpp b/src/graphics/glwrap.hpp index af824b681..3477b649b 100644 --- a/src/graphics/glwrap.hpp +++ b/src/graphics/glwrap.hpp @@ -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); diff --git a/src/graphics/texturemanager.cpp b/src/graphics/texturemanager.cpp index 74d9c548b..7d2711771 100644 --- a/src/graphics/texturemanager.cpp +++ b/src/graphics/texturemanager.cpp @@ -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(2, 2), tmp); img->grab();