From 360827e766d7a94aad4a8df472662e0bf1b4a00e Mon Sep 17 00:00:00 2001 From: Oleksandr Nemesh Date: Thu, 11 Jul 2024 14:45:03 +0300 Subject: [PATCH 1/6] add cclightning --- .../cocos/robtop/special_nodes/CCLightning.h | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h diff --git a/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h b/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h new file mode 100644 index 00000000..5ac1ae61 --- /dev/null +++ b/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h @@ -0,0 +1,77 @@ +#ifndef __CCLIGHTNING_H__ +#define __CCLIGHTNING_H__ + +#include "../../include/ccMacros.h" +#include "../../base_nodes/CCNode.h" + +NS_CC_BEGIN + +// @note RobTop Addition +class CCLightning : public CCNode, public CCRGBAProtocol { +public: + CCLightning(); + virtual ~CCLightning(); + + static cocos2d::CCLightning* lightningWithStrikePoint(cocos2d::CCPoint strikePoint, cocos2d::CCPoint strikePoint2, float duration); + static cocos2d::CCLightning* lightningWithStrikePoint(cocos2d::CCPoint strikePoint); + + bool initWithStrikePoint(cocos2d::CCPoint strikePoint, cocos2d::CCPoint strikePoint2, float duration); + bool initWithStrikePoint(cocos2d::CCPoint strikePoint) { + return initWithStrikePoint(strikePoint, {0, 0}, 0.5f); + } + + void strike(); + void strikeFinished(); + + void strikeRandom() { + m_seed = rand(); + this->strike(); + } + + void strikeWithSeed(uint64_t seed) { + m_seed = seed; + this->strike(); + } + + void draw(); + + // cocos2d::CCRGBAProtocol + bool isOpacityModifyRGB(); + void setOpacityModifyRGB(bool); + unsigned char getOpacity(); + unsigned char getDisplayedOpacity(); + void setOpacity(unsigned char); + void updateDisplayedOpacity(unsigned char); + bool isCascadeColorEnabled(); + void setCascadeOpacityEnabled(bool); + cocos2d::_ccColor3B const& getColor(); + cocos2d::_ccColor3B const& getDisplayedColor(); + void setColor(cocos2d::_ccColor3B const&); + void updateDisplayedColor(cocos2d::_ccColor3B const&); + bool isCascadeOpacityEnabled(); + void setCascadeColorEnabled(bool); + +protected: + cocos2d::CCPoint m_strikePoint; + cocos2d::CCPoint m_strikePoint2; + bool m_split; + PAD(7); + uint32_t m_displacement; + uint64_t m_seed; + float m_lineWidth; + PAD(4); + float m_duration; + float m_extraOpacity; + cocos2d::CCPoint* m_lightningPoints; + uint32_t m_numPoints; + uint8_t m_unk148; + uint8_t m_opacity; + PAD(3); + cocos2d::CCColor3B m_tColor; + PAD(3); +}; + +NS_CC_END + + +#endif //__CCLIGHTNING_H__ \ No newline at end of file From 0ee2b5beb2fbb3a350bb623e0c094caf1ca16c74 Mon Sep 17 00:00:00 2001 From: Oleksandr Nemesh Date: Thu, 11 Jul 2024 14:46:55 +0300 Subject: [PATCH 2/6] add include --- loader/include/Geode/cocos/include/cocos2d.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/include/Geode/cocos/include/cocos2d.h b/loader/include/Geode/cocos/include/cocos2d.h index 215aa4ae..6af49aaa 100644 --- a/loader/include/Geode/cocos/include/cocos2d.h +++ b/loader/include/Geode/cocos/include/cocos2d.h @@ -325,6 +325,8 @@ THE SOFTWARE. #include "../robtop/scene_nodes/CCSceneTransitionDelegate.h" +#include "../robtop/special_nodes/CCLightning.h" + #include "../robtop/xml/DS_Dictionary.h" // #include "../robtop/glfw/glfw3.h" From e46353908d529f8354ea4cc85a458015a77566fe Mon Sep 17 00:00:00 2001 From: Oleksandr Nemesh Date: Thu, 11 Jul 2024 14:50:09 +0300 Subject: [PATCH 3/6] fix ccColor --- loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h b/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h index 5ac1ae61..125e25e5 100644 --- a/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h +++ b/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h @@ -67,7 +67,7 @@ protected: uint8_t m_unk148; uint8_t m_opacity; PAD(3); - cocos2d::CCColor3B m_tColor; + cocos2d::_ccColor3B m_tColor; PAD(3); }; From 94dc60a7f204af38276ac60e8dd2e237c01e7be6 Mon Sep 17 00:00:00 2001 From: Oleksandr Nemesh Date: Wed, 24 Jul 2024 12:34:55 +0300 Subject: [PATCH 4/6] fix whitespace --- .../cocos/robtop/special_nodes/CCLightning.h | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h b/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h index 125e25e5..bae79914 100644 --- a/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h +++ b/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h @@ -9,66 +9,66 @@ NS_CC_BEGIN // @note RobTop Addition class CCLightning : public CCNode, public CCRGBAProtocol { public: - CCLightning(); - virtual ~CCLightning(); + CCLightning(); + virtual ~CCLightning(); - static cocos2d::CCLightning* lightningWithStrikePoint(cocos2d::CCPoint strikePoint, cocos2d::CCPoint strikePoint2, float duration); - static cocos2d::CCLightning* lightningWithStrikePoint(cocos2d::CCPoint strikePoint); + static cocos2d::CCLightning* lightningWithStrikePoint(cocos2d::CCPoint strikePoint, cocos2d::CCPoint strikePoint2, float duration); + static cocos2d::CCLightning* lightningWithStrikePoint(cocos2d::CCPoint strikePoint); - bool initWithStrikePoint(cocos2d::CCPoint strikePoint, cocos2d::CCPoint strikePoint2, float duration); - bool initWithStrikePoint(cocos2d::CCPoint strikePoint) { - return initWithStrikePoint(strikePoint, {0, 0}, 0.5f); - } + bool initWithStrikePoint(cocos2d::CCPoint strikePoint, cocos2d::CCPoint strikePoint2, float duration); + bool initWithStrikePoint(cocos2d::CCPoint strikePoint) { + return initWithStrikePoint(strikePoint, {0, 0}, 0.5f); + } - void strike(); - void strikeFinished(); + void strike(); + void strikeFinished(); - void strikeRandom() { - m_seed = rand(); - this->strike(); - } + void strikeRandom() { + m_seed = rand(); + this->strike(); + } - void strikeWithSeed(uint64_t seed) { - m_seed = seed; - this->strike(); - } + void strikeWithSeed(uint64_t seed) { + m_seed = seed; + this->strike(); + } void draw(); // cocos2d::CCRGBAProtocol - bool isOpacityModifyRGB(); - void setOpacityModifyRGB(bool); - unsigned char getOpacity(); - unsigned char getDisplayedOpacity(); - void setOpacity(unsigned char); - void updateDisplayedOpacity(unsigned char); - bool isCascadeColorEnabled(); - void setCascadeOpacityEnabled(bool); - cocos2d::_ccColor3B const& getColor(); - cocos2d::_ccColor3B const& getDisplayedColor(); - void setColor(cocos2d::_ccColor3B const&); - void updateDisplayedColor(cocos2d::_ccColor3B const&); - bool isCascadeOpacityEnabled(); - void setCascadeColorEnabled(bool); - + bool isOpacityModifyRGB(); + void setOpacityModifyRGB(bool); + unsigned char getOpacity(); + unsigned char getDisplayedOpacity(); + void setOpacity(unsigned char); + void updateDisplayedOpacity(unsigned char); + bool isCascadeColorEnabled(); + void setCascadeOpacityEnabled(bool); + cocos2d::_ccColor3B const& getColor(); + cocos2d::_ccColor3B const& getDisplayedColor(); + void setColor(cocos2d::_ccColor3B const&); + void updateDisplayedColor(cocos2d::_ccColor3B const&); + bool isCascadeOpacityEnabled(); + void setCascadeColorEnabled(bool); + protected: cocos2d::CCPoint m_strikePoint; - cocos2d::CCPoint m_strikePoint2; - bool m_split; - PAD(7); - uint32_t m_displacement; - uint64_t m_seed; - float m_lineWidth; - PAD(4); - float m_duration; - float m_extraOpacity; - cocos2d::CCPoint* m_lightningPoints; - uint32_t m_numPoints; - uint8_t m_unk148; - uint8_t m_opacity; - PAD(3); - cocos2d::_ccColor3B m_tColor; - PAD(3); + cocos2d::CCPoint m_strikePoint2; + bool m_split; + PAD(7); + uint32_t m_displacement; + uint64_t m_seed; + float m_lineWidth; + PAD(4); + float m_duration; + float m_extraOpacity; + cocos2d::CCPoint* m_lightningPoints; + uint32_t m_numPoints; + uint8_t m_unk148; + uint8_t m_opacity; + PAD(3); + cocos2d::_ccColor3B m_tColor; + PAD(3); }; NS_CC_END From fca774adbffdbbc7c6a2536d8af81c59d286fdea Mon Sep 17 00:00:00 2001 From: Oleksandr Nemesh Date: Sat, 10 Aug 2024 13:37:08 +0300 Subject: [PATCH 5/6] cleanup the header --- .../cocos/robtop/special_nodes/CCLightning.h | 46 +++++++------------ 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h b/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h index bae79914..89f37995 100644 --- a/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h +++ b/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h @@ -12,26 +12,17 @@ public: CCLightning(); virtual ~CCLightning(); - static cocos2d::CCLightning* lightningWithStrikePoint(cocos2d::CCPoint strikePoint, cocos2d::CCPoint strikePoint2, float duration); - static cocos2d::CCLightning* lightningWithStrikePoint(cocos2d::CCPoint strikePoint); + static CCLightning* lightningWithStrikePoint(CCPoint strikePoint, CCPoint strikePoint2, float duration); + static CCLightning* lightningWithStrikePoint(CCPoint strikePoint); - bool initWithStrikePoint(cocos2d::CCPoint strikePoint, cocos2d::CCPoint strikePoint2, float duration); - bool initWithStrikePoint(cocos2d::CCPoint strikePoint) { - return initWithStrikePoint(strikePoint, {0, 0}, 0.5f); - } + bool initWithStrikePoint(CCPoint strikePoint, CCPoint strikePoint2, float duration); + bool initWithStrikePoint(CCPoint strikePoint); void strike(); void strikeFinished(); - void strikeRandom() { - m_seed = rand(); - this->strike(); - } - - void strikeWithSeed(uint64_t seed) { - m_seed = seed; - this->strike(); - } + void strikeRandom(); + void strikeWithSeed(uint64_t seed); void draw(); @@ -44,34 +35,31 @@ public: void updateDisplayedOpacity(unsigned char); bool isCascadeColorEnabled(); void setCascadeOpacityEnabled(bool); - cocos2d::_ccColor3B const& getColor(); - cocos2d::_ccColor3B const& getDisplayedColor(); - void setColor(cocos2d::_ccColor3B const&); - void updateDisplayedColor(cocos2d::_ccColor3B const&); + ccColor3B const& getColor(); + ccColor3B const& getDisplayedColor(); + void setColor(ccColor3B const&); + void updateDisplayedColor(ccColor3B const&); bool isCascadeOpacityEnabled(); void setCascadeColorEnabled(bool); protected: - cocos2d::CCPoint m_strikePoint; - cocos2d::CCPoint m_strikePoint2; + CCPoint m_strikePoint; + CCPoint m_strikePoint2; bool m_split; - PAD(7); - uint32_t m_displacement; + int m_displacement; + int m_minDisplacement; uint64_t m_seed; float m_lineWidth; - PAD(4); + bool m_unkBool; float m_duration; float m_extraOpacity; - cocos2d::CCPoint* m_lightningPoints; + std::array* m_lightningPoints; uint32_t m_numPoints; uint8_t m_unk148; uint8_t m_opacity; - PAD(3); - cocos2d::_ccColor3B m_tColor; - PAD(3); + ccColor3B m_tColor; }; NS_CC_END - #endif //__CCLIGHTNING_H__ \ No newline at end of file From 3ea6001ca4bc5fe2f88cf32b2ba577ce34f3bb98 Mon Sep 17 00:00:00 2001 From: Oleksandr Nemesh Date: Sat, 10 Aug 2024 18:58:32 +0300 Subject: [PATCH 6/6] fix members --- .../Geode/cocos/robtop/special_nodes/CCLightning.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h b/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h index 89f37995..ce7972e6 100644 --- a/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h +++ b/loader/include/Geode/cocos/robtop/special_nodes/CCLightning.h @@ -51,13 +51,18 @@ protected: uint64_t m_seed; float m_lineWidth; bool m_unkBool; + bool m_removeAfterFinished; float m_duration; - float m_extraOpacity; + float m_opacityModify; std::array* m_lightningPoints; uint32_t m_numPoints; - uint8_t m_unk148; + uint8_t m_displayedOpacity; uint8_t m_opacity; - ccColor3B m_tColor; + ccColor3B m_displayedColor; + ccColor3B m_color; + bool m_cascadeColorEnabled; + bool m_cascadeOpacityEnabled; + bool m_opacityModifyEnabled; }; NS_CC_END