fix geode nly field macro

This commit is contained in:
altalk23 2022-05-24 10:58:57 +03:00
parent 37c7c5aaf2
commit d18e9b4fce
3 changed files with 6 additions and 1 deletions

View file

@ -807,10 +807,12 @@ class cocos2d::CCTouch {
}
class cocos2d::CCTouchDispatcher {
auto addTargetedDelegate(cocos2d::CCTouchDelegate*, int, bool) = mac 0x281180;
auto decrementForcePrio(int) = mac 0x280f70, ios 0xcc280;
auto incrementForcePrio(int) = mac 0x280f60, ios 0xcc268;
void touches(cocos2d::CCSet*, cocos2d::CCEvent*, unsigned int) = mac 0x281a60;
void removeDelegate(cocos2d::CCTouchDelegate* delegate);
}
class cocos2d::CCTouchHandler {

View file

@ -115,6 +115,9 @@ namespace geode {
*/
template<auto Detour, template <class, class...> class Convention>
Result<Hook*> addHook(std::string const& displayName, void* address) {
if (this->m_mod) {
return this->m_mod->addHook<Detour, Convention>(displayName, address);
}
this->m_scheduledHooks.push_back({ displayName, address, &Mod::addHook<Detour, Convention> });
return Ok<Hook*>(nullptr);
}

View file

@ -57,7 +57,7 @@ template <> struct GEODE_HIDDEN _##derived<derived##ID> \
#define $modify(...) GEODE_INVOKE(GEODE_CONCAT(GEODE_CRTP, GEODE_NUMBER_OF_ARGS(__VA_ARGS__)), __VA_ARGS__)
#define $(...) $modify(__VA_ARGS__)
#define GEODE_ONLY_FIELD(type, field) private: field<type> field; public:
#define GEODE_ONLY_FIELD(type, field_) private: field<type> field_; public:
#define GEODE_INTERNAL_FIELD(type, field, name) inline type& name() { return this->*field; }
#define GEODE_EXTERNAL_FIELD(type, field, name) static inline type& name##From(void* self) { return reinterpret_cast<decltype(this)>(self)->*field; }
#define GEODE_FIELD(type, field, name) GEODE_ONLY_FIELD(type, field) GEODE_INTERNAL_FIELD(type, field, name) GEODE_EXTERNAL_FIELD(type, field, name)