OSDN Git Service

* AssetPathURL now accepts non-relative asset paths
authorshadowislord <shadowislord@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Mon, 25 Jul 2011 14:51:33 +0000 (14:51 +0000)
committershadowislord <shadowislord@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Mon, 25 Jul 2011 14:51:33 +0000 (14:51 +0000)
 * 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

engine/src/core/com/jme3/app/Application.java
engine/src/desktop/com/jme3/asset/plugins/ZipLocator.java
engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglDisplay.java

index 99c934b..84a7bf2 100644 (file)
@@ -158,7 +158,7 @@ public class Application implements SystemListener {
                 } catch (MalformedURLException ex) {\r
                 }\r
                 if (url == null) {\r
-                    url = Application.class.getResource(assetCfg);\r
+                    url = Application.class.getClassLoader().getResource(assetCfg);\r
                     if (url == null) {\r
                         logger.log(Level.SEVERE, "Unable to access AssetConfigURL in asset config:{0}", assetCfg);\r
                         return;\r
index 4638dd4..499ca93 100644 (file)
@@ -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);
         }
     }
 
index 31bd7b3..681ba7c 100644 (file)
@@ -126,7 +126,7 @@ public class LwjglDisplay extends LwjglAbstractDisplay {
         \r
         Display.setVSyncEnabled(settings.isVSync());\r
         \r
-        if (created.get()){\r
+        if (created.get() && !pixelFormatChanged){\r
             Display.releaseContext();\r
             Display.makeCurrent();\r
             Display.update();\r