Browse Source

temp revert for preview4 support

ncannasse 7 years ago
parent
commit
dbca873de7
4 changed files with 11 additions and 32 deletions
  1. 2 8
      hxd/fmt/fbx/BaseLibrary.hx
  2. 2 7
      hxd/res/BitmapFont.hx
  3. 6 11
      hxd/res/DynamicText.hx
  4. 1 6
      hxd/res/TiledMap.hx

+ 2 - 8
hxd/fmt/fbx/BaseLibrary.hx

@@ -3,12 +3,6 @@ import haxe.io.Bytes;
 using hxd.fmt.fbx.Data;
 import h3d.col.Point;
 
-#if (haxe_ver < 4)
-import haxe.xml.Fast in Access;
-#else
-import haxe.xml.Access;
-#end
-
 class TmpObject {
 	public var index : Int;
 	public var model : FbxNode;
@@ -186,12 +180,12 @@ class BaseLibrary {
 						switch( pname ) {
 						case "UV" if( pval != "" ):
 							var xml = try Xml.parse(pval) catch( e : Dynamic ) throw "Invalid UV data in " + m.getName();
-							var frames = [for( f in new Access(xml.firstElement()).elements ) { var f = f.innerData.split(" ");  { t : Std.parseFloat(f[0]) * 9622116.25, u : Std.parseFloat(f[1]), v : Std.parseFloat(f[2]) }} ];
+							var frames = [for( f in new haxe.xml.Fast(xml.firstElement()).elements ) { var f = f.innerData.split(" ");  { t : Std.parseFloat(f[0]) * 9622116.25, u : Std.parseFloat(f[1]), v : Std.parseFloat(f[2]) }} ];
 							if( uvAnims == null ) uvAnims = new Map();
 							uvAnims.set(m.getName(), frames);
 						case "Events":
 							var xml = try Xml.parse(pval) catch( e : Dynamic ) throw "Invalid Events data in " + m.getName();
-							animationEvents = [for( f in new Access(xml.firstElement()).elements ) { var f = f.innerData.split(" ");  { frame : Std.parseInt(f.shift()), data : StringTools.trim(f.join(" ")) }} ];
+							animationEvents = [for( f in new haxe.xml.Fast(xml.firstElement()).elements ) { var f = f.innerData.split(" ");  { frame : Std.parseInt(f.shift()), data : StringTools.trim(f.join(" ")) }} ];
 						default:
 						}
 					}

+ 2 - 7
hxd/res/BitmapFont.hx

@@ -1,9 +1,4 @@
 package hxd.res;
-#if (haxe_ver < 4)
-import haxe.xml.Fast in Access;
-#else
-import haxe.xml.Access;
-#end
 
 class BitmapFont extends Resource {
 
@@ -27,7 +22,7 @@ class BitmapFont extends Resource {
 			var xml = Xml.parse(entry.getBytes().toString());
 			// support only the FontBuilder/Divo format
 			// export with FontBuilder https://github.com/andryblack/fontbuilder/downloads
-			var xml = new Access(xml.firstElement());
+			var xml = new haxe.xml.Fast(xml.firstElement());
 			size = Std.parseInt(xml.att.size);
 			lineHeight = Std.parseInt(xml.att.height);
 			name = xml.att.family;
@@ -49,7 +44,7 @@ class BitmapFont extends Resource {
 			// support for Littera XML format (starts with <font>)
 			// http://kvazars.com/littera/
 			var xml = Xml.parse(entry.getBytes().toString());
-			var xml = new Access(xml.firstElement());
+			var xml = new haxe.xml.Fast(xml.firstElement());
 			size = Std.parseInt(xml.node.info.att.size);
 			lineHeight = Std.parseInt(xml.node.common.att.lineHeight);
 			name = xml.node.info.att.face;

+ 6 - 11
hxd/res/DynamicText.hx

@@ -3,11 +3,6 @@ package hxd.res;
 import haxe.macro.Context;
 import haxe.macro.Expr;
 #end
-#if (haxe_ver < 4)
-import haxe.xml.Fast in Access;
-#else
-import haxe.xml.Access;
-#end
 
 abstract NoArg({}) {
 }
@@ -24,7 +19,7 @@ abstract Key<T>(String) {
 class DynamicText {
 
 	public static function parse( data : String ) : Dynamic {
-		var x = new Access(Xml.parse(data).firstElement());
+		var x = new haxe.xml.Fast(Xml.parse(data).firstElement());
 		var obj = {};
 		for( e in x.elements )
 			Reflect.setField(obj, e.att.id, parseXmlData(e));
@@ -32,7 +27,7 @@ class DynamicText {
 	}
 
 	public static function apply( obj : Dynamic, data : String, ?onMissing ) {
-		var x = new Access(Xml.parse(data).firstElement());
+		var x = new haxe.xml.Fast(Xml.parse(data).firstElement());
 		applyRec([], obj, x, onMissing);
 	}
 
@@ -70,7 +65,7 @@ class DynamicText {
 		return parseText(str);
 	}
 
-	public static function applyRec( path : Array<String>, obj : Dynamic, data : Access, onMissing ) {
+	public static function applyRec( path : Array<String>, obj : Dynamic, data : haxe.xml.Fast, onMissing ) {
 		var fields = new Map();
 		for( f in Reflect.fields(obj) ) fields.set(f, true);
 		if( data != null )
@@ -123,7 +118,7 @@ class DynamicText {
 		}
 	}
 
-	static function parseXmlData( x : Access ) : Dynamic {
+	static function parseXmlData( x : haxe.xml.Fast ) : Dynamic {
 		switch( x.name ) {
 		case "g":
 			var first = x.elements.hasNext() ? x.elements.next() : null;
@@ -183,7 +178,7 @@ class DynamicText {
 		return Context.makePosition({ min : index, max : index + str.length, file : pos.file });
 	}
 
-	static function typeFromXml( x : Access, pos : { file : String, content : String, pos : Position } ) {
+	static function typeFromXml( x : haxe.xml.Fast, pos : { file : String, content : String, pos : Position } ) {
 		switch( x.name ) {
 		case "g":
 			var first = x.elements.next();
@@ -262,7 +257,7 @@ class DynamicText {
 		var fields = Context.getBuildFields();
 		var pos = Context.currentPos();
 		var fpos = { file : fullPath, content : content.toLowerCase(), pos : pos };
-		for( x in new Access(x.firstElement()).elements ) {
+		for( x in new haxe.xml.Fast(x.firstElement()).elements ) {
 			var id = x.att.id;
 			var t = typeFromXml(x, fpos);
 			fields.push( {

+ 1 - 6
hxd/res/TiledMap.hx

@@ -1,9 +1,4 @@
 package hxd.res;
-#if (haxe_ver < 4)
-import haxe.xml.Fast in Access;
-#else
-import haxe.xml.Access;
-#end
 
 typedef TiledMapLayer = {
 	var data : Array<Int>;
@@ -23,7 +18,7 @@ class TiledMap extends Resource {
 	public function toMap() : TiledMapData {
 		var data = entry.getBytes().toString();
 		var base = new haxe.crypto.BaseCode(haxe.io.Bytes.ofString("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"));
-		var x = new Access(Xml.parse(data).firstElement());
+		var x = new haxe.xml.Fast(Xml.parse(data).firstElement());
 		var layers = [];
 		for( l in x.nodes.layer ) {
 			var data = StringTools.trim(l.node.data.innerData);