Browse Source

changes in hl namings

Nicolas Cannasse 8 years ago
parent
commit
dee4eb1922
5 changed files with 16 additions and 16 deletions
  1. 9 9
      h3d/impl/GlDriver.hx
  2. 2 2
      h3d/prim/BigPrimitive.hx
  3. 3 3
      hxd/BitmapData.hx
  4. 1 1
      hxd/impl/Float32.hx
  5. 1 1
      hxd/impl/UInt16.hx

+ 9 - 9
h3d/impl/GlDriver.hx

@@ -243,7 +243,7 @@ class GlDriver extends Driver {
 		case Globals:
 			if( s.globals != null ) {
 				#if hl
-				gl.uniform4fv(s.globals, streamData(@:privateAccess (cast buf.globals.toData() : hl.types.ArrayBasic.ArrayF32).bytes, 0, s.shader.globalsSize * 16), 0, s.shader.globalsSize * 4);
+				gl.uniform4fv(s.globals, streamData(hl.Bytes.getArray(buf.globals.toData()), 0, s.shader.globalsSize * 16), 0, s.shader.globalsSize * 4);
 				#elseif hxsdl
 				gl.uniform4fv(s.globals, buf.globals.toData(), 0, s.shader.globalsSize * 4);
 				#else
@@ -254,7 +254,7 @@ class GlDriver extends Driver {
 		case Params:
 			if( s.params != null ) {
 				#if hl
-				gl.uniform4fv(s.params, streamData(@:privateAccess (cast buf.params.toData() : hl.types.ArrayBasic.ArrayF32).bytes, 0, s.shader.paramsSize * 16), 0, s.shader.paramsSize * 4);
+				gl.uniform4fv(s.params, streamData(hl.Bytes.getArray(buf.params.toData()), 0, s.shader.paramsSize * 16), 0, s.shader.paramsSize * 4);
 				#elseif hxsdl
 				gl.uniform4fv(s.params, buf.params.toData(), 0, s.shader.paramsSize * 4);
 				#else
@@ -575,7 +575,7 @@ class GlDriver extends Driver {
 	static inline var STREAM_POS = #if hl 0 #else 1 #end;
 	#if hl
 
-	var streamBytes : hl.types.Bytes;
+	var streamBytes : hl.Bytes;
 	var streamLen : Int;
 	var streamPos : Int;
 
@@ -593,7 +593,7 @@ class GlDriver extends Driver {
 		var newLen = streamLen == 0 ? 0x10000 : streamLen;
 		while( newLen < needed )
 			newLen = (newLen * 3) >> 1;
-		var newBytes = new hl.types.Bytes(newLen);
+		var newBytes = new hl.Bytes(newLen);
 		if( streamPos > 0 )
 			newBytes.blit(0, streamBytes, 0, streamPos);
 		streamLen = newLen;
@@ -643,7 +643,7 @@ class GlDriver extends Driver {
 		var stride : Int = v.stride;
 		gl.bindBuffer(GL.ARRAY_BUFFER, v.b);
 		#if hxsdl
-		var data = #if hl @:privateAccess (cast buf.getNative() : hl.types.ArrayBasic.ArrayF32).bytes #else buf.getNative() #end;
+		var data = #if hl hl.Bytes.getArray(buf.getNative()) #else buf.getNative() #end;
 		gl.bufferSubData(GL.ARRAY_BUFFER, startVertex * stride * 4, streamData(data,bufPos * 4,vertexCount * stride * 4), bufPos * 4 * STREAM_POS, vertexCount * stride * 4);
 		#else
 		var buf = new Float32Array(buf.getNative());
@@ -669,7 +669,7 @@ class GlDriver extends Driver {
 	override function uploadIndexBuffer( i : IndexBuffer, startIndice : Int, indiceCount : Int, buf : hxd.IndexBuffer, bufPos : Int ) {
 		gl.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, i);
 		#if hxsdl
-		var data = #if hl @:privateAccess (cast buf.getNative() : hl.types.ArrayBasic.ArrayUI16).bytes #else buf.getNative() #end;
+		var data = #if hl hl.Bytes.getArray(buf.getNative()) #else buf.getNative() #end;
 		gl.bufferSubData(GL.ELEMENT_ARRAY_BUFFER, startIndice * 2, streamData(data,bufPos*2,indiceCount*2), bufPos * 2 * STREAM_POS, indiceCount * 2);
 		#else
 		var buf = new Uint16Array(buf.getNative());
@@ -779,7 +779,7 @@ class GlDriver extends Driver {
 			if( mrtExt != null )
 				mrtExt.drawBuffersWEBGL([GL.COLOR_ATTACHMENT0]);
 			#elseif hlsdl
-			gl.drawBuffers(1, @:privateAccess CBUFFERS.bytes);
+			gl.drawBuffers(1, CBUFFERS);
 			#end
 		}
 	}
@@ -833,7 +833,7 @@ class GlDriver extends Driver {
 		if( mrtExt != null )
 			mrtExt.drawBuffersWEBGL([for( i in 0...textures.length ) GL.COLOR_ATTACHMENT0 + i]);
 		#elseif hlsdl
-			gl.drawBuffers(textures.length, @:privateAccess CBUFFERS.bytes);
+			gl.drawBuffers(textures.length, CBUFFERS);
 		#end
 	}
 
@@ -953,7 +953,7 @@ class GlDriver extends Driver {
 	];
 
 	#if hlsdl
-	static var CBUFFERS = (cast [for( i in 0...32 ) GL.COLOR_ATTACHMENT0 + i] : hl.types.ArrayBasic<Int>);
+	static var CBUFFERS = hl.Bytes.getArray([for( i in 0...32 ) GL.COLOR_ATTACHMENT0 + i]);
 	#end
 
 }

+ 2 - 2
h3d/prim/BigPrimitive.hx

@@ -185,8 +185,8 @@ class BigPrimitive extends Primitive {
 		var pos = bufPos;
 		var tmpBuf = tmpBuf;
 		#if hl
-		var buf = @:privateAccess (cast buf.getNative() : hl.types.ArrayBasic.ArrayF32).bytes;
-		var tmpBuf = @:privateAccess (cast tmpBuf.getNative() : hl.types.ArrayBasic.ArrayF32).bytes;
+		var buf : hl.BytesAccess<hxd.impl.Float32> = hl.Bytes.getArray(buf.getNative());
+		var tmpBuf : hl.BytesAccess<hxd.impl.Float32> = hl.Bytes.getArray(tmpBuf.getNative());
 		#end
 		for( i in 0...nvert ) {
 			var p = (i + startVert) * stride;

+ 3 - 3
hxd/BitmapData.hx

@@ -12,7 +12,7 @@ typedef BitmapInnerData =
 
 class BitmapInnerDataImpl {
 	#if hl
-	public var pixels : hl.types.BytesAccess<Int>;
+	public var pixels : hl.BytesAccess<Int>;
 	#else
 	public var pixels : haxe.ds.Vector<Int>;
 	#end
@@ -60,7 +60,7 @@ class BitmapData {
 			#else
 			data = new BitmapInnerData();
 			#if hl
-			data.pixels = new hl.types.Bytes(width * height * 4);
+			data.pixels = new hl.Bytes(width * height * 4);
 			#else
 			data.pixels = new haxe.ds.Vector(width * height);
 			#end
@@ -288,7 +288,7 @@ class BitmapData {
 		b.width = w;
 		b.height = h;
 		#if hl
-		b.pixels = new hl.types.Bytes(w * h * 4);
+		b.pixels = new hl.Bytes(w * h * 4);
 		for( dy in 0...h )
 			b.pixels.blit(dy * w, data.pixels, x + (y + dy) * width, w);
 		#else

+ 1 - 1
hxd/impl/Float32.hx

@@ -1,3 +1,3 @@
 package hxd.impl;
 
-typedef Float32 = #if cpp cpp.Float32 #elseif hl hl.types.F32 #else Float #end;
+typedef Float32 = #if cpp cpp.Float32 #elseif hl hl.F32 #else Float #end;

+ 1 - 1
hxd/impl/UInt16.hx

@@ -1,3 +1,3 @@
 package hxd.impl;
 
-typedef UInt16 = #if cpp cpp.UInt16 #elseif hl hl.types.UI16 #else Int #end;
+typedef UInt16 = #if cpp cpp.UInt16 #elseif hl hl.UI16 #else Int #end;