summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-05-05 17:45:35 -0700
committerRichard Linden <none@none>2013-05-05 17:45:35 -0700
commit6b81b8629e67d82a7620e48781ded73b6e6126ea (patch)
treeb029ca5925dd2eb0f6ccc952bf8d71dd23f45cf1 /indra/llrender
parent41e5bf346eaa0a43646058691cc8090ddfe498e9 (diff)
Spring cleaning: removed unused .cpp and.h files, and cleaned up header dependencies
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llfontregistry.cpp24
-rw-r--r--indra/llrender/llfontregistry.h5
2 files changed, 16 insertions, 13 deletions
diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp
index b5bdba996f..ef48ffa39a 100644
--- a/indra/llrender/llfontregistry.cpp
+++ b/indra/llrender/llfontregistry.cpp
@@ -34,13 +34,15 @@
#include "llcontrol.h"
#include "lldir.h"
#include "llwindow.h"
+#include "llxmlnode.h"
extern LLControlGroup gSavedSettings;
using std::string;
using std::map;
-bool fontDescInitFromXML(LLXMLNodePtr node, LLFontDescriptor& desc);
+bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc);
+bool init_from_xml(LLFontRegistry* registry, LLXMLNodePtr node);
LLFontDescriptor::LLFontDescriptor():
mStyle(0)
@@ -207,7 +209,7 @@ bool LLFontRegistry::parseFontInfo(const std::string& xml_filename)
if (root->hasName("fonts"))
{
// Expect a collection of children consisting of "font" or "font_size" entries
- bool init_succ = initFromXML(root);
+ bool init_succ = init_from_xml(this, root);
success = success || init_succ;
}
}
@@ -230,7 +232,7 @@ std::string currentOsName()
#endif
}
-bool fontDescInitFromXML(LLXMLNodePtr node, LLFontDescriptor& desc)
+bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc)
{
if (node->hasName("font"))
{
@@ -263,14 +265,14 @@ bool fontDescInitFromXML(LLXMLNodePtr node, LLFontDescriptor& desc)
{
if (child_name == currentOsName())
{
- fontDescInitFromXML(child, desc);
+ font_desc_init_from_xml(child, desc);
}
}
}
return true;
}
-bool LLFontRegistry::initFromXML(LLXMLNodePtr node)
+bool init_from_xml(LLFontRegistry* registry, LLXMLNodePtr node)
{
LLXMLNodePtr child;
@@ -281,17 +283,17 @@ bool LLFontRegistry::initFromXML(LLXMLNodePtr node)
if (child->hasName("font"))
{
LLFontDescriptor desc;
- bool font_succ = fontDescInitFromXML(child, desc);
+ bool font_succ = font_desc_init_from_xml(child, desc);
LLFontDescriptor norm_desc = desc.normalize();
if (font_succ)
{
// if this is the first time we've seen this font name,
// create a new template map entry for it.
- const LLFontDescriptor *match_desc = getMatchingFontDesc(desc);
+ const LLFontDescriptor *match_desc = registry->getMatchingFontDesc(desc);
if (match_desc == NULL)
{
// Create a new entry (with no corresponding font).
- mFontMap[norm_desc] = NULL;
+ registry->mFontMap[norm_desc] = NULL;
}
// otherwise, find the existing entry and combine data.
else
@@ -306,8 +308,8 @@ bool LLFontRegistry::initFromXML(LLXMLNodePtr node)
desc.getFileNames().end());
LLFontDescriptor new_desc = *match_desc;
new_desc.getFileNames() = match_file_names;
- mFontMap.erase(*match_desc);
- mFontMap[new_desc] = NULL;
+ registry->mFontMap.erase(*match_desc);
+ registry->mFontMap[new_desc] = NULL;
}
}
}
@@ -318,7 +320,7 @@ bool LLFontRegistry::initFromXML(LLXMLNodePtr node)
if (child->getAttributeString("name",size_name) &&
child->getAttributeF32("size",size_value))
{
- mFontSizes[size_name] = size_value;
+ registry->mFontSizes[size_name] = size_value;
}
}
diff --git a/indra/llrender/llfontregistry.h b/indra/llrender/llfontregistry.h
index 059248fbbd..177eb6c8a5 100644
--- a/indra/llrender/llfontregistry.h
+++ b/indra/llrender/llfontregistry.h
@@ -28,7 +28,7 @@
#ifndef LL_LLFONTREGISTRY_H
#define LL_LLFONTREGISTRY_H
-#include "llxmlnode.h"
+#include "llpointer.h"
class LLFontGL;
@@ -65,6 +65,7 @@ private:
class LLFontRegistry
{
public:
+ friend bool init_from_xml(LLFontRegistry*, LLPointer<class LLXMLNode>);
// create_gl_textures - set to false for test apps with no OpenGL window,
// such as llui_libtest
LLFontRegistry(bool create_gl_textures);
@@ -72,7 +73,6 @@ public:
// Load standard font info from XML file(s).
bool parseFontInfo(const std::string& xml_filename);
- bool initFromXML(LLXMLNodePtr node);
// Clear cached glyphs for all fonts.
void reset();
@@ -94,6 +94,7 @@ public:
const string_vec_t& getUltimateFallbackList() const;
private:
+ LLFontRegistry(const LLFontRegistry& other); // no-copy
LLFontGL *createFont(const LLFontDescriptor& desc);
typedef std::map<LLFontDescriptor,LLFontGL*> font_reg_map_t;
typedef std::map<std::string,F32> font_size_map_t;