reading nested yaml sequences for vertices

This commit is contained in:
Luka Jankovic 2025-07-25 01:48:23 +02:00
parent 03da03d679
commit e694c32496
3 changed files with 25 additions and 9 deletions

View file

@ -23,14 +23,30 @@
#include <cyaml/cyaml.h>
#include <stdio.h>
typedef float kubo_file_vertex[2];
//
// struct kubo_file_wall {
// kubo_file_vertex *vertices;
// unsigned vertices_count;
// };
//
// struct kubo_file_scene {
// struct kubo_file_wall *walls;
// unsigned walls_count;
// };
struct numbers {
char *name;
int *data;
kubo_file_vertex *data;
unsigned data_count;
};
static const cyaml_schema_value_t float_entry = {
CYAML_VALUE_FLOAT(CYAML_FLAG_DEFAULT, float),
};
static const cyaml_schema_value_t data_entry = {
CYAML_VALUE_INT(CYAML_FLAG_DEFAULT, int),
CYAML_VALUE_SEQUENCE_FIXED(CYAML_FLAG_DEFAULT, float, &float_entry, 2),
};
static const cyaml_schema_field_t top_mapping_schema[] = {