فهرست منبع

added hl.types.BytesAccess.blit, minor hl Vector fix

Nicolas Cannasse 9 سال پیش
والد
کامیت
e593459b89
3فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 0 3
      std/haxe/ds/Vector.hx
  2. 1 0
      std/hl/_std/haxe/ds/Vector.hx
  3. 4 0
      std/hl/types/BytesAccess.hx

+ 0 - 3
std/haxe/ds/Vector.hx

@@ -71,9 +71,6 @@ abstract Vector<T>(VectorData<T>) {
 			this.setSize(length);
 		#elseif python
 			this = python.Syntax.pythonCode("[{0}]*{1}", null, length);
-		#elseif hl
-			this = [];
-			if( length > 0 ) this[length - 1] = cast null;
 		#else
 			this = [];
 			untyped this.length = length;

+ 1 - 0
std/hl/_std/haxe/ds/Vector.hx

@@ -23,6 +23,7 @@ package haxe.ds;
 
 private typedef VectorData<T> = Array<T>
 
+@:coreApi
 abstract Vector<T>(VectorData<T>) {
 
 	public inline function new(length:Int) {

+ 4 - 0
std/hl/types/BytesAccess.hx

@@ -35,6 +35,10 @@ package hl.types;
 		return untyped $bytes_nullvalue(this);
 	}
 
+	@:extern public inline function blit( pos : Int, src : BytesAccess<T>, srcPos : Int, len : Int ) : Void {
+		(this:Bytes).blit(pos << sizeBits, src, srcPos << sizeBits, len << sizeBits);
+	}
+
 	@:extern @:arrayAccess public inline function get( pos : Int ) : T {
 		return untyped $bget(this,pos);
 	}