no need to overload addressOfNonVirtual

This commit is contained in:
matcool 2024-01-18 16:09:29 -03:00
parent 647d463f6a
commit 98f4e7e817

View file

@ -119,20 +119,10 @@ namespace geode::addresser {
return addressOfVirtual(reinterpret_cast<Return (Class::*)(Parameters...)>(func)); return addressOfVirtual(reinterpret_cast<Return (Class::*)(Parameters...)>(func));
} }
template <class Return, class Class, class... Parameters>
static intptr_t addressOfNonVirtual(Return (Class::*func)(Parameters...) const) {
return addressOfNonVirtual(reinterpret_cast<Return (Class::*)(Parameters...)>(func));
}
static intptr_t followThunkFunction(intptr_t address); static intptr_t followThunkFunction(intptr_t address);
template <class Return, class Class, class... Parameters> template <class FnPtr>
static intptr_t addressOfNonVirtual(Return (Class::*func)(Parameters...)) { static intptr_t addressOfNonVirtual(FnPtr func) {
return followThunkFunction(geode::cast::reference_cast<intptr_t>(func));
}
template <class Return, class... Parameters>
static intptr_t addressOfNonVirtual(Return (*func)(Parameters...)) {
return followThunkFunction(geode::cast::reference_cast<intptr_t>(func)); return followThunkFunction(geode::cast::reference_cast<intptr_t>(func));
} }