2026-03-06 12:56:38 +01:00
|
|
|
|
2026-03-09 13:17:15 +01:00
|
|
|
#include "../global.h"
|
|
|
|
|
|
2026-06-05 14:48:27 +02:00
|
|
|
typedef struct tex_image_node {
|
|
|
|
|
struct logic_node *base;
|
|
|
|
|
struct ui_node *raw;
|
|
|
|
|
} tex_image_node_t;
|
|
|
|
|
|
2026-03-06 12:56:38 +01:00
|
|
|
logic_node_value_t *tex_image_node_get(tex_image_node_t *self, i32 from) {
|
2026-03-31 18:47:10 +02:00
|
|
|
string_array_t *ar = ui_nodes_enum_texts(self->raw->type);
|
2026-04-21 10:52:27 +02:00
|
|
|
i32 i = self->raw->buttons->buffer[0]->default_value->buffer[0];
|
|
|
|
|
char *file = ar->buffer[i];
|
2026-03-06 12:56:38 +01:00
|
|
|
|
|
|
|
|
if (from == 0) {
|
2026-03-10 11:49:57 +01:00
|
|
|
logic_node_value_t *v = GC_ALLOC_INIT(logic_node_value_t, {._str = string("%s.rgb", file)});
|
2026-03-06 12:56:38 +01:00
|
|
|
return v;
|
|
|
|
|
}
|
|
|
|
|
else {
|
2026-03-10 11:49:57 +01:00
|
|
|
logic_node_value_t *v = GC_ALLOC_INIT(logic_node_value_t, {._str = string("%s.a", file)});
|
2026-03-06 12:56:38 +01:00
|
|
|
return v;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-04 21:38:20 +02:00
|
|
|
|
2026-06-05 14:48:27 +02:00
|
|
|
void *tex_image_node_create(ui_node_t *raw, f32_array_t *args) {
|
2026-04-04 21:38:20 +02:00
|
|
|
tex_image_node_t *n = GC_ALLOC_INIT(tex_image_node_t, {0});
|
|
|
|
|
n->base = logic_node_create(n);
|
|
|
|
|
n->base->get = tex_image_node_get;
|
|
|
|
|
n->raw = raw;
|
|
|
|
|
return n;
|
|
|
|
|
}
|