From 1844e9d63dfcb29563fb59c25b6b173272bc6530 Mon Sep 17 00:00:00 2001 From: Dan Date: Sat, 9 Dec 2023 18:29:35 -0800 Subject: [PATCH] added some ifdefs --- VortexEngine/src/Menus/MenuList/Randomizer.cpp | 4 ++++ VortexEngine/src/Menus/MenuList/Randomizer.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/VortexEngine/src/Menus/MenuList/Randomizer.cpp b/VortexEngine/src/Menus/MenuList/Randomizer.cpp index 2004a0f175..9a80cb9f3a 100644 --- a/VortexEngine/src/Menus/MenuList/Randomizer.cpp +++ b/VortexEngine/src/Menus/MenuList/Randomizer.cpp @@ -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); @@ -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) { @@ -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)) { @@ -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 diff --git a/VortexEngine/src/Menus/MenuList/Randomizer.h b/VortexEngine/src/Menus/MenuList/Randomizer.h index 134162a5ae..8fa6cc3413 100644 --- a/VortexEngine/src/Menus/MenuList/Randomizer.h +++ b/VortexEngine/src/Menus/MenuList/Randomizer.h @@ -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;