Update Files
This commit is contained in:
30
Kha/Backends/Java/kha/arrays/Float32Array.hx
Normal file
30
Kha/Backends/Java/kha/arrays/Float32Array.hx
Normal file
@ -0,0 +1,30 @@
|
||||
package kha.arrays;
|
||||
|
||||
import java.NativeArray;
|
||||
|
||||
abstract Float32Array(NativeArray<Float>) {
|
||||
public inline function new(elements: Int) {
|
||||
this = new NativeArray<Float>(elements);
|
||||
}
|
||||
|
||||
public var length(get, never): Int;
|
||||
|
||||
inline function get_length(): Int {
|
||||
return this.length;
|
||||
}
|
||||
|
||||
@:arrayAccess
|
||||
public function set(index: Int, value: FastFloat): FastFloat {
|
||||
this[index] = value;
|
||||
return value;
|
||||
}
|
||||
|
||||
@:arrayAccess
|
||||
public inline function get(index: Int): FastFloat {
|
||||
return this[index];
|
||||
}
|
||||
|
||||
public inline function data(): NativeArray<Float> {
|
||||
return this;
|
||||
}
|
||||
}
|
41
Kha/Backends/Java/kha/arrays/Int16Array.hx
Normal file
41
Kha/Backends/Java/kha/arrays/Int16Array.hx
Normal file
@ -0,0 +1,41 @@
|
||||
package kha.arrays;
|
||||
|
||||
import java.NativeArray;
|
||||
|
||||
abstract Int16Array(NativeArray<java.Int16>) {
|
||||
public inline function new(elements: Int) {
|
||||
this = new NativeArray<java.Int16>(elements);
|
||||
}
|
||||
|
||||
public var length(get, never): Int;
|
||||
|
||||
inline function get_length(): Int {
|
||||
return this.length;
|
||||
}
|
||||
|
||||
public inline function set(index: Int, value: Int): Int {
|
||||
return this[index] = value;
|
||||
}
|
||||
|
||||
public inline function get(index: Int): Int {
|
||||
return this[index];
|
||||
}
|
||||
|
||||
public inline function data(): NativeArray<java.Int16> {
|
||||
return this;
|
||||
}
|
||||
|
||||
@:arrayAccess
|
||||
public inline function arrayRead(index: Int): Int {
|
||||
return this[index];
|
||||
}
|
||||
|
||||
@:arrayAccess
|
||||
public inline function arrayWrite(index: Int, value: Int): Int {
|
||||
return this[index] = value;
|
||||
}
|
||||
|
||||
// public inline function subarray(start: Int, ?end: Int): Int16Array {
|
||||
// return cast this.subarray(start, end);
|
||||
// }
|
||||
}
|
41
Kha/Backends/Java/kha/arrays/Int32Array.hx
Normal file
41
Kha/Backends/Java/kha/arrays/Int32Array.hx
Normal file
@ -0,0 +1,41 @@
|
||||
package kha.arrays;
|
||||
|
||||
import java.NativeArray;
|
||||
|
||||
abstract Int32Array(NativeArray<Int>) {
|
||||
public inline function new(elements: Int) {
|
||||
this = new NativeArray<Int>(elements);
|
||||
}
|
||||
|
||||
public var length(get, never): Int;
|
||||
|
||||
inline function get_length(): Int {
|
||||
return this.length;
|
||||
}
|
||||
|
||||
public inline function set(index: Int, value: Int): Int {
|
||||
return this[index] = value;
|
||||
}
|
||||
|
||||
public inline function get(index: Int): Int {
|
||||
return this[index];
|
||||
}
|
||||
|
||||
public inline function data(): NativeArray<Int> {
|
||||
return this;
|
||||
}
|
||||
|
||||
@:arrayAccess
|
||||
public inline function arrayRead(index: Int): Int {
|
||||
return this[index];
|
||||
}
|
||||
|
||||
@:arrayAccess
|
||||
public inline function arrayWrite(index: Int, value: Int): Int {
|
||||
return this[index] = value;
|
||||
}
|
||||
|
||||
// public inline function subarray(start: Int, ?end: Int): Int16Array {
|
||||
// return cast this.subarray(start, end);
|
||||
// }
|
||||
}
|
Reference in New Issue
Block a user