From 9f4cfabe765190f00ef4fb9736c98e1b95fca885 Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 3 May 2024 01:46:39 -0700 Subject: [PATCH] some minor reintegrations --- VortexEngine/src/Patterns/Pattern.cpp | 6 ++---- VortexEngine/src/Patterns/PatternArgs.h | 2 +- VortexEngine/src/Patterns/PatternBuilder.cpp | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VortexEngine/src/Patterns/Pattern.cpp b/VortexEngine/src/Patterns/Pattern.cpp index 768a9966f2..bcdf645fc9 100644 --- a/VortexEngine/src/Patterns/Pattern.cpp +++ b/VortexEngine/src/Patterns/Pattern.cpp @@ -90,10 +90,8 @@ bool Pattern::unserialize(ByteStream &buffer) // start with the default args for this pattern PatternArgs args = PatternBuilder::getDefaultArgs(m_patternID); // then unserialize any different args overtop of the defaults - if (args.unserialize(buffer) != ARG_NONE) { - // if any args were unserialized, set them - setArgs(args); - } + args.unserialize(buffer); + setArgs(args); return true; } diff --git a/VortexEngine/src/Patterns/PatternArgs.h b/VortexEngine/src/Patterns/PatternArgs.h index f195c1916c..67759ad682 100644 --- a/VortexEngine/src/Patterns/PatternArgs.h +++ b/VortexEngine/src/Patterns/PatternArgs.h @@ -29,7 +29,7 @@ typedef uint8_t ArgMap; // some helpers to set/clear/check #define ARGMAP_SET(map, arg) (map |= ARG(arg)) #define ARGMAP_CLEAR(map, arg) (map &= ~ARG(arg)) -#define ARGMAP_ISSET(map, arg) (map & ARG(arg)) +#define ARGMAP_ISSET(map, arg) ((map & ARG(arg)) != 0) // a structured method for passing arguments to patterns, there's definitely more dynamic // ways to approach this but I'm aiming for simple and lightweight here diff --git a/VortexEngine/src/Patterns/PatternBuilder.cpp b/VortexEngine/src/Patterns/PatternBuilder.cpp index 3468945ed0..2d965664b7 100644 --- a/VortexEngine/src/Patterns/PatternBuilder.cpp +++ b/VortexEngine/src/Patterns/PatternBuilder.cpp @@ -44,9 +44,11 @@ Pattern *PatternBuilder::make(PatternID id, const PatternArgs *args) DEBUG_LOGF("Invalid pattern id: %u", id); id = PATTERN_FIRST; } +#if VORTEX_SLIM == 0 if (isMultiLedPatternID(id)) { return makeMulti(id, args); } +#endif return makeSingle(id, args); }