Removed old LUMINANCE_ALPHA code pathways since they are no longer used.
This commit is contained in:
@@ -94,41 +94,6 @@ osgText::Font::Glyph* FreeTypeFont::getGlyph(unsigned int charcode)
|
||||
|
||||
osg::ref_ptr<osgText::Font::Glyph> 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;p<data+dataSize;) { *p++ = 255; *p++ = 0; }
|
||||
|
||||
glyph->setImage(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;c<sourceWidth;++c,++ptr)
|
||||
{
|
||||
(*data++)=255;
|
||||
(*data++)=*ptr;
|
||||
}
|
||||
data+=2*margin; // skip the right margin.
|
||||
}
|
||||
#else
|
||||
unsigned int dataSize = width*height;
|
||||
unsigned char* data = new unsigned char[dataSize];
|
||||
|
||||
@@ -160,7 +125,6 @@ osgText::Font::Glyph* FreeTypeFont::getGlyph(unsigned int charcode)
|
||||
}
|
||||
data+=margin; // skip the right margin.
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
FT_Glyph_Metrics* metrics = &(glyphslot->metrics);
|
||||
|
||||
@@ -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> 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;p<data+dataSize;) { *p++ = 255; *p++ = 0; }
|
||||
|
||||
glyph->setImage(_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;row<sourceHeight;++row,++ptr)
|
||||
{
|
||||
data+=2*_margin; // skip the left margin
|
||||
(*data++)=255;
|
||||
(*data++)=((*ptr)&128)?value_on:value_off;
|
||||
(*data++)=255;
|
||||
(*data++)=((*ptr)&64)?value_on:value_off;
|
||||
(*data++)=255;
|
||||
(*data++)=((*ptr)&32)?value_on:value_off;
|
||||
(*data++)=255;
|
||||
(*data++)=((*ptr)&16)?value_on:value_off;
|
||||
(*data++)=255;
|
||||
(*data++)=((*ptr)&8)?value_on:value_off;
|
||||
(*data++)=255;
|
||||
(*data++)=((*ptr)&4)?value_on:value_off;
|
||||
(*data++)=255;
|
||||
(*data++)=((*ptr)&2)?value_on:value_off;
|
||||
(*data++)=255;
|
||||
(*data++)=((*ptr)&1)?value_on:value_off;
|
||||
data+=2*_margin; // skip the right margin.
|
||||
}
|
||||
#else
|
||||
_width = sourceWidth+2*_margin;
|
||||
_height = sourceHeight+2*_margin;
|
||||
|
||||
@@ -291,7 +239,6 @@ void DefaultFont::constructGlyphs()
|
||||
(*data++)=((*ptr)&1)?value_on:value_off;
|
||||
data+=_margin; // skip the right margin.
|
||||
}
|
||||
#endif
|
||||
|
||||
glyph->setHorizontalBearing(osg::Vec2(0.0f,0.0f)); // bottom left.
|
||||
glyph->setHorizontalAdvance((float)_width);
|
||||
|
||||
Reference in New Issue
Block a user