diff options
author | jmarshallnz <jmarshallnz@svn> | 2009-10-12 22:25:20 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2009-10-12 22:25:20 +0000 |
commit | 6a1c17b7b859ed6ff60f380c3e5b114656c62113 (patch) | |
tree | 05cefa92a9e5d1ce4432bcf3d1d4dfadf0bd7984 /guilib/GUIFontTTF.cpp | |
parent | ed5009b882d112c49db5c6ed167a6f9f4517aeca (diff) |
fixed: Don't use a fixed texture size for font textures - use whatever the GPU supports.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@23674 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUIFontTTF.cpp')
-rw-r--r-- | guilib/GUIFontTTF.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/guilib/GUIFontTTF.cpp b/guilib/GUIFontTTF.cpp index 95e4edd989..2fa31b9b28 100644 --- a/guilib/GUIFontTTF.cpp +++ b/guilib/GUIFontTTF.cpp @@ -27,6 +27,7 @@ #include "FileSystem/SpecialProtocol.h" #include "MathUtils.h" #include "utils/log.h" +#include "WindowingFactory.h" #include <math.h> @@ -52,8 +53,6 @@ int CGUIFontTTFBase::justification_word_weight = 6; // weight of word spacing // A larger number means more of the "dead space" is placed between // words rather than between letters. -unsigned int CGUIFontTTFBase::max_texture_size = 2048; // max texture size - 2048 for GMA965 - class CFreeTypeLibrary { public: @@ -265,7 +264,8 @@ bool CGUIFontTTFBase::Load(const CStdString& strFilename, float height, float as m_textureWidth = CBaseTexture::PadPow2(m_textureWidth); - if (m_textureWidth > max_texture_size) m_textureWidth = max_texture_size; + if (m_textureWidth > g_Windowing.GetMaxTextureSize()) + m_textureWidth = g_Windowing.GetMaxTextureSize(); // set the posX and posY so that our texture will be created on first character write. m_posX = m_textureWidth; @@ -562,10 +562,10 @@ bool CGUIFontTTFBase::CacheCharacter(wchar_t letter, uint32_t style, Character * { // create the new larger texture unsigned int newHeight = m_posY + m_cellHeight; - // check for max height (can't be more than max_texture_size texels - if (newHeight > max_texture_size) + // check for max height + if (newHeight > g_Windowing.GetMaxTextureSize()) { - CLog::Log(LOGDEBUG, "GUIFontTTF::CacheCharacter: New cache texture is too large (%u > %u pixels long)", newHeight, max_texture_size); + CLog::Log(LOGDEBUG, "GUIFontTTF::CacheCharacter: New cache texture is too large (%u > %u pixels long)", newHeight, g_Windowing.GetMaxTextureSize()); FT_Done_Glyph(glyph); return false; } |