Zero the array to prevent black border in glyph

Also use the correct internal format
This commit is contained in:
Benau 2017-01-08 00:05:00 +08:00
parent 314c32865b
commit f609114594
2 changed files with 2 additions and 2 deletions

View File

@ -134,7 +134,7 @@ void FontWithFace::createNewGlyphPage()
{
#ifndef SERVER_ONLY
uint8_t* data = new uint8_t[getGlyphPageSize() * getGlyphPageSize() *
(CVS->isARBTextureSwizzleUsable() ? 1 : 4)];
(CVS->isARBTextureSwizzleUsable() ? 1 : 4)]();
#else
uint8_t* data = NULL;
#endif

View File

@ -159,7 +159,7 @@ void STKTexture::reload(bool no_upload, uint8_t* preload_data,
const unsigned int w = m_size.Width;
const unsigned int h = m_size.Height;
unsigned int format = single_channel ? GL_RED : GL_BGRA;
unsigned int internal_format = single_channel ? GL_RED : GL_RGBA;
unsigned int internal_format = single_channel ? GL_R8 : GL_RGBA;
#if !defined(USE_GLES2)
if (m_mesh_texture && CVS->isTextureCompressionEnabled())