2022-07-30 12:24:03 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <dlfcn.h>
|
|
|
|
|
2023-06-05 20:42:22 -04:00
|
|
|
namespace geode {
|
|
|
|
struct PlatformInfo {
|
|
|
|
void* m_so;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-07-30 12:24:03 -04:00
|
|
|
namespace geode::base {
|
2022-10-30 14:59:20 -04:00
|
|
|
GEODE_NOINLINE inline uintptr_t get() {
|
|
|
|
static uintptr_t base = reinterpret_cast<uintptr_t>(dlopen("libcocos2dcpp.so", RTLD_LAZY));
|
|
|
|
return base;
|
|
|
|
}
|
2022-07-30 12:24:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace geode::cast {
|
2022-10-30 14:59:20 -04:00
|
|
|
template <class After, class Before>
|
|
|
|
After typeinfo_cast(Before ptr) {
|
|
|
|
// yall have symbols smh
|
|
|
|
return dynamic_cast<After>(ptr);
|
|
|
|
}
|
2022-07-30 12:24:03 -04:00
|
|
|
}
|