Skip to content

Commit

Permalink
Merge branch 'master' into handle
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Dec 10, 2023
2 parents 1162b47 + 1844e9d commit d6ae8b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions VortexEngine/src/Menus/MenuList/Randomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ bool Randomizer::init()
}
// grab the multi ld pattern colorset crc if it's present
Mode *cur = Modes::curMode();
#if VORTEX_SLIM == 0
if (cur->hasMultiLed()) {
ByteStream ledData;
Pattern *pat = cur->getPattern(LED_MULTI);
Expand All @@ -43,6 +44,7 @@ bool Randomizer::init()
}
m_multiRandCtx.seed(ledData.recalcCRC());
}
#endif
// initialize the randomseed of each led with the
// CRC of the colorset on the respective LED
for (LedPos l = LED_FIRST; l < LED_COUNT; ++l) {
Expand Down Expand Up @@ -70,6 +72,7 @@ Menu::MenuAction Randomizer::run()
showRandomizationSelect();
return MENU_CONTINUE;
}
#if VORTEX_SLIM == 0
// if they are trying to randomize a multi-led pattern just convert
// the pattern to all singles with the same colorset upon entry
if (m_previewMode.isMultiLed() && m_targetLeds != MAP_LED(LED_MULTI)) {
Expand All @@ -83,6 +86,7 @@ Menu::MenuAction Randomizer::run()
m_previewMode.setPattern(newID);
m_previewMode.init();
}
#endif
// if the user fast-clicks 3 times then toggle automode
if (g_pButton->onRelease() && g_pButton->onConsecutivePresses(AUTO_CYCLE_RANDOMIZER_CLICKS)) {
// toggle the auto cycle flag
Expand Down
2 changes: 2 additions & 0 deletions VortexEngine/src/Menus/MenuList/Randomizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class Randomizer : public Menu
private:
// random context for each led and led multi (LED_COUNT + 1)
Random m_singlesRandCtx[LED_COUNT];
#if VORTEX_SLIM == 0
Random m_multiRandCtx;
#endif

// the time of the last randomization
uint32_t m_lastRandomization;
Expand Down

0 comments on commit d6ae8b0

Please sign in to comment.