OSDN Git Service

Throw better exception if allocation failed.
authorNathanSweet <nathan.sweet@gmail.com>
Thu, 21 Mar 2013 12:34:17 +0000 (13:34 +0100)
committerNathanSweet <nathan.sweet@gmail.com>
Thu, 21 Mar 2013 12:34:17 +0000 (13:34 +0100)
gdx/src/com/badlogic/gdx/graphics/g2d/Gdx2DPixmap.java

index cacebfc..3efad63 100644 (file)
@@ -81,9 +81,10 @@ public class Gdx2DPixmap implements Disposable {
                format = (int)nativeData[3];\r
        }\r
 \r
-       public Gdx2DPixmap (int width, int height, int format) throws IllegalArgumentException {\r
+       /** @throws GdxRuntimeException if allocation failed. */\r
+       public Gdx2DPixmap (int width, int height, int format) throws GdxRuntimeException {\r
                pixelPtr = newPixmap(nativeData, width, height, format);\r
-               if (pixelPtr == null) throw new IllegalArgumentException("couldn't load pixmap");\r
+               if (pixelPtr == null) throw new GdxRuntimeException("couldn't load pixmap");\r
 \r
                this.basePtr = nativeData[0];\r
                this.width = (int)nativeData[1];\r