diff --git a/plugins/Makefile b/plugins/Makefile index 79ac0d0..577515e 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -838,34 +838,40 @@ else PLUGIN_LIST = $(subst /plugin.json,,$(wildcard */plugin.json)) endif +RESOURCE_FILES = \ + $(wildcard */presets) \ + $(wildcard */res/*.svg) \ + $(filter-out HetrickCV/res/illustrator - deprecated/MyModule.svg,$(wildcard */res/*/*.svg)) \ + $(wildcard */res/*.ttf) $(wildcard */res/*/*.ttf) + PLUGIN_RESOURCES = -PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.lv2/resources/%) PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.lv2/resources/PluginManifests/%.json) +PLUGIN_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.lv2/resources/%) ifeq ($(MACOS),true) -PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst/Contents/Resources/%) PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst/Contents/Resources/PluginManifests/%.json) +PLUGIN_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.vst/Contents/Resources/%) else -PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst/resources/%) PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst/resources/PluginManifests/%.json) +PLUGIN_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.vst/resources/%) endif -PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst3/Contents/Resources/%) PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst3/Contents/Resources/PluginManifests/%.json) +PLUGIN_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.vst3/Contents/Resources/%) resources: $(PLUGIN_RESOURCES) -../bin/CardinalFX.lv2/resources/%: %/res +../bin/CardinalFX.lv2/resources/%: % -@mkdir -p "$(shell dirname $@)" ln -sf $(abspath $<) $@ -../bin/CardinalFX.vst/resources/%: %/res +../bin/CardinalFX.vst/resources/%: % -@mkdir -p "$(shell dirname $@)" ln -sf $(abspath $<) $@ -../bin/CardinalFX.vst/Contents/Resources/%: %/res +../bin/CardinalFX.vst/Contents/Resources/%: % -@mkdir -p "$(shell dirname $@)" ln -sf $(abspath $<) $@ -../bin/CardinalFX.vst3/Contents/Resources/%: %/res +../bin/CardinalFX.vst3/Contents/Resources/%: % -@mkdir -p "$(shell dirname $@)" ln -sf $(abspath $<) $@ diff --git a/plugins/Mog b/plugins/Mog index c1b1288..01c4fac 160000 --- a/plugins/Mog +++ b/plugins/Mog @@ -1 +1 @@ -Subproject commit c1b128866786246a407c10713efb00ecc8486ced +Subproject commit 01c4fac9f2e91f60125d36767224f457b2057fb7 diff --git a/src/Makefile.cardinal.mk b/src/Makefile.cardinal.mk index b39781d..cc8b018 100644 --- a/src/Makefile.cardinal.mk +++ b/src/Makefile.cardinal.mk @@ -223,7 +223,7 @@ ifeq ($(NAME),CardinalFX) all: lv2 vst2 vst3 resources -CORE_RESOURCES = $(filter-out icon.png,$(subst ../Rack/res/,,$(wildcard ../Rack/res/*))) template.vcv +CORE_RESOURCES = $(subst ../Rack/res/,,$(wildcard ../Rack/res/ComponentLibrary/*.svg ../Rack/res/fonts/*.ttf)) template.vcv PLUGIN_RESOURCES += $(CORE_RESOURCES:%=$(TARGET_DIR)/CardinalFX.lv2/resources/%) ifeq ($(MACOS),true) diff --git a/src/custom/asset.cpp b/src/custom/asset.cpp index 4a243b3..8b52d8b 100644 --- a/src/custom/asset.cpp +++ b/src/custom/asset.cpp @@ -50,14 +50,16 @@ std::string user(std::string filename) { // get system resource, trimming "res/" prefix if we are loaded as a plugin bundle std::string system(std::string filename) { - if (string::endsWith(filename, "/ComponentLibrary/ScrewSilver.svg")) + // Always use dark screws + if (string::endsWith(filename, "/ScrewSilver.svg")) filename = filename.substr(0, filename.size()-10) + "Black.svg"; return system::join(systemDir, bundlePath.empty() ? filename : trim(filename)); } -// get plugin resource, also trims "res/" as needed +// get plugin resource std::string plugin(plugin::Plugin* plugin, std::string filename) { DISTRHO_SAFE_ASSERT_RETURN(plugin != nullptr, {}); + // always use dark scheme if (plugin->slug == "GlueTheGiant") { if (filename == "res/BusDepot.svg" @@ -73,28 +75,24 @@ std::string plugin(plugin::Plugin* plugin, std::string filename) { filename = filename.substr(0, filename.size()-4) + "_Night.svg"; } } - return system::join(plugin->path, trim(filename)); + return system::join(plugin->path, filename); } // path to plugin manifest std::string pluginManifest(const std::string& dirname) { + // no bundlePath set, assume local source build if (bundlePath.empty()) - { - if (dirname == "Core") - return system::join(systemDir, "..", "..", "plugins", "Core.json"); return system::join(systemDir, "..", "..", "plugins", dirname, "plugin.json"); - } + // bundlePath is present, use resources from bundle return system::join(bundlePath, dirname + ".json"); } // path to plugin files std::string pluginPath(const std::string& dirname) { + // no bundlePath set, assume local source build if (bundlePath.empty()) - { - if (dirname == "Core") - return systemDir; return system::join(systemDir, "..", "..", "plugins", "res", dirname); - } + // bundlePath is present, use resources from bundle return system::join(systemDir, dirname); }