Selaa lähdekoodia

added -D swf-compress-level (allows faster SWF compression for large SWFs)

Nicolas Cannasse 12 vuotta sitten
vanhempi
commit
2193bebde9
2 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. 2 0
      common.ml
  2. 2 0
      genswf.ml

+ 2 - 0
common.ml

@@ -178,6 +178,7 @@ module Define = struct
 		| ReplaceFiles
 		| Scriptable
 		| Swc
+		| SwfCompressLevel
 		| SwfDebugPassword
 		| SwfDirectBlit
 		| SwfGpu
@@ -234,6 +235,7 @@ module Define = struct
 		| ReplaceFiles -> ("replace_files","GenCommon internal")
 		| Scriptable -> ("scriptable","GenCPP internal")
 		| Swc -> ("swc","Output a SWC instead of a SWF")
+		| SwfCompressLevel -> ("swf_compress_level","<level:1-9> Set the amount of compression for the SWF output")
 		| SwfDebugPassword -> ("swf_debug_password", "Set a password for debugging.")
 		| SwfDirectBlit -> ("swf_direct_blit", "Use hardware acceleration to blit graphics")
 		| SwfGpu -> ("swf_gpu", "Use GPU compositing features when drawing graphics")

+ 2 - 0
genswf.ml

@@ -1158,6 +1158,8 @@ let generate com swf_header =
 	t();
   (* write swf/swc *)
 	let t = Common.timer "write swf" in
+	let level = (try int_of_string (Common.defined_value com Define.SwfCompressLevel) with Not_found -> 9) in
+	SwfParser.init Extc.input_zip (Extc.output_zip ~level);
 	(match swc with
 	| Some cat ->
 		let ch = IO.output_strings() in