Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Commit 4c1bebd

Browse files
author
ttddee
committed
Copy OCIO config files on startup.
1 parent f15bce6 commit 4c1bebd

File tree

3 files changed

+33
-16
lines changed

3 files changed

+33
-16
lines changed

Cascade.pro

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,6 @@ linux-g++ {
244244

245245
CONFIG(debug, debug|release): DESTDIR = $$OUT_PWD/debug
246246
CONFIG(release, debug|release): DESTDIR = $$OUT_PWD/release
247-
248-
COPIES += ocio
249-
ocio.files += $$files(ocio/config.ocio)
250-
ocio.path = $$DESTDIR/ocio
251-
252-
COPIES += luts
253-
luts.files += $$files(ocio/luts/*)
254-
luts.path = $$DESTDIR/ocio/luts
255247
}
256248

257249
win32-msvc* {
@@ -396,14 +388,6 @@ win32-msvc* {
396388
dlls.path = $$DESTDIR
397389
platforms.path = $$DESTDIR/platforms
398390

399-
COPIES += ocio
400-
ocio.files += $$files(ocio/config.ocio)
401-
ocio.path = $$DESTDIR/ocio
402-
403-
COPIES += luts
404-
luts.files += $$files(ocio/luts/*)
405-
luts.path = $$DESTDIR/ocio/luts
406-
407391
COPIES += license
408392
license.files += $$files(LICENSE)
409393
license.path = $$DESTDIR

resources.qrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,16 @@
5858
<file>shaders/smartdenoise_comp.spv</file>
5959
<file>default.prefs</file>
6060
<file>design/logo/cascade-logo-full.png</file>
61+
<file>ocio/config.ocio</file>
62+
<file>ocio/luts/alexalogc.spi1d</file>
63+
<file>ocio/luts/cineon.spi1d</file>
64+
<file>ocio/luts/panalog.spi1d</file>
65+
<file>ocio/luts/ploglin.spi1d</file>
66+
<file>ocio/luts/rec709.spi1d</file>
67+
<file>ocio/luts/redlog.spi1d</file>
68+
<file>ocio/luts/slog.spi1d</file>
69+
<file>ocio/luts/srgb.spi1d</file>
70+
<file>ocio/luts/srgbf.spi1d</file>
71+
<file>ocio/luts/viperlog.spi1d</file>
6172
</qresource>
6273
</RCC>

src/main.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <QApplication>
2525
#include <QFontDatabase>
2626
#include <QFile>
27+
#include <QDir>
2728

2829
#include "log.h"
2930

@@ -53,6 +54,27 @@ int main(int argc, char *argv[])
5354
QString style = QLatin1String(f.readAll());
5455
a.setStyleSheet(style);
5556

57+
// Copy the OCIO config from the resources to disk.
58+
// We do this so that they end up in the right place when
59+
// running from an AppImage.
60+
if (!QDir("ocio").exists())
61+
{
62+
QDir().mkdir("ocio");
63+
QDir().mkdir("ocio/luts");
64+
65+
QFile::copy(":/ocio/config.ocio", "ocio/config.ocio");
66+
QFile::copy(":/ocio/luts/alexalogc.spi1d", "ocio/luts/alexalogc.spi1d");
67+
QFile::copy(":/ocio/luts/cineon.spi1d", "ocio/luts/cineon.spi1d");
68+
QFile::copy(":/ocio/luts/panalog.spi1d", "ocio/luts/panalog.spi1d");
69+
QFile::copy(":/ocio/luts/ploglin.spi1d", "ocio/luts/ploglin.spi1d");
70+
QFile::copy(":/ocio/luts/rec709.spi1d", "ocio/luts/rec709.spi1d");
71+
QFile::copy(":/ocio/luts/redlog.spi1d", "ocio/luts/redlog.spi1d");
72+
QFile::copy(":/ocio/luts/slog.spi1d", "ocio/luts/slog.spi1d");
73+
QFile::copy(":/ocio/luts/srgb.spi1d", "ocio/luts/srgb.spi1d");
74+
QFile::copy(":/ocio/luts/srgbf.spi1d", "ocio/luts/srgbf.spi1d");
75+
QFile::copy(":/ocio/luts/viperlog.spi1d", "ocio/luts/viperlog.spi1d");
76+
}
77+
5678
// Create window
5779
MainWindow w;
5880
w.setWindowState(Qt::WindowMaximized);

0 commit comments

Comments
 (0)