summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-10-19 17:31:05 -0700
committerSteve Bennetts <steve@lindenlab.com>2009-10-19 17:31:05 -0700
commit1d5be6eca1969da3e6b923cbf5326d3bdc8b066f (patch)
treea03a2e782f5022ebbbe1ef933e3a11c1b9de00a6 /indra/llrender
parent97d2b740d3e700d86665183d5fc5cfcb3efe72d6 (diff)
parentd78520f6b7fd4a20bbb1d1291a34761efc1fd740 (diff)
merge
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llfontgl.cpp7
-rw-r--r--indra/llrender/llfontgl.h1
-rw-r--r--indra/llrender/llfontregistry.cpp5
-rw-r--r--indra/llrender/llgl.cpp2
4 files changed, 12 insertions, 3 deletions
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index c9163d2890..793a526c26 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -893,6 +893,13 @@ LLFontGL* LLFontGL::getFontByName(const std::string& name)
}
}
+//static
+LLFontGL* LLFontGL::getFontDefault()
+{
+ return getFontSansSerif(); // Fallback to sans serif as default font
+}
+
+
// static
std::string LLFontGL::getFontPathSystem()
{
diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h
index a278d88287..5f2c86c6c1 100644
--- a/indra/llrender/llfontgl.h
+++ b/indra/llrender/llfontgl.h
@@ -165,6 +165,7 @@ public:
static LLFontGL* getFont(const LLFontDescriptor& desc);
// Use with legacy names like "SANSSERIF_SMALL" or "OCRA"
static LLFontGL* getFontByName(const std::string& name);
+ static LLFontGL* getFontDefault(); // default fallback font
static std::string getFontPathLocal();
static std::string getFontPathSystem();
diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp
index 45573cd817..7a3d6ec4f2 100644
--- a/indra/llrender/llfontregistry.cpp
+++ b/indra/llrender/llfontregistry.cpp
@@ -380,7 +380,10 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
LLFontDescriptor nearest_exact_desc = *match_desc;
nearest_exact_desc.setSize(norm_desc.getSize());
font_reg_map_t::iterator it = mFontMap.find(nearest_exact_desc);
- if (it != mFontMap.end())
+ // If we fail to find a font in the fonts directory, it->second might be NULL.
+ // We shouldn't construcnt a font with a NULL mFontFreetype.
+ // This may not be the best solution, but it at least prevents a crash.
+ if (it != mFontMap.end() && it->second != NULL)
{
llinfos << "-- matching font exists: " << nearest_exact_desc.getName() << " size " << nearest_exact_desc.getSize() << " style " << ((S32) nearest_exact_desc.getStyle()) << llendl;
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 10315bacf1..3400a72385 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -593,8 +593,6 @@ void LLGLManager::shutdownGL()
// these are used to turn software blending on. They appear in the Debug/Avatar menu
// presence of vertex skinning/blending or vertex programs will set these to FALSE by default.
-extern LLCPUInfo gSysCPU;
-
void LLGLManager::initExtensions()
{
#if LL_MESA_HEADLESS