From 681bf12333225684967a98aeaa20948e22fdb72b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 9 May 2007 07:54:32 +0000 Subject: [PATCH] Added imageData block initialized to 0 for first construction of GlyphTexture --- src/osgText/Font.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/osgText/Font.cpp b/src/osgText/Font.cpp index ad24fb18b..3e57353f1 100644 --- a/src/osgText/Font.cpp +++ b/src/osgText/Font.cpp @@ -134,7 +134,7 @@ Font::Font(FontImplementation* implementation): _width(16), _height(16), _margin(1), - _marginRatio(0.05), + _marginRatio(0.02), _textureWidthHint(1024), _textureHeightHint(1024), _minFilterHint(osg::Texture::LINEAR_MIPMAP_LINEAR), @@ -375,7 +375,7 @@ void Font::addGlyph(unsigned int width, unsigned int height, unsigned int charco Font::GlyphTexture::GlyphTexture(): _margin(1), - _marginRatio(0.05f), + _marginRatio(0.02f), _usedY(0), _partUsedX(0), _partUsedY(0) @@ -524,13 +524,23 @@ void Font::GlyphTexture::apply(osg::State& state) const // not mip mapping so no problems. break; } + + unsigned int imageDataSize = getTextureHeight()*getTextureWidth(); + unsigned char* imageData = new unsigned char[imageDataSize]; + for(unsigned int i=0; i