Procházet zdrojové kódy

use streamed zip I/O for big swfs

Nicolas Cannasse před 15 roky
rodič
revize
2830ba2e81
4 změnil soubory, kde provedl 11 přidání a 12 odebrání
  1. 4 6
      Makefile.win
  2. 1 0
      doc/CHANGES.txt
  3. 2 2
      doc/install.ml
  4. 4 4
      genswf.ml

+ 4 - 6
Makefile.win

@@ -24,23 +24,21 @@ genneko.cmx: type.cmx codegen.cmx ../neko/libs/include/ocaml/nxml.cmx ../neko/li
 
 ../neko/libs/include/ocaml/nxml.cmx: ../neko/libs/include/ocaml/nast.cmx
 
-../../mtcvs/swflib/as3hl.cmi: ../../mtcvs/swflib/as3.cmi
-
 codegen.cmx: typeload.cmx typecore.cmx type.cmx genxml.cmx common.cmx ast.cmx
 
 common.cmx: type.cmx ast.cmx
 
-genas3.cmx: type.cmx codegen.cmx ../../mtcvs/swflib/swfParser.cmx ../../mtcvs/swflib/swf.cmx common.cmx ast.cmx ../../mtcvs/swflib/as3parse.cmx ../../mtcvs/swflib/as3code.cmx ../../mtcvs/swflib/as3.cmi
+genas3.cmx: type.cmx codegen.cmx common.cmx ast.cmx
 
 genjs.cmx: type.cmx codegen.cmx lexer.cmx common.cmx ast.cmx
 
 genphp.cmx: type.cmx codegen.cmx lexer.cmx common.cmx ast.cmx
 
-genswf.cmx: type.cmx codegen.cmx ../../mtcvs/swflib/swfZip.cmx ../../mtcvs/swflib/swfParser.cmx ../../mtcvs/swflib/swf.cmx genswf9.cmx genswf8.cmx common.cmx ast.cmx ../../mtcvs/swflib/as3hlparse.cmx ../../mtcvs/swflib/as3hl.cmi ../../mtcvs/swflib/as3.cmi
+genswf.cmx: type.cmx codegen.cmx genswf9.cmx genswf8.cmx common.cmx ast.cmx
 
-genswf8.cmx: type.cmx codegen.cmx ../../mtcvs/swflib/swf.cmx lexer.cmx common.cmx ast.cmx ../../mtcvs/swflib/actionScript.cmx
+genswf8.cmx: type.cmx codegen.cmx lexer.cmx common.cmx ast.cmx
 
-genswf9.cmx: type.cmx codegen.cmx lexer.cmx common.cmx ast.cmx ../../mtcvs/swflib/as3hlparse.cmx ../../mtcvs/swflib/as3hl.cmi ../../mtcvs/swflib/as3.cmi
+genswf9.cmx: type.cmx codegen.cmx lexer.cmx common.cmx ast.cmx
 
 genxml.cmx: type.cmx lexer.cmx common.cmx ast.cmx
 

+ 1 - 0
doc/CHANGES.txt

@@ -10,6 +10,7 @@
 	all : make haxe.rtti.Generic typing lazy (fix for self-recursion)
 	all : allow haxe.rtti.Generic + inheritance
 	all : added resource size limit to 12MB (ocaml max_string_size is 16MB + b64)
+	flash : changes in swf handling to work with >16MB swfs
 
 2010-01-09: 2.05
 	js : added js.Scroll

+ 2 - 2
doc/install.ml

@@ -95,14 +95,14 @@ let compile_libs() =
 	let c_opts = (if Sys.ocaml_version < "3.08" then " -ccopt -Dcaml_copy_string=copy_string " else " ") in
 	command ("ocamlc" ^ c_opts ^ " -I ../" ^ zlib_path ^ " extc_stubs.c");
 
-	let options = "-cclib ../ocaml/extc/extc_stubs" ^ obj_ext ^ " -cclib " ^ zlib ^ " extc.mli extc.ml" in
+	let options = "-cclib ../ocaml/extc/extc_stubs" ^ obj_ext ^ " -cclib " ^ zlib ^ " extc.ml" in
 	if bytecode then command ("ocamlc -a -o extc.cma " ^ options);
 	if native then command ("ocamlopt -a -o extc.cmxa " ^ options);
 	Sys.chdir "../..";
 
 	(* SWFLIB *)
 	Sys.chdir "ocaml/swflib";
-	let files = "-I .. -I ../extc as3.mli as3hl.mli as3code.ml as3parse.ml as3hlparse.ml swf.ml swfZip.ml actionScript.ml swfParser.ml" in
+	let files = "-I .. -I ../extc as3.mli as3hl.mli as3code.ml as3parse.ml as3hlparse.ml swf.ml actionScript.ml swfParser.ml" in
 	if bytecode then command ("ocamlc -a -o swflib.cma " ^ files);
 	if native then command ("ocamlopt -a -o swflib.cmxa " ^ files);
 	Sys.chdir "../..";

+ 4 - 4
genswf.ml

@@ -586,13 +586,13 @@ let generate com swf_header swf_lib =
 	t();
 	let t = Common.timer "write swf" in
 	if Common.defined com "swc" then begin
-		let ch = IO.output_string() in
+		let ch = IO.output_strings() in
 		Swf.write ch swf;
 		let swf = IO.close_out ch in
 		let ch = IO.output_channel (open_out_bin file) in
 		let z = zip_create ch in
 		zip_write_file z "catalog.xml" ctx.swc_catalog (Unix.time()) true;
-		zip_write_file z "library.swf" swf (Unix.time()) false;
+		zip_write_file z "library.swf" (match swf with [s] -> s | _ -> failwith "SWF too big for SWC") (Unix.time()) false;
 		zip_write_cdr z;
 		IO.close_out ch;
 	end else begin
@@ -600,10 +600,10 @@ let generate com swf_header swf_lib =
 		Swf.write ch swf;
 		IO.close_out ch;
 	end;
-	t();
+	t()
 
 ;;
-SwfParser.init SwfZip.inflate SwfZip.deflate;
+SwfParser.init Extc.input_zip Extc.output_zip;
 SwfParser.full_parsing := false;
 SwfParser.force_as3_parsing := true;
 Swf.warnings := false;