mirror of
https://github.com/geode-sdk/geode.git
synced 2024-12-02 12:17:10 -05:00
9869ddcdea
updates loader refactor stuff and other things --------- Co-authored-by: matcool <26722564+matcool@users.noreply.github.com> Co-authored-by: dankmeme01 <42031238+dankmeme01@users.noreply.github.com>
22 lines
860 B
C++
22 lines
860 B
C++
#include <Geode/DefaultInclude.hpp>
|
|
#include <Geode/loader/Mod.hpp>
|
|
|
|
using namespace geode::prelude;
|
|
|
|
$execute {
|
|
// this replaces the call to __dynamic_cast with a call to our own
|
|
// this is needed because the transitions in cocos uses dynamic cast to check
|
|
// layers, which fail on user layers due to typeinfo not matching
|
|
|
|
#if defined(GEODE_IS_MACOS)
|
|
void* dynamicCastAddr = reinterpret_cast<void*>(base::get() + 0x7a7c9f);
|
|
(void) Mod::get()->hook(dynamicCastAddr, &cast::typeinfoCastInternal, "__dynamic_cast");
|
|
#elif defined(GEODE_IS_ANDROID)
|
|
void* handle = dlopen("libcocos2dcpp.so", RTLD_LAZY | RTLD_NOLOAD);
|
|
void* dynamicCastAddr = dlsym(handle, "__dynamic_cast");
|
|
|
|
(void)Mod::get()->hook(dynamicCastAddr, &cast::typeinfoCastInternal, "__dynamic_cast");
|
|
|
|
dlclose(handle);
|
|
#endif
|
|
}
|