summaryrefslogtreecommitdiffstats
path: root/modules/basis_universal
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-02-18 18:48:14 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-02-18 18:55:40 +0100
commit48ed0474e2bc6e165e8dd30740d21536e6d0e40c (patch)
tree4e3dd06c8c50f0bbe76c1d693487012436d1b945 /modules/basis_universal
parent5f05e2b9b1a3fedcdd7ecb2ab976a2687fd6f19a (diff)
downloadredot-engine-48ed0474e2bc6e165e8dd30740d21536e6d0e40c.tar.gz
basis_universal: Unbundle jpgd, use our newer copy
Diffstat (limited to 'modules/basis_universal')
-rw-r--r--modules/basis_universal/SCsub7
-rw-r--r--modules/basis_universal/config.py1
-rw-r--r--modules/basis_universal/patches/external-jpgd.patch13
3 files changed, 18 insertions, 3 deletions
diff --git a/modules/basis_universal/SCsub b/modules/basis_universal/SCsub
index 14669847bc..80bfd7e858 100644
--- a/modules/basis_universal/SCsub
+++ b/modules/basis_universal/SCsub
@@ -28,7 +28,6 @@ encoder_sources = [
"basisu_resample_filters.cpp",
"basisu_ssim.cpp",
"basisu_uastc_enc.cpp",
- "jpgd.cpp",
"pvpngreader.cpp",
]
encoder_sources = [thirdparty_dir + "encoder/" + file for file in encoder_sources]
@@ -36,9 +35,11 @@ transcoder_sources = [thirdparty_dir + "transcoder/basisu_transcoder.cpp"]
# Treat Basis headers as system headers to avoid raising warnings. Not supported on MSVC.
if not env.msvc:
- env_basisu.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path])
+ env_basisu.Append(
+ CPPFLAGS=["-isystem", Dir(thirdparty_dir).path, "-isystem", Dir("#thirdparty/jpeg-compressor").path]
+ )
else:
- env_basisu.Prepend(CPPPATH=[thirdparty_dir])
+ env_basisu.Prepend(CPPPATH=[thirdparty_dir, "#thirdparty/jpeg-compressor"])
if env["builtin_zstd"]:
env_basisu.Prepend(CPPPATH=["#thirdparty/zstd"])
diff --git a/modules/basis_universal/config.py b/modules/basis_universal/config.py
index d22f9454ed..6a67f2c77c 100644
--- a/modules/basis_universal/config.py
+++ b/modules/basis_universal/config.py
@@ -1,4 +1,5 @@
def can_build(env, platform):
+ env.module_add_dependencies("basis_universal", ["jpg"])
return True
diff --git a/modules/basis_universal/patches/external-jpgd.patch b/modules/basis_universal/patches/external-jpgd.patch
new file mode 100644
index 0000000000..7a805d00cb
--- /dev/null
+++ b/modules/basis_universal/patches/external-jpgd.patch
@@ -0,0 +1,13 @@
+diff --git a/thirdparty/basis_universal/encoder/basisu_enc.cpp b/thirdparty/basis_universal/encoder/basisu_enc.cpp
+index c431ceaf12..e87dd636a2 100644
+--- a/thirdparty/basis_universal/encoder/basisu_enc.cpp
++++ b/thirdparty/basis_universal/encoder/basisu_enc.cpp
+@@ -409,7 +409,7 @@ namespace basisu
+ bool load_jpg(const char *pFilename, image& img)
+ {
+ int width = 0, height = 0, actual_comps = 0;
+- uint8_t *pImage_data = jpgd::decompress_jpeg_image_from_file(pFilename, &width, &height, &actual_comps, 4, jpgd::jpeg_decoder::cFlagLinearChromaFiltering);
++ uint8_t *pImage_data = jpgd::decompress_jpeg_image_from_file(pFilename, &width, &height, &actual_comps, 4, jpgd::jpeg_decoder::cFlagBoxChromaFiltering);
+ if (!pImage_data)
+ return false;
+