From c2d2f1bf464e1263fcd0147693e9058aff312494 Mon Sep 17 00:00:00 2001 From: Rustring <155897302+Rustring@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:28:43 +0000 Subject: [PATCH] attemp 5 --- src/hacks/Player/SolidWaveTrail.cpp | 32 +++++++++-------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/hacks/Player/SolidWaveTrail.cpp b/src/hacks/Player/SolidWaveTrail.cpp index 7fdcec79..7d76352a 100644 --- a/src/hacks/Player/SolidWaveTrail.cpp +++ b/src/hacks/Player/SolidWaveTrail.cpp @@ -23,29 +23,17 @@ namespace eclipse::hacks::Player { REGISTER_HACK(SolidWaveTrail) - class $modify (CCDrawNode) - { - bool drawPolygon(CCPoint *verts, unsigned int count, const cocos2d::ccColor4F &fillColor, float borderWidth, const cocos2d::ccColor4F &borderColor) - { - if (typeinfo_cast(this)) - { - if (!config::get("player.solidwavetrail", true)) - { - if (fillColor.r >= 1.0f && fillColor.g >= 1.0f && fillColor.b >= 1.0f && this->getColor() != ccc3(255, 255, 255)) - return true; - - if (this->getTag() != 1) - { - this->setTag(1); - this->setBlendFunc(CCSprite::create()->getBlendFunc()); - } - - this->setZOrder(-1); - } - } - - return CCDrawNode::drawPolygon(verts, count, fillColor, borderWidth, borderColor); + class $modify(cocos2d::CCDrawNode) { // The actual hack code + bool drawPolygon(cocos2d::CCPoint *p0, unsigned int p1, const cocos2d::ccColor4F &p2, float p3, const cocos2d::ccColor4F &p4) { + if (!config::get("player.solidwavetrail", true)) + return CCDrawNode::drawPolygon(p0,p1,p2,p3,p4); + if (p2.r == 1.F && p2.g == 1.F && p2.b == 1.F && p2.a != 1.F) + return true; + this->setBlendFunc(CCSprite::create()->getBlendFunc()); + this->setZOrder(-1); + return CCDrawNode::drawPolygon(p0,p1,p2,p3,p4); } }; } +