Use setStackBottom for methods called from outside

This commit is contained in:
Ruslan Mustakov 2017-11-28 12:04:07 +07:00
commit 0d21c361d0
2 changed files with 8 additions and 1 deletions

View file

@ -1,4 +1,4 @@
version = "0.6.8"
version = "0.6.9"
author = "Xored Software, Inc."
description = "Godot Engine bindings"
license = "MIT"

View file

@ -541,10 +541,17 @@ proc genType(obj: ObjectDecl): NimNode {.compileTime.} =
template registerGodotMethod(classNameLit, classNameIdent, methodNameIdent,
methodNameLit, minArgs, maxArgs,
argTypes, methFuncIdent, hasReturnValue) =
{.emit: """/*TYPESECTION*/
N_NOINLINE(void, setStackBottom)(void* thestackbottom);
""".}
proc methFuncIdent(obj: ptr GodotObject, methodData: pointer,
userData: pointer, numArgs: cint,
args: var array[MAX_ARG_COUNT, ptr GodotVariant]):
GodotVariant {.noconv.} =
var stackBottom {.volatile.}: pointer
{.emit: """
setStackBottom((void*)(&`stackBottom`));
""".}
let self = cast[classNameIdent](userData)
const isStaticCall = methodNameLit == cstring"_ready" or
methodNameLit == cstring"_process" or