Major cleanup.
Moved to namespace Cleanup includes
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
#include "FontManager.h"
|
||||
|
||||
std::map <std::string, Ref<Font>> FontManager::m_Fonts = std::map<std::string, Ref<Font>>();
|
||||
namespace Nuake {
|
||||
std::map <std::string, Ref<Font>> FontManager::m_Fonts = std::map<std::string, Ref<Font>>();
|
||||
|
||||
Ref<Font> FontManager::GetFont(const std::string& font)
|
||||
{
|
||||
// Fonts exists in memory
|
||||
if (m_Fonts.find(font) != m_Fonts.end())
|
||||
Ref<Font> FontManager::GetFont(const std::string& font)
|
||||
{
|
||||
return m_Fonts[font];
|
||||
}
|
||||
|
||||
// Load font
|
||||
Ref<Font> newFont = FontLoader::LoadFont(font);
|
||||
if (newFont)
|
||||
return newFont;
|
||||
// Fonts exists in memory
|
||||
if (m_Fonts.find(font) != m_Fonts.end())
|
||||
{
|
||||
return m_Fonts[font];
|
||||
}
|
||||
|
||||
Logger::Log("Error: failed to load font " + font, CRITICAL);
|
||||
return nullptr;
|
||||
}
|
||||
// Load font
|
||||
Ref<Font> newFont = FontLoader::LoadFont(font);
|
||||
if (newFont)
|
||||
return newFont;
|
||||
|
||||
Logger::Log("Error: failed to load font " + font, CRITICAL);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user