Ver código fonte

added flash 11.5 / swf version 18 future support

Nicolas Cannasse 13 anos atrás
pai
commit
7c6e8cec8a
2 arquivos alterados com 11 adições e 10 exclusões
  1. 7 7
      common.ml
  2. 4 3
      genswf.ml

+ 7 - 7
common.ml

@@ -61,7 +61,7 @@ type stats = {
 *)
 type capture_policy =
 	(** do nothing, let the platform handle it *)
-	| CPNone 
+	| CPNone
 	(** wrap all captured variables into a single-element array to allow modifications *)
 	| CPWrapRef
 	(** similar to wrap ref, but will only apply to the locals that are declared in loops *)
@@ -240,7 +240,7 @@ let stats =
 		s_macros_called = ref 0;
 	}
 
-let default_config = 
+let default_config =
 	{
 		pf_static = true;
 		pf_sys = true;
@@ -274,7 +274,7 @@ let get_config com =
 		{
 			pf_static = false;
 			pf_sys = false;
-			pf_locals_scope = false;		
+			pf_locals_scope = false;
 			pf_captured_scope = false;
 			pf_unique_locals = false;
 			pf_can_init_member = (fun _ -> false);
@@ -329,7 +329,7 @@ let get_config com =
 				match cf.cf_kind, cf.cf_expr with
 				| Var { v_write = AccCall _ },  _ -> false
 				| _, Some { eexpr = TTypeExpr _ } -> false
-				| _ -> true 
+				| _ -> true
 			);
 			pf_capture_policy = CPNone;
 			pf_pad_nulls = true;
@@ -475,12 +475,12 @@ let flash_versions = List.map (fun v ->
 	let maj = int_of_float v in
 	let min = int_of_float (mod_float (v *. 10.) 10.) in
 	v, string_of_int maj ^ (if min = 0 then "" else "_" ^ string_of_int min)
-) [9.;10.;10.1;10.2;10.3;11.;11.1;11.2;11.3;11.4]
+) [9.;10.;10.1;10.2;10.3;11.;11.1;11.2;11.3;11.4;11.5]
 
 let raw_defined ctx v =
 	PMap.mem v ctx.defines
 
-let defined ctx v = 
+let defined ctx v =
 	raw_defined ctx (fst (Define.infos v))
 
 let raw_define ctx v =
@@ -512,7 +512,7 @@ let rec has_feature com f =
 		if com.types = [] then defined com Define.AllFeatures else
 		match List.rev (ExtString.String.nsplit f ".") with
 		| [] -> assert false
-		| [cl] -> has_feature com (cl ^ ".*") 
+		| [cl] -> has_feature com (cl ^ ".*")
 		| meth :: cl :: pack ->
 			let r = (try
 				let path = List.rev pack, cl in

+ 4 - 3
genswf.ml

@@ -436,7 +436,7 @@ let parse_swf com file =
 		with _ ->
 			Zip.close_in zip;
 			failwith ("The input swc " ^ file ^ " is corrupted")
-	end else 
+	end else
 		IO.input_channel (open_in_bin file)
 	in
 	let h, tags = (try Swf.parse ch with _ -> failwith ("The input swf " ^ file ^ " is corrupted")) in
@@ -498,11 +498,12 @@ let swf_ver = function
 	| 11.2 -> 15
 	| 11.3 -> 16
 	| 11.4 -> 17
+	| 11.5 -> 18
 	| _ -> assert false
 
 let convert_header com (w,h,fps,bg) =
 	let high = (max w h) * 20 in
-	let rec loop b =		
+	let rec loop b =
 		if 1 lsl b > high then b else loop (b + 1)
 	in
 	let bits = loop 0 in
@@ -743,7 +744,7 @@ let detect_format file p =
 	let fmt = (match (try let a = input_byte ch in a, input_byte ch with _ -> 0,0) with
 		| 0xFF, 0xD8 -> BJPG
 		| 0x89, 0x50 -> BPNG
-		| x,y -> 
+		| x,y ->
 			close_in ch;
 			error "Unknown image file format" p
 	) in