Skip to content

Commit

Permalink
Replace hxJson2 with the new built-in parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
aduros committed Mar 12, 2012
1 parent 7f6ca53 commit a1d630b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
1 change: 0 additions & 1 deletion etc/haxelib.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
</description>

<depends name="format"/>
<depends name="hxJson2"/> <!-- TODO(bruno): Remove this dependency after next haXe release -->

<version name="{{VERSION}}">See https://github.com/aduros/flambe/wiki/changelog</version>

Expand Down
4 changes: 2 additions & 2 deletions src/flambe/display/SpriteSheet.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package flambe.display;

import hxjson2.JSONDecoder;
import haxe.Json;

import flambe.asset.AssetPack;
import flambe.display.Texture;
Expand All @@ -27,7 +27,7 @@ class SpriteSheet

_animations = new Hash();

var json = new JSONDecoder(pack.loadFile(name + ".json"), true).getValue();
var json = Json.parse(pack.loadFile(name + ".json"));
var animations :Array<Dynamic> = json.animations;
for (animData in animations) {
var anim = new Animation();
Expand Down
12 changes: 2 additions & 10 deletions src/flambe/swf/Library.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package flambe.swf;

import haxe.Json;

import flambe.asset.AssetPack;
import flambe.display.Sprite;
import flambe.swf.Format;
Expand Down Expand Up @@ -75,13 +77,3 @@ class Library

private var _symbols :Hash<Symbol>;
}

// TODO(bruno): Temporary hack for native JSON parsing until it becomes available in the next
// version of haxe
#if (flash_10_3 || js)
@:native("JSON") extern private class Json {
public static function parse (text :String) :Dynamic;
}
#else
typedef Json = hxjson2.JSON;
#end
2 changes: 1 addition & 1 deletion tools/flambe.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def apply_flambe(ctx):
classpath = [ ctx.path.find_dir("src"), ctx.bld.root.find_dir(FLAMBE_ROOT+"/src") ] + \
Utils.to_list(ctx.classpath) # The classpath option should be a list of nodes
flags = ["-main", ctx.main, "--dead-code-elimination"] + Utils.to_list(ctx.flags)
libs = ["hxJson2", "format"] + Utils.to_list(ctx.libs)
libs = ["format"] + Utils.to_list(ctx.libs)
platforms = Utils.to_list(ctx.platforms)
debug = ctx.env.debug

Expand Down

0 comments on commit a1d630b

Please sign in to comment.