mirror of
https://github.com/geode-sdk/geode.git
synced 2025-02-18 09:10:17 -05:00
add GEODE_HIDDEN to _spr
This commit is contained in:
parent
f64c74a128
commit
71a79ab4dd
3 changed files with 6 additions and 4 deletions
|
@ -412,6 +412,6 @@ namespace geode {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char const* operator"" _spr(char const* str, size_t) {
|
GEODE_HIDDEN inline char const* operator"" _spr(char const* str, size_t) {
|
||||||
return geode::Mod::get()->expandSpriteName(str);
|
return geode::Mod::get()->expandSpriteName(str);
|
||||||
}
|
}
|
||||||
|
|
|
@ -592,14 +592,14 @@ ghc::filesystem::path Mod::Impl::getConfigDir(bool create) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
char const* Mod::Impl::expandSpriteName(char const* name) {
|
char const* Mod::Impl::expandSpriteName(char const* name) {
|
||||||
static std::unordered_map<std::string, char const*> expanded = {};
|
log::debug("Expanding sprite name {} for {}", name, m_metadata.getID());
|
||||||
if (expanded.count(name)) return expanded[name];
|
if (m_expandedSprites.count(name)) return m_expandedSprites[name];
|
||||||
|
|
||||||
auto exp = new char[strlen(name) + 2 + m_metadata.getID().size()];
|
auto exp = new char[strlen(name) + 2 + m_metadata.getID().size()];
|
||||||
auto exps = m_metadata.getID() + "/" + name;
|
auto exps = m_metadata.getID() + "/" + name;
|
||||||
memcpy(exp, exps.c_str(), exps.size() + 1);
|
memcpy(exp, exps.c_str(), exps.size() + 1);
|
||||||
|
|
||||||
expanded[name] = exp;
|
m_expandedSprites[name] = exp;
|
||||||
|
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,8 @@ namespace geode {
|
||||||
*/
|
*/
|
||||||
bool m_loggingEnabled = true;
|
bool m_loggingEnabled = true;
|
||||||
|
|
||||||
|
std::unordered_map<std::string, char const*> m_expandedSprites;
|
||||||
|
|
||||||
|
|
||||||
ModRequestedAction m_requestedAction = ModRequestedAction::None;
|
ModRequestedAction m_requestedAction = ModRequestedAction::None;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue