diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-11 08:10:50 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-11 08:10:50 +0400 |
commit | 5ea86e1e2b09b58a72992083f79c03ee3f20af49 (patch) | |
tree | 79d682900c73c4a87aa90a8d9dbd293c4396013e /source | |
parent | dd2b4a05c3dc527bc0c459f81f5810e6ecb151a6 (diff) | |
parent | 758c2282635f77ee1317d4bdbdf1959bf0c09525 (diff) |
svn merge ^/trunk/blender -r43995:44024
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenfont/BLF_api.h | 1 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 27 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 3 | ||||
-rw-r--r-- | source/blender/modifiers/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/gameengine/BlenderRoutines/KX_BlenderGL.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | 6 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_FontObject.cpp | 6 |
7 files changed, 15 insertions, 34 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 8752defcc15..a045f47cb40 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -197,7 +197,6 @@ void BLF_dir_free(char **dirs, int count); #define BLF_KERNING_DEFAULT (1<<3) #define BLF_MATRIX (1<<4) #define BLF_ASPECT (1<<5) -#define BLF_TEXFILTER (1<<6) #define BLF_DRAW_STR_DUMMY_MAX 1024 diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index ab7ef8072a9..f0cfcdc97b9 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -54,8 +54,6 @@ #include "blf_internal_types.h" #include "blf_internal.h" -#define _BLF_PADDING 3 -#define _BLF_MIPMAP_LEVELS 3 GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, int size, int dpi) { @@ -89,11 +87,7 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font) gc->cur_tex= -1; gc->x_offs= 0; gc->y_offs= 0; - /* Increase padding for each mipmap level: 0->3, 1->4, 2->6, 3->10, ... */ - if (font->flags & BLF_TEXFILTER) - gc->pad= pow(2, _BLF_MIPMAP_LEVELS) + 2; - else - gc->pad= _BLF_PADDING; + gc->pad= 3; gc->num_glyphs= font->face->num_glyphs; gc->rem_glyphs= font->face->num_glyphs; @@ -302,17 +296,13 @@ void blf_glyph_free(GlyphBLF *g) static void blf_texture_draw(float uv[2][2], float dx, float y1, float dx1, float y2) { - /* When a string is being rendered as individual glyphs (as in the game - * engine), the leading edge needs to be raised a fraction to prevent - * z-fighting for kerned characters. - z0r */ - const float twist = (dx1 - dx) * 0.0002f; - + glBegin(GL_QUADS); glTexCoord2f(uv[0][0], uv[0][1]); - glVertex3f(dx, y1, twist); + glVertex2f(dx, y1); glTexCoord2f(uv[0][0], uv[1][1]); - glVertex3f(dx, y2, twist); + glVertex2f(dx, y2); glTexCoord2f(uv[1][0], uv[1][1]); glVertex2f(dx1, y2); @@ -415,15 +405,6 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y) glBindTexture(GL_TEXTURE_2D, g->tex); glTexSubImage2D(GL_TEXTURE_2D, 0, g->xoff, g->yoff, g->width, g->height, GL_ALPHA, GL_UNSIGNED_BYTE, g->bitmap); - if (font->flags & BLF_TEXFILTER) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, - _BLF_MIPMAP_LEVELS); - glGenerateMipmap(GL_TEXTURE_2D); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_LINEAR_MIPMAP_LINEAR); - } glPopClientAttrib(); g->uv[0][0]= ((float)g->xoff) / ((float)gc->p2_width); diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index a6672130dc3..a3e3eb19a5b 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -174,7 +174,8 @@ void GPU_extensions_init(void) strstr(renderer, "R5") || strstr(renderer, "RV5") || strstr(renderer, "RS600") || strstr(renderer, "RS690") || strstr(renderer, "RS740") || strstr(renderer, "X1") || - strstr(renderer, "X2")) + strstr(renderer, "X2") || strstr(renderer, "Radeon 9") || + strstr(renderer, "RADEON 9")) GG.npotdisabled = 1; } diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt index 6ccd71dd6a7..8170481cfd6 100644 --- a/source/blender/modifiers/CMakeLists.txt +++ b/source/blender/modifiers/CMakeLists.txt @@ -12,7 +12,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2006, Blender Foundation # All rights reserved. diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index 78dcfc8edd9..7a99a4a1419 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -136,8 +136,8 @@ void BL_print_game_line(int fontid, const char* text, int size, int dpi, float* /* the actual drawing */ glColor4fv(color); - BLF_enable(fontid, BLF_MATRIX|BLF_ASPECT|BLF_TEXFILTER); /* multiply the text matrix by the object matrix */ + BLF_enable(fontid, BLF_MATRIX|BLF_ASPECT); BLF_matrix(fontid, mat); /* aspect is the inverse scale that allows you to increase */ @@ -149,7 +149,7 @@ void BL_print_game_line(int fontid, const char* text, int size, int dpi, float* BLF_position(fontid, 0, 0, 0); BLF_draw(fontid, (char *)text, 65535); - BLF_disable(fontid, BLF_MATRIX|BLF_ASPECT|BLF_TEXFILTER); + BLF_disable(fontid, BLF_MATRIX|BLF_ASPECT); } void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int height) diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index b06a9783b50..55e3220c08c 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -292,10 +292,10 @@ void GPC_RenderTools::RenderText3D( int fontid, float aspect) { /* the actual drawing */ - glColor3fv(color); + glColor4fv(color); - BLF_enable(fontid, BLF_MATRIX|BLF_ASPECT|BLF_TEXFILTER); /* multiply the text matrix by the object matrix */ + BLF_enable(fontid, BLF_MATRIX|BLF_ASPECT); BLF_matrix(fontid, mat); /* aspect is the inverse scale that allows you to increase */ @@ -307,7 +307,7 @@ void GPC_RenderTools::RenderText3D( int fontid, BLF_position(fontid, 0, 0, 0); BLF_draw(fontid, text, 65535); - BLF_disable(fontid, BLF_MATRIX|BLF_ASPECT|BLF_TEXFILTER); + BLF_disable(fontid, BLF_MATRIX|BLF_ASPECT); glEnable(GL_DEPTH_TEST); } diff --git a/source/gameengine/Ketsji/KX_FontObject.cpp b/source/gameengine/Ketsji/KX_FontObject.cpp index 8cce9471587..519ff97a2a2 100644 --- a/source/gameengine/Ketsji/KX_FontObject.cpp +++ b/source/gameengine/Ketsji/KX_FontObject.cpp @@ -173,10 +173,10 @@ void KX_FontObject::DrawText() this->GetObjectColor().getValue(m_color); /* HARDCODED MULTIPLICATION FACTOR - this will affect the render resolution directly */ - float RES = BGE_FONT_RES * m_resolution; + const float RES = BGE_FONT_RES * m_resolution; - float size = m_fsize * m_object->size[0] * RES; - float aspect = 1.f / (m_object->size[0] * RES); + const float size = m_fsize * this->NodeGetWorldScaling()[0] * RES; + const float aspect = m_fsize / size; /* Get a working copy of the OpenGLMatrix to use */ double mat[16]; |