Browse Source

no warning for unknown extensions (allow loading its data)

ncannasse 12 years ago
parent
commit
e87550f0a3
2 changed files with 6 additions and 2 deletions
  1. 1 1
      hxd/res/FileTree.hx
  2. 5 1
      hxd/res/Loader.hx

+ 1 - 1
hxd/res/FileTree.hx

@@ -266,7 +266,7 @@ class FileTree {
 		case "wav", "mp3":
 			return { e : macro loader.loadSound($epath), t : macro : hxd.res.Sound };
 		default:
-			Context.warning("File extension not supported '." + ext + "'", Context.makePosition( { min : 0, max : 0, file : fullPath } ));
+			return { e : macro loader.loadData($epath), t : macro : hxd.res.Resource };
 		}
 		return null;
 	}

+ 5 - 1
hxd/res/Loader.hx

@@ -2,7 +2,7 @@ package hxd.res;
 
 class Loader {
 	
-	var fs : FileSystem;
+	public var fs(default,null) : FileSystem;
 	var modelCache : Map<String,Model>;
 	var textureCache : Map<String,Texture>;
 	var soundCache : Map<String,Sound>;
@@ -53,4 +53,8 @@ class Loader {
 		return new Font(fs.get(path));
 	}
 	
+	function loadData( path : String ) {
+		return new Resource(fs.get(path));
+	}
+	
 }