From f609114594c9113083794f417df2cabb71186793 Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 8 Jan 2017 00:05:00 +0800 Subject: [PATCH] Zero the array to prevent black border in glyph Also use the correct internal format --- src/font/font_with_face.cpp | 2 +- src/graphics/stk_texture.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/font/font_with_face.cpp b/src/font/font_with_face.cpp index 37c5af420..87b406ddc 100644 --- a/src/font/font_with_face.cpp +++ b/src/font/font_with_face.cpp @@ -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 diff --git a/src/graphics/stk_texture.cpp b/src/graphics/stk_texture.cpp index e2a3ec6b7..9f48b564c 100644 --- a/src/graphics/stk_texture.cpp +++ b/src/graphics/stk_texture.cpp @@ -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())