Fix warnings

This commit is contained in:
luboslenco
2025-12-16 11:03:50 +01:00
parent 1c15bb7953
commit 7f16c8122e
20 changed files with 61 additions and 63 deletions
+2 -2
View File
@@ -66,10 +66,10 @@ function box_preferences_interface_tab() {
for (let j: i32 = 0; j < c.nodes.length; ++j) {
let n: ui_node_t = c.nodes[j];
if (config_raw.node_previews) {
n.flags |= _ui_node_flag_t.PREVIEW;
n.flags |= ui_node_flag_t.PREVIEW;
}
else {
n.flags &= ~_ui_node_flag_t.PREVIEW;
n.flags &= ~ui_node_flag_t.PREVIEW;
}
}
}
+3 -3
View File
@@ -182,11 +182,11 @@ function export_texture_run_layers(path: string, layers: slot_layer_t[], object_
}
// Clear export layer
_gpu_begin(layers_expa, null, null, clear_flag_t.COLOR, color_from_floats(0.0, 0.0, 0.0, 0.0));
_gpu_begin(layers_expa, null, null, gpu_clear_t.COLOR, color_from_floats(0.0, 0.0, 0.0, 0.0));
gpu_end();
_gpu_begin(layers_expb, null, null, clear_flag_t.COLOR, color_from_floats(0.5, 0.5, 1.0, 0.0));
_gpu_begin(layers_expb, null, null, gpu_clear_t.COLOR, color_from_floats(0.5, 0.5, 1.0, 0.0));
gpu_end();
_gpu_begin(layers_expc, null, null, clear_flag_t.COLOR, color_from_floats(1.0, 0.0, 0.0, 0.0));
_gpu_begin(layers_expc, null, null, gpu_clear_t.COLOR, color_from_floats(1.0, 0.0, 0.0, 0.0));
gpu_end();
// Flatten layers
+3 -3
View File
@@ -190,7 +190,7 @@ function render_path_base_draw_bloom(source: string, target: string) {
for (let i: i32 = 0; i < num_mips; ++i) {
render_path_base_bloom_current_mip = i;
render_path_set_target(render_path_base_bloom_mipmaps[i].name, null, null, clear_flag_t.COLOR, 0x00000000);
render_path_set_target(render_path_base_bloom_mipmaps[i].name, null, null, gpu_clear_t.COLOR, 0x00000000);
render_path_bind_target(i == 0 ? source : render_path_base_bloom_mipmaps[i - 1].name, "tex");
render_path_draw_shader("Scene/bloom_pass/bloom_downsample_pass");
}
@@ -351,7 +351,7 @@ function render_path_base_swap_buf(bufb: string) {
}
function render_path_base_draw_gbuffer() {
render_path_set_target("gbuffer0", null, "main", clear_flag_t.DEPTH, 0, 1.0); // Only clear gbuffer0
render_path_set_target("gbuffer0", null, "main", gpu_clear_t.DEPTH, 0, 1.0); // Only clear gbuffer0
let additional: string[] = [ "gbuffer1", "gbuffer2" ];
render_path_set_target("gbuffer0", additional, "main");
render_path_paint_bind_layers();
@@ -363,7 +363,7 @@ function render_path_base_draw_gbuffer() {
let ping: string = i % 2 == 1 ? "_copy" : "";
let pong: string = i % 2 == 1 ? "" : "_copy";
if (i == make_mesh_layer_pass_count - 1) {
render_path_set_target("gbuffer2" + ping, null, null, clear_flag_t.COLOR, 0xff000000);
render_path_set_target("gbuffer2" + ping, null, null, gpu_clear_t.COLOR, 0xff000000);
}
let g1ping: string = "gbuffer1" + ping;
let g2ping: string = "gbuffer2" + ping;
+4 -4
View File
@@ -123,7 +123,7 @@ function render_path_paint_commands_paint(dilation: bool = true) {
if (context_raw.pdirty > 0) {
if (context_raw.tool == tool_type_t.COLORID) {
render_path_set_target("texpaint_colorid", null, null, clear_flag_t.COLOR, 0xff000000);
render_path_set_target("texpaint_colorid", null, null, gpu_clear_t.COLOR, 0xff000000);
render_path_bind_target("gbuffer2", "gbuffer2");
render_path_paint_draw_fullscreen_triangle("paint");
ui_header_handle.redraws = 2;
@@ -233,7 +233,7 @@ function render_path_paint_commands_paint(dilation: bool = true) {
let texpaint: string = "texpaint" + tid;
if (context_raw.tool == tool_type_t.BAKE && context_raw.brush_time == sys_delta()) {
// Clear to black on bake start
render_path_set_target(texpaint, null, null, clear_flag_t.COLOR, 0xff000000);
render_path_set_target(texpaint, null, null, gpu_clear_t.COLOR, 0xff000000);
}
render_path_set_target("texpaint_blend1");
@@ -677,8 +677,8 @@ function render_path_paint_draw() {
if (context_raw.brush_blend_dirty) {
context_raw.brush_blend_dirty = false;
render_path_set_target("texpaint_blend0", null, null, clear_flag_t.COLOR, 0x00000000);
render_path_set_target("texpaint_blend1", null, null, clear_flag_t.COLOR, 0x00000000);
render_path_set_target("texpaint_blend0", null, null, gpu_clear_t.COLOR, 0x00000000);
render_path_set_target("texpaint_blend1", null, null, gpu_clear_t.COLOR, 0x00000000);
render_path_end();
}
+2 -2
View File
@@ -62,7 +62,7 @@ function render_path_preview_init() {
}
function render_path_preview_commands_preview() {
render_path_set_target("mgbuffer0", null, "mmain", clear_flag_t.COLOR | clear_flag_t.DEPTH, 0xffffffff, 1.0);
render_path_set_target("mgbuffer0", null, "mmain", gpu_clear_t.COLOR | gpu_clear_t.DEPTH, 0xffffffff, 1.0);
let additional: string[] = [ "mgbuffer1" ];
render_path_set_target("mgbuffer0", additional, "mmain");
render_path_draw_meshes("mesh");
@@ -95,7 +95,7 @@ function render_path_preview_commands_preview() {
}
function render_path_preview_commands_decal() {
render_path_set_target("gbuffer0", null, "main", clear_flag_t.COLOR | clear_flag_t.DEPTH, 0xffffffff, 1.0);
render_path_set_target("gbuffer0", null, "main", gpu_clear_t.COLOR | gpu_clear_t.DEPTH, 0xffffffff, 1.0);
let additional: string[] = [ "gbuffer1" ];
render_path_set_target("gbuffer0", additional, "main");
render_path_draw_meshes("mesh");
+1 -1
View File
@@ -56,7 +56,7 @@ function render_path_raytrace_bake_commands(parse_paint_material: (b?: bool) =>
let _bake_type: bake_type_t = context_raw.bake_type;
context_raw.bake_type = bake_type_t.INIT;
parse_paint_material(true);
render_path_set_target("baketex0", null, null, clear_flag_t.COLOR, 0x00000000);
render_path_set_target("baketex0", null, null, gpu_clear_t.COLOR, 0x00000000);
// Pixels with alpha of 0.0 are skipped during raytracing
let additional: string[] = [ "baketex1" ];
render_path_set_target("baketex0", additional);
+7 -7
View File
@@ -233,7 +233,7 @@ function slot_layer_swap(raw: slot_layer_t, other: slot_layer_t) {
function slot_layer_clear(raw: slot_layer_t, base_color: i32 = 0x00000000, base_image: gpu_texture_t = null, occlusion: f32 = 1.0,
roughness: f32 = layers_default_rough, metallic: f32 = 0.0) {
// Base
_gpu_begin(raw.texpaint, null, null, clear_flag_t.COLOR, base_color);
_gpu_begin(raw.texpaint, null, null, gpu_clear_t.COLOR, base_color);
gpu_end();
if (base_image != null) {
draw_begin(raw.texpaint);
@@ -243,10 +243,10 @@ function slot_layer_clear(raw: slot_layer_t, base_color: i32 = 0x00000000, base_
if (slot_layer_is_layer(raw)) {
// Nor
_gpu_begin(raw.texpaint_nor, null, null, clear_flag_t.COLOR, color_from_floats(0.5, 0.5, 1.0, 0.0));
_gpu_begin(raw.texpaint_nor, null, null, gpu_clear_t.COLOR, color_from_floats(0.5, 0.5, 1.0, 0.0));
gpu_end();
// Occ, rough, met
_gpu_begin(raw.texpaint_pack, null, null, clear_flag_t.COLOR, color_from_floats(occlusion, roughness, metallic, 0.0));
_gpu_begin(raw.texpaint_pack, null, null, gpu_clear_t.COLOR, color_from_floats(occlusion, roughness, metallic, 0.0));
gpu_end();
}
@@ -1537,11 +1537,11 @@ function layers_flatten(height_to_normal: bool = false, layers: slot_layer_t[] =
let empty: gpu_texture_t = empty_rt._image;
// Clear export layer
_gpu_begin(layers_expa, null, null, clear_flag_t.COLOR, color_from_floats(0.0, 0.0, 0.0, 0.0));
_gpu_begin(layers_expa, null, null, gpu_clear_t.COLOR, color_from_floats(0.0, 0.0, 0.0, 0.0));
gpu_end();
_gpu_begin(layers_expb, null, null, clear_flag_t.COLOR, color_from_floats(0.5, 0.5, 1.0, 0.0));
_gpu_begin(layers_expb, null, null, gpu_clear_t.COLOR, color_from_floats(0.5, 0.5, 1.0, 0.0));
gpu_end();
_gpu_begin(layers_expc, null, null, clear_flag_t.COLOR, color_from_floats(1.0, 0.0, 0.0, 0.0));
_gpu_begin(layers_expc, null, null, gpu_clear_t.COLOR, color_from_floats(1.0, 0.0, 0.0, 0.0));
gpu_end();
// Flatten layers
@@ -1559,7 +1559,7 @@ function layers_flatten(height_to_normal: bool = false, layers: slot_layer_t[] =
if (l1masks != null) {
if (l1masks.length > 1) {
layers_make_temp_mask_img();
draw_begin(pipes_temp_mask_image, clear_flag_t.COLOR, 0x00000000);
draw_begin(pipes_temp_mask_image, gpu_clear_t.COLOR, 0x00000000);
draw_end();
let l1: slot_layer_t = {texpaint : pipes_temp_mask_image};
for (let i: i32 = 0; i < l1masks.length; ++i) {
+1 -1
View File
@@ -65,7 +65,7 @@ function slot_material_create(m: material_data_t = null, c: ui_node_canvas_t = n
if (config_raw.node_previews) {
for (let i: i32 = 0; i < raw.canvas.nodes.length; ++i) {
let n: ui_node_t = raw.canvas.nodes[i];
n.flags |= _ui_node_flag_t.PREVIEW;
n.flags |= ui_node_flag_t.PREVIEW;
}
}
+3 -3
View File
@@ -767,7 +767,7 @@ function ui_nodes_recompile() {
}
function ui_nodes_get_linked_nodes(linked_nodes: ui_node_t[], n: ui_node_t, c: ui_node_canvas_t) {
if (array_index_of(linked_nodes, n) == -1 && (n.flags & _ui_node_flag_t.PREVIEW)) {
if (array_index_of(linked_nodes, n) == -1 && (n.flags & ui_node_flag_t.PREVIEW)) {
array_push(linked_nodes, n);
}
for (let i: i32 = 0; i < c.links.length; ++i) {
@@ -1004,7 +1004,7 @@ function ui_nodes_render() {
if (context_raw.selected_node_preview && ui_nodes.nodes_selected_id.length > 0) {
let sel: ui_node_t = ui_get_node(c.nodes, ui_nodes.nodes_selected_id[0]);
let img: gpu_texture_t = ui_nodes_get_node_preview_image(sel);
if (img != null && !(sel.flags & _ui_node_flag_t.PREVIEW)) {
if (img != null && !(sel.flags & ui_node_flag_t.PREVIEW)) {
let tw: f32 = 128 * UI_SCALE();
let th: f32 = tw * (img.height / img.width);
let tx: f32 = ui_nodes_ww - tw - 8 * UI_SCALE();
@@ -1390,7 +1390,7 @@ function ui_nodes_make_node(n: ui_node_t, nodes: ui_nodes_t, canvas: ui_node_can
node.outputs = [];
node.buttons = [];
node.width = 0;
node.flags = config_raw.node_previews ? _ui_node_flag_t.PREVIEW : _ui_node_flag_t.NONE;
node.flags = config_raw.node_previews ? ui_node_flag_t.PREVIEW : ui_node_flag_t.NONE;
let count: i32 = 0;
for (let i: i32 = 0; i < n.inputs.length; ++i) {
+1 -1
View File
@@ -126,7 +126,7 @@ function util_uv_cache_dilate_map() {
mask = context_raw.layer_filter;
}
let geom: mesh_data_t = mask == 0 && context_raw.merged_object != null ? context_raw.merged_object.data : context_raw.paint_object.data;
_gpu_begin(util_uv_dilatemap, null, null, clear_flag_t.COLOR, 0x00000000);
_gpu_begin(util_uv_dilatemap, null, null, gpu_clear_t.COLOR, 0x00000000);
gpu_set_pipeline(util_uv_pipe_dilate);
gpu_set_vertex_buffer(geom._.vertex_buffer);
gpu_set_index_buffer(geom._.index_buffer);