Browse Source

serialize resources

Simon Krajewski 11 years ago
parent
commit
43966ddc4f
2 changed files with 3 additions and 3 deletions
  1. 2 2
      genpy.ml
  2. 1 1
      tests/unit/compile-each.hxml

+ 2 - 2
genpy.ml

@@ -1716,12 +1716,12 @@ module Generator = struct
 			let first = ref true in
 			Hashtbl.iter (fun k v ->
 				let prefix = if !first then begin
-					first := true;
+					first := false;
 					"";
 				end else
 					","
 				in
-				print ctx "%s'%s':'%s'" prefix k v
+				print ctx "%s'%s':'''%s'''" prefix k (Codegen.bytes_serialize v)
 			) ctx.com.resources;
 			spr ctx "}\n"
 		end

+ 1 - 1
tests/unit/compile-each.hxml

@@ -2,5 +2,5 @@
 -debug
 -cp ..
 -resource res1.txt
-#-resource res2.bin
+-resource res2.bin
 -dce full