Refactored variant setters/getters

-Discern between named, indexed and keyed
-Get direct access to functions for typed GDScript and GDNative bindings
-Small changes to some classes in order to work with the new setget binder
This commit is contained in:
reduz 2020-11-06 22:29:22 -03:00
parent 709964849f
commit 05de7ce6ca
16 changed files with 1571 additions and 1996 deletions

View file

@ -620,7 +620,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
const StringName *index = &_global_names_ptr[indexname];
bool valid;
dst->set_named(*index, *value, &valid);
dst->set_named(*index, *value, valid);
#ifdef DEBUG_ENABLED
if (!valid) {
@ -647,10 +647,10 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
bool valid;
#ifdef DEBUG_ENABLED
//allow better error message in cases where src and dst are the same stack position
Variant ret = src->get_named(*index, &valid);
Variant ret = src->get_named(*index, valid);
#else
*dst = src->get_named(*index, &valid);
*dst = src->get_named(*index, valid);
#endif
#ifdef DEBUG_ENABLED
if (!valid) {