Skip to content

Commit a6f215f

Browse files
committed
allow using sdk without GEODE_MOD_ID macro, useful for static libs that link to geode
1 parent dd9446b commit a6f215f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

loader/include/Geode/loader/Mod.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ namespace geode {
503503
};
504504
}
505505

506+
#ifdef GEODE_MOD_ID
507+
506508
namespace geode::geode_internal {
507509
// this impl relies on the GEODE_MOD_ID macro set by cmake
508510
template <size_t N>
@@ -527,6 +529,14 @@ constexpr auto operator""_spr() {
527529
return Str.buffer;
528530
}
529531

532+
#else
533+
534+
GEODE_HIDDEN inline char const* operator"" _spr(char const* str, size_t len) {
535+
return geode::Mod::get()->expandSpriteName({ str, len }).data();
536+
}
537+
538+
#endif
539+
530540
/**
531541
* Leaves a marker in the binary that can be used to patch
532542
* the game at a specific offset with a specific byte sequence.

0 commit comments

Comments
 (0)