From 84aef3255237077f3eb07b7e7f58db50080f0da7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 28 Apr 2005 19:08:44 +0000 Subject: [PATCH] Removed old LUMINANCE_ALPHA code pathways since they are no longer used. --- src/osgPlugins/freetype/FreeTypeFont.cpp | 36 ---------------- src/osgText/DefaultFont.cpp | 53 ------------------------ 2 files changed, 89 deletions(-) diff --git a/src/osgPlugins/freetype/FreeTypeFont.cpp b/src/osgPlugins/freetype/FreeTypeFont.cpp index be3cb1526..fa4477741 100644 --- a/src/osgPlugins/freetype/FreeTypeFont.cpp +++ b/src/osgPlugins/freetype/FreeTypeFont.cpp @@ -94,41 +94,6 @@ osgText::Font::Glyph* FreeTypeFont::getGlyph(unsigned int charcode) osg::ref_ptr glyph = new osgText::Font::Glyph; - -#ifdef OSG_FONT_USE_LUMINANCE_ALPHA - unsigned int dataSize = width*height*2; - unsigned char* data = new unsigned char[dataSize]; - - - // clear the image to zeros. - for(unsigned char* p=data;psetImage(width,height,1, - GL_LUMINANCE_ALPHA, - GL_LUMINANCE_ALPHA,GL_UNSIGNED_BYTE, - data, - osg::Image::USE_NEW_DELETE, - 1); - - glyph->setInternalTextureFormat(GL_LUMINANCE_ALPHA); - - // skip the top margin - data += (margin*width)*2; - - // copy image across to osgText::Glyph image. - for(int r=sourceHeight-1;r>=0;--r) - { - data+=2*margin; // skip the left margin - - unsigned char* ptr = buffer+r*pitch; - for(unsigned int c=0;cmetrics); diff --git a/src/osgText/DefaultFont.cpp b/src/osgText/DefaultFont.cpp index 35f1abda5..d0a43214e 100644 --- a/src/osgText/DefaultFont.cpp +++ b/src/osgText/DefaultFont.cpp @@ -195,58 +195,6 @@ void DefaultFont::constructGlyphs() unsigned int sourceWidth = 8; unsigned int sourceHeight = 12; -#ifdef OSG_FONT_USE_LUMINANCE_ALPHA - _width = sourceWidth+2*_margin; - _height = sourceHeight+2*_margin; - - // populate the glyph mp - for(unsigned int i=32;i<127;i++) - { - osg::ref_ptr glyph = new Glyph; - - unsigned int dataSize = _width*_height*2; - unsigned char* data = new unsigned char[dataSize]; - - // clear the image to zeros. - for(unsigned char* p=data;psetImage(_width,_height,1, - GL_LUMINANCE_ALPHA, - GL_LUMINANCE_ALPHA,GL_UNSIGNED_BYTE, - data, - osg::Image::USE_NEW_DELETE, - 1); - - // now populate data arry by converting bitmap into a luminance_alpha map. - unsigned char* ptr = rasters[i-32]; - unsigned char value_on = 255; - unsigned char value_off = 0; - - // skip the top margin - data += (_margin*_width)*2; - - for(unsigned int row=0;rowsetHorizontalBearing(osg::Vec2(0.0f,0.0f)); // bottom left. glyph->setHorizontalAdvance((float)_width);