mirror of
https://github.com/zeldaret/st
synced 2026-05-30 08:56:35 -04:00
Decompile Title overlay (#20)
* Decompile Title overlay * math structs as cpp when applicable * fixes and improvements * regressions fix 1 * regressions fix 2
This commit is contained in:
+17
-15
@@ -23,30 +23,32 @@ typedef s32 unk32;
|
||||
#define CEIL_DIV(a, b) (((a) + (b) - 1) / (b))
|
||||
|
||||
#ifdef __cplusplus
|
||||
template <typename T> struct PTMF {
|
||||
typedef void (T::*PTMFCallback)();
|
||||
#define DECL_PTMF(name, ...) \
|
||||
template <typename T> struct name { \
|
||||
typedef void (T::*PTMFCallback)(__VA_ARGS__); \
|
||||
\
|
||||
PTMFCallback callback; \
|
||||
};
|
||||
|
||||
PTMFCallback callback;
|
||||
|
||||
#define CALL_PTMF(cls, data, ...) \
|
||||
#define CALL_PTMF(type, data, ...) \
|
||||
{ \
|
||||
PTMF<cls> &ptr = (data); \
|
||||
type &ptr = (data); \
|
||||
(this->*ptr.callback)(__VA_ARGS__); \
|
||||
}
|
||||
|
||||
#define STATIC_CALL_PTMF(cls, data, thisx, ...) \
|
||||
{ \
|
||||
PTMF<cls> &ptr = (data); \
|
||||
((thisx)->*ptr.callback)(__VA_ARGS__); \
|
||||
#define STATIC_CALL_PTMF(type, data, thisx, ...) \
|
||||
{ \
|
||||
type &ptr = (data); \
|
||||
((thisx)->*ptr.callback)(__VA_ARGS__); \
|
||||
}
|
||||
|
||||
#define STATIC_PTMFCALLBACK(cls, data, thisx, ...) \
|
||||
{ \
|
||||
PTMF<cls>::PTMFCallback &ptr = (data); \
|
||||
((thisx)->*ptr)(__VA_ARGS__); \
|
||||
#define STATIC_PTMFCALLBACK(type, data, thisx, ...) \
|
||||
{ \
|
||||
type::PTMFCallback &ptr = (data); \
|
||||
((thisx)->*ptr)(__VA_ARGS__); \
|
||||
}
|
||||
};
|
||||
|
||||
DECL_PTMF(PTMF);
|
||||
typedef void (*UnkCallback)(u16 param1);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user