variant.c 480 B

12345678910111213141516171819202122
  1. #include "variant.h"
  2. #include <gdnative/variant.h>
  3. #include <stdlib.h>
  4. godot_variant **go_godot_variant_build_array(int length) {
  5. godot_variant **arr = malloc(sizeof(godot_variant *) * length);
  6. return arr;
  7. }
  8. void go_godot_variant_add_element(godot_variant **array, godot_variant *element,
  9. int index) {
  10. godot_variant copy = *element;
  11. array[index] = &copy;
  12. }
  13. godot_variant *go_godot_new_variant() {
  14. godot_variant *var = malloc(sizeof(godot_variant));
  15. return var;
  16. }