diff options
| author | tech kaczynski <tk@techkaczynski.dev> | 2026-10-01 05:30:26 +1000 |
|---|---|---|
| committer | tech kaczynski <tk@techkaczynski.dev> | 2026-10-01 05:30:26 +1000 |
| commit | 2790624094ab0b81dfdc3150eaf0da08accf610e (patch) | |
| tree | 4133285cd02178322a9062e363d24e51251acc30 /res.c | |
| parent | 7f42c8ec0d3faf22499ebc0b6644ca3009cabd03 (diff) | |
added model picker panel. work on property panel components.
Diffstat (limited to 'res.c')
| -rw-r--r-- | res.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -174,6 +174,34 @@ void res_update(void) { } +char** +asset_mdl_keys(int *count) { + *count = 0; + + if (!res.assets.base.nnodes) { + return NULL; + } + + char **keys = malloc(res.assets.base.nnodes * sizeof(*keys)); + if (!keys) { + perror("asset_mdl_keys: mem allocation failed."); + exit(1); + } + + map_iter_t iter = map_iter(&res.assets); + cstr key; + + while ((key = map_next(&res.assets, &iter))) { + if (strcmp(GetFileExtension(key), ".glb") != 0) { + continue; + } + + keys[(*count)++] = map_get(&res.assets, key)->path; + } + + return keys; +} + Asset* asset_get(cstr key) { Asset *asset = map_get(&res.assets, key); |
