Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Dec 9, 2023
1 parent 06d53ee commit 80b987d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions VortexEngine/src/Menus/MenuList/Randomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,19 @@ bool Randomizer::splitMultiRandomize()
// apply pattern1 and colorset1 to the bitmap
PatternID pat1 = rollSingleLedPatternID(m_multiRandCtx);
Colorset set1 = rollColorset(m_multiRandCtx);
if (!applyPatternAndColorsetToMap(m_multiRandCtx, randomMap, pat1, set1)) {
if (!applyPatternAndColorsetToMap(randomMap, pat1, set1)) {
return false;
}
// apply pattern2 and colorset2 to the inverse bitmap
PatternID pat2 = rollSingleLedPatternID(m_multiRandCtx);
Colorset set2 = rollColorset(m_multiRandCtx);
if (!applyPatternAndColorsetToMap(m_multiRandCtx, MAP_INVERSE(randomMap), pat2, set2)) {
if (!applyPatternAndColorsetToMap(MAP_INVERSE(randomMap), pat2, set2)) {
return false;
}
return true;
}

bool Randomizer::applyPatternAndColorsetToMap(Random &ctx, LedMap map, PatternID pattern, const Colorset &colorset)
bool Randomizer::applyPatternAndColorsetToMap(LedMap map, PatternID pattern, const Colorset &colorset)
{
MAP_FOREACH_LED(map) {
if (!m_previewMode.setPattern(pattern, pos) || !m_previewMode.setColorset(colorset, pos)) {
Expand Down
4 changes: 1 addition & 3 deletions VortexEngine/src/Menus/MenuList/Randomizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ class Randomizer : public Menu
bool reRollSingles();
bool reRollForContext(Random &ctx, LedPos pos);
bool splitMultiRandomize();
bool rollPatternForPosition(Random &ctx, LedPos pos);
bool rollColorsetForPosition(Random &ctx, LedPos pos);
bool applyPatternAndColorsetToMap(Random &ctx, LedMap map, PatternID pattern, const Colorset &colorset);
bool applyPatternAndColorsetToMap(LedMap map, PatternID pattern, const Colorset &colorset);
PatternID rollSingleLedPatternID(Random &ctx);
PatternID rollMultiLedPatternID(Random &ctx);
Colorset rollColorset(Random &ctx);
Expand Down

0 comments on commit 80b987d

Please sign in to comment.