diff --git a/bindings/Cocos2d.bro b/bindings/Cocos2d.bro index 7ba211b1..3555d895 100644 --- a/bindings/Cocos2d.bro +++ b/bindings/Cocos2d.bro @@ -91,6 +91,13 @@ class cocos2d::CCClippingNode { auto visit() = mac 0x419530; } +// not sure how the entire class is supposed to be added to only windows cuz idk if it even exists on mac +//class cocos2d::CCControllerHandler { +// CCControllerHandler(int userIndex) = win 0xc7f50; +// cocos2d::CCControllerState getState() = win 0xc7f80; +// void updateConnected() = win 0xc7fb0; +//} + class cocos2d::CCDelayTime { static cocos2d::CCDelayTime* create(float) = mac 0x1f4380; } diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index d6d091a7..2438792d 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -97,9 +97,14 @@ class AppDelegate : cocos2d::CCApplication, cocos2d::CCSceneDelegate { void resumeSound() = win 0x3d4d0; void setupGLView() = win 0x3c950; + bool m_unk0; + bool m_unk1; cocos2d::CCScene* m_runningScene; bool m_loadingFinished; - // there's 0x18 more on Windows + bool m_unk2; + bool m_unk3; + bool m_use16BitFormatForColorPicker; + bool m_unk4; } class ArtistCell : TableViewCell { diff --git a/loader/include/Geode/cocos/platform/win32/CCApplication.h b/loader/include/Geode/cocos/platform/win32/CCApplication.h index 3a0c752c..4ade1ac2 100644 --- a/loader/include/Geode/cocos/platform/win32/CCApplication.h +++ b/loader/include/Geode/cocos/platform/win32/CCApplication.h @@ -5,6 +5,7 @@ #include "CCStdC.h" #include "../CCCommon.h" #include "../CCApplicationProtocol.h" +#include "CCControllerHandler.h" #include <string> NS_CC_BEGIN @@ -71,15 +72,15 @@ public: HINSTANCE m_hInstance; HACCEL m_hAccelTable; LARGE_INTEGER m_nAnimationInterval; - PAD(8); + LARGE_INTEGER m_nVsyncInterval; std::string m_resourceRootPath; std::string m_startupScriptFilename; - void* m_pUnknown; + CCControllerHandler* m_pControllerHandler; bool m_bUpdateController; CC_SYNTHESIZE_NV(bool, m_bShutdownCalled, ShutdownCalled); INPUT m_iInput; - CCPoint m_obUnknown1; - CCPoint m_obUnknown2; + CCPoint m_obLeftThumb; + CCPoint m_obRightThumb; bool m_bMouseControl; float m_fOldAnimationInterval; float m_fAnimationInterval; diff --git a/loader/include/Geode/cocos/platform/win32/CCControllerHandler.h b/loader/include/Geode/cocos/platform/win32/CCControllerHandler.h new file mode 100644 index 00000000..83e8108d --- /dev/null +++ b/loader/include/Geode/cocos/platform/win32/CCControllerHandler.h @@ -0,0 +1,40 @@ +#ifndef __CC_CONTROLLER_HANDLER_WIN32_H__ +#define __CC_CONTROLLER_HANDLER_WIN32_H__ + +#include "../../include/ccMacros.h" +#include "CCStdC.h" +#include "CCControllerState.h" +#include <Xinput.h> + +NS_CC_BEGIN + +class CC_DLL CCControllerHandler +{ + GEODE_FRIEND_MODIFY +public: + //CCControllerHandler(); + //CCControllerState getState(); + //void updateConnected(); + + XINPUT_STATE m_xinputState; + int m_userIndex; + bool m_controllerConnected; + bool m_dpadUp; + bool m_dpadDown; + bool m_dpadLeft; + bool m_dpadRight; + bool m_start; + bool m_back; + bool m_lt; + bool m_rt; + bool m_lb; + bool m_rb; + bool m_buttonA; + bool m_buttonB; + bool m_buttonX; + bool m_buttonY; +}; + +NS_CC_END + +#endif \ No newline at end of file diff --git a/loader/include/Geode/cocos/platform/win32/CCControllerState.h b/loader/include/Geode/cocos/platform/win32/CCControllerState.h new file mode 100644 index 00000000..7dcf8aba --- /dev/null +++ b/loader/include/Geode/cocos/platform/win32/CCControllerState.h @@ -0,0 +1,25 @@ +#ifndef __CC_CONTROLLER_STATE_WIN32_H__ +#define __CC_CONTROLLER_STATE_WIN32_H__ + +#include "../../include/ccMacros.h" +#include "CCStdC.h" + +NS_CC_BEGIN + +class CC_DLL CCControllerState +{ + GEODE_FRIEND_MODIFY +public: + DWORD m_packetNumber; + WORD m_buttons; + byte m_leftTrigger; + byte m_rightTrigger; + short m_thumbLX; + short m_thumbLY; + short m_thumbRX; + short m_thumbRY; +}; + +NS_CC_END + +#endif \ No newline at end of file diff --git a/loader/test/members/Windows.cpp b/loader/test/members/Windows.cpp index 501c7e41..12c2a9f3 100644 --- a/loader/test/members/Windows.cpp +++ b/loader/test/members/Windows.cpp @@ -2,6 +2,9 @@ #ifdef GEODE_IS_WINDOWS +GEODE_MEMBER_CHECK(cocos2d::CCApplication, m_fAnimationInterval, 0x8c); +GEODE_MEMBER_CHECK(AppDelegate, m_runningScene, 0xa0); + GEODE_MEMBER_CHECK(GameObject, m_effectPlistName, 0x278); GEODE_MEMBER_CHECK(GameObject, m_effectManager, 0x454); GEODE_MEMBER_CHECK(GameObject, m_firstPosition, 0x424);