Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Borghetti <bdiego@gmail.com>2009-04-24 01:57:41 +0400
committerDiego Borghetti <bdiego@gmail.com>2009-04-24 01:57:41 +0400
commitefd1a69d6c12d97594c93857365547a56e6792e9 (patch)
treebf509b370b103c2b6db14a318f79dcf361030da5 /source/blender/blenfont/intern/blf_glyph.c
parent1b95d684afd7153a16ebb6d9af16b60b56fc1159 (diff)
Move texture draw to blf_util.c, now both font used it.
A little cleanup on the internal font, it's possible load the old bmfont with: BLF_load_mem(name, NULL, 0) where name can be: helv, helvb or scr. Note that the internal font also support both draw, texture and bitmap, by default always used texture. Remove some old lang function that I left there and don't exist any more because the locale are now in the RNA. Small changes to Style's, so if we build without freetype2 by default go back to the internal font, this is a little ugly (and have the old problem of scale) but now blender always show text (need work a little more there).
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c69
1 files changed, 3 insertions, 66 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index bdec76e01ff..510204b0f51 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -433,69 +433,6 @@ void blf_glyph_free(GlyphBLF *g)
MEM_freeN(g);
}
-static void blf_glyph_texture_draw(float uv[2][2], float dx, float y1, float dx1, float y2)
-{
-
- glBegin(GL_QUADS);
- glTexCoord2f(uv[0][0], uv[0][1]);
- glVertex2f(dx, y1);
-
- glTexCoord2f(uv[0][0], uv[1][1]);
- glVertex2f(dx, y2);
-
- glTexCoord2f(uv[1][0], uv[1][1]);
- glVertex2f(dx1, y2);
-
- glTexCoord2f(uv[1][0], uv[0][1]);
- glVertex2f(dx1, y1);
- glEnd();
-
-}
-
-static void blf_glyph_texture5_draw(float uv[2][2], float x1, float y1, float x2, float y2)
-{
- float soft[25]= {
- 1/60.0f, 1/60.0f, 2/60.0f, 1/60.0f, 1/60.0f,
- 1/60.0f, 3/60.0f, 5/60.0f, 3/60.0f, 1/60.0f,
- 2/60.0f, 5/60.0f, 8/60.0f, 5/60.0f, 2/60.0f,
- 1/60.0f, 3/60.0f, 5/60.0f, 3/60.0f, 1/60.0f,
- 1/60.0f, 1/60.0f, 2/60.0f, 1/60.0f, 1/60.0f};
-
- float color[4], *fp= soft;
- int dx, dy;
-
- glGetFloatv(GL_CURRENT_COLOR, color);
-
- for(dx=-2; dx<3; dx++) {
- for(dy=-2; dy<3; dy++, fp++) {
- glColor4f(color[0], color[1], color[2], fp[0]*color[3]);
- blf_glyph_texture_draw(uv, x1+dx, y1+dy, x2+dx, y2+dy);
- }
- }
-
- glColor4fv(color);
-}
-
-static void blf_glyph_texture3_draw(float uv[2][2], float x1, float y1, float x2, float y2)
-{
- float soft[9]= {1/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 4/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 1/16.0f};
- float color[4], *fp= soft;
- int dx, dy;
-
- glGetFloatv(GL_CURRENT_COLOR, color);
-
- for(dx=-1; dx<2; dx++) {
- for(dy=-1; dy<2; dy++, fp++) {
- glColor4f(color[0], color[1], color[2], fp[0]*color[3]);
- blf_glyph_texture_draw(uv, x1+dx, y1+dy, x2+dx, y2+dy);
- }
- }
-
- glColor4fv(color);
-}
-
-
-
int blf_glyph_texture_render(FontBLF *font, GlyphBLF *g, float x, float y)
{
GlyphTextureBLF *gt;
@@ -525,11 +462,11 @@ int blf_glyph_texture_render(FontBLF *font, GlyphBLF *g, float x, float y)
glBindTexture(GL_TEXTURE_2D, gt->tex);
if (font->blur==3)
- blf_glyph_texture3_draw(gt->uv, dx, y1, dx1, y2);
+ blf_texture3_draw(gt->uv, dx, y1, dx1, y2);
else if (font->blur==5)
- blf_glyph_texture5_draw(gt->uv, dx, y1, dx1, y2);
+ blf_texture5_draw(gt->uv, dx, y1, dx1, y2);
else
- blf_glyph_texture_draw(gt->uv, dx, y1, dx1, y2);
+ blf_texture_draw(gt->uv, dx, y1, dx1, y2);
return(1);
}