From: shadowislord Date: Mon, 25 Jul 2011 14:51:33 +0000 (+0000) Subject: * AssetPathURL now accepts non-relative asset paths X-Git-Tag: v0.8.0~673 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a083f0230d3d23b5cb754e3948dbb010340cfb3a;p=mikumikustudio%2FMikuMikuStudio.git * AssetPathURL now accepts non-relative asset paths * ZipLocator will now crash if the specified zip file does not exist * Fixed crash when restarting context with pixel format changes git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@7914 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- diff --git a/engine/src/core/com/jme3/app/Application.java b/engine/src/core/com/jme3/app/Application.java index 99c934b91..84a7bf23d 100644 --- a/engine/src/core/com/jme3/app/Application.java +++ b/engine/src/core/com/jme3/app/Application.java @@ -158,7 +158,7 @@ public class Application implements SystemListener { } catch (MalformedURLException ex) { } if (url == null) { - url = Application.class.getResource(assetCfg); + url = Application.class.getClassLoader().getResource(assetCfg); if (url == null) { logger.log(Level.SEVERE, "Unable to access AssetConfigURL in asset config:{0}", assetCfg); return; diff --git a/engine/src/desktop/com/jme3/asset/plugins/ZipLocator.java b/engine/src/desktop/com/jme3/asset/plugins/ZipLocator.java index 4638dd41c..499ca9371 100644 --- a/engine/src/desktop/com/jme3/asset/plugins/ZipLocator.java +++ b/engine/src/desktop/com/jme3/asset/plugins/ZipLocator.java @@ -34,12 +34,12 @@ package com.jme3.asset.plugins; import com.jme3.asset.AssetInfo; import com.jme3.asset.AssetKey; +import com.jme3.asset.AssetLoadException; import com.jme3.asset.AssetLocator; import com.jme3.asset.AssetManager; import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.util.logging.Level; import java.util.logging.Logger; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -66,9 +66,8 @@ public class ZipLocator implements AssetLocator { try{ return zipfile.getInputStream(entry); }catch (IOException ex){ - logger.log(Level.WARNING, "Failed to load zip entry: "+entry, ex); + throw new AssetLoadException("Failed to load zip entry: "+entry, ex); } - return null; } } @@ -76,7 +75,7 @@ public class ZipLocator implements AssetLocator { try{ zipfile = new ZipFile(new File(rootPath), ZipFile.OPEN_READ); }catch (IOException ex){ - logger.log(Level.WARNING, "Failed to open zip file: "+rootPath, ex); + throw new AssetLoadException("Failed to open zip file: " + rootPath, ex); } } 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 31bd7b39b..681ba7cde 100644 --- a/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglDisplay.java +++ b/engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglDisplay.java @@ -126,7 +126,7 @@ public class LwjglDisplay extends LwjglAbstractDisplay { Display.setVSyncEnabled(settings.isVSync()); - if (created.get()){ + if (created.get() && !pixelFormatChanged){ Display.releaseContext(); Display.makeCurrent(); Display.update();