plugins: minic fixes

This commit is contained in:
luboslenco
2026-03-24 14:24:11 +01:00
parent 3b66ae7954
commit 26e4e4ea24
7 changed files with 119 additions and 35 deletions
+5 -13
View File
@@ -7,11 +7,7 @@ char *node_type = "HELLO_WORLD";
char *custom_node(ui_node_t *node, char *socket_name) {
void *kong = plugin_material_kong_get();
any_array_t *ar = node->inputs;
ui_node_socket_t *soc = ar->buffer[0];
// ui_node_socket_t *soc = node->inputs->buffer[0];
char *scale = parser_material_parse_value_input(soc, false);
// char *scale = parser_material_parse_value_input(node->inputs->buffer[0], false);
char *scale = parser_material_parse_value_input(node->inputs->buffer[0], false);
char *my_out = "my_out";
node_shader_write_frag(kong,
@@ -37,8 +33,7 @@ void main() {
// Create new node category
any_array_t *node_list = any_array_create(0);
// ui_node_t *n = gc_alloc(sizeof(ui_node_t));
ui_node_t *n = gc_alloc(72);
ui_node_t *n = gc_alloc(sizeof(ui_node_t));
any_array_push(node_list, n);
n->id = 0;
@@ -49,8 +44,7 @@ void main() {
n->color = 0xffb34f5a;
n->inputs = any_array_create(0);
// ui_node_socket_t *s = gc_alloc(sizeof(ui_node_socket_t));
ui_node_socket_t *s = gc_alloc(56);
ui_node_socket_t *s = gc_alloc(sizeof(ui_node_socket_t));
any_array_push(n->inputs, s);
s->id = 0;
s->node_id = 0;
@@ -64,8 +58,7 @@ void main() {
s->display = 0;
n->outputs = any_array_create(0);
// s = gc_alloc(sizeof(ui_node_socket_t));
s = gc_alloc(56);
s = gc_alloc(sizeof(ui_node_socket_t));
any_array_push(n->outputs, s);
s->id = 0;
s->node_id = 0;
@@ -78,8 +71,7 @@ void main() {
s->precision = 100.0;
s->display = 0;
// s = gc_alloc(sizeof(ui_node_socket_t));
s = gc_alloc(56);
s = gc_alloc(sizeof(ui_node_socket_t));
any_array_push(n->outputs, s);
s->id = 1;
s->node_id = 0;
+6 -7
View File
@@ -6,7 +6,9 @@ char *node_name = "Hello World";
char *node_type = "HELLO_WORLD";
float custom_node(logic_node_t *node, int from) {
return sin(sys_time() * node->inputs->buffer[0]->get(0));
// float f = node->inputs->buffer[0]->get(0);
float f = 1.0;
return sinf(sys_time() * f);
}
void on_delete() {
@@ -20,8 +22,7 @@ void main() {
// Create new node category
any_array_t *node_list = any_array_create(0);
// ui_node_t *n = gc_alloc(sizeof(ui_node_t));
ui_node_t *n = gc_alloc(72);
ui_node_t *n = gc_alloc(sizeof(ui_node_t));
any_array_push(node_list, n);
n->id = 0;
@@ -32,8 +33,7 @@ void main() {
n->color = 0xffb34f5a;
n->inputs = any_array_create(0);
// ui_node_socket_t *s = gc_alloc(sizeof(ui_node_socket_t));
ui_node_socket_t *s = gc_alloc(56);
ui_node_socket_t *s = gc_alloc(sizeof(ui_node_socket_t));
any_array_push(n->inputs, s);
s->id = 0;
s->node_id = 0;
@@ -47,8 +47,7 @@ void main() {
s->display = 0;
n->outputs = any_array_create(0);
// s = gc_alloc(sizeof(ui_node_socket_t));
s = gc_alloc(56);
s = gc_alloc(sizeof(ui_node_socket_t));
any_array_push(n->outputs, s);
s->id = 0;
s->node_id = 0;