Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finished MutliLed randomize and fixed a bug
Browse files Browse the repository at this point in the history
LivingSynthesis committed Dec 5, 2023
1 parent acedd21 commit a4a5746
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions VortexEngine/src/Leds/LedTypes.h
Original file line number Diff line number Diff line change
@@ -304,6 +304,9 @@ typedef uint64_t LedMap;
// convert a map to the first Led position in the map
inline LedPos mapGetFirstLed(LedMap map)
{
if (map == LED_MULTI) {
return LED_MULTI;
}
LedPos pos = LED_FIRST;
while (map && pos < LED_COUNT) {
if (map & 1) {
1 change: 1 addition & 0 deletions VortexEngine/src/Menus/MenuList/ColorSelect.cpp
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@ bool ColorSelect::init()
return false;
}
if (cur->isMultiLed()) {
m_targetLeds = LED_MULTI;
m_ledSelected = true;
}
m_state = STATE_INIT;
5 changes: 3 additions & 2 deletions VortexEngine/src/Menus/MenuList/Randomizer.cpp
Original file line number Diff line number Diff line change
@@ -315,7 +315,7 @@ LedMap maps[] = {
MAP_RING_INNER,
MAP_RING_MIDDLE,
MAP_RING_OUTER,
MAP_RING_EDGE,
MAP_RING_EDGE
};

bool Randomizer::reRoll()
@@ -352,8 +352,9 @@ bool Randomizer::reRoll()
LedMap randomMap;
LedMap inverseMap;
if (splitMultiRandomize) {
m_previewMode.clearPattern();
// choose a random led map
randomMap = maps[m_multiRandCtx.next8(0, NUM_MAPS)];
randomMap = maps[m_multiRandCtx.next8(0, (NUM_MAPS - 1))];
inverseMap = MAP_INVERSE(randomMap);
}
if (m_flags & RANDOMIZE_PATTERN) {

0 comments on commit a4a5746

Please sign in to comment.