Skip to content

Commit

Permalink
fix blend flips and randomizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Jan 13, 2024
1 parent 9b2b98f commit 9deba30
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 7 additions & 2 deletions VortexEngine/src/Menus/MenuList/Randomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,13 @@ bool Randomizer::rollCustomPattern(Random &ctx, Mode *pMode, LedPos pos)
// colors instead of blinking each color in the set
if (!ctx.next8(0, 3)) {
newPat = PATTERN_BLEND;
// this is the number of blinks to a complementary color
args.arg7 = ctx.next8(0, 3);
// set the blend speed
args.arg6 = ctx.next8(1, 10);
// 1/2 chance to make the blend a flipping blend of some kind
if (!ctx.next8(0, 2)) {
// this is the number of blinks to a complementary color
args.arg7 = ctx.next8(0, 3);
}
// up to arg7 is filled now
args.numArgs = 7;
}
Expand Down
5 changes: 4 additions & 1 deletion VortexEngine/src/Patterns/Single/BlendPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ void BlendPattern::onBlinkOn()
interpolate(m_cur.green, m_next.green);
interpolate(m_cur.blue, m_next.blue);
RGBColor col = m_cur;
if (m_flip) {
// it should be impossible for m_numFlips to be 0 and m_flip to be 1
// unless the pattern arg is changed mid-play which could happen with
// and editor or something, so check both for 0
if (m_flip && m_numFlips) {
// convert to hsv
HSVColor hsvCol = m_cur;
// shift the hue by a flip size
Expand Down

0 comments on commit 9deba30

Please sign in to comment.