paint: merge gc remove

This commit is contained in:
luboslenco
2026-08-21 22:35:41 +02:00
parent 4c77755da0
commit eb25ff4f46
213 changed files with 3104 additions and 2920 deletions
@@ -3,28 +3,22 @@
char *curvature_bake_node_value(ui_node_t *node, ui_node_socket_t *socket) {
if (parser_material_bake_passthrough) {
gc_unroot(parser_material_bake_passthrough_strength);
parser_material_bake_passthrough_strength = string_copy(parser_material_parse_value_input(node->inputs->buffer[0], false));
gc_root(parser_material_bake_passthrough_strength);
gc_unroot(parser_material_bake_passthrough_radius);
parser_material_bake_passthrough_radius = string_copy(parser_material_parse_value_input(node->inputs->buffer[1], false));
gc_root(parser_material_bake_passthrough_radius);
gc_unroot(parser_material_bake_passthrough_offset);
parser_material_bake_passthrough_offset = string_copy(parser_material_parse_value_input(node->inputs->buffer[2], false));
gc_root(parser_material_bake_passthrough_offset);
return "0.0";
}
char *tex_name = string("texbake_%s", parser_material_node_name(node, NULL));
node_shader_add_texture(parser_material_kong, tex_name, string("_%s", tex_name));
char *tex_name = string_tmp("texbake_%s", parser_material_node_name(node, NULL));
node_shader_add_texture(parser_material_kong, tex_name, string_tmp("_%s", tex_name));
char *store = parser_material_store_var_name(node);
parser_material_write(parser_material_kong, string("var %s_res: float = sample(%s, sampler_linear, tex_coord).r;", store, tex_name));
return string("%s_res", store);
parser_material_write(parser_material_kong, string_tmp("var %s_res: float = sample(%s, sampler_linear, tex_coord).r;", store, tex_name));
return string_tmp("%s_res", store);
}
void curvature_bake_node_init() {
ui_node_t *curvature_bake_node_def =
GC_ALLOC_INIT(ui_node_t, {.id = 0,
ALLOC_INIT(ui_node_t, {.id = 0,
.name = _tr("Curvature Texture"),
.type = "BAKE_CURVATURE", // extension
.x = 0,
@@ -32,7 +26,7 @@ void curvature_bake_node_init() {
.color = 0xff4982a0,
.inputs = any_array_create_from_raw(
(void *[]){
GC_ALLOC_INIT(ui_node_socket_t, {.id = 0,
ALLOC_INIT(ui_node_socket_t, {.id = 0,
.node_id = 0,
.name = _tr("Strength"),
.type = "VALUE",
@@ -42,7 +36,7 @@ void curvature_bake_node_init() {
.max = 2.0,
.precision = 100,
.display = 0}),
GC_ALLOC_INIT(ui_node_socket_t, {.id = 0,
ALLOC_INIT(ui_node_socket_t, {.id = 0,
.node_id = 0,
.name = _tr("Radius"),
.type = "VALUE",
@@ -52,7 +46,7 @@ void curvature_bake_node_init() {
.max = 2.0,
.precision = 100,
.display = 0}),
GC_ALLOC_INIT(ui_node_socket_t, {.id = 0,
ALLOC_INIT(ui_node_socket_t, {.id = 0,
.node_id = 0,
.name = _tr("Offset"),
.type = "VALUE",
@@ -66,7 +60,7 @@ void curvature_bake_node_init() {
3),
.outputs = any_array_create_from_raw(
(void *[]){
GC_ALLOC_INIT(ui_node_socket_t, {.id = 0,
ALLOC_INIT(ui_node_socket_t, {.id = 0,
.node_id = 0,
.name = _tr("Value"),
.type = "VALUE",