소스 검색

track bigtexture allocation position

bstouls 9 년 전
부모
커밋
a2cdd2ade1
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      h3d/prim/BigPrimitive.hx

+ 8 - 2
h3d/prim/BigPrimitive.hx

@@ -14,14 +14,20 @@ class BigPrimitive extends Primitive {
 	var tmpIdx : hxd.IndexBuffer;
 	var bounds : h3d.col.Bounds;
 	var startIndex : Int;
+	#if debug
+	var allocPos : h3d.impl.AllocPos;
+	#end
 
-	public function new(stride, isRaw=false) {
+	public function new(stride, isRaw=false, ?pos : h3d.impl.AllocPos ) {
 		this.isRaw = isRaw;
 		buffers = [];
 		allIndexes = [];
 		bounds = new h3d.col.Bounds();
 		this.stride = stride;
 		if( stride < 3 ) throw "Minimum stride = 3";
+		#if debug
+		allocPos = pos;
+		#end
 	}
 
 	/**
@@ -87,7 +93,7 @@ class BigPrimitive extends Primitive {
 	public function flush() {
 		if( tmpBuf != null ) {
 			if( tmpBuf.length > 0 && tmpIdx.length > 0 ) {
-				var b = h3d.Buffer.ofFloats(tmpBuf, stride);
+				var b = h3d.Buffer.ofFloats(tmpBuf, stride #if debug ,null,allocPos #end);
 				if( isRaw ) b.flags.set(RawFormat);
 				buffers.push(b);
 				allIndexes.push(h3d.Indexes.alloc(tmpIdx));