diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 6da53abe..8847d1ff 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,5 +1,5 @@ name: Bug Report -description: Report a bug where something is not working as expected, which does not crash the game. +description: Report a bug where something is not working as expected in Geode Loader (not specific mods), which does not crash the game. labels: [ "unverified", "bug" ] body: - type: dropdown diff --git a/.github/ISSUE_TEMPLATE/crash-report.yml b/.github/ISSUE_TEMPLATE/crash-report.yml index e6c272a0..a0f69868 100644 --- a/.github/ISSUE_TEMPLATE/crash-report.yml +++ b/.github/ISSUE_TEMPLATE/crash-report.yml @@ -1,5 +1,5 @@ name: Crash Report -description: Report a bug that crashes the game or prevents startup. +description: Report a bug that crashes the game or prevents startup caused by Geode Loader (not individual mods). labels: [ "unverified", "crash" ] body: - type: dropdown @@ -40,7 +40,7 @@ body: id: crash-report attributes: label: Crash Report - description: "You can find the crash report in `geode/crashlogs/`, if one was created. If you are using MacOS you can find the crash report in `Console.app` too. Additionally, please attach latest log in `geode/log/`. If either or both files do not exist, state such. Please link to a paste site with their content, such as GitHub Gists or Pastebin. **Do not paste the contents of either these files directly into the text box.**" + description: "You can find the crash report in `geode/crashlogs/`, if one was created. Additionally, please attach latest log in `geode/log/`. If either or both files do not exist, state such. Please link to a paste site with their content, such as GitHub Gists or Pastebin. **Do not paste the contents of either these files directly into the text box.**" placeholder: "Example: a link to a paste site with the crash report and latest.log." validations: required: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a9aa220..f6e819b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Geode Changelog ## v1.0.0 + * Make JSON library exported (a2b8f27) * Fix GLFW headers for Windows (6ada069) * Add crashlog to MacOS (9b58b33) * Implement a new updater / bootstrapper for Windows (b47870e) diff --git a/bindings/Cocos2d.bro b/bindings/Cocos2d.bro index 7ba211b1..0a34c7c6 100644 --- a/bindings/Cocos2d.bro +++ b/bindings/Cocos2d.bro @@ -17,6 +17,7 @@ class cocos2d::CCAnimation { } class cocos2d::CCApplication { + virtual auto run(); virtual auto getCurrentLanguage() = mac 0x1a3f40, ios 0x10e508; virtual auto getTargetPlatform() = mac 0x1a3f20, ios 0x10e57c; virtual auto openURL(char const*) = mac 0x1a4550, ios 0x10e7a4; @@ -71,7 +72,7 @@ class cocos2d::CCClippingNode { m_fAlphaThreshold = 1.f; m_bInverted = false; } - ~CCClippingNode() = mac 0x4191e0; + ~CCClippingNode() = mac 0x4191e0, win 0xadae0; static cocos2d::CCClippingNode* create() = mac 0x4192a0; static cocos2d::CCClippingNode* create(cocos2d::CCNode*) = mac 0x419330; // Inlined in create() call @@ -91,6 +92,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; } @@ -143,6 +151,7 @@ class cocos2d::CCDirector { auto willSwitchToScene(cocos2d::CCScene* scene); auto setOpenGLView(cocos2d::CCEGLView *pobOpenGLView) = mac 0x249be0; auto updateScreenScale(cocos2d::CCSize) = mac 0x249f10; + auto setContentScaleFactor(float); auto setNextScene() = mac 0x2498d0; auto showStats() = mac 0x2499e0; @@ -151,7 +160,7 @@ class cocos2d::CCDirector { } class cocos2d::CCDrawNode { - CCDrawNode() = mac 0x378b40; + CCDrawNode() = mac 0x378b40, win 0x6b9f0; auto clear() = mac 0x379e80; static cocos2d::CCDrawNode* create() = mac 0x378d00; auto drawPolygon(cocos2d::CCPoint*, unsigned int, cocos2d::_ccColor4F const&, float, cocos2d::_ccColor4F const&) = mac 0x3797f0; @@ -162,12 +171,12 @@ class cocos2d::CCDrawNode { virtual auto init() = mac 0x378e00; auto setBlendFunc(cocos2d::_ccBlendFunc const&) = mac 0x379eb0; virtual auto draw() = mac 0x379020; - virtual ~CCDrawNode() = mac 0x378cc0; + virtual ~CCDrawNode() = mac 0x378cc0, win 0x6ba60; } class cocos2d::CCAction { - CCAction() = mac 0x35b610; - virtual ~CCAction() = mac 0x35b6b0; + CCAction() = mac 0x35b610, win 0x7a6d0; + virtual ~CCAction() = mac 0x35b6b0, win 0x7a7f0; auto stop() = mac 0x35b860; auto copyWithZone(cocos2d::CCZone* zone) = mac 0x35b7a0; auto startWithTarget(cocos2d::CCNode* target) = mac 0x35b850; @@ -238,8 +247,8 @@ class cocos2d::CCEGLView { } class cocos2d::CCEGLViewProtocol { - CCEGLViewProtocol(); - virtual ~CCEGLViewProtocol(); + CCEGLViewProtocol() = win 0xbac00; + virtual ~CCEGLViewProtocol() = win 0xbacc0; auto getViewPortRect() const = mac 0x29e2f0; auto getScaleX() const = mac 0x29e300; auto getScaleY() const = mac 0x29e310; @@ -293,8 +302,8 @@ class cocos2d::CCIMEDispatcher { } class cocos2d::CCImage { - CCImage() = mac 0x24fa00; - virtual ~CCImage() = mac 0x24fa80; + CCImage() = mac 0x24fa00, win 0xc5fd0; + virtual ~CCImage() = mac 0x24fa80, win 0xc6100; auto initWithImageFile(const char*, cocos2d::CCImage::EImageFormat imageType); auto initWithImageFileThreadSafe(const char*, cocos2d::CCImage::EImageFormat imageType); auto initWithImageData(void*, int, cocos2d::CCImage::EImageFormat, int, int, int) = mac 0x24fcb0; @@ -308,13 +317,13 @@ class cocos2d::CCKeyboardDispatcher { class cocos2d::CCKeyboardHandler { static cocos2d::CCKeyboardHandler* handlerWithDelegate(cocos2d::CCKeyboardDelegate*) = mac 0x242030; virtual auto initWithDelegate(cocos2d::CCKeyboardDelegate*) = mac 0x241ff0, ios 0x13f8b8; - ~CCKeyboardHandler() = mac 0x241e90, ios 0x13f87c; + ~CCKeyboardHandler() = mac 0x241e90, ios 0x13f87c, win 0x99a10; } class cocos2d::CCKeypadHandler { static cocos2d::CCKeypadHandler* handlerWithDelegate(cocos2d::CCKeypadDelegate*) = mac 0x1ff2d0; virtual auto initWithDelegate(cocos2d::CCKeypadDelegate*) = mac 0x1ff290, ios 0x69; // iOS stub - virtual ~CCKeypadHandler() = mac 0x1ff130, ios 0x2c530; + virtual ~CCKeypadHandler() = mac 0x1ff130, ios 0x2c530, win 0xf5f50; cocos2d::CCKeypadDelegate* getDelegate() = mac 0x1ff0b0; } @@ -352,7 +361,7 @@ class cocos2d::CCLabelBMFont { virtual auto isCascadeColorEnabled() = mac 0x3493c0, ios 0x21aa3c; virtual auto setCascadeColorEnabled(bool) = mac 0x3493e0, ios 0x21aa4c; virtual auto setString(unsigned short*, bool) = mac 0x348a60, ios 0x21a4b4; - virtual ~CCLabelBMFont() = mac 0x347e80; + virtual ~CCLabelBMFont() = mac 0x347e80, win 0x9be70; } class cocos2d::CCLabelTTF { @@ -363,7 +372,7 @@ class cocos2d::CCLabelTTF { } class cocos2d::CCLayer { - CCLayer() = mac 0x2725b0, ios 0xc7708; + CCLayer() = mac 0x2725b0, ios 0xc7708, win 0xa15e0; virtual auto ccTouchBegan(cocos2d::CCTouch*, cocos2d::CCEvent*) = mac 0x2734d0, ios 0xc810c; virtual auto ccTouchCancelled(cocos2d::CCTouch*, cocos2d::CCEvent*) = mac 0x273650, ios 0xc82ac; virtual auto ccTouchEnded(cocos2d::CCTouch*, cocos2d::CCEvent*) = mac 0x2735d0, ios 0xc820c; @@ -399,11 +408,11 @@ class cocos2d::CCLayer { virtual auto setTouchMode(cocos2d::ccTouchesMode) = mac 0x272d60, ios 0xc7acc; virtual auto setTouchPriority(int) = mac 0x272db0, ios 0xc7b30; virtual auto unregisterScriptTouchHandler() = mac 0x272c30, ios 0xc7a28; - ~CCLayer() = mac 0x2727b0, ios 0xc7848; + virtual ~CCLayer() = mac 0x2727b0, ios 0xc7848, win 0xa1940; } class cocos2d::CCLayerColor { - CCLayerColor() = mac 0x274320, ios 0xc8aec; + CCLayerColor() = mac 0x274320, ios 0xc8aec, win 0xa1710; static cocos2d::CCLayerColor* create(cocos2d::_ccColor4B const&, float, float) = mac 0x2745e0; static cocos2d::CCLayerColor* create(cocos2d::_ccColor4B const&) = mac 0x2744c0; virtual auto draw() = mac 0x274b50, ios 0xc8fe0; @@ -416,11 +425,11 @@ class cocos2d::CCLayerColor { virtual auto setContentSize(cocos2d::CCSize const&) = mac 0x2749f0, ios 0xc8f64; virtual auto setOpacity(unsigned char) = mac 0x274db0, ios 0xc9108; virtual auto updateColor() = mac 0x274ae0, ios 0xc8f80; - virtual ~CCLayerColor() = mac 0x2743d0, ios 0x2743e0; + virtual ~CCLayerColor() = mac 0x2743d0, ios 0x2743e0, win 0xa1a20; } class cocos2d::CCLayerRGBA { - CCLayerRGBA() = mac 0x2738d0, ios 0xc85cc; + CCLayerRGBA() = mac 0x2738d0, ios 0xc85cc, win 0xa1890; virtual auto init() = mac 0x273b40, ios 0xc8de8; virtual auto getOpacity() = mac 0x273be0, ios 0xc8698; virtual auto getDisplayedOpacity() = mac 0x273c00, ios 0xc8724; @@ -436,7 +445,7 @@ class cocos2d::CCLayerRGBA { virtual auto setCascadeColorEnabled(bool) = mac 0x274250, ios 0xc8adc; // virtual auto setOpacityModifyRGB(bool) = mac 0x6180, ios 0x68e8; // virtual auto isOpacityModifyRGB() = mac 0x6190, ios 0x68ec; - virtual ~CCLayerRGBA() = mac 0x273aa0, ios 0xc77b0; + virtual ~CCLayerRGBA() = mac 0x273aa0, ios 0xc77b0, win 0xa1b20; } class cocos2d::CCMenu { @@ -464,7 +473,7 @@ class cocos2d::CCMenu { class cocos2d::CCMenuItem { bool initWithTarget(cocos2d::CCObject*, cocos2d::SEL_MenuHandler) = mac 0x1fb7f0; - virtual ~CCMenuItem() = mac 0x1fb8e0, ios 0x2cdf4; + virtual ~CCMenuItem() = mac 0x1fb8e0, ios 0x2cdf4, win 0xab9c0; virtual auto activate() = mac 0x1fba70, ios 0x2ceb0; virtual auto selected() = mac 0x1fb9e0, ios 0x2ce2e; virtual auto unselected() = mac 0x1fb9f0, ios 0x2ce38; @@ -514,6 +523,8 @@ class cocos2d::CCMenuItemSprite { } class cocos2d::CCMotionStreak { + CCMotionStreak() = win 0xae310; + virtual ~CCMotionStreak() = win 0xae450; auto reset() = mac 0x2ee190; auto resumeStroke() = mac 0x2edb30; auto stopStroke() = mac 0x2edb20; @@ -529,7 +540,7 @@ class cocos2d::CCMouseDispatcher { class cocos2d::CCMouseHandler { static cocos2d::CCMouseHandler* handlerWithDelegate(cocos2d::CCMouseDelegate*) = mac 0x12ef80; virtual auto initWithDelegate(cocos2d::CCMouseDelegate*) = mac 0x12ef40, ios 0x43798; - ~CCMouseHandler() = mac 0x12ede0, ios 0x4375c; + ~CCMouseHandler() = mac 0x12ede0, ios 0x4375c, win 0xb1fd0; } class cocos2d::CCMoveBy { @@ -541,7 +552,7 @@ class cocos2d::CCMoveTo { } class cocos2d::CCNode { - CCNode() = mac 0x122550; + CCNode() = mac 0x122550, win 0x5e7d0; auto boundingBox() = mac 0x123030; virtual auto _setZOrder(int) = mac 0x122990, ios 0x15dd7c; virtual auto addChild(cocos2d::CCNode*) = mac 0x1233d0, ios 0x15e5d4; @@ -656,12 +667,12 @@ class cocos2d::CCNode { virtual auto updateTweenAction(float, char const*) = mac 0x1249c0, ios 0x15f644; virtual auto visit() = mac 0x123850, ios 0x15e978; virtual auto worldToNodeTransform() = mac 0x124710, ios 0x15f51c; - virtual ~CCNode() = mac 0x122750, ios 0x6c98; + virtual ~CCNode() = mac 0x122750, ios 0x6c98, win 0x5ea40; } class cocos2d::CCNodeRGBA { - CCNodeRGBA() = mac 0x124b30; - virtual ~CCNodeRGBA() = mac 0x124bb0, ios 0x15f748; + CCNodeRGBA() = mac 0x124b30, win 0x5e9d0; + virtual ~CCNodeRGBA() = mac 0x124bb0, ios 0x15f748, win 0x5ebb0; virtual auto init() = mac 0x124bf0, ios 0x15f780; virtual auto getOpacity() = mac 0x124cd0, ios 0x15f7b8; virtual auto getDisplayedOpacity() = mac 0x124cf0, ios 0x15f7c8; @@ -678,7 +689,7 @@ class cocos2d::CCNodeRGBA { } class cocos2d::CCObject { - CCObject() = mac 0x250ca0, ios 0x43864; + CCObject() = mac 0x250ca0, ios 0x43864, win 0x69230; auto acceptVisitor(cocos2d::CCDataVisitor&) = mac 0x250f30, ios 0x439f0; auto autorelease() = mac 0x250ed0, ios 0x439b8; auto canEncode() = mac 0x250f90, ios 0x43a24; @@ -689,12 +700,12 @@ class cocos2d::CCObject { auto retain() = mac 0x250ec0, ios 0x439a8; virtual auto setTag(int) = mac 0x250f60, ios 0x43a10; - ~CCObject() = mac 0x250d20, ios 0x6ac0; + ~CCObject() = mac 0x250d20, ios 0x6ac0, win 0x69270; } class cocos2d::CCParticleSystem { - CCParticleSystem(); - virtual ~CCParticleSystem(); + CCParticleSystem() = win 0xb6650; + virtual ~CCParticleSystem() = win 0xb68e0; virtual auto update(float); virtual auto draw(); auto initParticle(cocos2d::tCCParticle*); @@ -704,8 +715,8 @@ class cocos2d::CCParticleSystem { } class cocos2d::CCParticleSystemQuad { - CCParticleSystemQuad(); - virtual ~CCParticleSystemQuad(); + CCParticleSystemQuad() = win 0xb9bd0; + virtual ~CCParticleSystemQuad() = win 0xb9c10; static cocos2d::CCParticleSystemQuad* create(char const*) = mac 0x36b000; virtual auto draw(); auto setupVBO(); @@ -778,10 +789,10 @@ class cocos2d::CCSequence { } class cocos2d::CCSet { - CCSet() = mac 0x45ad80, ios 0x10e870; + CCSet() = mac 0x45ad80, ios 0x10e870, win 0x699e0; static auto create() = mac 0x45b0b0; auto addObject(cocos2d::CCObject*) = mac 0x45b1f0; - virtual ~CCSet() = mac 0x45b050, ios 0x10ebcc; + virtual ~CCSet() = mac 0x45b050, ios 0x10ebcc, win 0x69a80; virtual auto acceptVisitor(cocos2d::CCDataVisitor&) = mac 0x45b090, ios 0x10ec04; auto anyObject() = mac 0x45b410; } @@ -792,7 +803,7 @@ class cocos2d::CCShaderCache { } class cocos2d::CCSprite { - virtual ~CCSprite() = mac 0x133430, ios 0x15b92c; + virtual ~CCSprite() = mac 0x133430, ios 0x15b92c, win 0xd2f90; virtual auto init() = mac 0x132ef0, ios 0x15b488; virtual auto setVertexZ(float) = mac 0x134a80, ios 0x15ccc8; virtual auto setScaleX(float) = mac 0x134900, ios 0x15cb3c; @@ -852,7 +863,7 @@ class cocos2d::CCSprite { virtual auto setReorderChildDirtyRecursively() = mac 0x134550, ios 0x15c764; virtual auto setDirtyRecursively(bool) = mac 0x1345b0, ios 0x15c7cc; - CCSprite() = mac 0x133300, ios 0x15b82c; + CCSprite() = mac 0x133300, ios 0x15b82c, win 0xd2eb0; static cocos2d::CCSprite* create() = mac 0x132df0; static cocos2d::CCSprite* create(char const*) = mac 0x132a80; @@ -871,7 +882,7 @@ class cocos2d::CCSpriteBatchNode { auto getUsedAtlasCapacity() = mac 0xbc6b0; auto increaseAtlasCapacity(unsigned int) = mac 0xbc670; - virtual ~CCSpriteBatchNode() = mac 0xbb790, ios 0x130d18; + virtual ~CCSpriteBatchNode() = mac 0xbb790, ios 0x130d18, win 0xd5580; virtual auto init() = mac 0xbb680, ios 0x130c20; virtual auto addChild(cocos2d::CCNode*) = mac 0xbbb40, ios 0x131034; @@ -904,7 +915,7 @@ class cocos2d::CCSpriteFrameCache { class cocos2d::CCStandardTouchHandler { static cocos2d::CCStandardTouchHandler* handlerWithDelegate(cocos2d::CCTouchDelegate*, int) = mac 0x247f30; virtual auto initWithDelegate(cocos2d::CCTouchDelegate*, int) = mac 0x247ed0, ios 0x69; // iOS stub - ~CCStandardTouchHandler() = mac 0x2482a0, ios 0x6d28; + ~CCStandardTouchHandler() = mac 0x2482a0, ios 0x6d28, win 0xf5a40; } class cocos2d::CCString { @@ -925,13 +936,13 @@ class cocos2d::CCString { class cocos2d::CCTargetedTouchHandler { static cocos2d::CCTargetedTouchHandler* handlerWithDelegate(cocos2d::CCTouchDelegate*, int, bool) = mac 0x248010; auto initWithDelegate(cocos2d::CCTouchDelegate*, int, bool) = mac 0x2480f0, ios 0x69; // iOS stub - ~CCTargetedTouchHandler() = mac 0x248180, ios 0x6cec; + ~CCTargetedTouchHandler() = mac 0x248180, ios 0x6cec, win 0xf59a0; } class cocos2d::CCTexture2D { - ~CCTexture2D() = mac 0x246350; - CCTexture2D() = mac 0x246280; + CCTexture2D() = mac 0x246280, win 0xe9300; + ~CCTexture2D() = mac 0x246350, win 0xe93f0; auto getContentSize() = mac 0x246460; auto getMaxS() = mac 0x2464e0; auto getMaxT() = mac 0x246500; @@ -954,8 +965,8 @@ class cocos2d::CCTexture2D { } class cocos2d::CCTextureAtlas { - CCTextureAtlas(); - virtual ~CCTextureAtlas(); + CCTextureAtlas() = win 0xea680; + virtual ~CCTextureAtlas() = win 0xea6c0; auto drawNumberOfQuads(unsigned int, unsigned int); auto mapBuffers(); } diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index d6d091a7..27545eb4 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 { @@ -451,8 +456,65 @@ class CCMenuItemToggler : cocos2d::CCMenuItem { } class CCMoveCNode : cocos2d::CCNode { - static CCMoveCNode* create() = mac 0x1842a0; + static CCMoveCNode* create() = mac 0x1842a0, win 0x121c70; ~CCMoveCNode() = mac 0x18b2c0; + + float m_staticMoveX; + float m_staticMoveY; + float m_staticRotation; + bool m_lockObjectRotation; + int m_parentGroupId; + bool m_forceUpdate; + int m_unk104; + float m_followXMod; + float m_followYMod; + bool m_unk110; + float m_optimizedMoveX; + float m_optimizedMoveY; + float m_optimizedRotation; + float m_playerFollowSpeed; + float m_playerFollowDelay; + float m_playerFollowOffset; + float m_playerFollowMaxSpeed; + GroupCommandObject* m_followCommand; +} + +class GroupCommandObject : cocos2d::CCNode { + // too lazy to re rn + // the ints are definitely real members but idk their types + cocos2d::CCPoint m_ec; + int m_f4; + int m_f8; + int m_fc; + int m_100; + int m_104; + int m_108; + cocos2d::CCPoint m_10c; + cocos2d::CCPoint m_114; + cocos2d::CCPoint m_11c; + int m_124; + int m_128; + int m_12c; + int m_130; + int m_134; + bool m_138; + float m_13c; + float m_140; + bool m_144; + int m_148; + int m_14c; + int m_150; + int m_154; + int m_158; + int m_15c; + cocos2d::CCPoint m_160; + cocos2d::CCPoint m_168; + int m_170; + int m_174; + int m_178; + int m_17c; + int m_180; + bool m_184; } class CCNodeContainer : cocos2d::CCNode { @@ -2163,12 +2225,12 @@ class GJEffectManager : cocos2d::CCNode { cocos2d::CCDictionary* m_followActions; cocos2d::CCArray* m_spawnActions; cocos2d::CCArray* m_moveActions; - cocos2d::CCArray* m_f1c28; + cocos2d::CCArray* m_groupCommands; // array of GroupCommandObject cocos2d::CCNode* m_f1c30; - cocos2d::CCDictionary* m_f1c38; - cocos2d::CCDictionary* m_f1c40; - cocos2d::CCDictionary* m_f1c48; - cocos2d::CCDictionary* m_f1c50; + cocos2d::CCDictionary* m_moveNodes; // dict of CCMoveCNode + cocos2d::CCDictionary* m_rotationNodes; // dict of CCMoveCNode + cocos2d::CCDictionary* m_followNodes; // dict of CCMoveCNode + cocos2d::CCDictionary* m_playerFollowNodes; // dict of CCMoveCNode float m_time; float m_velocity; float m_acceleration; @@ -3250,6 +3312,7 @@ class GameObject : CCSpritePlus { bool m_hasBeenActivatedP2; bool m_hasDetailColor; bool m_isPulseStick; + bool m_hasOrientedBox; int m_linkedGroup; bool m_isSaw; int m_customRotateSpeed; @@ -3316,7 +3379,7 @@ class GameObject : CCSpritePlus { float m_realOpacity; GJSpriteColor* m_baseColor; GJSpriteColor* m_detailColor; - int m_unknown420; + int m_unknown420; ZLayer m_defaultZLayer; ZLayer m_zLayer; int m_gameZOrder; @@ -3340,14 +3403,27 @@ class GameObject : CCSpritePlus { int m_unk414; PAD = mac 0xc, win 0xc; cocos2d::CCPoint m_firstPosition; - PAD = mac 0x15, win 0x15; + bool m_unk42C; + bool m_unk42D; + PAD = mac 0x6, win 0x6; + bool m_isAnimated; + PAD = mac 0x7, win 0x7; + bool m_hasEffectLine; + bool m_specialUnk43d; + PAD = mac 0x1, win 0x1; + bool m_hasDurationLine; bool m_isTriggerable; + bool m_triggeredInEditor; PAD = mac 0x6, win 0x6; bool m_highDetail; ColorActionSprite* m_colorActionSpriteBase; ColorActionSprite* m_colorActionSpriteDetail; GJEffectManager* m_effectManager; - PAD = mac 0xc, win 0xc; + bool m_unk458; + bool m_unk459; + bool m_unk45A; + bool m_wasForcedRotatedPositionUpdateIdk; + PAD = mac 0x8, win 0x8; bool m_orbMultiActivate; } diff --git a/flash.toml b/flash.toml index 8ecd8e62..dc749c85 100644 --- a/flash.toml +++ b/flash.toml @@ -4,7 +4,7 @@ [project] name = "Geode" -version = "v1.0.0-beta" +version = "v1.0.0" repository = "https://github.com/geode-sdk/geode" tree = "https://github.com/geode-sdk/geode/tree/main" icon = "loader/resources/logos/geode-circle.png" @@ -60,4 +60,4 @@ build-args = [ ] # The file we use to get all the include paths and such -infer-args-from = "loader/src/main.cpp" +infer-args-from = "loader/src/load.cpp" diff --git a/loader/include/Geode/cocos/CCDirector.h b/loader/include/Geode/cocos/CCDirector.h index fb9c1d9b..e400bcad 100644 --- a/loader/include/Geode/cocos/CCDirector.h +++ b/loader/include/Geode/cocos/CCDirector.h @@ -348,13 +348,13 @@ public: protected: virtual void mainLoop(void) {} +public: /** The size in pixels of the surface. It could be different than the screen size. High-res devices might have a higher surface size than the screen size. Only available when compiled using SDK >= 4.0. @since v0.99.4 */ void setContentScaleFactor(float scaleFactor); -public: inline float getContentScaleFactor(void) { return m_fContentScaleFactor; } RT_ADD( diff --git a/loader/include/Geode/cocos/platform/win32/CCApplication.h b/loader/include/Geode/cocos/platform/win32/CCApplication.h index 3a0c752c..c143123b 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 NS_CC_BEGIN @@ -47,6 +48,11 @@ public: virtual void setupGLView(); virtual void platformShutdown(); void toggleVerticalSync(bool); + RT_ADD( + void setupVerticalSync(); + void updateVerticalSync(); + void updateControllerKeys(); + ) /** * Sets the Resource root path. @@ -71,18 +77,18 @@ 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; + float m_fVsyncInterval; CC_SYNTHESIZE_READONLY_NV(bool, m_bVerticalSyncEnabled, VerticalSyncEnabled); CC_SYNTHESIZE_READONLY_NV(bool, m_bControllerConnected, ControllerConnected); CC_SYNTHESIZE_NV(bool, m_bSleepMode, SleepMode); 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 + +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/include/Geode/cocos/platform/win32/CCEGLView.h b/loader/include/Geode/cocos/platform/win32/CCEGLView.h index 6ec16add..1cdf225a 100644 --- a/loader/include/Geode/cocos/platform/win32/CCEGLView.h +++ b/loader/include/Geode/cocos/platform/win32/CCEGLView.h @@ -95,6 +95,7 @@ public: float getFrameZoomFactor(); RT_REMOVE( virtual void centerWindow(); ) RT_ADD( void centerWindow(); ) + RT_ADD( bool windowShouldClose(); ) RT_ADD( void showCursor(bool state); ) @@ -169,7 +170,7 @@ public: RT_ADD( CC_SYNTHESIZE_NV(CCSize, m_obWindowedSize, WindowedSize); ) -protected: + RT_ADD( float m_fMouseX; float m_fMouseY; @@ -178,6 +179,7 @@ protected: bool m_bShouldCallGLFinish; ) +protected: RT_ADD( void onGLFWCharCallback(GLFWwindow* window, unsigned int entered); void onGLFWCursorEnterFunCallback(GLFWwindow* window, int entered); diff --git a/loader/include/Geode/ui/EnterLayerEvent.hpp b/loader/include/Geode/ui/EnterLayerEvent.hpp index 91c22835..acab4980 100644 --- a/loader/include/Geode/ui/EnterLayerEvent.hpp +++ b/loader/include/Geode/ui/EnterLayerEvent.hpp @@ -53,7 +53,7 @@ namespace geode { template concept InheritsEnterLayer = std::is_base_of_v, T>; - template T> + template T = EnterLayerEvent> class EnterLayerFilter : public EventFilter> { public: using Callback = void(T*); diff --git a/loader/launcher/windows/fakeGeode.c b/loader/launcher/windows/fakeGeode.c index c33e5e8e..0928d953 100644 --- a/loader/launcher/windows/fakeGeode.c +++ b/loader/launcher/windows/fakeGeode.c @@ -1,2 +1 @@ -#include -__declspec(dllexport) DWORD WINAPI loadGeode(void* arg) { return 0; } \ No newline at end of file +__declspec(dllexport) void fake() { } \ No newline at end of file diff --git a/loader/launcher/windows/proxyLoader.c b/loader/launcher/windows/proxyLoader.c index f080545c..d6d9d95f 100644 --- a/loader/launcher/windows/proxyLoader.c +++ b/loader/launcher/windows/proxyLoader.c @@ -5,23 +5,10 @@ #pragma comment(linker, "/export:XInputSetState=xinput1_4.XInputSetState") #pragma comment(linker, "/export:XInputGetCapabilities=xinput1_4.XInputGetCapabilities") +__declspec(dllimport) void fake(); DWORD XInputGetDSoundAudioDeviceGuids(DWORD user, GUID* render, GUID* capture) { + fake(); return ERROR_BAD_ARGUMENTS; } #pragma comment(linker, "/export:XInputGetDSoundAudioDeviceGuids=_XInputGetDSoundAudioDeviceGuids") - -__declspec(dllimport) DWORD WINAPI loadGeode(void*); -BOOL WINAPI DllMain(HINSTANCE module, DWORD reason, LPVOID _) { - if (reason == DLL_PROCESS_ATTACH) { - // Prevents threads from notifying this DLL on creation or destruction. - // Kind of redundant for a game that isn't multi-threaded but will provide - // some slight optimizations if a mod frequently creates and deletes threads. - DisableThreadLibraryCalls(module); - - DWORD code = loadGeode(module); - if (code != 0) - return FALSE; - } - return TRUE; -} diff --git a/loader/src/platform/windows/main.cpp b/loader/src/platform/windows/main.cpp index e1184f39..ebed3c0a 100644 --- a/loader/src/platform/windows/main.cpp +++ b/loader/src/platform/windows/main.cpp @@ -42,7 +42,7 @@ int WINAPI gdMainHook(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd return reinterpret_cast(geode::base::get() + 0x260ff8)(hInstance, hPrevInstance, lpCmdLine, nCmdShow); } -extern "C" __declspec(dllexport) DWORD WINAPI loadGeode(void* arg) { +bool loadGeode() { auto process = GetCurrentProcess(); auto patchAddr = reinterpret_cast(geode::base::get() + 0x260ff8); @@ -59,19 +59,11 @@ extern "C" __declspec(dllexport) DWORD WINAPI loadGeode(void* arg) { }; DWORD oldProtect; - if (VirtualProtectEx(process, patchAddr, patchLength, PAGE_EXECUTE_READWRITE, &oldProtect)) { - std::memcpy(patchAddr, patchBytes, patchLength); - VirtualProtectEx(process, patchAddr, patchLength, oldProtect, &oldProtect); - } else { - LoaderImpl::get()->platformMessageBox( - "Unable to Load Geode!", - "There was an unknown fatal error hooking " - "the GD main function and Geode can not be loaded." - ); - return 1; - } - - return 0; + if (!VirtualProtectEx(process, patchAddr, patchLength, PAGE_EXECUTE_READWRITE, &oldProtect)) + return false; + std::memcpy(patchAddr, patchBytes, patchLength); + VirtualProtectEx(process, patchAddr, patchLength, oldProtect, &oldProtect); + return true; } DWORD WINAPI upgradeThread(void*) { @@ -79,18 +71,45 @@ DWORD WINAPI upgradeThread(void*) { return 0; } -BOOL WINAPI DllMain(HINSTANCE module, DWORD reason, LPVOID) { - if (reason == DLL_PROCESS_ATTACH) { - DisableThreadLibraryCalls(module); +void earlyError(std::string message) { + // try to write a file and display a message box + // wine might not display the message box but *should* write a file + std::ofstream fout("_geode_early_error.txt"); + fout << message; + fout.close(); + LoaderImpl::get()->platformMessageBox("Unable to Load Geode!", message); +} +extern "C" __declspec(dllexport) void fake() { } +BOOL WINAPI DllMain(HINSTANCE module, DWORD reason, LPVOID) { + if (reason != DLL_PROCESS_ATTACH) + return TRUE; + // Prevents threads from notifying this DLL on creation or destruction. + // Kind of redundant for a game that isn't multi-threaded but will provide + // some slight optimizations if a mod frequently creates and deletes threads. + DisableThreadLibraryCalls(module); + + try { // if we find the old bootstrapper dll, don't load geode, copy new updater and let it do the rest auto workingDir = dirs::getGameDir(); - auto error = std::error_code(); - if (ghc::filesystem::exists(workingDir / "GeodeBootstrapper.dll", error) && !error) - CreateThread(nullptr, 0, upgradeThread, nullptr, 0, nullptr); - if (error) + std::error_code error; + bool oldBootstrapperExists = ghc::filesystem::exists(workingDir / "GeodeBootstrapper.dll", error); + if (error) { + earlyError("There was an error checking whether the old GeodeBootstrapper.dll exists: " + error.message()); return FALSE; + } + else if (oldBootstrapperExists) + CreateThread(nullptr, 0, upgradeThread, nullptr, 0, nullptr); + else if (!loadGeode()) { + earlyError("There was an unknown error hooking the GD main function."); + return FALSE; + } } + catch(...) { + earlyError("There was an unknown error somewhere very very early and this is really really bad."); + return FALSE; + } + return TRUE; } diff --git a/loader/test/members/Windows.cpp b/loader/test/members/Windows.cpp index 501c7e41..1650d337 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_fVsyncInterval, 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); @@ -53,4 +56,4 @@ static_assert(sizeof(GJBaseGameLayer) == 0x2cc); GEODE_MEMBER_CHECK(AudioEffectsLayer, m_unk19C, 0x19c); -#endif \ No newline at end of file +#endif