diff --git a/src/trail_customization/solid_trail.cpp b/src/trail_customization/solid_trail.cpp index cdb6030..5ea4fdc 100644 --- a/src/trail_customization/solid_trail.cpp +++ b/src/trail_customization/solid_trail.cpp @@ -5,21 +5,17 @@ using namespace geode::prelude; class $modify(CCDrawNode) { - bool drawPolygon(CCPoint *verts, unsigned int cnt, const ccColor4F &fillColor, float borderWidth, const ccColor4F &borderColor) { - bool solid_wave = Mod::get()->getSettingValue("solid-wave-trail"); - - if (typeinfo_cast(this)) { - if (solid_wave) { - 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()); - } + bool drawPolygon(CCPoint* verts, unsigned int cnt, const ccColor4F& fillColor, float borderWidth, const ccColor4F& borderColor) { + if (typeinfo_cast(this) && Mod::get()->getSettingValue("solid-wave-trail")) { + if (fillColor.r >= 1.0f && fillColor.g >= 1.0f && fillColor.b >= 1.0f && this->getColor() != ccc3(255, 255, 255)) { + return true; // Likely a shortcut under specific conditions + } - this->setZOrder(-1); + // Optimized blending if not already set + if (this->getTag() != 1) { + this->setTag(1); + this->setBlendFunc(CCSprite::create()->getBlendFunc()); + this->setZOrder(-1); } } @@ -27,4 +23,4 @@ class $modify(CCDrawNode) { } }; -#endif \ No newline at end of file +#endif \ No newline at end of file