Use setStackBottom for methods called from outside
This commit is contained in:
parent
3e1e8f1073
commit
0d21c361d0
2 changed files with 8 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
version = "0.6.8"
|
version = "0.6.9"
|
||||||
author = "Xored Software, Inc."
|
author = "Xored Software, Inc."
|
||||||
description = "Godot Engine bindings"
|
description = "Godot Engine bindings"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
||||||
|
|
@ -541,10 +541,17 @@ proc genType(obj: ObjectDecl): NimNode {.compileTime.} =
|
||||||
template registerGodotMethod(classNameLit, classNameIdent, methodNameIdent,
|
template registerGodotMethod(classNameLit, classNameIdent, methodNameIdent,
|
||||||
methodNameLit, minArgs, maxArgs,
|
methodNameLit, minArgs, maxArgs,
|
||||||
argTypes, methFuncIdent, hasReturnValue) =
|
argTypes, methFuncIdent, hasReturnValue) =
|
||||||
|
{.emit: """/*TYPESECTION*/
|
||||||
|
N_NOINLINE(void, setStackBottom)(void* thestackbottom);
|
||||||
|
""".}
|
||||||
proc methFuncIdent(obj: ptr GodotObject, methodData: pointer,
|
proc methFuncIdent(obj: ptr GodotObject, methodData: pointer,
|
||||||
userData: pointer, numArgs: cint,
|
userData: pointer, numArgs: cint,
|
||||||
args: var array[MAX_ARG_COUNT, ptr GodotVariant]):
|
args: var array[MAX_ARG_COUNT, ptr GodotVariant]):
|
||||||
GodotVariant {.noconv.} =
|
GodotVariant {.noconv.} =
|
||||||
|
var stackBottom {.volatile.}: pointer
|
||||||
|
{.emit: """
|
||||||
|
setStackBottom((void*)(&`stackBottom`));
|
||||||
|
""".}
|
||||||
let self = cast[classNameIdent](userData)
|
let self = cast[classNameIdent](userData)
|
||||||
const isStaticCall = methodNameLit == cstring"_ready" or
|
const isStaticCall = methodNameLit == cstring"_ready" or
|
||||||
methodNameLit == cstring"_process" or
|
methodNameLit == cstring"_process" or
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue