Skip to content

Commit

Permalink
attemp 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustring authored Aug 9, 2024
1 parent 43dfa53 commit c2d2f1b
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions src/hacks/Player/SolidWaveTrail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<HardStreak*>(this))
{
if (!config::get<bool>("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<bool>("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);
}
};

}

0 comments on commit c2d2f1b

Please sign in to comment.