Major cleanup.

Moved to namespace
Cleanup includes
This commit is contained in:
Antoine Pilote
2021-07-11 18:56:44 -04:00
parent f77bef6b28
commit 0c6ed48bbd
174 changed files with 11772 additions and 11296 deletions

View File

@@ -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;
}
}