diff --git a/include/components.hpp b/include/components.hpp index 3bafa52f..ffd5a169 100644 --- a/include/components.hpp +++ b/include/components.hpp @@ -402,7 +402,7 @@ struct ColorValueLight : ValueLight { void setValue(float v) { v = sqrtBipolar(v); color = baseColor; - color.a = clampf(v * baseColor.a, 0.0, 1.0); + color.a *= clampf(v, 0.0, 1.0); } }; @@ -430,7 +430,7 @@ struct PolarityLight : ValueLight { void setValue(float v) { v = sqrtBipolar(v); color = (v >= 0.0) ? posColor : negColor; - color.a = clampf(fabsf(v) * color.a, 0.0, 1.0); + color.a *= clampf(fabsf(v), 0.0, 1.0); } }; diff --git a/src/plugin.cpp b/src/plugin.cpp index 07ee7583..0153e606 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -89,6 +89,11 @@ static int loadPlugin(std::string path) { plugin->handle = handle; initCallback(plugin); + // Check that this is a unique slug + for (Plugin *otherPlugin : gPlugins) { + assert(plugin->slug != otherPlugin->slug); + } + // Add plugin to list gPlugins.push_back(plugin); fprintf(stderr, "Loaded plugin %s\n", libraryFilename.c_str());