mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -05:00
add GEODE_HIDDEN to _spr
This commit is contained in:
parent
93482eb7c2
commit
9a28e58639
3 changed files with 10 additions and 4 deletions
|
@ -398,6 +398,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);
|
||||
}
|
||||
|
|
|
@ -572,14 +572,13 @@ ghc::filesystem::path Mod::Impl::getConfigDir(bool create) const {
|
|||
}
|
||||
|
||||
char const* Mod::Impl::expandSpriteName(char const* name) {
|
||||
static std::unordered_map<std::string, char const*> expanded = {};
|
||||
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 exps = m_metadata.getID() + "/" + name;
|
||||
memcpy(exp, exps.c_str(), exps.size() + 1);
|
||||
|
||||
expanded[name] = exp;
|
||||
m_expandedSprites[name] = exp;
|
||||
|
||||
return exp;
|
||||
}
|
||||
|
|
|
@ -57,6 +57,13 @@ namespace geode {
|
|||
* Whether the mod resources are loaded or not
|
||||
*/
|
||||
bool m_resourcesLoaded = false;
|
||||
/**
|
||||
* Whether logging is enabled for this mod
|
||||
*/
|
||||
bool m_loggingEnabled = true;
|
||||
|
||||
std::unordered_map<std::string, char const*> m_expandedSprites;
|
||||
|
||||
|
||||
ModRequestedAction m_requestedAction = ModRequestedAction::None;
|
||||
|
||||
|
|
Loading…
Reference in a new issue