From 6505acaa75e8cd429be62fb7673517cee35c3373 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 6 Jan 2024 15:51:20 +0100 Subject: [PATCH] Cleanup, rebuild CI, add lighter version color util for later Signed-off-by: falkTX --- .github/workflows/build.yml | 2 +- deps/PawPaw | 2 +- plugins/plugins.cpp | 13 ------------- src/custom/dep.cpp | 24 +++++++++++------------- 4 files changed, 13 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d2a2d16..e479b9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: build on: [push, pull_request] env: - CACHE_VERSION: 6 + CACHE_VERSION: 7 CARDINAL_UNDER_WINE: 1 CIBUILD: true DEBIAN_FRONTEND: noninteractive diff --git a/deps/PawPaw b/deps/PawPaw index 7822bb0..cfa9dc5 160000 --- a/deps/PawPaw +++ b/deps/PawPaw @@ -1 +1 @@ -Subproject commit 7822bb0ba1deb75b3010d6efab63a4f854174b56 +Subproject commit cfa9dc50b32ebdb567d2d86467d3dc58157252c7 diff --git a/plugins/plugins.cpp b/plugins/plugins.cpp index 96b5429..35fd776 100644 --- a/plugins/plugins.cpp +++ b/plugins/plugins.cpp @@ -18,7 +18,6 @@ // ZamAudio (always enabled) - TODO // #include "ZamAudio/src/plugin.hpp" -#ifndef NOPLUGINS // 21kHz #include "21kHz/src/21kHz.hpp" @@ -784,12 +783,9 @@ void surgext_rack_update_theme(); #include "ZZC/src/ZZC.hpp" #undef modelClock -#endif // NOPLUGINS - // known terminal modules std::vector hostTerminalModels; -#ifndef NOPLUGINS // stuff that reads config files, we don't want that int loadConsoleType() { return 0; } bool loadDarkAsDefault() { return settings::preferDarkPanels; } @@ -802,13 +798,11 @@ void saveDefaultTheme(ModuleTheme) {} void saveDirectOutMode(bool) {} void saveHighQualityAsDefault(bool) {} void writeDefaultTheme() {} -#endif // plugin instances Plugin* pluginInstance__Cardinal; Plugin* pluginInstance__Fundamental; // Plugin* pluginInstance__ZamAudio; -#ifndef NOPLUGINS Plugin* pluginInstance__21kHz; Plugin* pluginInstance__8Mode; extern Plugin* pluginInstance__AaronStatic; @@ -881,7 +875,6 @@ Plugin* pluginInstance__Voxglitch; Plugin* pluginInstance__WhatTheRack; Plugin* pluginInstance__ZetaCarinaeModules; Plugin* pluginInstance__ZZC; -#endif // NOPLUGINS namespace rack { @@ -1103,7 +1096,6 @@ static void initStatic__ZamAudio() } */ -#ifndef NOPLUGINS static void initStatic__21kHz() { Plugin* const p = new Plugin; @@ -3123,14 +3115,12 @@ static void initStatic__ZZC() #undef modelClock } } -#endif // NOPLUGINS void initStaticPlugins() { initStatic__Cardinal(); initStatic__Fundamental(); // initStatic__ZamAudio(); -#ifndef NOPLUGINS initStatic__21kHz(); initStatic__8Mode(); initStatic__AaronStatic(); @@ -3203,7 +3193,6 @@ void initStaticPlugins() initStatic__WhatTheRack(); initStatic__ZetaCarinaeModules(); initStatic__ZZC(); -#endif // NOPLUGINS } void destroyStaticPlugins() @@ -3215,7 +3204,6 @@ void destroyStaticPlugins() void updateStaticPluginsDarkMode() { -#ifndef NOPLUGINS const bool darkMode = settings::preferDarkPanels; // bogaudio { @@ -3239,7 +3227,6 @@ void updateStaticPluginsDarkMode() { surgext_rack_update_theme(); } -#endif } } diff --git a/src/custom/dep.cpp b/src/custom/dep.cpp index af87b8c..a7fd1e2 100644 --- a/src/custom/dep.cpp +++ b/src/custom/dep.cpp @@ -1,18 +1,7 @@ /* * DISTRHO Cardinal Plugin - * Copyright (C) 2021-2022 Filipe Coelho - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 3 of - * the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the LICENSE file. + * Copyright (C) 2021-2024 Filipe Coelho + * SPDX-License-Identifier: GPL-3.0-or-later */ #define STDIO_OVERRIDE Rackdep @@ -650,6 +639,15 @@ unsigned int darkerColor(const unsigned int color) noexcept | (std::max(0, (color & 0xff) - 0x80)); } +static inline +unsigned int lighterColor(const unsigned int color) noexcept +{ + return (color & 0xff000000) + | (std::min(0xff, ((color & 0xff0000) >> 16) + 0x80) << 16) + | (std::min(0xff, ((color & 0xff00) >> 8) + 0x80) << 8) + | (std::min(0xff, (color & 0xff) + 0x80)); +} + static inline unsigned int invertColor(const unsigned int color) noexcept {