Skip to content

Commit a42de2f

Browse files
committed
shorten a comment
1 parent e2cf0cf commit a42de2f

File tree

1 file changed

+2
-36
lines changed

1 file changed

+2
-36
lines changed

include/nodes/ColorDrawNode.hpp

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -33,42 +33,8 @@ class ColorDrawNode : public CCDrawNode {
3333
// instead of using drawPolygon, which is broken in geometry dash for some reason, implement a custom method to draw a triangle
3434
// - CCDrawNode::drawPolygon cannot draw triangles correctly, their points are in entirely different positions, for reasons unknown to me
3535
// - CCDrawNode::drawPolygon can draw quads, but parts of them overlap, also for reasons unknown to me
36-
// disadvantage: some mod menus hook drawPolygon in order to implement solid wave trail, so solid wave trail will be broken
37-
// unless mod menus decide to properly implement solid wave trails; psst, for any mod menu makers reading this, do the following:
38-
// - set the blending function to regular alpha blending if solid wave trail is toggled; do it somewhere that isn't drawPolygon, for example in updateStroke (after original);
39-
// this will make solid wave trail act correctly if Wave Trail Draw Fix is not installed as well, even if it's not required if WTDrawF is being used, since this node
40-
// ignores the blending function, and uses its own, according to the configuration (the default is the correct one for solid wave trail, though)
41-
// - set m_isSolid to true, instead of hooking drawPolyon to check if the color being drawn is a non-opaque white and manually ignoring it (WHY WOULD YOU DO THAT
42-
// also it breaks a pure white trail fading out when you die lol);
43-
// this allows even vanilla gd to automatically ignore the inner part of the trail, since that is the behavior vanilla has with m_isSolid;
44-
// this node reimplements such behavior through m_skipIfSolid and m_skipIfNonSolid, so it will also work with WTDrawF
45-
// here is how i would implement solid wave trail personally:
46-
/*
47-
class $modify(MyHardStreak, HardStreak) {
48-
struct Fields {
49-
std::optional<bool> m_prevIsSolid = std::nullopt;
50-
};
51-
void updateStroke(float dt) {
52-
if (solidWaveTrailIsOn && !m_fields->m_prevIsSolid) {
53-
// solid wave trail was just turned on
54-
m_fields->m_prevIsSolid = m_isSolid;
55-
m_isSolid = true;
56-
} else if (!solidWaveTrailIsOn && m_fields->m_prevIsSolid) {
57-
// solid wave trail was just turned off
58-
m_isSolid = *m_fields->m_prevIsSolid;
59-
m_fields->m_prevIsSolid = std::nullopt;
60-
}
61-
HardStreak::updateStroke(dt);
62-
// afaik the only thing m_isSolid on its own controls in vanilla is whether the inner white part of the trail gets drawn
63-
// the rest is controlled by the blending function, which has to be set manually
64-
if (m_isSolid) setBlendFunc({GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA});
65-
else setBlendFunc({GL_SRC_ALPHA, GL_ONE});
66-
}
67-
};
68-
*/
69-
// i guess a drawback of that is that it needs to constantly hook, you cannot dynamically disable the hook depending on whether a hack is on or not
70-
// do note that the m_prevIsSolid field is required to get it to behave nicely with black trails, which are solid by default; we have to restore the solid state
71-
// back to solid in case the trail is black, otherwise a black trail would turn invisible after turning off the hack
36+
// disadvantage: some mod menus hook drawPolygon in order to implement solid wave trail (formerly, Eclipse did this), so solid wave trail will be broken
37+
// for mod creators: for a proper implementation of solid wave trail, that works with both this mod and with vanilla, have a look at Eclipse's implementation
7238
void drawTriangle(CCPoint const&, CCPoint const&, CCPoint const&, _ccColor4B);
7339

7440
bool init(matjson::Value&);

0 commit comments

Comments
 (0)