Removed singletone from FontConfig
Also renamed class so it now matches better with class file name1008-fix
parent
1e614d64d0
commit
94cacdae96
|
@ -44,7 +44,6 @@ class CSoundInterface;
|
|||
class CInput;
|
||||
class CPathManager;
|
||||
class CConfigFile;
|
||||
class CFontConfigFile;
|
||||
class CSystemUtils;
|
||||
struct SystemTimeStamp;
|
||||
|
||||
|
|
|
@ -37,17 +37,17 @@
|
|||
|
||||
namespace bp = boost::property_tree;
|
||||
|
||||
CFontConfigFile::CFontConfigFile()
|
||||
CFontConfig::CFontConfig()
|
||||
: m_needsSave(false)
|
||||
, m_loaded(false)
|
||||
{
|
||||
}
|
||||
|
||||
CFontConfigFile::~CFontConfigFile()
|
||||
CFontConfig::~CFontConfig()
|
||||
{
|
||||
}
|
||||
|
||||
bool CFontConfigFile::Init()
|
||||
bool CFontConfig::Init()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ bool CFontConfigFile::Init()
|
|||
return true;
|
||||
}
|
||||
|
||||
std::string CFontConfigFile::GetFont(Gfx::FontType type)
|
||||
std::string CFontConfig::GetFont(Gfx::FontType type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
|
|
|
@ -33,17 +33,17 @@
|
|||
#include <string>
|
||||
|
||||
/**
|
||||
* \class CFontConfigFile
|
||||
* \class CFontConfig
|
||||
*
|
||||
* \brief Class for loading config file
|
||||
*
|
||||
*/
|
||||
|
||||
class CFontConfigFile : public CSingleton<CFontConfigFile>
|
||||
class CFontConfig
|
||||
{
|
||||
public:
|
||||
CFontConfigFile();
|
||||
virtual ~CFontConfigFile();
|
||||
CFontConfig();
|
||||
virtual ~CFontConfig();
|
||||
|
||||
/** Loads fonts.ini
|
||||
* \return return true on success
|
||||
|
@ -60,9 +60,3 @@ private:
|
|||
bool m_needsSave;
|
||||
bool m_loaded;
|
||||
};
|
||||
|
||||
//! Global function to get config file instance
|
||||
inline CFontConfigFile & GetFontConfigFile()
|
||||
{
|
||||
return CFontConfigFile::GetInstance();
|
||||
}
|
|
@ -117,8 +117,8 @@ CText::~CText()
|
|||
|
||||
bool CText::Create()
|
||||
{
|
||||
CFontConfigFile fontconfig;
|
||||
if (!GetFontConfigFile().Init())
|
||||
CFontConfig fontConfig;
|
||||
if (!fontConfig.Init())
|
||||
{
|
||||
GetLogger()->Warn("Error on parsing fonts config file: failed to open file\n");
|
||||
}
|
||||
|
@ -128,14 +128,14 @@ bool CText::Create()
|
|||
return false;
|
||||
}
|
||||
|
||||
m_fonts[FONT_COMMON] = MakeUnique<MultisizeFont>(GetFontConfigFile().GetFont(FONT_COMMON));
|
||||
m_fonts[FONT_COMMON_BOLD] = MakeUnique<MultisizeFont>(GetFontConfigFile().GetFont(FONT_COMMON_BOLD));
|
||||
m_fonts[FONT_COMMON_ITALIC] = MakeUnique<MultisizeFont>(GetFontConfigFile().GetFont(FONT_COMMON_ITALIC));
|
||||
m_fonts[FONT_COMMON] = MakeUnique<MultisizeFont>(fontConfig.GetFont(FONT_COMMON));
|
||||
m_fonts[FONT_COMMON_BOLD] = MakeUnique<MultisizeFont>(fontConfig.GetFont(FONT_COMMON_BOLD));
|
||||
m_fonts[FONT_COMMON_ITALIC] = MakeUnique<MultisizeFont>(fontConfig.GetFont(FONT_COMMON_ITALIC));
|
||||
|
||||
m_fonts[FONT_SATCOM] = MakeUnique<MultisizeFont>(GetFontConfigFile().GetFont(FONT_SATCOM));
|
||||
m_fonts[FONT_SATCOM] = MakeUnique<MultisizeFont>(fontConfig.GetFont(FONT_SATCOM));
|
||||
|
||||
m_fonts[FONT_STUDIO] = MakeUnique<MultisizeFont>(GetFontConfigFile().GetFont(FONT_STUDIO));
|
||||
m_fonts[FONT_STUDIO_BOLD] = MakeUnique<MultisizeFont>(GetFontConfigFile().GetFont(FONT_STUDIO_BOLD));
|
||||
m_fonts[FONT_STUDIO] = MakeUnique<MultisizeFont>(fontConfig.GetFont(FONT_STUDIO));
|
||||
m_fonts[FONT_STUDIO_BOLD] = MakeUnique<MultisizeFont>(fontConfig.GetFont(FONT_STUDIO_BOLD));
|
||||
|
||||
for (auto it = m_fonts.begin(); it != m_fonts.end(); ++it)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue