1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Implement proper font handling

This commit is contained in:
sapier 2014-11-23 13:40:43 +01:00
parent 25945dc539
commit dceb9f7d60
91 changed files with 902 additions and 194 deletions

View file

@ -620,6 +620,13 @@ void Settings::update(const Settings &other)
}
void Settings::registerChangedCallback(std::string name,
setting_changed_callback cbf)
{
m_callbacks[name].push_back(cbf);
}
inline bool Settings::parseConfigObject(std::istream &is,
std::string &name, std::string &value)
{
@ -701,3 +708,20 @@ void Settings::clearNoLock()
m_defaults.clear();
}
void Settings::doCallbacks(const std::string name)
{
std::vector<setting_changed_callback> tempvector;
{
JMutexAutoLock lock(m_mutex);
if (m_callbacks.find(name) != m_callbacks.end())
{
tempvector = m_callbacks[name];
}
}
for (std::vector<setting_changed_callback>::iterator iter = tempvector.begin();
iter != tempvector.end(); iter ++)
{
(*iter)(name);
}
}