OSDN Git Service

throwing GdxRuntimeException now in case a classpath FileHAndandle is created
authorMario Zechner <contact@badlogicgames.com>
Mon, 21 Jan 2013 22:26:03 +0000 (23:26 +0100)
committerMario Zechner <contact@badlogicgames.com>
Mon, 21 Jan 2013 22:26:03 +0000 (23:26 +0100)
backends/gdx-backend-iosmonotouch/src/com/badlogic/gdx/backends/ios/IOSFileHandle.java
backends/gdx-backend-iosmonotouch/src/com/badlogic/gdx/backends/ios/IOSFiles.java

index 86adf08..a56fccd 100644 (file)
@@ -19,15 +19,22 @@ import java.io.File;
 \r
 import com.badlogic.gdx.Files.FileType;\r
 import com.badlogic.gdx.files.FileHandle;\r
+import com.badlogic.gdx.utils.GdxRuntimeException;\r
 \r
 // FIXME see if we can get classpath files to work\r
 public class IOSFileHandle extends FileHandle {\r
        public IOSFileHandle (String fileName, FileType type) {\r
                super(fileName, type);\r
+               if(type == FileType.Classpath) {\r
+                       throw new GdxRuntimeException("Classpath files are not supported on iOS, this likely happened because you used the default constructor of BitmapFont.");\r
+               }\r
        }\r
 \r
        public IOSFileHandle (File file, FileType type) {\r
                super(file, type);\r
+               if(type == FileType.Classpath) {\r
+                       throw new GdxRuntimeException("Classpath files are not supported on iOS, this likely happened because you used the default constructor of BitmapFont.");\r
+               }\r
        }\r
 \r
        public FileHandle child (String name) {\r
index 6927760..a58b8dc 100644 (file)
@@ -20,6 +20,7 @@ import cli.System.IO.Directory;
 
 import com.badlogic.gdx.Files;
 import com.badlogic.gdx.files.FileHandle;
+import com.badlogic.gdx.utils.GdxRuntimeException;\r
 
 public class IOSFiles implements Files {
        static final String externalPath = Environment.GetFolderPath(Environment.SpecialFolder.wrap(Environment.SpecialFolder.MyDocuments));
@@ -36,8 +37,8 @@ public class IOSFiles implements Files {
        }
 
        @Override
-       public FileHandle classpath (String path) {
-               return new IOSFileHandle(path, FileType.Classpath);
+       public FileHandle classpath (String path) {\r
+               throw new GdxRuntimeException("Classpath files are not supported on iOS, this likely happened because you used the default constructor of BitmapFont.");
        }
 
        @Override