fix LevelEditorLayer members + fix Wrapper (alk fixed it but because

she was extremely silly and did it on her own branch i'm taking credit
and claiming i figured out and wrote this fix all on my own >:-) )
This commit is contained in:
HJfod 2022-09-29 00:49:59 +03:00
parent 6af42cb41f
commit d9b7489d66
3 changed files with 19 additions and 4 deletions

View file

@ -1202,7 +1202,7 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
cocos2d::CCArray* m_hideableUIElementArray;
PAD = mac 0x8, win 0x4, android 0x0;
float m_gridSize;
PAD = mac 0x14, win 0x14, android 0x0;
PAD = mac 0x18, win 0x14, android 0x0;
bool m_moveModifier;
int m_rotationTouchID;
int m_scaleTouchID;
@ -1220,10 +1220,12 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
float m_minYLimit;
float m_unknown2;
bool m_swipeEnabled;
PAD = mac 0x3, win 0x3, android 0x3;
bool m_freeMoveEnabled;
PAD = mac 0x12, win 0xc, android 0xc;
PAD = mac 0xb, win 0xb, android 0xa;
bool m_updateTimeMarkers;
cocos2d::CCArray* m_unknownArray2;
PAD = mac 0x10, win 0x8, android 0x8;
PAD = mac 0x8, win 0x8, android 0x8;
cocos2d::CCArray* m_selectedObjects;
cocos2d::CCMenu* m_deleteMenu;
cocos2d::CCArray* m_unknownArray4;
@ -3612,7 +3614,7 @@ class LevelEditorLayer : GJBaseGameLayer, LevelSettingsDelegate {
DrawGridLayer* m_drawGridLayer;
GJGameLevel* m_level;
PlaybackMode m_playbackMode;
PAD = mac 0x8, win 0x4, android 0x0;
PAD = mac 0x8, win 0x14, android 0x0;
GJGroundLayer* m_groundLayer;
}

View file

@ -1,5 +1,6 @@
#pragma once
#include "Traits.hpp"
#include "../utils/addresser.hpp"
#define GEODE_WRAPPER_FOR_IDENTIFIER(identifier) \
/* Default - function Return Class::identifier(Parameters...) does not exist */ \
@ -29,6 +30,7 @@ struct identifier<
> { \
private: \
static Return wrapperImpl(Class* self, Parameters... ps) { \
self = addresser::rthunkAdjust(substitute<Return(Parameters...)>(&Class::identifier), self); \
return self->Class::identifier(ps...); \
} \
public: \

View file

@ -25,6 +25,9 @@ namespace geode::addresser {
template<typename T, typename F>
inline F thunkAdjust(T func, F self);
template<typename T, typename F>
inline F rthunkAdjust(T func, F self);
class GEODE_DLL Addresser final {
template <char C>
struct SingleInheritance {
@ -146,6 +149,9 @@ namespace geode::addresser {
template<typename T, typename F>
friend F thunkAdjust(T func, F self);
template<typename T, typename F>
friend F rthunkAdjust(T func, F self);
};
#ifdef GEODE_ADDRESSER_TEST
@ -179,5 +185,10 @@ namespace geode::addresser {
inline F thunkAdjust(T func, F self) {
return (F)((intptr_t)self + Addresser::thunkOf(func));
}
template<typename T, typename F>
inline F rthunkAdjust(T func, F self) {
return (F)((intptr_t)self - Addresser::thunkOf(func));
}
#endif
}