Skip to content

Commit f3940e7

Browse files
committed
Added start vertice to Buffer uploadBytes.
1 parent f7fabcf commit f3940e7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

h3d/Buffer.hx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,21 @@ class Buffer {
111111
if ( bytesPos & 3 != 0 ) bytesPos += ( 4 - (bytesPos & 3) );
112112
}
113113
}
114-
uploadBytes(bytes, 0, vertices);
114+
uploadBytes(bytes, 0, vertices, startVertice);
115115
return;
116116
}
117117
engine.driver.uploadBufferData(this, startVertice, vertices, buf, bufPos);
118118
}
119119

120-
public function uploadBytes( data : haxe.io.Bytes, dataPos : Int, vertices : Int ) {
121-
if( vertices < 0 || vertices > this.vertices )
120+
public function uploadBytes( data : haxe.io.Bytes, dataPos : Int, vertices : Int, startVertice : Int = 0 ) {
121+
if( startVertice < 0 || vertices < 0 || startVertice + vertices > this.vertices )
122122
throw "Invalid vertices count";
123123
if( vertices == 0 )
124124
return;
125-
engine.driver.uploadBufferBytes(this, 0, vertices, data, dataPos);
125+
engine.driver.uploadBufferBytes(this, startVertice, vertices, data, dataPos);
126126
}
127127

128-
public function readBytes( bytes : haxe.io.Bytes, bytesPosition : Int, vertices : Int, startVertice : Int = 0 ) {
128+
public function readBytes( bytes : haxe.io.Bytes, bytesPosition : Int, vertices : Int, startVertice : Int = 0 ) {
129129
if( startVertice < 0 || vertices < 0 || startVertice + vertices > this.vertices )
130130
throw "Invalid vertices count";
131131
engine.driver.readBufferBytes(this, startVertice, vertices, bytes, bytesPosition);

0 commit comments

Comments
 (0)