From 799148b4ac17fdc898423e0257966568326169fb Mon Sep 17 00:00:00 2001 From: luboslenco Date: Mon, 15 Jun 2026 21:47:29 +0200 Subject: [PATCH] paint: cleanup --- paint/sources/slot_layer.c | 6 ++--- paint/sources/startup.c | 54 +++++++++++++++++++------------------- paint/sources/uniforms.c | 10 +++---- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/paint/sources/slot_layer.c b/paint/sources/slot_layer.c index 60ba0d52..696fd89f 100644 --- a/paint/sources/slot_layer.c +++ b/paint/sources/slot_layer.c @@ -460,9 +460,9 @@ void slot_layer_resize_and_set_bits(slot_layer_t *raw) { gpu_delete_texture(_texpaint_sculpt); render_target_t *srt = any_map_get(rts, string("texpaint_sculpt%s", raw->ext)); - srt->width = res_x; - srt->height = res_y; - srt->_image = raw->texpaint_sculpt; + srt->width = res_x; + srt->height = res_y; + srt->_image = raw->texpaint_sculpt; } } diff --git a/paint/sources/startup.c b/paint/sources/startup.c index 29f4c83a..c608546f 100644 --- a/paint/sources/startup.c +++ b/paint/sources/startup.c @@ -1104,39 +1104,39 @@ static int16_t mesh__ScaleZ_nor[] = {0, 0, 0, 0, 0, 0, 0, static uint32_t mesh__ScaleZ_indices[] = {0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23}; -static int16_t mesh__TranslateX_pos[] = {-11796, -3276, -3276, 0, -11796, -3276, 3276, 0, -11796, 3276, 3276, 0, -11796, 3276, -3276, 0, - -11796, 3276, -3276, 0, -11796, 3276, 3276, 0, 11796, 3276, 3276, 0, 11796, 3276, -3276, 0, - 11796, 3276, -3276, 0, 11796, 3276, 3276, 0, 11796, -3276, 3276, 0, 11796, -3276, -3276, 0, - 11796, -3276, -3276, 0, 11796, -3276, 3276, 0, -11796, -3276, 3276, 0, -11796, -3276, -3276, 0, - -11796, 3276, -3276, -32767, 11796, 3276, -3276, -32767, 11796, -3276, -3276, -32767, -11796, -3276, -3276, -32767, - 11796, 3276, 3276, 32767, -11796, 3276, 3276, 32767, -11796, -3276, 3276, 32767, 11796, -3276, 3276, 32767}; -static int16_t mesh__TranslateX_nor[] = {-32767, 0, -32767, 0, -32767, 0, -32767, 0, 0, 32767, 0, 32767, 0, 32767, 0, 32767, - 32767, 0, 32767, 0, 32767, 0, 32767, 0, 0, -32767, 0, -32767, 0, -32767, 0, -32767, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +static int16_t mesh__TranslateX_pos[] = {-11796, -3276, -3276, 0, -11796, -3276, 3276, 0, -11796, 3276, 3276, 0, -11796, 3276, -3276, 0, + -11796, 3276, -3276, 0, -11796, 3276, 3276, 0, 11796, 3276, 3276, 0, 11796, 3276, -3276, 0, + 11796, 3276, -3276, 0, 11796, 3276, 3276, 0, 11796, -3276, 3276, 0, 11796, -3276, -3276, 0, + 11796, -3276, -3276, 0, 11796, -3276, 3276, 0, -11796, -3276, 3276, 0, -11796, -3276, -3276, 0, + -11796, 3276, -3276, -32767, 11796, 3276, -3276, -32767, 11796, -3276, -3276, -32767, -11796, -3276, -3276, -32767, + 11796, 3276, 3276, 32767, -11796, 3276, 3276, 32767, -11796, -3276, 3276, 32767, 11796, -3276, 3276, 32767}; +static int16_t mesh__TranslateX_nor[] = {-32767, 0, -32767, 0, -32767, 0, -32767, 0, 0, 32767, 0, 32767, 0, 32767, 0, 32767, + 32767, 0, 32767, 0, 32767, 0, 32767, 0, 0, -32767, 0, -32767, 0, -32767, 0, -32767, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static uint32_t mesh__TranslateX_indices[] = {0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23}; -static int16_t mesh__TranslateY_pos[] = {3276, -11796, -3276, 0, 3276, -11796, 3276, 0, -3276, -11796, 3276, 0, -3276, -11796, -3276, 0, - -3276, -11796, -3276, 0, -3276, -11796, 3276, 0, -3276, 11796, 3276, 0, -3276, 11796, -3276, 0, - -3276, 11796, -3276, 0, -3276, 11796, 3276, 0, 3276, 11796, 3276, 0, 3276, 11796, -3276, 0, - 3276, 11796, -3276, 0, 3276, 11796, 3276, 0, 3276, -11796, 3276, 0, 3276, -11796, -3276, 0, - -3276, -11796, -3276, -32767, -3276, 11796, -3276, -32767, 3276, 11796, -3276, -32767, 3276, -11796, -3276, -32767, - -3276, 11796, 3276, 32767, -3276, -11796, 3276, 32767, 3276, -11796, 3276, 32767, 3276, 11796, 3276, 32767}; -static int16_t mesh__TranslateY_nor[] = {0, -32767, 0, -32767, 0, -32767, 0, -32767, -32767, 0, -32767, 0, -32767, 0, -32767, 0, - 0, 32767, 0, 32767, 0, 32767, 0, 32767, 32767, 0, 32767, 0, 32767, 0, 32767, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +static int16_t mesh__TranslateY_pos[] = {3276, -11796, -3276, 0, 3276, -11796, 3276, 0, -3276, -11796, 3276, 0, -3276, -11796, -3276, 0, + -3276, -11796, -3276, 0, -3276, -11796, 3276, 0, -3276, 11796, 3276, 0, -3276, 11796, -3276, 0, + -3276, 11796, -3276, 0, -3276, 11796, 3276, 0, 3276, 11796, 3276, 0, 3276, 11796, -3276, 0, + 3276, 11796, -3276, 0, 3276, 11796, 3276, 0, 3276, -11796, 3276, 0, 3276, -11796, -3276, 0, + -3276, -11796, -3276, -32767, -3276, 11796, -3276, -32767, 3276, 11796, -3276, -32767, 3276, -11796, -3276, -32767, + -3276, 11796, 3276, 32767, -3276, -11796, 3276, 32767, 3276, -11796, 3276, 32767, 3276, 11796, 3276, 32767}; +static int16_t mesh__TranslateY_nor[] = {0, -32767, 0, -32767, 0, -32767, 0, -32767, -32767, 0, -32767, 0, -32767, 0, -32767, 0, + 0, 32767, 0, 32767, 0, 32767, 0, 32767, 32767, 0, 32767, 0, 32767, 0, 32767, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static uint32_t mesh__TranslateY_indices[] = {0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23}; -static int16_t mesh__TranslateZ_pos[] = {-3276, -3276, 11796, 32767, 3276, -3276, 11796, 32767, 3276, 3276, 11796, 32767, -3276, 3276, 11796, 32767, - -3276, 3276, 11796, 0, 3276, 3276, 11796, 0, 3276, 3276, -11796, 0, -3276, 3276, -11796, 0, - -3276, 3276, -11796, -32767, 3276, 3276, -11796, -32767, 3276, -3276, -11796, -32767, -3276, -3276, -11796, -32767, - -3276, -3276, -11796, 0, 3276, -3276, -11796, 0, 3276, -3276, 11796, 0, -3276, -3276, 11796, 0, - -3276, 3276, 11796, 0, -3276, 3276, -11796, 0, -3276, -3276, -11796, 0, -3276, -3276, 11796, 0, - 3276, 3276, -11796, 0, 3276, 3276, 11796, 0, 3276, -3276, 11796, 0, 3276, -3276, -11796, 0}; -static int16_t mesh__TranslateZ_nor[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 32767, 0, 32767, 0, 32767, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -32767, 0, -32767, 0, -32767, 0, -32767, - -32767, 0, -32767, 0, -32767, 0, -32767, 0, 32767, 0, 32767, 0, 32767, 0, 32767, 0}; +static int16_t mesh__TranslateZ_pos[] = {-3276, -3276, 11796, 32767, 3276, -3276, 11796, 32767, 3276, 3276, 11796, 32767, -3276, 3276, 11796, 32767, + -3276, 3276, 11796, 0, 3276, 3276, 11796, 0, 3276, 3276, -11796, 0, -3276, 3276, -11796, 0, + -3276, 3276, -11796, -32767, 3276, 3276, -11796, -32767, 3276, -3276, -11796, -32767, -3276, -3276, -11796, -32767, + -3276, -3276, -11796, 0, 3276, -3276, -11796, 0, 3276, -3276, 11796, 0, -3276, -3276, 11796, 0, + -3276, 3276, 11796, 0, -3276, 3276, -11796, 0, -3276, -3276, -11796, 0, -3276, -3276, 11796, 0, + 3276, 3276, -11796, 0, 3276, 3276, 11796, 0, 3276, -3276, 11796, 0, 3276, -3276, -11796, 0}; +static int16_t mesh__TranslateZ_nor[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, 32767, 0, 32767, 0, 32767, + 0, 0, 0, 0, 0, 0, 0, 0, 0, -32767, 0, -32767, 0, -32767, 0, -32767, + -32767, 0, -32767, 0, -32767, 0, -32767, 0, 32767, 0, 32767, 0, 32767, 0, 32767, 0}; static uint32_t mesh__TranslateZ_indices[] = {0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23}; diff --git a/paint/sources/uniforms.c b/paint/sources/uniforms.c index 1dc08fda..e8185ac3 100644 --- a/paint/sources/uniforms.c +++ b/paint/sources/uniforms.c @@ -308,11 +308,11 @@ vec4_t uniforms_ext_vec4_link(object_t *object, material_data_t *mat, char *link mat4_t uniforms_ext_mat4_link(object_t *object, material_data_t *mat, char *link) { if (string_equals(link, "_decal_layer_matrix")) { // Decal layer - mat4_t m = mat4_inv(g_context->layer->decal_mat); - f32 parent_scale = object->parent != NULL ? object->parent->transform->scale.x : 1.0; - f32 f = parent_scale * object->transform->scale_world; - m = mat4_scale(m, (vec4_t){f, f, f, 1.0}); - m = mat4_mult_mat(m, uniforms_ext_ortho_p); + mat4_t m = mat4_inv(g_context->layer->decal_mat); + f32 parent_scale = object->parent != NULL ? object->parent->transform->scale.x : 1.0; + f32 f = parent_scale * object->transform->scale_world; + m = mat4_scale(m, (vec4_t){f, f, f, 1.0}); + m = mat4_mult_mat(m, uniforms_ext_ortho_p); return m; }