replace kFont with std::string

This commit is contained in:
2019-12-01 15:00:10 +01:00
parent 0ee3f1d125
commit 0905827b8d
11 changed files with 38 additions and 46 deletions

View File

@@ -6,7 +6,7 @@
#include "util.h"
#include "app.h"
std::map<kFont, Font> FontManager::m_fonts;
std::map<std::string, Font> FontManager::m_fonts;
Sampler FontManager::m_sampler;
bool Font::load(const std::string& ttf, int font_size, float font_scale)
@@ -59,12 +59,12 @@ void FontManager::init()
m_sampler.create();
}
bool FontManager::load(kFont id, const char* ttf, int sz, float scale)
bool FontManager::load(const std::string& id, const char* ttf, int sz, float scale)
{
return m_fonts[id].load(ttf, sz, scale);
}
const Font& FontManager::get(kFont id)
const Font& FontManager::get(const std::string& id)
{
return m_fonts[id];
}
@@ -136,7 +136,7 @@ bool TextMesh::create()
return true;
}
void TextMesh::update(kFont id, const std::string& text)
void TextMesh::update(const std::string& id, const std::string& text)
{
font_id = id;
auto& f = FontManager::get(id);