More pool array features: subarray, mitems, mpairs
This commit is contained in:
parent
d11856377e
commit
be6f01e3b7
5 changed files with 559 additions and 92 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
version = "0.7.6"
|
version = "0.7.7"
|
||||||
author = "Xored Software, Inc."
|
author = "Xored Software, Inc."
|
||||||
description = "Godot Engine bindings"
|
description = "Godot Engine bindings"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,12 @@ template definePoolArray(T, GodotT, DataT, fieldName, newProcName, initProcName;
|
||||||
proc len*(self: T): int {.inline.} =
|
proc len*(self: T): int {.inline.} =
|
||||||
self.fieldName.len.int
|
self.fieldName.len.int
|
||||||
|
|
||||||
|
proc subarray*(self: T, idxFrom, idxTo: int): T {.inline.} =
|
||||||
|
## Indexes are inclusive, negative values count from the end of the array.
|
||||||
|
assert(idxFrom >= low(cint) and idxFrom <= high(cint) and
|
||||||
|
idxTo >= low(cint) and idxTo <= high(cint))
|
||||||
|
newProcName(self.fieldName.subarray(idxFrom.cint, idxTo.cint))
|
||||||
|
|
||||||
when not noData:
|
when not noData:
|
||||||
proc add*(self: T; data: DataT) {.inline.} =
|
proc add*(self: T; data: DataT) {.inline.} =
|
||||||
self.fieldName.add(data)
|
self.fieldName.add(data)
|
||||||
|
|
@ -62,12 +68,20 @@ template definePoolArray(T, GodotT, DataT, fieldName, newProcName, initProcName;
|
||||||
self.fieldName[idx.cint]
|
self.fieldName[idx.cint]
|
||||||
|
|
||||||
iterator items*(arr: T): DataT =
|
iterator items*(arr: T): DataT =
|
||||||
for i in 0..<arr.len:
|
for item in arr.fieldName.items:
|
||||||
yield arr[i]
|
yield item
|
||||||
|
|
||||||
iterator pairs*(arr: T): tuple[key: int, val: DataT] =
|
iterator pairs*(arr: T): tuple[key: int, val: DataT] =
|
||||||
for i in 0..<arr.len:
|
for pair in arr.fieldName.pairs:
|
||||||
yield (i, arr[i])
|
yield (pair[0].int, pair[1])
|
||||||
|
|
||||||
|
iterator mitems*(arr: T): var DataT =
|
||||||
|
for item in arr.fieldName.mitems:
|
||||||
|
yield item
|
||||||
|
|
||||||
|
iterator mpairs*(arr: T): tuple[key: int, val: var DataT] =
|
||||||
|
for pair in arr.fieldName.mpairs:
|
||||||
|
yield (pair[0].int, pair[1])
|
||||||
|
|
||||||
definePoolArrayBase(PoolByteArray, GodotPoolByteArray, uint8,
|
definePoolArrayBase(PoolByteArray, GodotPoolByteArray, uint8,
|
||||||
godotPoolByteArray, newPoolByteArray,
|
godotPoolByteArray, newPoolByteArray,
|
||||||
|
|
@ -75,7 +89,7 @@ definePoolArrayBase(PoolByteArray, GodotPoolByteArray, uint8,
|
||||||
definePoolArrayBase(PoolIntArray, GodotPoolIntArray, cint,
|
definePoolArrayBase(PoolIntArray, GodotPoolIntArray, cint,
|
||||||
godotPoolIntArray, newPoolIntArray,
|
godotPoolIntArray, newPoolIntArray,
|
||||||
initGodotPoolIntArray)
|
initGodotPoolIntArray)
|
||||||
definePoolArrayBase(PoolRealArray, GodotPoolRealArray, float64,
|
definePoolArrayBase(PoolRealArray, GodotPoolRealArray, float32,
|
||||||
godotPoolRealArray, newPoolRealArray,
|
godotPoolRealArray, newPoolRealArray,
|
||||||
initGodotPoolRealArray)
|
initGodotPoolRealArray)
|
||||||
definePoolArrayBase(PoolVector2Array, GodotPoolVector2Array, Vector2,
|
definePoolArrayBase(PoolVector2Array, GodotPoolVector2Array, Vector2,
|
||||||
|
|
@ -99,7 +113,7 @@ definePoolArray(PoolByteArray, GodotPoolByteArray, uint8,
|
||||||
definePoolArray(PoolIntArray, GodotPoolIntArray, cint,
|
definePoolArray(PoolIntArray, GodotPoolIntArray, cint,
|
||||||
godotPoolIntArray, newPoolIntArray,
|
godotPoolIntArray, newPoolIntArray,
|
||||||
initGodotPoolIntArray)
|
initGodotPoolIntArray)
|
||||||
definePoolArray(PoolRealArray, GodotPoolRealArray, float64,
|
definePoolArray(PoolRealArray, GodotPoolRealArray, float32,
|
||||||
godotPoolRealArray, newPoolRealArray,
|
godotPoolRealArray, newPoolRealArray,
|
||||||
initGodotPoolRealArray)
|
initGodotPoolRealArray)
|
||||||
definePoolArray(PoolVector2Array, GodotPoolVector2Array, Vector2,
|
definePoolArray(PoolVector2Array, GodotPoolVector2Array, Vector2,
|
||||||
|
|
|
||||||
|
|
@ -347,8 +347,10 @@ type
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolByteArrayResize: proc (self: var GodotPoolByteArray, size: cint)
|
poolByteArrayResize: proc (self: var GodotPoolByteArray, size: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolByteArrayRead: pointer
|
poolByteArrayRead: proc (self: GodotPoolByteArray): ptr GodotPoolByteArrayReadAccess
|
||||||
poolByteArrayWrite: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolByteArrayWrite: proc (self: var GodotPoolByteArray): ptr GodotPoolByteArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolByteArraySet: proc (self: var GodotPoolByteArray, idx: cint, data: byte)
|
poolByteArraySet: proc (self: var GodotPoolByteArray, idx: cint, data: byte)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolByteArrayGet: proc (self: GodotPoolByteArray, idx: cint): byte
|
poolByteArrayGet: proc (self: GodotPoolByteArray, idx: cint): byte
|
||||||
|
|
@ -384,8 +386,10 @@ type
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolIntArrayResize: proc (self: var GodotPoolIntArray, size: cint)
|
poolIntArrayResize: proc (self: var GodotPoolIntArray, size: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolIntArrayRead: pointer
|
poolIntArrayRead: proc (self: GodotPoolIntArray): ptr GodotPoolIntArrayReadAccess
|
||||||
poolIntArrayWrite: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolIntArrayWrite: proc (self: var GodotPoolIntArray): ptr GodotPoolIntArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolIntArraySet: proc (self: var GodotPoolIntArray, idx: cint, data: cint)
|
poolIntArraySet: proc (self: var GodotPoolIntArray, idx: cint, data: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolIntArrayGet: proc (self: GodotPoolIntArray, idx: cint): cint
|
poolIntArrayGet: proc (self: GodotPoolIntArray, idx: cint): cint
|
||||||
|
|
@ -423,8 +427,10 @@ type
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolRealArrayResize: proc (self: var GodotPoolRealArray, size: cint)
|
poolRealArrayResize: proc (self: var GodotPoolRealArray, size: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolRealArrayRead: pointer
|
poolRealArrayRead: proc (self: GodotPoolRealArray): ptr GodotPoolRealArrayReadAccess
|
||||||
poolRealArrayWrite: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolRealArrayWrite: proc (self: var GodotPoolRealArray): ptr GodotPoolRealArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolRealArraySet: proc (self: var GodotPoolRealArray, idx: cint,
|
poolRealArraySet: proc (self: var GodotPoolRealArray, idx: cint,
|
||||||
data: float32)
|
data: float32)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
@ -471,8 +477,10 @@ type
|
||||||
poolStringArrayResize: proc (self: var GodotPoolStringArray, size: cint)
|
poolStringArrayResize: proc (self: var GodotPoolStringArray, size: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [],
|
{.noconv, raises: [], gcsafe, tags: [],
|
||||||
locks: 0.}
|
locks: 0.}
|
||||||
poolStringArrayRead: pointer
|
poolStringArrayRead: proc (self: GodotPoolStringArray): ptr GodotPoolStringArrayReadAccess
|
||||||
poolStringArrayWrite: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolStringArrayWrite: proc (self: var GodotPoolStringArray): ptr GodotPoolStringArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolStringArraySet: proc (self: var GodotPoolStringArray, idx: cint,
|
poolStringArraySet: proc (self: var GodotPoolStringArray, idx: cint,
|
||||||
data: GodotString)
|
data: GodotString)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
@ -519,8 +527,10 @@ type
|
||||||
poolVector2ArrayResize: proc (self: var GodotPoolVector2Array, size: cint)
|
poolVector2ArrayResize: proc (self: var GodotPoolVector2Array, size: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [],
|
{.noconv, raises: [], gcsafe, tags: [],
|
||||||
locks: 0.}
|
locks: 0.}
|
||||||
poolVector2ArrayRead: pointer
|
poolVector2ArrayRead: proc (self: GodotPoolVector2Array): ptr GodotPoolVector2ArrayReadAccess
|
||||||
poolVector2ArrayWrite: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayWrite: proc (self: var GodotPoolVector2Array): ptr GodotPoolVector2ArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolVector2ArraySet: proc (self: var GodotPoolVector2Array, idx: cint,
|
poolVector2ArraySet: proc (self: var GodotPoolVector2Array, idx: cint,
|
||||||
data: Vector2)
|
data: Vector2)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
@ -566,8 +576,10 @@ type
|
||||||
poolVector3ArrayResize: proc (self: var GodotPoolVector3Array,
|
poolVector3ArrayResize: proc (self: var GodotPoolVector3Array,
|
||||||
size: cint) {.noconv, raises: [], gcsafe,
|
size: cint) {.noconv, raises: [], gcsafe,
|
||||||
tags: [], locks: 0.}
|
tags: [], locks: 0.}
|
||||||
poolVector3ArrayRead: pointer
|
poolVector3ArrayRead: proc (self: GodotPoolVector3Array): ptr GodotPoolVector3ArrayReadAccess
|
||||||
poolVector3ArrayWrite: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayWrite: proc (self: var GodotPoolVector3Array): ptr GodotPoolVector3ArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolVector3ArraySet: proc (self: var GodotPoolVector3Array, idx: cint,
|
poolVector3ArraySet: proc (self: var GodotPoolVector3Array, idx: cint,
|
||||||
data: Vector3) {.noconv, raises: [], gcsafe,
|
data: Vector3) {.noconv, raises: [], gcsafe,
|
||||||
tags: [], locks: 0.}
|
tags: [], locks: 0.}
|
||||||
|
|
@ -609,8 +621,10 @@ type
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolColorArrayResize: proc (self: var GodotPoolColorArray, size: cint)
|
poolColorArrayResize: proc (self: var GodotPoolColorArray, size: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolColorArrayRead: pointer
|
poolColorArrayRead: proc (self: GodotPoolColorArray): ptr GodotPoolColorArrayReadAccess
|
||||||
poolColorArrayWrite: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayWrite: proc (self: var GodotPoolColorArray): ptr GodotPoolColorArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolColorArraySet: proc (self: var GodotPoolColorArray, idx: cint,
|
poolColorArraySet: proc (self: var GodotPoolColorArray, idx: cint,
|
||||||
data: Color)
|
data: Color)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
@ -622,65 +636,133 @@ type
|
||||||
{.noconv, raises: [], gcsafe, tags: [],
|
{.noconv, raises: [], gcsafe, tags: [],
|
||||||
locks: 0.}
|
locks: 0.}
|
||||||
|
|
||||||
# Pool Array Read Access API
|
# Pool Array Read/Write Access API
|
||||||
|
|
||||||
poolByteArrayReadAccessCopy: pointer
|
poolByteArrayReadAccessCopy: proc (self: ptr GodotPoolByteArrayReadAccess): ptr GodotPoolByteArrayReadAccess
|
||||||
poolByteArrayReadAccessPtr: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolByteArrayReadAccessOperatorAssign: pointer
|
poolByteArrayReadAccessPtr: proc (self: ptr GodotPoolByteArrayReadAccess): ptr byte
|
||||||
poolByteArrayReadAccessDestroy: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolIntArrayReadAccessCopy: pointer
|
poolByteArrayReadAccessOperatorAssign: proc (self, other: ptr GodotPoolByteArrayReadAccess)
|
||||||
poolIntArrayReadAccessPtr: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolIntArrayReadAccessOperatorAssign: pointer
|
poolByteArrayReadAccessDestroy: proc (self: ptr GodotPoolByteArrayReadAccess)
|
||||||
poolIntArrayReadAccessDestroy: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolRealArrayReadAccessCopy: pointer
|
|
||||||
poolRealArrayReadAccessPtr: pointer
|
|
||||||
poolRealArrayReadAccessOperatorAssign: pointer
|
|
||||||
poolRealArrayReadAccessDestroy: pointer
|
|
||||||
poolStringArrayReadAccessCopy: pointer
|
|
||||||
poolStringArrayReadAccessPtr: pointer
|
|
||||||
poolStringArrayReadAccessOperatorAssign: pointer
|
|
||||||
poolStringArrayReadAccessDestroy: pointer
|
|
||||||
poolVector2ArrayReadAccessCopy: pointer
|
|
||||||
poolVector2ArrayReadAccessPtr: pointer
|
|
||||||
poolVector2ArrayReadAccessOperatorAssign: pointer
|
|
||||||
poolVector2ArrayReadAccessDestroy: pointer
|
|
||||||
poolVector3ArrayReadAccessCopy: pointer
|
|
||||||
poolVector3ArrayReadAccessPtr: pointer
|
|
||||||
poolVector3ArrayReadAccessOperatorAssign: pointer
|
|
||||||
poolVector3ArrayReadAccessDestroy: pointer
|
|
||||||
poolColorArrayReadAccessCopy: pointer
|
|
||||||
poolColorArrayReadAccessPtr: pointer
|
|
||||||
poolColorArrayReadAccessOperatorAssign: pointer
|
|
||||||
poolColorArrayReadAccessDestroy: pointer
|
|
||||||
|
|
||||||
poolByteArrayWriteAccessCopy: pointer
|
poolIntArrayReadAccessCopy: proc (self: ptr GodotPoolIntArrayReadAccess): ptr GodotPoolIntArrayReadAccess
|
||||||
poolByteArrayWriteAccessPtr: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolByteArrayWriteAccessOperatorAssign: pointer
|
poolIntArrayReadAccessPtr: proc (self: ptr GodotPoolIntArrayReadAccess): ptr cint
|
||||||
poolByteArrayWriteAccessDestroy: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolIntArrayWriteAccessCopy: pointer
|
poolIntArrayReadAccessOperatorAssign: proc (self, other: ptr GodotPoolIntArrayReadAccess)
|
||||||
poolIntArrayWriteAccessPtr: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolIntArrayWriteAccessOperatorAssign: pointer
|
poolIntArrayReadAccessDestroy: proc (self: ptr GodotPoolIntArrayReadAccess)
|
||||||
poolIntArrayWriteAccessDestroy: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolRealArrayWriteAccessCopy: pointer
|
|
||||||
poolRealArrayWriteAccessPtr: pointer
|
poolRealArrayReadAccessCopy: proc (self: ptr GodotPoolRealArrayReadAccess): ptr GodotPoolRealArrayReadAccess
|
||||||
poolRealArrayWriteAccessOperatorAssign: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolRealArrayWriteAccessDestroy: pointer
|
poolRealArrayReadAccessPtr: proc (self: ptr GodotPoolRealArrayReadAccess): ptr float32
|
||||||
poolStringArrayWriteAccessCopy: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolStringArrayWriteAccessPtr: pointer
|
poolRealArrayReadAccessOperatorAssign: proc (self, other: ptr GodotPoolRealArrayReadAccess)
|
||||||
poolStringArrayWriteAccessOperatorAssign: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolStringArrayWriteAccessDestroy: pointer
|
poolRealArrayReadAccessDestroy: proc (self: ptr GodotPoolRealArrayReadAccess)
|
||||||
poolVector2ArrayWriteAccessCopy: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolVector2ArrayWriteAccessPtr: pointer
|
|
||||||
poolVector2ArrayWriteAccessOperatorAssign: pointer
|
poolStringArrayReadAccessCopy: proc (self: ptr GodotPoolStringArrayReadAccess): ptr GodotPoolStringArrayReadAccess
|
||||||
poolVector2ArrayWriteAccessDestroy: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolVector3ArrayWriteAccessCopy: pointer
|
poolStringArrayReadAccessPtr: proc (self: ptr GodotPoolStringArrayReadAccess): ptr GodotString
|
||||||
poolVector3ArrayWriteAccessPtr: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolVector3ArrayWriteAccessOperatorAssign: pointer
|
poolStringArrayReadAccessOperatorAssign: proc (self, other: ptr GodotPoolStringArrayReadAccess)
|
||||||
poolVector3ArrayWriteAccessDestroy: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolColorArrayWriteAccessCopy: pointer
|
poolStringArrayReadAccessDestroy: proc (self: ptr GodotPoolStringArrayReadAccess)
|
||||||
poolColorArrayWriteAccessPtr: pointer
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolColorArrayWriteAccessOperatorAssign: pointer
|
|
||||||
poolColorArrayWriteAccessDestroy: pointer
|
poolVector2ArrayReadAccessCopy: proc (self: ptr GodotPoolVector2ArrayReadAccess): ptr GodotPoolVector2ArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayReadAccessPtr: proc (self: ptr GodotPoolVector2ArrayReadAccess): ptr Vector2
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayReadAccessOperatorAssign: proc (self, other: ptr GodotPoolVector2ArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayReadAccessDestroy: proc (self: ptr GodotPoolVector2ArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolVector3ArrayReadAccessCopy: proc (self: ptr GodotPoolVector3ArrayReadAccess): ptr GodotPoolVector3ArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayReadAccessPtr: proc (self: ptr GodotPoolVector3ArrayReadAccess): ptr Vector3
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayReadAccessOperatorAssign: proc (self, other: ptr GodotPoolVector3ArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayReadAccessDestroy: proc (self: ptr GodotPoolVector3ArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolColorArrayReadAccessCopy: proc (self: ptr GodotPoolColorArrayReadAccess): ptr GodotPoolColorArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayReadAccessPtr: proc (self: ptr GodotPoolColorArrayReadAccess): ptr Color
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayReadAccessOperatorAssign: proc (self, other: ptr GodotPoolColorArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayReadAccessDestroy: proc (self: ptr GodotPoolColorArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolByteArrayWriteAccessCopy: proc (self: ptr GodotPoolByteArrayWriteAccess): ptr GodotPoolByteArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolByteArrayWriteAccessPtr: proc (self: ptr GodotPoolByteArrayWriteAccess): ptr byte
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolByteArrayWriteAccessOperatorAssign: proc (self, other: ptr GodotPoolByteArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolByteArrayWriteAccessDestroy: proc (self: ptr GodotPoolByteArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolIntArrayWriteAccessCopy: proc (self: ptr GodotPoolIntArrayWriteAccess): ptr GodotPoolIntArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolIntArrayWriteAccessPtr: proc (self: ptr GodotPoolIntArrayWriteAccess): ptr cint
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolIntArrayWriteAccessOperatorAssign: proc (self, other: ptr GodotPoolIntArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolIntArrayWriteAccessDestroy: proc (self: ptr GodotPoolIntArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolRealArrayWriteAccessCopy: proc (self: ptr GodotPoolRealArrayWriteAccess): ptr GodotPoolRealArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolRealArrayWriteAccessPtr: proc (self: ptr GodotPoolRealArrayWriteAccess): ptr float32
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolRealArrayWriteAccessOperatorAssign: proc (self, other: ptr GodotPoolRealArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolRealArrayWriteAccessDestroy: proc (self: ptr GodotPoolRealArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolStringArrayWriteAccessCopy: proc (self: ptr GodotPoolStringArrayWriteAccess): ptr GodotPoolStringArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolStringArrayWriteAccessPtr: proc (self: ptr GodotPoolStringArrayWriteAccess): ptr GodotString
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolStringArrayWriteAccessOperatorAssign: proc (self, other: ptr GodotPoolStringArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolStringArrayWriteAccessDestroy: proc (self: ptr GodotPoolStringArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolVector2ArrayWriteAccessCopy: proc (self: ptr GodotPoolVector2ArrayWriteAccess): ptr GodotPoolVector2ArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayWriteAccessPtr: proc (self: ptr GodotPoolVector2ArrayWriteAccess): ptr Vector2
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayWriteAccessOperatorAssign: proc (self, other: ptr GodotPoolVector2ArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayWriteAccessDestroy: proc (self: ptr GodotPoolVector2ArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolVector3ArrayWriteAccessCopy: proc (self: ptr GodotPoolVector3ArrayWriteAccess): ptr GodotPoolVector3ArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayWriteAccessPtr: proc (self: ptr GodotPoolVector3ArrayWriteAccess): ptr Vector3
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayWriteAccessOperatorAssign: proc (self, other: ptr GodotPoolVector3ArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayWriteAccessDestroy: proc (self: ptr GodotPoolVector3ArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolColorArrayWriteAccessCopy: proc (self: ptr GodotPoolColorArrayWriteAccess): ptr GodotPoolColorArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayWriteAccessPtr: proc (self: ptr GodotPoolColorArrayWriteAccess): ptr Color
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayWriteAccessOperatorAssign: proc (self, other: ptr GodotPoolColorArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayWriteAccessDestroy: proc (self: ptr GodotPoolColorArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
# Array API
|
# Array API
|
||||||
arrayNew: proc (dest: var GodotArray)
|
arrayNew: proc (dest: var GodotArray)
|
||||||
|
|
@ -1707,6 +1789,10 @@ type
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolByteArrayResize*: proc (self: var GodotPoolByteArray, size: cint)
|
poolByteArrayResize*: proc (self: var GodotPoolByteArray, size: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolByteArrayRead*: proc (self: GodotPoolByteArray): ptr GodotPoolByteArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolByteArrayWrite*: proc (self: var GodotPoolByteArray): ptr GodotPoolByteArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolByteArraySet*: proc (self: var GodotPoolByteArray, idx: cint, data: byte)
|
poolByteArraySet*: proc (self: var GodotPoolByteArray, idx: cint, data: byte)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolByteArrayGet*: proc (self: GodotPoolByteArray, idx: cint): byte
|
poolByteArrayGet*: proc (self: GodotPoolByteArray, idx: cint): byte
|
||||||
|
|
@ -1742,6 +1828,10 @@ type
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolIntArrayResize*: proc (self: var GodotPoolIntArray, size: cint)
|
poolIntArrayResize*: proc (self: var GodotPoolIntArray, size: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolIntArrayRead*: proc (self: GodotPoolIntArray): ptr GodotPoolIntArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolIntArrayWrite*: proc (self: var GodotPoolIntArray): ptr GodotPoolIntArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolIntArraySet*: proc (self: var GodotPoolIntArray, idx: cint, data: cint)
|
poolIntArraySet*: proc (self: var GodotPoolIntArray, idx: cint, data: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolIntArrayGet*: proc (self: GodotPoolIntArray, idx: cint): cint
|
poolIntArrayGet*: proc (self: GodotPoolIntArray, idx: cint): cint
|
||||||
|
|
@ -1779,6 +1869,10 @@ type
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolRealArrayResize*: proc (self: var GodotPoolRealArray, size: cint)
|
poolRealArrayResize*: proc (self: var GodotPoolRealArray, size: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolRealArrayRead*: proc (self: GodotPoolRealArray): ptr GodotPoolRealArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolRealArrayWrite*: proc (self: var GodotPoolRealArray): ptr GodotPoolRealArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolRealArraySet*: proc (self: var GodotPoolRealArray, idx: cint,
|
poolRealArraySet*: proc (self: var GodotPoolRealArray, idx: cint,
|
||||||
data: float32)
|
data: float32)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
@ -1825,6 +1919,10 @@ type
|
||||||
poolStringArrayResize*: proc (self: var GodotPoolStringArray, size: cint)
|
poolStringArrayResize*: proc (self: var GodotPoolStringArray, size: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [],
|
{.noconv, raises: [], gcsafe, tags: [],
|
||||||
locks: 0.}
|
locks: 0.}
|
||||||
|
poolStringArrayRead*: proc (self: GodotPoolStringArray): ptr GodotPoolStringArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolStringArrayWrite*: proc (self: var GodotPoolStringArray): ptr GodotPoolStringArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolStringArraySet*: proc (self: var GodotPoolStringArray, idx: cint,
|
poolStringArraySet*: proc (self: var GodotPoolStringArray, idx: cint,
|
||||||
data: GodotString)
|
data: GodotString)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
@ -1871,6 +1969,10 @@ type
|
||||||
poolVector2ArrayResize*: proc (self: var GodotPoolVector2Array, size: cint)
|
poolVector2ArrayResize*: proc (self: var GodotPoolVector2Array, size: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [],
|
{.noconv, raises: [], gcsafe, tags: [],
|
||||||
locks: 0.}
|
locks: 0.}
|
||||||
|
poolVector2ArrayRead*: proc (self: GodotPoolVector2Array): ptr GodotPoolVector2ArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayWrite*: proc (self: var GodotPoolVector2Array): ptr GodotPoolVector2ArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolVector2ArraySet*: proc (self: var GodotPoolVector2Array, idx: cint,
|
poolVector2ArraySet*: proc (self: var GodotPoolVector2Array, idx: cint,
|
||||||
data: Vector2)
|
data: Vector2)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
@ -1916,6 +2018,10 @@ type
|
||||||
poolVector3ArrayResize*: proc (self: var GodotPoolVector3Array,
|
poolVector3ArrayResize*: proc (self: var GodotPoolVector3Array,
|
||||||
size: cint) {.noconv, raises: [], gcsafe,
|
size: cint) {.noconv, raises: [], gcsafe,
|
||||||
tags: [], locks: 0.}
|
tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayRead*: proc (self: GodotPoolVector3Array): ptr GodotPoolVector3ArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayWrite*: proc (self: var GodotPoolVector3Array): ptr GodotPoolVector3ArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolVector3ArraySet*: proc (self: var GodotPoolVector3Array, idx: cint,
|
poolVector3ArraySet*: proc (self: var GodotPoolVector3Array, idx: cint,
|
||||||
data: Vector3) {.noconv, raises: [], gcsafe,
|
data: Vector3) {.noconv, raises: [], gcsafe,
|
||||||
tags: [], locks: 0.}
|
tags: [], locks: 0.}
|
||||||
|
|
@ -1957,6 +2063,10 @@ type
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolColorArrayResize*: proc (self: var GodotPoolColorArray, size: cint)
|
poolColorArrayResize*: proc (self: var GodotPoolColorArray, size: cint)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayRead*: proc (self: GodotPoolColorArray): ptr GodotPoolColorArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayWrite*: proc (self: var GodotPoolColorArray): ptr GodotPoolColorArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
poolColorArraySet*: proc (self: var GodotPoolColorArray, idx: cint,
|
poolColorArraySet*: proc (self: var GodotPoolColorArray, idx: cint,
|
||||||
data: Color)
|
data: Color)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
@ -1968,6 +2078,134 @@ type
|
||||||
{.noconv, raises: [], gcsafe, tags: [],
|
{.noconv, raises: [], gcsafe, tags: [],
|
||||||
locks: 0.}
|
locks: 0.}
|
||||||
|
|
||||||
|
# Pool Array Read/Write Access API
|
||||||
|
|
||||||
|
poolByteArrayReadAccessCopy*: proc (self: ptr GodotPoolByteArrayReadAccess): ptr GodotPoolByteArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolByteArrayReadAccessPtr*: proc (self: ptr GodotPoolByteArrayReadAccess): ptr byte
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolByteArrayReadAccessOperatorAssign*: proc (self, other: ptr GodotPoolByteArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolByteArrayReadAccessDestroy*: proc (self: ptr GodotPoolByteArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolIntArrayReadAccessCopy*: proc (self: ptr GodotPoolIntArrayReadAccess): ptr GodotPoolIntArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolIntArrayReadAccessPtr*: proc (self: ptr GodotPoolIntArrayReadAccess): ptr cint
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolIntArrayReadAccessOperatorAssign*: proc (self, other: ptr GodotPoolIntArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolIntArrayReadAccessDestroy*: proc (self: ptr GodotPoolIntArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolRealArrayReadAccessCopy*: proc (self: ptr GodotPoolRealArrayReadAccess): ptr GodotPoolRealArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolRealArrayReadAccessPtr*: proc (self: ptr GodotPoolRealArrayReadAccess): ptr float32
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolRealArrayReadAccessOperatorAssign*: proc (self, other: ptr GodotPoolRealArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolRealArrayReadAccessDestroy*: proc (self: ptr GodotPoolRealArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolStringArrayReadAccessCopy*: proc (self: ptr GodotPoolStringArrayReadAccess): ptr GodotPoolStringArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolStringArrayReadAccessPtr*: proc (self: ptr GodotPoolStringArrayReadAccess): ptr GodotString
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolStringArrayReadAccessOperatorAssign*: proc (self, other: ptr GodotPoolStringArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolStringArrayReadAccessDestroy*: proc (self: ptr GodotPoolStringArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolVector2ArrayReadAccessCopy*: proc (self: ptr GodotPoolVector2ArrayReadAccess): ptr GodotPoolVector2ArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayReadAccessPtr*: proc (self: ptr GodotPoolVector2ArrayReadAccess): ptr Vector2
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayReadAccessOperatorAssign*: proc (self, other: ptr GodotPoolVector2ArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayReadAccessDestroy*: proc (self: ptr GodotPoolVector2ArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolVector3ArrayReadAccessCopy*: proc (self: ptr GodotPoolVector3ArrayReadAccess): ptr GodotPoolVector3ArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayReadAccessPtr*: proc (self: ptr GodotPoolVector3ArrayReadAccess): ptr Vector3
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayReadAccessOperatorAssign*: proc (self, other: ptr GodotPoolVector3ArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayReadAccessDestroy*: proc (self: ptr GodotPoolVector3ArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolColorArrayReadAccessCopy*: proc (self: ptr GodotPoolColorArrayReadAccess): ptr GodotPoolColorArrayReadAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayReadAccessPtr*: proc (self: ptr GodotPoolColorArrayReadAccess): ptr Color
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayReadAccessOperatorAssign*: proc (self, other: ptr GodotPoolColorArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayReadAccessDestroy*: proc (self: ptr GodotPoolColorArrayReadAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolByteArrayWriteAccessCopy*: proc (self: ptr GodotPoolByteArrayWriteAccess): ptr GodotPoolByteArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolByteArrayWriteAccessPtr*: proc (self: ptr GodotPoolByteArrayWriteAccess): ptr byte
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolByteArrayWriteAccessOperatorAssign*: proc (self, other: ptr GodotPoolByteArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolByteArrayWriteAccessDestroy*: proc (self: ptr GodotPoolByteArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolIntArrayWriteAccessCopy*: proc (self: ptr GodotPoolIntArrayWriteAccess): ptr GodotPoolIntArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolIntArrayWriteAccessPtr*: proc (self: ptr GodotPoolIntArrayWriteAccess): ptr cint
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolIntArrayWriteAccessOperatorAssign*: proc (self, other: ptr GodotPoolIntArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolIntArrayWriteAccessDestroy*: proc (self: ptr GodotPoolIntArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolRealArrayWriteAccessCopy*: proc (self: ptr GodotPoolRealArrayWriteAccess): ptr GodotPoolRealArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolRealArrayWriteAccessPtr*: proc (self: ptr GodotPoolRealArrayWriteAccess): ptr float32
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolRealArrayWriteAccessOperatorAssign*: proc (self, other: ptr GodotPoolRealArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolRealArrayWriteAccessDestroy*: proc (self: ptr GodotPoolRealArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolStringArrayWriteAccessCopy*: proc (self: ptr GodotPoolStringArrayWriteAccess): ptr GodotPoolStringArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolStringArrayWriteAccessPtr*: proc (self: ptr GodotPoolStringArrayWriteAccess): ptr GodotString
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolStringArrayWriteAccessOperatorAssign*: proc (self, other: ptr GodotPoolStringArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolStringArrayWriteAccessDestroy*: proc (self: ptr GodotPoolStringArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolVector2ArrayWriteAccessCopy*: proc (self: ptr GodotPoolVector2ArrayWriteAccess): ptr GodotPoolVector2ArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayWriteAccessPtr*: proc (self: ptr GodotPoolVector2ArrayWriteAccess): ptr Vector2
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayWriteAccessOperatorAssign*: proc (self, other: ptr GodotPoolVector2ArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector2ArrayWriteAccessDestroy*: proc (self: ptr GodotPoolVector2ArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolVector3ArrayWriteAccessCopy*: proc (self: ptr GodotPoolVector3ArrayWriteAccess): ptr GodotPoolVector3ArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayWriteAccessPtr*: proc (self: ptr GodotPoolVector3ArrayWriteAccess): ptr Vector3
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayWriteAccessOperatorAssign*: proc (self, other: ptr GodotPoolVector3ArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolVector3ArrayWriteAccessDestroy*: proc (self: ptr GodotPoolVector3ArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
|
poolColorArrayWriteAccessCopy*: proc (self: ptr GodotPoolColorArrayWriteAccess): ptr GodotPoolColorArrayWriteAccess
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayWriteAccessPtr*: proc (self: ptr GodotPoolColorArrayWriteAccess): ptr Color
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayWriteAccessOperatorAssign*: proc (self, other: ptr GodotPoolColorArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
poolColorArrayWriteAccessDestroy*: proc (self: ptr GodotPoolColorArrayWriteAccess)
|
||||||
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
||||||
# Array API
|
# Array API
|
||||||
arrayNew*: proc (dest: var GodotArray)
|
arrayNew*: proc (dest: var GodotArray)
|
||||||
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
{.noconv, raises: [], gcsafe, tags: [], locks: 0.}
|
||||||
|
|
@ -2780,6 +3018,8 @@ proc setGDNativeAPI*(apiStruct: pointer, initOptions: ptr GDNativeInitOptions) =
|
||||||
poolByteArrayPushBack
|
poolByteArrayPushBack
|
||||||
poolByteArrayRemove
|
poolByteArrayRemove
|
||||||
poolByteArrayResize
|
poolByteArrayResize
|
||||||
|
poolByteArrayRead
|
||||||
|
poolByteArrayWrite
|
||||||
poolByteArraySet
|
poolByteArraySet
|
||||||
poolByteArrayGet
|
poolByteArrayGet
|
||||||
poolByteArraySize
|
poolByteArraySize
|
||||||
|
|
@ -2796,6 +3036,8 @@ proc setGDNativeAPI*(apiStruct: pointer, initOptions: ptr GDNativeInitOptions) =
|
||||||
poolIntArrayPushBack
|
poolIntArrayPushBack
|
||||||
poolIntArrayRemove
|
poolIntArrayRemove
|
||||||
poolIntArrayResize
|
poolIntArrayResize
|
||||||
|
poolIntArrayRead
|
||||||
|
poolIntArrayWrite
|
||||||
poolIntArraySet
|
poolIntArraySet
|
||||||
poolIntArrayGet
|
poolIntArrayGet
|
||||||
poolIntArraySize
|
poolIntArraySize
|
||||||
|
|
@ -2812,6 +3054,8 @@ proc setGDNativeAPI*(apiStruct: pointer, initOptions: ptr GDNativeInitOptions) =
|
||||||
poolRealArrayPushBack
|
poolRealArrayPushBack
|
||||||
poolRealArrayRemove
|
poolRealArrayRemove
|
||||||
poolRealArrayResize
|
poolRealArrayResize
|
||||||
|
poolRealArrayRead
|
||||||
|
poolRealArrayWrite
|
||||||
poolRealArraySet
|
poolRealArraySet
|
||||||
poolRealArrayGet
|
poolRealArrayGet
|
||||||
poolRealArraySize
|
poolRealArraySize
|
||||||
|
|
@ -2828,6 +3072,8 @@ proc setGDNativeAPI*(apiStruct: pointer, initOptions: ptr GDNativeInitOptions) =
|
||||||
poolStringArrayPushBack
|
poolStringArrayPushBack
|
||||||
poolStringArrayRemove
|
poolStringArrayRemove
|
||||||
poolStringArrayResize
|
poolStringArrayResize
|
||||||
|
poolStringArrayRead
|
||||||
|
poolStringArrayWrite
|
||||||
poolStringArraySet
|
poolStringArraySet
|
||||||
poolStringArrayGet
|
poolStringArrayGet
|
||||||
poolStringArraySize
|
poolStringArraySize
|
||||||
|
|
@ -2845,6 +3091,8 @@ proc setGDNativeAPI*(apiStruct: pointer, initOptions: ptr GDNativeInitOptions) =
|
||||||
poolVector2ArrayPushBack
|
poolVector2ArrayPushBack
|
||||||
poolVector2ArrayRemove
|
poolVector2ArrayRemove
|
||||||
poolVector2ArrayResize
|
poolVector2ArrayResize
|
||||||
|
poolVector2ArrayRead
|
||||||
|
poolVector2ArrayWrite
|
||||||
poolVector2ArraySet
|
poolVector2ArraySet
|
||||||
poolVector2ArrayGet
|
poolVector2ArrayGet
|
||||||
poolVector2ArraySize
|
poolVector2ArraySize
|
||||||
|
|
@ -2861,6 +3109,8 @@ proc setGDNativeAPI*(apiStruct: pointer, initOptions: ptr GDNativeInitOptions) =
|
||||||
poolVector3ArrayPushBack
|
poolVector3ArrayPushBack
|
||||||
poolVector3ArrayRemove
|
poolVector3ArrayRemove
|
||||||
poolVector3ArrayResize
|
poolVector3ArrayResize
|
||||||
|
poolVector3ArrayRead
|
||||||
|
poolVector3ArrayWrite
|
||||||
poolVector3ArraySet
|
poolVector3ArraySet
|
||||||
poolVector3ArrayGet
|
poolVector3ArrayGet
|
||||||
poolVector3ArraySize
|
poolVector3ArraySize
|
||||||
|
|
@ -2877,6 +3127,8 @@ proc setGDNativeAPI*(apiStruct: pointer, initOptions: ptr GDNativeInitOptions) =
|
||||||
poolColorArrayPushBack
|
poolColorArrayPushBack
|
||||||
poolColorArrayRemove
|
poolColorArrayRemove
|
||||||
poolColorArrayResize
|
poolColorArrayResize
|
||||||
|
poolColorArrayRead
|
||||||
|
poolColorArrayWrite
|
||||||
poolColorArraySet
|
poolColorArraySet
|
||||||
poolColorArrayGet
|
poolColorArrayGet
|
||||||
poolColorArraySize
|
poolColorArraySize
|
||||||
|
|
@ -2922,6 +3174,78 @@ proc setGDNativeAPI*(apiStruct: pointer, initOptions: ptr GDNativeInitOptions) =
|
||||||
arrayBSearchCustom
|
arrayBSearchCustom
|
||||||
arrayDestroy
|
arrayDestroy
|
||||||
|
|
||||||
|
# Pool Array Read/Write Access API
|
||||||
|
|
||||||
|
poolByteArrayReadAccessCopy
|
||||||
|
poolByteArrayReadAccessPtr
|
||||||
|
poolByteArrayReadAccessOperatorAssign
|
||||||
|
poolByteArrayReadAccessDestroy
|
||||||
|
|
||||||
|
poolIntArrayReadAccessCopy
|
||||||
|
poolIntArrayReadAccessPtr
|
||||||
|
poolIntArrayReadAccessOperatorAssign
|
||||||
|
poolIntArrayReadAccessDestroy
|
||||||
|
|
||||||
|
poolRealArrayReadAccessCopy
|
||||||
|
poolRealArrayReadAccessPtr
|
||||||
|
poolRealArrayReadAccessOperatorAssign
|
||||||
|
poolRealArrayReadAccessDestroy
|
||||||
|
|
||||||
|
poolStringArrayReadAccessCopy
|
||||||
|
poolStringArrayReadAccessPtr
|
||||||
|
poolStringArrayReadAccessOperatorAssign
|
||||||
|
poolStringArrayReadAccessDestroy
|
||||||
|
|
||||||
|
poolVector2ArrayReadAccessCopy
|
||||||
|
poolVector2ArrayReadAccessPtr
|
||||||
|
poolVector2ArrayReadAccessOperatorAssign
|
||||||
|
poolVector2ArrayReadAccessDestroy
|
||||||
|
|
||||||
|
poolVector3ArrayReadAccessCopy
|
||||||
|
poolVector3ArrayReadAccessPtr
|
||||||
|
poolVector3ArrayReadAccessOperatorAssign
|
||||||
|
poolVector3ArrayReadAccessDestroy
|
||||||
|
|
||||||
|
poolColorArrayReadAccessCopy
|
||||||
|
poolColorArrayReadAccessPtr
|
||||||
|
poolColorArrayReadAccessOperatorAssign
|
||||||
|
poolColorArrayReadAccessDestroy
|
||||||
|
|
||||||
|
poolByteArrayWriteAccessCopy
|
||||||
|
poolByteArrayWriteAccessPtr
|
||||||
|
poolByteArrayWriteAccessOperatorAssign
|
||||||
|
poolByteArrayWriteAccessDestroy
|
||||||
|
|
||||||
|
poolIntArrayWriteAccessCopy
|
||||||
|
poolIntArrayWriteAccessPtr
|
||||||
|
poolIntArrayWriteAccessOperatorAssign
|
||||||
|
poolIntArrayWriteAccessDestroy
|
||||||
|
|
||||||
|
poolRealArrayWriteAccessCopy
|
||||||
|
poolRealArrayWriteAccessPtr
|
||||||
|
poolRealArrayWriteAccessOperatorAssign
|
||||||
|
poolRealArrayWriteAccessDestroy
|
||||||
|
|
||||||
|
poolStringArrayWriteAccessCopy
|
||||||
|
poolStringArrayWriteAccessPtr
|
||||||
|
poolStringArrayWriteAccessOperatorAssign
|
||||||
|
poolStringArrayWriteAccessDestroy
|
||||||
|
|
||||||
|
poolVector2ArrayWriteAccessCopy
|
||||||
|
poolVector2ArrayWriteAccessPtr
|
||||||
|
poolVector2ArrayWriteAccessOperatorAssign
|
||||||
|
poolVector2ArrayWriteAccessDestroy
|
||||||
|
|
||||||
|
poolVector3ArrayWriteAccessCopy
|
||||||
|
poolVector3ArrayWriteAccessPtr
|
||||||
|
poolVector3ArrayWriteAccessOperatorAssign
|
||||||
|
poolVector3ArrayWriteAccessDestroy
|
||||||
|
|
||||||
|
poolColorArrayWriteAccessCopy
|
||||||
|
poolColorArrayWriteAccessPtr
|
||||||
|
poolColorArrayWriteAccessOperatorAssign
|
||||||
|
poolColorArrayWriteAccessDestroy
|
||||||
|
|
||||||
# Dictionary API
|
# Dictionary API
|
||||||
dictionaryNew
|
dictionaryNew
|
||||||
dictionaryNewCopy
|
dictionaryNewCopy
|
||||||
|
|
|
||||||
|
|
@ -16,18 +16,52 @@ type
|
||||||
|
|
||||||
GodotPoolByteArray* {.byref.} = object
|
GodotPoolByteArray* {.byref.} = object
|
||||||
data: array[sizeof(int), byte]
|
data: array[sizeof(int), byte]
|
||||||
|
GodotPoolByteArrayReadAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
GodotPoolByteArrayWriteAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
|
||||||
GodotPoolIntArray* {.byref.} = object
|
GodotPoolIntArray* {.byref.} = object
|
||||||
data: array[sizeof(int), byte]
|
data: array[sizeof(int), byte]
|
||||||
|
GodotPoolIntArrayReadAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
GodotPoolIntArrayWriteAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
|
||||||
GodotPoolRealArray* {.byref.} = object
|
GodotPoolRealArray* {.byref.} = object
|
||||||
data: array[sizeof(int), byte]
|
data: array[sizeof(int), byte]
|
||||||
|
GodotPoolRealArrayReadAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
GodotPoolRealArrayWriteAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
|
||||||
GodotPoolStringArray* {.byref.} = object
|
GodotPoolStringArray* {.byref.} = object
|
||||||
data: array[sizeof(int), byte]
|
data: array[sizeof(int), byte]
|
||||||
|
GodotPoolStringArrayReadAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
GodotPoolStringArrayWriteAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
|
||||||
GodotPoolVector2Array* {.byref.} = object
|
GodotPoolVector2Array* {.byref.} = object
|
||||||
data: array[sizeof(int), byte]
|
data: array[sizeof(int), byte]
|
||||||
|
GodotPoolVector2ArrayReadAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
GodotPoolVector2ArrayWriteAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
|
||||||
GodotPoolVector3Array* {.byref.} = object
|
GodotPoolVector3Array* {.byref.} = object
|
||||||
data: array[sizeof(int), byte]
|
data: array[sizeof(int), byte]
|
||||||
|
GodotPoolVector3ArrayReadAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
GodotPoolVector3ArrayWriteAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
|
||||||
GodotPoolColorArray* {.byref.} = object
|
GodotPoolColorArray* {.byref.} = object
|
||||||
data: array[sizeof(int), byte]
|
data: array[sizeof(int), byte]
|
||||||
|
GodotPoolColorArrayReadAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
GodotPoolColorArrayWriteAccess* {.byref.} = object
|
||||||
|
data: array[1, byte]
|
||||||
|
|
||||||
GodotString* {.byref.} = object
|
GodotString* {.byref.} = object
|
||||||
data: array[sizeof(int), byte]
|
data: array[sizeof(int), byte]
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,16 @@
|
||||||
import godotinternaltypes, gdnativeapi
|
import godotinternaltypes, gdnativeapi
|
||||||
import core.godotcoretypes
|
import core.godotcoretypes
|
||||||
|
|
||||||
|
proc offset[T](p: ptr T, offset: int): ptr T {.inline.} =
|
||||||
|
cast[ptr T](cast[ByteAddress](p) +% (offset * sizeof(T)))
|
||||||
|
|
||||||
template genPoolArrayAPI(ArrayT, initIdent, DataT,
|
template genPoolArrayAPI(ArrayT, initIdent, DataT,
|
||||||
newProc, newCopyProc, newWithArrayProc, appendProc,
|
newProc, newCopyProc, newWithArrayProc, appendProc,
|
||||||
appendArrayProc, insertProc, invertProc, pushBackProc,
|
appendArrayProc, insertProc, invertProc, pushBackProc,
|
||||||
removeProc, resizeProc, setProc, getProc, sizeProc,
|
removeProc, resizeProc, setProc, getProc, sizeProc,
|
||||||
destroyProc) =
|
destroyProc, readProc, writeProc,
|
||||||
|
readAccessPtrProc, writeAccessPtrProc,
|
||||||
|
readAccessDestroyProc, writeAccessDestroyProc) =
|
||||||
proc initIdent*(dest: var ArrayT) {.inline.} =
|
proc initIdent*(dest: var ArrayT) {.inline.} =
|
||||||
getGDNativeAPI().newProc(dest)
|
getGDNativeAPI().newProc(dest)
|
||||||
|
|
||||||
|
|
@ -48,13 +53,61 @@ template genPoolArrayAPI(ArrayT, initIdent, DataT,
|
||||||
proc len*(self: ArrayT): cint {.inline.} =
|
proc len*(self: ArrayT): cint {.inline.} =
|
||||||
getGDNativeAPI().sizeProc(self)
|
getGDNativeAPI().sizeProc(self)
|
||||||
|
|
||||||
iterator items*(arr: ArrayT): DataT =
|
iterator items*(self: ArrayT): DataT =
|
||||||
for i in 0.cint..<arr.len:
|
let readAccess = getGDNativeAPI().readProc(self)
|
||||||
yield arr[i]
|
let readPtr = getGDNativeAPI().readAccessPtrProc(readAccess)
|
||||||
|
for i in 0.cint..<self.len:
|
||||||
|
yield readPtr.offset(i)[]
|
||||||
|
getGDNativeAPI().readAccessDestroyProc(readAccess)
|
||||||
|
|
||||||
iterator pairs*(arr: ArrayT): tuple[key: cint, val: DataT] =
|
iterator mitems*(self: var ArrayT): var DataT =
|
||||||
for i in 0.cint..<arr.len:
|
let writeAccess = getGDNativeAPI().writeProc(self)
|
||||||
yield (i, arr[i])
|
let writePtr = getGDNativeAPI().writeAccessPtrProc(writeAccess)
|
||||||
|
for i in 0.cint..<self.len:
|
||||||
|
yield writePtr.offset(i)[]
|
||||||
|
getGDNativeAPI().writeAccessDestroyProc(writeAccess)
|
||||||
|
|
||||||
|
iterator pairs*(self: ArrayT): tuple[key: cint, val: DataT] =
|
||||||
|
let readAccess = getGDNativeAPI().readProc(self)
|
||||||
|
let readPtr = getGDNativeAPI().readAccessPtrProc(readAccess)
|
||||||
|
for i in 0.cint..<self.len:
|
||||||
|
yield (i, readPtr.offset(i)[])
|
||||||
|
getGDNativeAPI().readAccessDestroyProc(readAccess)
|
||||||
|
|
||||||
|
iterator mpairs*(self: var ArrayT): tuple[key: cint, val: var DataT] =
|
||||||
|
let writeAccess = getGDNativeAPI().writeProc(self)
|
||||||
|
let writePtr = getGDNativeAPI().writeAccessPtrProc(writeAccess)
|
||||||
|
for i in 0.cint..<self.len:
|
||||||
|
yield (i, writePtr.offset(i)[])
|
||||||
|
getGDNativeAPI().writeAccessDestroyProc(writeAccess)
|
||||||
|
|
||||||
|
proc subarray*(self: ArrayT, idxFrom, idxTo: cint): ArrayT =
|
||||||
|
## Indexes are inclusive, negative values count from the end of the array.
|
||||||
|
let ownLen = self.len
|
||||||
|
var actualIdxFrom = if idxFrom < 0: idxFrom + ownLen
|
||||||
|
else: idxFrom
|
||||||
|
var actualIdxTo = if idxTo < 0: idxTo + ownLen
|
||||||
|
else: idxTo
|
||||||
|
|
||||||
|
initIdent(result)
|
||||||
|
if actualIdxFrom < 0 or actualIdxFrom >= ownLen:
|
||||||
|
let (file, line) = instantiationInfo()
|
||||||
|
getGDNativeAPI().printError(
|
||||||
|
cstring"Invalid subarray begin index", cstring"subarray", file, line.cint)
|
||||||
|
return
|
||||||
|
if actualIdxTo < 0 or actualIdxTo >= ownLen:
|
||||||
|
let (file, line) = instantiationInfo()
|
||||||
|
getGDNativeAPI().printError(
|
||||||
|
cstring"Invalid subarray end index", cstring"subarray", file, line.cint)
|
||||||
|
return
|
||||||
|
let span = actualIdxTo - actualIdxFrom + 1
|
||||||
|
result.setLen(span)
|
||||||
|
let readAccess = getGDNativeAPI().readProc(self)
|
||||||
|
let writeAccess = getGDNativeAPI().writeProc(result)
|
||||||
|
let readPtr = getGDNativeAPI().readAccessPtrProc(readAccess).offset(actualIdxFrom)
|
||||||
|
copyMem(getGDNativeAPI().writeAccessPtrProc(writeAccess), readPtr, span)
|
||||||
|
getGDNativeAPI().readAccessDestroyProc(readAccess)
|
||||||
|
getGDNativeAPI().writeAccessDestroyProc(writeAccess)
|
||||||
|
|
||||||
genPoolArrayAPI(GodotPoolByteArray, initGodotPoolByteArray, byte,
|
genPoolArrayAPI(GodotPoolByteArray, initGodotPoolByteArray, byte,
|
||||||
poolByteArrayNew,
|
poolByteArrayNew,
|
||||||
|
|
@ -70,7 +123,13 @@ genPoolArrayAPI(GodotPoolByteArray, initGodotPoolByteArray, byte,
|
||||||
poolByteArraySet,
|
poolByteArraySet,
|
||||||
poolByteArrayGet,
|
poolByteArrayGet,
|
||||||
poolByteArraySize,
|
poolByteArraySize,
|
||||||
poolByteArrayDestroy)
|
poolByteArrayDestroy,
|
||||||
|
poolByteArrayRead,
|
||||||
|
poolByteArrayWrite,
|
||||||
|
poolByteArrayReadAccessPtr,
|
||||||
|
poolByteArrayWriteAccessPtr,
|
||||||
|
poolByteArrayReadAccessDestroy,
|
||||||
|
poolByteArrayWriteAccessDestroy)
|
||||||
|
|
||||||
genPoolArrayAPI(GodotPoolIntArray, initGodotPoolIntArray, cint,
|
genPoolArrayAPI(GodotPoolIntArray, initGodotPoolIntArray, cint,
|
||||||
poolIntArrayNew,
|
poolIntArrayNew,
|
||||||
|
|
@ -86,7 +145,13 @@ genPoolArrayAPI(GodotPoolIntArray, initGodotPoolIntArray, cint,
|
||||||
poolIntArraySet,
|
poolIntArraySet,
|
||||||
poolIntArrayGet,
|
poolIntArrayGet,
|
||||||
poolIntArraySize,
|
poolIntArraySize,
|
||||||
poolIntArrayDestroy)
|
poolIntArrayDestroy,
|
||||||
|
poolIntArrayRead,
|
||||||
|
poolIntArrayWrite,
|
||||||
|
poolIntArrayReadAccessPtr,
|
||||||
|
poolIntArrayWriteAccessPtr,
|
||||||
|
poolIntArrayReadAccessDestroy,
|
||||||
|
poolIntArrayWriteAccessDestroy)
|
||||||
|
|
||||||
genPoolArrayAPI(GodotPoolRealArray, initGodotPoolRealArray, float32,
|
genPoolArrayAPI(GodotPoolRealArray, initGodotPoolRealArray, float32,
|
||||||
poolRealArrayNew,
|
poolRealArrayNew,
|
||||||
|
|
@ -102,7 +167,13 @@ genPoolArrayAPI(GodotPoolRealArray, initGodotPoolRealArray, float32,
|
||||||
poolRealArraySet,
|
poolRealArraySet,
|
||||||
poolRealArrayGet,
|
poolRealArrayGet,
|
||||||
poolRealArraySize,
|
poolRealArraySize,
|
||||||
poolRealArrayDestroy)
|
poolRealArrayDestroy,
|
||||||
|
poolRealArrayRead,
|
||||||
|
poolRealArrayWrite,
|
||||||
|
poolRealArrayReadAccessPtr,
|
||||||
|
poolRealArrayWriteAccessPtr,
|
||||||
|
poolRealArrayReadAccessDestroy,
|
||||||
|
poolRealArrayWriteAccessDestroy)
|
||||||
|
|
||||||
genPoolArrayAPI(GodotPoolStringArray, initGodotPoolStringArray, GodotString,
|
genPoolArrayAPI(GodotPoolStringArray, initGodotPoolStringArray, GodotString,
|
||||||
poolStringArrayNew,
|
poolStringArrayNew,
|
||||||
|
|
@ -118,7 +189,13 @@ genPoolArrayAPI(GodotPoolStringArray, initGodotPoolStringArray, GodotString,
|
||||||
poolStringArraySet,
|
poolStringArraySet,
|
||||||
poolStringArrayGet,
|
poolStringArrayGet,
|
||||||
poolStringArraySize,
|
poolStringArraySize,
|
||||||
poolStringArrayDestroy)
|
poolStringArrayDestroy,
|
||||||
|
poolStringArrayRead,
|
||||||
|
poolStringArrayWrite,
|
||||||
|
poolStringArrayReadAccessPtr,
|
||||||
|
poolStringArrayWriteAccessPtr,
|
||||||
|
poolStringArrayReadAccessDestroy,
|
||||||
|
poolStringArrayWriteAccessDestroy)
|
||||||
|
|
||||||
genPoolArrayAPI(GodotPoolVector2Array, initGodotPoolVector2Array, Vector2,
|
genPoolArrayAPI(GodotPoolVector2Array, initGodotPoolVector2Array, Vector2,
|
||||||
poolVector2ArrayNew,
|
poolVector2ArrayNew,
|
||||||
|
|
@ -134,7 +211,13 @@ genPoolArrayAPI(GodotPoolVector2Array, initGodotPoolVector2Array, Vector2,
|
||||||
poolVector2ArraySet,
|
poolVector2ArraySet,
|
||||||
poolVector2ArrayGet,
|
poolVector2ArrayGet,
|
||||||
poolVector2ArraySize,
|
poolVector2ArraySize,
|
||||||
poolVector2ArrayDestroy)
|
poolVector2ArrayDestroy,
|
||||||
|
poolVector2ArrayRead,
|
||||||
|
poolVector2ArrayWrite,
|
||||||
|
poolVector2ArrayReadAccessPtr,
|
||||||
|
poolVector2ArrayWriteAccessPtr,
|
||||||
|
poolVector2ArrayReadAccessDestroy,
|
||||||
|
poolVector2ArrayWriteAccessDestroy)
|
||||||
|
|
||||||
genPoolArrayAPI(GodotPoolVector3Array, initGodotPoolVector3Array, Vector3,
|
genPoolArrayAPI(GodotPoolVector3Array, initGodotPoolVector3Array, Vector3,
|
||||||
poolVector3ArrayNew,
|
poolVector3ArrayNew,
|
||||||
|
|
@ -150,7 +233,13 @@ genPoolArrayAPI(GodotPoolVector3Array, initGodotPoolVector3Array, Vector3,
|
||||||
poolVector3ArraySet,
|
poolVector3ArraySet,
|
||||||
poolVector3ArrayGet,
|
poolVector3ArrayGet,
|
||||||
poolVector3ArraySize,
|
poolVector3ArraySize,
|
||||||
poolVector3ArrayDestroy)
|
poolVector3ArrayDestroy,
|
||||||
|
poolVector3ArrayRead,
|
||||||
|
poolVector3ArrayWrite,
|
||||||
|
poolVector3ArrayReadAccessPtr,
|
||||||
|
poolVector3ArrayWriteAccessPtr,
|
||||||
|
poolVector3ArrayReadAccessDestroy,
|
||||||
|
poolVector3ArrayWriteAccessDestroy)
|
||||||
|
|
||||||
genPoolArrayAPI(GodotPoolColorArray, initGodotPoolColorArray, Color,
|
genPoolArrayAPI(GodotPoolColorArray, initGodotPoolColorArray, Color,
|
||||||
poolColorArrayNew,
|
poolColorArrayNew,
|
||||||
|
|
@ -166,4 +255,10 @@ genPoolArrayAPI(GodotPoolColorArray, initGodotPoolColorArray, Color,
|
||||||
poolColorArraySet,
|
poolColorArraySet,
|
||||||
poolColorArrayGet,
|
poolColorArrayGet,
|
||||||
poolColorArraySize,
|
poolColorArraySize,
|
||||||
poolColorArrayDestroy)
|
poolColorArrayDestroy,
|
||||||
|
poolColorArrayRead,
|
||||||
|
poolColorArrayWrite,
|
||||||
|
poolColorArrayReadAccessPtr,
|
||||||
|
poolColorArrayWriteAccessPtr,
|
||||||
|
poolColorArrayReadAccessDestroy,
|
||||||
|
poolColorArrayWriteAccessDestroy)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue