diff --git a/pom.xml b/pom.xml index 635db96..5be248a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 org.atriasoft @@ -5,12 +6,12 @@ 0.1.0 3.13.0 - 21 - 21 + 24 + 24 3.1.1 3.3.3 0.1.8 - natives-linux + natives-linux @@ -251,7 +252,7 @@ org.junit.jupiter junit-jupiter-api - 5.11.0-M2 + 5.11.0 test @@ -263,13 +264,13 @@ - src + src/main ${basedir}/src/resources - test/src + src/test org.apache.maven.plugins @@ -285,7 +286,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.1 + 4.0.0-beta-1 attach-sources @@ -299,7 +300,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M5 + 3.2.5 maven-assembly-plugin @@ -318,7 +319,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.3.0 private true @@ -332,7 +333,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.3.0 public diff --git a/src/org/atriasoft/gale/resource/ResourceTexture.java b/src/org/atriasoft/gale/resource/ResourceTexture.java index 135e8b3..7b67bc4 100644 --- a/src/org/atriasoft/gale/resource/ResourceTexture.java +++ b/src/org/atriasoft/gale/resource/ResourceTexture.java @@ -55,7 +55,14 @@ public class ResourceTexture extends Resource { return null; } resource = new ResourceTexture(uriTexture, textureUnit); - final ImageRawData decodedData = ImageLoader.decodePngFile(uriTexture); + ImageRawData decodedData; + try { + decodedData = ImageLoader.decodePngFile(uriTexture); + } catch (final Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return null; + } final ImageByteRGBA img = new ImageByteRGBA(decodedData.getWidth(), decodedData.getHeight()); final ByteBuffer mlklmklm = decodedData.getBuffer(); final byte[] elemData = new byte[mlklmklm.remaining()]; diff --git a/src/org/atriasoft/gale/test/sample1/Log.java b/src/org/atriasoft/gale/test/sample1/Log.java deleted file mode 100644 index 2b25c42..0000000 --- a/src/org/atriasoft/gale/test/sample1/Log.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.atriasoft.gale.test.sample1; - -public class Log { - private Log() {} - private static final String LIBNAME = "Sample1"; - public static void print(String data) { - System.out.println(data); - } - public static void critical(String data) { - System.out.println("[C] " + LIBNAME + " | " + data); - } - public static void error(String data) { - System.out.println("[E] " + LIBNAME + " | " + data); - } - public static void warning(String data) { - System.out.println("[W] " + LIBNAME + " | " + data); - } - public static void info(String data) { - System.out.println("[I] " + LIBNAME + " | " + data); - } - public static void debug(String data) { - System.out.println("[D] " + LIBNAME + " | " + data); - } - public static void verbose(String data) { - System.out.println("[V] " + LIBNAME + " | " + data); - } - public static void todo(String data) { - System.out.println("[TODO] " + LIBNAME + " | " + data); - } -} diff --git a/src/org/atriasoft/gale/tools/ImageLoader.java b/src/org/atriasoft/gale/tools/ImageLoader.java index 4bba13a..96615d0 100644 --- a/src/org/atriasoft/gale/tools/ImageLoader.java +++ b/src/org/atriasoft/gale/tools/ImageLoader.java @@ -5,12 +5,11 @@ import java.io.InputStream; import java.nio.ByteBuffer; import org.atriasoft.etk.Uri; - import org.atriasoft.pngdecoder.PNGDecoder; import org.atriasoft.pngdecoder.PNGDecoder.Format; public class ImageLoader { - public static ImageRawData decodePngFile(final Uri filename) { + public static ImageRawData decodePngFile(final Uri filename) throws Exception { ByteBuffer buf = null; int tWidth = 0; int tHeight = 0; @@ -18,6 +17,9 @@ public class ImageLoader { try { // Open the PNG file as an InputStream final InputStream in = Uri.getStream(filename); + if (in == null) { + throw new Exception("fail to get th estream ..."); + } // Link the PNG decoder to this stream final PNGDecoder decoder = new PNGDecoder(in); // Get the width and height of the texture