소스 검색

added excludedExt

ncannasse 9 년 전
부모
커밋
a3173d4aed
1개의 변경된 파일10개의 추가작업 그리고 4개의 파일을 삭제
  1. 10 4
      hxd/fmt/pak/Build.hx

+ 10 - 4
hxd/fmt/pak/Build.hx

@@ -3,6 +3,8 @@ import hxd.fmt.pak.Data;
 
 class Build {
 
+	public static var excludedExt : Array<String> = [];
+
 	static function buildRec( dir : String, path : String, out : { bytes : Array<haxe.io.Bytes>, size : Int } ) {
 		var f = new File();
 		f.name = path.split("/").pop();
@@ -22,8 +24,10 @@ class Build {
 			case "fbx":
 				dir = getTemp(dir,path,"hmd");
 			case "wav":
-				dir = getTemp(dir,path,#if stb_ogg_sound "ogg" #else "mp3" #end);
-			default:
+				dir = getTemp(dir, path, #if stb_ogg_sound "ogg" #else "mp3" #end);
+			case ext:
+				if( excludedExt.indexOf(ext) >= 0 )
+					return null;
 			}
 			var data = sys.io.File.getBytes(dir);
 			f.dataPosition = #if pakDiff out.bytes.length #else out.size #end;
@@ -131,8 +135,10 @@ class Build {
 	}
 
 	static function main() {
-		try sys.FileSystem.deleteFile("hxd.fmt.pak.Build.n") catch( e : Dynamic ) {};
-		make(haxe.macro.Compiler.getDefine("resourcesPath"),null #if pakDiff, true #end);
+		try sys.FileSystem.deleteFile("hxd.fmt.pak.Build.n") catch( e : Dynamic ) {};		
+		var ext = haxe.macro.Compiler.getDefine("excludeExt");
+		excludedExt = ext == null ? [] : ext.split(",");
+		make(haxe.macro.Compiler.getDefine("resourcesPath"), null #if pakDiff, true #end);
 	}
 
 }