Skip to content

Commit

Permalink
Cleanup, rebuild CI, add lighter version color util for later
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Jan 6, 2024
1 parent 43bf3ab commit 6505aca
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deps/PawPaw
13 changes: 0 additions & 13 deletions plugins/plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
// ZamAudio (always enabled) - TODO
// #include "ZamAudio/src/plugin.hpp"

#ifndef NOPLUGINS
// 21kHz
#include "21kHz/src/21kHz.hpp"

Expand Down Expand Up @@ -784,12 +783,9 @@ void surgext_rack_update_theme();
#include "ZZC/src/ZZC.hpp"
#undef modelClock

#endif // NOPLUGINS

// known terminal modules
std::vector<Model*> hostTerminalModels;

#ifndef NOPLUGINS
// stuff that reads config files, we don't want that
int loadConsoleType() { return 0; }
bool loadDarkAsDefault() { return settings::preferDarkPanels; }
Expand All @@ -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;
Expand Down Expand Up @@ -881,7 +875,6 @@ Plugin* pluginInstance__Voxglitch;
Plugin* pluginInstance__WhatTheRack;
Plugin* pluginInstance__ZetaCarinaeModules;
Plugin* pluginInstance__ZZC;
#endif // NOPLUGINS

namespace rack {

Expand Down Expand Up @@ -1103,7 +1096,6 @@ static void initStatic__ZamAudio()
}
*/

#ifndef NOPLUGINS
static void initStatic__21kHz()
{
Plugin* const p = new Plugin;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -3203,7 +3193,6 @@ void initStaticPlugins()
initStatic__WhatTheRack();
initStatic__ZetaCarinaeModules();
initStatic__ZZC();
#endif // NOPLUGINS
}

void destroyStaticPlugins()
Expand All @@ -3215,7 +3204,6 @@ void destroyStaticPlugins()

void updateStaticPluginsDarkMode()
{
#ifndef NOPLUGINS
const bool darkMode = settings::preferDarkPanels;
// bogaudio
{
Expand All @@ -3239,7 +3227,6 @@ void updateStaticPluginsDarkMode()
{
surgext_rack_update_theme();
}
#endif
}

}
Expand Down
24 changes: 11 additions & 13 deletions src/custom/dep.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021-2022 Filipe Coelho <[email protected]>
*
* 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 <[email protected]>
* SPDX-License-Identifier: GPL-3.0-or-later
*/

#define STDIO_OVERRIDE Rackdep
Expand Down Expand Up @@ -650,6 +639,15 @@ unsigned int darkerColor(const unsigned int color) noexcept
| (std::max<int>(0, (color & 0xff) - 0x80));
}

static inline
unsigned int lighterColor(const unsigned int color) noexcept
{
return (color & 0xff000000)
| (std::min<int>(0xff, ((color & 0xff0000) >> 16) + 0x80) << 16)
| (std::min<int>(0xff, ((color & 0xff00) >> 8) + 0x80) << 8)
| (std::min<int>(0xff, (color & 0xff) + 0x80));
}

static inline
unsigned int invertColor(const unsigned int color) noexcept
{
Expand Down

0 comments on commit 6505aca

Please sign in to comment.