forked from LeenkxTeam/LNXSDK
Update Files
This commit is contained in:
29
Kha/Sources/kha/arrays/Float64Array.hx
Normal file
29
Kha/Sources/kha/arrays/Float64Array.hx
Normal file
@ -0,0 +1,29 @@
|
||||
package kha.arrays;
|
||||
|
||||
@:forward
|
||||
abstract Float64Array(ByteArray) from ByteArray to ByteArray {
|
||||
public var length(get, never): Int;
|
||||
|
||||
inline function get_length(): Int {
|
||||
return this.byteLength >> 3;
|
||||
}
|
||||
|
||||
public function new(elements: Int) {
|
||||
this = ByteArray.make(elements * 8);
|
||||
}
|
||||
|
||||
@:arrayAccess
|
||||
public inline function get(k: Int): Float {
|
||||
return this.getFloat64(k * 8);
|
||||
}
|
||||
|
||||
@:arrayAccess
|
||||
public inline function set(k: Int, v: Float): Float {
|
||||
this.setFloat64(k * 8, v);
|
||||
return v;
|
||||
}
|
||||
|
||||
public inline function subarray(start: Int, ?end: Int): Float64Array {
|
||||
return this.subarray(start * 8, end != null ? end * 8 : end);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user