浏览代码

fixes for directories

ncannasse 12 年之前
父节点
当前提交
9f3d0d1665
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      hxd/res/EmbedFileSystem.hx

+ 2 - 1
hxd/res/EmbedFileSystem.hx

@@ -16,6 +16,7 @@ private class EmbedEntry extends FileEntry {
 	#end
 
 	function new(fs, name, relPath, data) {
+		this.fs = fs;
 		this.name = name;
 		this.relPath = relPath;
 		this.data = data;
@@ -203,7 +204,7 @@ class EmbedFileSystem #if !macro implements FileSystem #end {
 	public function get( path : String ) {
 		#if flash
 		var f = open(path);
-		if( f == null )
+		if( f == null && !isDirectory(path) )
 			throw "File not found " + path;
 		return new EmbedEntry(this, path.split("/").pop(), path, f);
 		#else