diff --git a/sdk/jme3-core/nbproject/project.xml b/sdk/jme3-core/nbproject/project.xml index 782a2ecf1..2ee8ca00d 100644 --- a/sdk/jme3-core/nbproject/project.xml +++ b/sdk/jme3-core/nbproject/project.xml @@ -258,6 +258,10 @@ com.jme3.gde.core.undoredo com.jme3.gde.core.util + + ext/DDSUtils.jar + release/modules/ext/DDSUtils.jar + diff --git a/sdk/jme3-core/release/modules/ext/DDSUtils.jar b/sdk/jme3-core/release/modules/ext/DDSUtils.jar new file mode 100644 index 000000000..afeb5c714 Binary files /dev/null and b/sdk/jme3-core/release/modules/ext/DDSUtils.jar differ diff --git a/sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/properties/TextureBrowser.java b/sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/properties/TextureBrowser.java index b7685cf5c..c5b38efb4 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/properties/TextureBrowser.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/properties/TextureBrowser.java @@ -31,12 +31,19 @@ */ package com.jme3.gde.core.sceneexplorer.nodes.properties; +import Model.DDSImageFile; import com.jme3.gde.core.assets.ProjectAssetManager; import com.jme3.texture.Texture; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; import java.util.logging.Logger; import javax.swing.DefaultListSelectionModel; import javax.swing.Icon; +import javax.swing.ImageIcon; import jme3tools.converters.ImageToAwt; +import org.openide.filesystems.FileUtil; +import org.openide.util.Exceptions; import org.openide.util.ImageUtilities; /** @@ -199,7 +206,19 @@ public class TextureBrowser extends javax.swing.JDialog { if (textureList.getSelectedIndex() > -1) { String selected = (String) textureList.getSelectedValue(); Texture tex = assetManager.loadTexture(selected); - Icon newicon = ImageUtilities.image2Icon(ImageToAwt.convert(tex.getImage(), false, true, 0)); + Icon newicon = null; + if(selected.endsWith(".dds")||selected.endsWith(".DDS")){ + try { + File file = FileUtil.toFile(assetManager.getAssetFolder().getFileObject(selected)); + DDSImageFile ddsImageFile = new DDSImageFile(file); + BufferedImage bufferedImage = ddsImageFile.getData(); + newicon = new ImageIcon(bufferedImage); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + }else{ + newicon = ImageUtilities.image2Icon(ImageToAwt.convert(tex.getImage(), false, true, 0)); + } imagePreviewLabel.setIcon(newicon); } else { imagePreviewLabel.setIcon(null);