浏览代码

added new hl profile api

Nicolas Cannasse 5 年之前
父节点
当前提交
ebc56ea675
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      std/hl/Profile.hx

+ 10 - 0
std/hl/Profile.hx

@@ -218,4 +218,14 @@ class Profile {
 	public static function getFieldName(hash:Int):Bytes {
 		return null;
 	}
+	
+	@:hlNative(1.11)
+	static function sys_profile_event( code : Int, data : hl.Bytes, dataLen : Int ) : Void {}
+	public static function event( code : Int, ?data : String ) @:privateAccess {
+		sys_profile_event(code,data == null ? null : data.bytes, data == null ? 0 : (data.length<<1));
+	}
+	public static function eventBytes( code : Int, data : haxe.io.Bytes ) @:privateAccess {
+		sys_profile_event(code,data == null ? null : data, data == null ? 0 : data.length);
+	}
+	
 }