diff --git a/engine/src/core/com/jme3/system/AppSettings.java b/engine/src/core/com/jme3/system/AppSettings.java index fcb377f7d..d308c877a 100644 --- a/engine/src/core/com/jme3/system/AppSettings.java +++ b/engine/src/core/com/jme3/system/AppSettings.java @@ -32,7 +32,6 @@ package com.jme3.system; import com.jme3.renderer.Renderer; -import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -376,7 +375,7 @@ public class AppSettings extends HashMap { * @param value An array of BufferedImages to use as icons. * (Default: not set) */ - public void setIcons(BufferedImage[] value) { + public void setIcons(Object[] value) { put("Icons", value); } @@ -440,8 +439,8 @@ public class AppSettings extends HashMap { return getString("AudioRenderer"); } - public BufferedImage[] getIcons() { - return (BufferedImage[]) get("Icons"); + public Object[] getIcons() { + return (Object[]) get("Icons"); } public void setSettingsDialogImage(String path) { diff --git a/engine/src/desktop/com/jme3/app/SettingsDialog.java b/engine/src/desktop/com/jme3/app/SettingsDialog.java index 1a51d7c7c..e10920b9e 100644 --- a/engine/src/desktop/com/jme3/app/SettingsDialog.java +++ b/engine/src/desktop/com/jme3/app/SettingsDialog.java @@ -45,6 +45,7 @@ import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import java.awt.image.BufferedImage; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; @@ -250,8 +251,8 @@ public final class SettingsDialog extends JDialog { } }); - if(source.getIcons()!=null){ - safeSetIconImages(Arrays.asList(source.getIcons())); + if (source.getIcons() != null) { + safeSetIconImages( (List) Arrays.asList((BufferedImage[]) source.getIcons()) ); } setTitle("Select Display Settings"); diff --git a/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglDisplay.java b/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglDisplay.java index 523b30073..6fd803265 100644 --- a/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglDisplay.java +++ b/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglDisplay.java @@ -113,8 +113,9 @@ public class LwjglDisplay extends LwjglAbstractDisplay { if (displayMode != null) Display.setDisplayMode(displayMode); - if (settings.getIcons() != null) + if (settings.getIcons() != null) { Display.setIcon(imagesToByteBuffers(settings.getIcons())); + } Display.setFullscreen(settings.isFullscreen()); Display.setVSyncEnabled(settings.isVSync()); @@ -190,10 +191,11 @@ public class LwjglDisplay extends LwjglAbstractDisplay { Display.setTitle(title); } - private ByteBuffer[] imagesToByteBuffers(BufferedImage[] images) { + private ByteBuffer[] imagesToByteBuffers(Object[] images) { ByteBuffer[] out = new ByteBuffer[images.length]; for (int i = 0; i < images.length; i++) { - out[i] = imageToByteBuffer(images[i]); + BufferedImage image = (BufferedImage) images[i]; + out[i] = imageToByteBuffer(image); } return out; }