]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
od-unix: ship starter filter presets
authorStefan Reinauer <stefan.reinauer@coreboot.org>
Fri, 12 Jun 2026 15:11:06 +0000 (08:11 -0700)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Wed, 17 Jun 2026 19:24:40 +0000 (12:24 -0700)
The Filter page's preset list was empty until the user saved their own
(GitHub issue #4). Add a set of bundled presets built from the portable
filter controls the Unix GLSL pipeline implements (Sharp Pixels, Soft
Bilinear, CRT Scanlines, Warm TV), installed under the shared data
directory on Linux and into the app bundle resources on macOS.

The preset combo lists user presets and bundled presets together; the
user directory wins on name collisions, saving always writes to the
user directory, and loading falls back to the bundled file when no user
preset of that name exists.

CMakeLists.txt
od-unix/qt/launcher.cpp
od-unix/share/filter-presets/CRT Scanlines.filter [new file with mode: 0644]
od-unix/share/filter-presets/Sharp Pixels.filter [new file with mode: 0644]
od-unix/share/filter-presets/Soft Bilinear.filter [new file with mode: 0644]
od-unix/share/filter-presets/Warm TV.filter [new file with mode: 0644]
tools/macos-bundle.sh

index 8541987cb000bab86c6bd0dec4a29930893886ea..b71c1e8fcca17e68a6c9e2fb2c9d98439c9b1b8a 100644 (file)
@@ -1728,6 +1728,9 @@ if(TARGET winuae_unix AND NOT APPLE)
         PATTERN "*.manifest" EXCLUDE
         PATTERN "resource.h" EXCLUDE
     )
+    install(DIRECTORY od-unix/share/filter-presets/
+        DESTINATION "${CMAKE_INSTALL_DATADIR}/winuae/od-unix/share/filter-presets"
+    )
     if(WINUAE_UNIX_WITH_PPC_QEMU)
         install(FILES "${WINUAE_QEMU_UAE_PLUGIN_PATH}"
             DESTINATION "${WINUAE_UNIX_INSTALL_PLUGINDIR_RELATIVE}"
index 8e04455636c95328b48e8eec7a75310b6a6c26b9..20fb2d6ca6bca8ed67b9a794db31c6eb31abd791 100644 (file)
@@ -12657,6 +12657,24 @@ private:
         return QDir(filterPresetDirectoryPath()).filePath(normalizedFilterPresetName(name) + QStringLiteral(".filter"));
     }
 
+    QString systemFilterPresetDirectory() const
+    {
+        return resourceFile(QStringLiteral("od-unix/share/filter-presets"));
+    }
+
+    QString findFilterPresetFile(const QString &name) const
+    {
+        const QString user = filterPresetPath(name);
+        if (QFileInfo::exists(user)) {
+            return user;
+        }
+        const QString system = QDir(systemFilterPresetDirectory()).filePath(normalizedFilterPresetName(name) + QStringLiteral(".filter"));
+        if (QFileInfo::exists(system)) {
+            return system;
+        }
+        return user;
+    }
+
     void refreshFilterPresetList(const QString &preferred = QString())
     {
         if (!filterPresetName) {
@@ -12666,11 +12684,19 @@ private:
         QSignalBlocker blocker(filterPresetName);
         filterPresetName->clear();
         filterPresetName->addItem(QString());
-        QDir dir(filterPresetDirectoryPath());
-        const QStringList files = dir.entryList({ QStringLiteral("*.filter") }, QDir::Files, QDir::Name | QDir::IgnoreCase);
-        for (const QString &file : files) {
-            filterPresetName->addItem(QFileInfo(file).completeBaseName());
+        QStringList names;
+        for (const QString &directory : { filterPresetDirectoryPath(), systemFilterPresetDirectory() }) {
+            QDir dir(directory);
+            const QStringList files = dir.entryList({ QStringLiteral("*.filter") }, QDir::Files, QDir::Name | QDir::IgnoreCase);
+            for (const QString &file : files) {
+                const QString name = QFileInfo(file).completeBaseName();
+                if (!names.contains(name, Qt::CaseInsensitive)) {
+                    names.append(name);
+                }
+            }
         }
+        names.sort(Qt::CaseInsensitive);
+        filterPresetName->addItems(names);
         filterPresetName->setCurrentText(current);
     }
 
@@ -12720,7 +12746,7 @@ private:
         if (name.isEmpty()) {
             return;
         }
-        QFile file(filterPresetPath(name));
+        QFile file(findFilterPresetFile(name));
         if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
             QMessageBox::warning(this, windowTitle(), QStringLiteral("Could not read %1:\n%2").arg(file.fileName(), file.errorString()));
             return;
diff --git a/od-unix/share/filter-presets/CRT Scanlines.filter b/od-unix/share/filter-presets/CRT Scanlines.filter
new file mode 100644 (file)
index 0000000..5b1ac80
--- /dev/null
@@ -0,0 +1,6 @@
+# WinUAE Qt filter preset
+gfx_filter_enable=1
+gfx_filter_bilinear=1
+gfx_filter_scanlines=50
+gfx_filter_scanlinelevel=12
+gfx_filter_scanlineoffset=0
diff --git a/od-unix/share/filter-presets/Sharp Pixels.filter b/od-unix/share/filter-presets/Sharp Pixels.filter
new file mode 100644 (file)
index 0000000..d1765a6
--- /dev/null
@@ -0,0 +1,5 @@
+# WinUAE Qt filter preset
+gfx_filter_enable=1
+gfx_filter_bilinear=0
+gfx_filter_autoscale=integer
+gfx_filter_scanlines=0
diff --git a/od-unix/share/filter-presets/Soft Bilinear.filter b/od-unix/share/filter-presets/Soft Bilinear.filter
new file mode 100644 (file)
index 0000000..24186c2
--- /dev/null
@@ -0,0 +1,5 @@
+# WinUAE Qt filter preset
+gfx_filter_enable=1
+gfx_filter_bilinear=1
+gfx_filter_autoscale=auto
+gfx_filter_scanlines=0
diff --git a/od-unix/share/filter-presets/Warm TV.filter b/od-unix/share/filter-presets/Warm TV.filter
new file mode 100644 (file)
index 0000000..33ed27d
--- /dev/null
@@ -0,0 +1,11 @@
+# WinUAE Qt filter preset
+gfx_filter_enable=1
+gfx_filter_bilinear=1
+gfx_filter_saturation=200
+gfx_filter_contrast=60
+gfx_filter_luminance=20
+gfx_filter_gamma=60
+gfx_filter_blur=120
+gfx_filter_noise=60
+gfx_filter_scanlines=30
+gfx_filter_scanlinelevel=10
index 5d62c136564ae555c41be1628bc829dfc4954450..62522bef4f0fb75a509e13022ec9afbead348bd0 100755 (executable)
@@ -161,6 +161,9 @@ find "${source_dir}/od-win32/resources" -maxdepth 1 -type f \
     ! -name '*.manifest' \
     ! -name 'resource.h' \
     -exec cp '{}' "${resources_dir}/od-win32/resources/" ';'
+mkdir -p "${resources_dir}/od-unix/share/filter-presets"
+cp "${source_dir}/od-unix/share/filter-presets/"*.filter \
+    "${resources_dir}/od-unix/share/filter-presets/"
 cp "${source_dir}/README_unix.md" "${resources_dir}/README_unix.md"
 
 if [[ -f "${source_dir}/od-win32/resources/winuae.ico" ]]; then