From a3cd3cbb047a32061c0fc252ea4044fb4f17ade4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Wei=C3=9F?= Date: Sat, 8 Apr 2017 21:18:16 +0200 Subject: [PATCH 1/3] Certain dds texture lack the DDSCAPS_TEXTURE-flag, but are still recognized by programs like IrfanView and can also be loaded in the engine. This commit weakens the check for this flag: Instead of throwing an exception, a warning is logged. --- .../plugins/java/com/jme3/texture/plugins/DDSLoader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java b/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java index 245591c05..c8334e8ab 100644 --- a/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java +++ b/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java @@ -203,9 +203,9 @@ public class DDSLoader implements AssetLoader { texture3D = false; if (!directx10) { - if (!is(caps1, DDSCAPS_TEXTURE)) { - throw new IOException("File is not a texture"); - } +// if (!is(caps1, DDSCAPS_TEXTURE)) { +// throw new IOException("File is not a texture"); +// } if (depth <= 0) { depth = 1; From 04b0578173ed1f26bcc8aa9f7d3076abc9e4cc71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Wei=C3=9F?= Date: Sat, 8 Apr 2017 21:22:06 +0200 Subject: [PATCH 2/3] Certain dds texture lack the DDSCAPS_TEXTURE-flag, but are still recognized by programs like IrfanView and can also be loaded in the engine. This commit weakens the check for this flag: Instead of throwing an exception, a warning is logged. --- .../src/plugins/java/com/jme3/texture/plugins/DDSLoader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java b/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java index c8334e8ab..a9c5f6a8f 100644 --- a/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java +++ b/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java @@ -203,9 +203,10 @@ public class DDSLoader implements AssetLoader { texture3D = false; if (!directx10) { -// if (!is(caps1, DDSCAPS_TEXTURE)) { + if (!is(caps1, DDSCAPS_TEXTURE)) { + logger.warning("Texture is missing the DDSCAPS_TEXTURE-flag"); // throw new IOException("File is not a texture"); -// } + } if (depth <= 0) { depth = 1; From 02781e799f24d56fec325117c0145cc44247a927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Wei=C3=9F?= Date: Sat, 8 Apr 2017 21:24:15 +0200 Subject: [PATCH 3/3] oh man, I should have learned it by now, that jme uses spaces, not tabs --- .../src/plugins/java/com/jme3/texture/plugins/DDSLoader.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java b/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java index a9c5f6a8f..948abe87e 100644 --- a/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java +++ b/jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java @@ -204,8 +204,7 @@ public class DDSLoader implements AssetLoader { if (!directx10) { if (!is(caps1, DDSCAPS_TEXTURE)) { - logger.warning("Texture is missing the DDSCAPS_TEXTURE-flag"); -// throw new IOException("File is not a texture"); + logger.warning("Texture is missing the DDSCAPS_TEXTURE-flag"); } if (depth <= 0) {