kubo scene file schema
This commit is contained in:
parent
156b962300
commit
8554b33cd6
4 changed files with 42 additions and 34 deletions
14
kubo_file.c
14
kubo_file.c
|
|
@ -7,16 +7,20 @@ void kubo_file_parse(char *file_name) {
|
|||
.log_level = CYAML_LOG_WARNING,
|
||||
};
|
||||
|
||||
struct numbers *n;
|
||||
struct kubo_file_scene *n;
|
||||
|
||||
cyaml_err_t err = cyaml_load_file(file_name, &config, &top_schema, (cyaml_data_t **)&n, NULL);
|
||||
cyaml_err_t err = cyaml_load_file(file_name, &config, &top_schema,
|
||||
(cyaml_data_t **)&n, NULL);
|
||||
if (err != CYAML_OK) {
|
||||
printf("cyaml err\n");
|
||||
}
|
||||
|
||||
printf("%s:\n", n->name);
|
||||
for (unsigned i = 0; i < n->data_count; i++) {
|
||||
printf(" - %f:%f\n", n->data[i][0], n->data[i][1]);
|
||||
for (unsigned i = 0; i < n->walls_count; i++) {
|
||||
printf("wall:\n");
|
||||
for (unsigned j = 0; j < n->walls[i].vertices_count; j++) {
|
||||
printf("\t%f:%f\n", n->walls[i].vertices[j][0],
|
||||
n->walls[i].vertices[j][1]);
|
||||
}
|
||||
}
|
||||
|
||||
err = cyaml_free(&config, &top_schema, n, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue