Implemented wrenGetArgumentBool

This commit is contained in:
Harry Lawrence
2015-01-19 14:40:37 +00:00
parent 2a4804bbc9
commit 2763ab3176
2 changed files with 12 additions and 0 deletions
+10
View File
@@ -1210,6 +1210,16 @@ const char* wrenGetArgumentString(WrenVM* vm, int index)
return AS_CSTRING(*(vm->foreignCallSlot + index));
}
bool wrenGetArgumentBool(WrenVM* vm, int index)
{
ASSERT(vm->foreignCallSlot != NULL, "Must be in foreign call.");
ASSERT(index >= 0, "index cannot be negative.");
ASSERT(index < vm->foreignCallNumArgs, "Not that many arguments.");
// TODO: Check actual value type first.
return AS_BOOL(*(vm->foreignCallSlot + index));
}
void wrenReturnDouble(WrenVM* vm, double value)
{
ASSERT(vm->foreignCallSlot != NULL, "Must be in foreign call.");