diff --git a/base/sources/backends/windows_system.c b/base/sources/backends/windows_system.c index 04770c71..e8e7c0a0 100644 --- a/base/sources/backends/windows_system.c +++ b/base/sources/backends/windows_system.c @@ -94,7 +94,7 @@ static BOOL CALLBACK EnumerationCallback(HMONITOR monitor, HDC hdc_unused, LPREC HDC hdc = CreateDCA(NULL, display->name, NULL, NULL); display->ppi = GetDeviceCaps(hdc, LOGPIXELSX); - int scale = GetDeviceCaps(hdc, SCALINGFACTORX); + /* int scale =*/ GetDeviceCaps(hdc, SCALINGFACTORX); DeleteDC(hdc); if (MyGetDpiForMonitor != NULL) { @@ -959,7 +959,7 @@ void iron_internal_shutdown() { void iron_copy_to_clipboard(const char *text) { wchar_t wtext[4096]; MultiByteToWideChar(CP_UTF8, 0, text, -1, wtext, 4096); - OpenClipboard(iron_windows_window_handle(0)); + OpenClipboard(iron_windows_window_handle()); EmptyClipboard(); size_t size = (wcslen(wtext) + 1) * sizeof(wchar_t); HANDLE handle = GlobalAlloc(GMEM_MOVEABLE, size); @@ -1156,7 +1156,7 @@ static void createWindow(const wchar_t *title, int x, int y, int width, int heig RegGetValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", L"AppsUseLightTheme", RRF_RT_REG_DWORD, NULL, vdata, &cbdata); BOOL use_dark_mode = (int)(vdata[3] << 24 | vdata[2] << 16 | vdata[1] << 8 | vdata[0]) != 1; - DwmSetWindowAttribute(iron_windows_window_handle(0), DWMWA_USE_IMMERSIVE_DARK_MODE, &use_dark_mode, sizeof(use_dark_mode)); + DwmSetWindowAttribute(iron_windows_window_handle(), DWMWA_USE_IMMERSIVE_DARK_MODE, &use_dark_mode, sizeof(use_dark_mode)); } void iron_window_resize(int width, int height) { @@ -1246,9 +1246,7 @@ void iron_windows_hide_windows(void) { } void iron_windows_destroy_windows(void) { - for (int i = 0; i < 1; ++i) { - iron_window_destroy(i); - } + iron_window_destroy(); UnregisterClassW(windowClassName, GetModuleHandleW(NULL)); } diff --git a/base/sources/iron_ui.h b/base/sources/iron_ui.h index 15a3dff3..86dff18a 100644 --- a/base/sources/iron_ui.h +++ b/base/sources/iron_ui.h @@ -11,13 +11,13 @@ typedef enum { UI_LAYOUT_VERTICAL, UI_LAYOUT_HORIZONTAL -} _ui_layout_t; +} ui_layout_t; typedef enum { UI_ALIGN_LEFT, UI_ALIGN_CENTER, UI_ALIGN_RIGHT -} _ui_align_t; +} ui_align_t; typedef enum { UI_STATE_IDLE, @@ -25,12 +25,12 @@ typedef enum { UI_STATE_DOWN, UI_STATE_RELEASED, UI_STATE_HOVERED -} _ui_state_t; +} ui_state_t; typedef enum { UI_LINK_STYLE_LINE, UI_LINK_STYLE_CUBIC_BEZIER -} _ui_link_style_t; +} ui_link_style_t; typedef struct ui_theme { int WINDOW_BG_COL; diff --git a/base/sources/iron_ui_nodes.c b/base/sources/iron_ui_nodes.c index 161eeed3..6a22d399 100644 --- a/base/sources/iron_ui_nodes.c +++ b/base/sources/iron_ui_nodes.c @@ -88,7 +88,7 @@ float UI_LINE_H() { } float UI_BUTTONS_H(ui_node_t *node) { - if (node->flags & NODE_FLAG_COLLAPSED) + if (node->flags & UI_NODE_FLAG_COLLAPSED) return 0.0; float h = 0.0; for (int i = 0; i < node->buttons->length; ++i) { @@ -111,7 +111,7 @@ float UI_BUTTONS_H(ui_node_t *node) { } float UI_OUTPUTS_H(ui_node_t *node, int length) { - if (node->flags & NODE_FLAG_COLLAPSED) + if (node->flags & UI_NODE_FLAG_COLLAPSED) return 0.0; float h = 0.0; for (int i = 0; i < (length < 0 ? node->outputs->length : length); ++i) { @@ -144,7 +144,7 @@ float UI_INPUTS_H(ui_node_canvas_t *canvas, ui_node_socket_t **sockets, int sock } float UI_NODE_H(ui_node_canvas_t *canvas, ui_node_t *node) { - if (node->flags & NODE_FLAG_COLLAPSED) + if (node->flags & UI_NODE_FLAG_COLLAPSED) return UI_LINE_H() * 1.2; return UI_LINE_H() * 1.2 + UI_INPUTS_H(canvas, node->inputs->buffer, node->inputs->length, -1) + UI_OUTPUTS_H(node, -1) + UI_BUTTONS_H(node); } @@ -162,13 +162,13 @@ float UI_NODE_Y(ui_node_t *node) { } float UI_INPUT_Y(ui_node_canvas_t *canvas, ui_node_t *node, int pos) { - if (node->flags & NODE_FLAG_COLLAPSED) + if (node->flags & UI_NODE_FLAG_COLLAPSED) return UI_LINE_H() * 0.5; return UI_LINE_H() * 1.62 + UI_INPUTS_H(canvas, node->inputs->buffer, node->inputs->length, pos); } float UI_OUTPUT_Y(ui_node_t *node, int pos) { - if (node->flags & NODE_FLAG_COLLAPSED) + if (node->flags & UI_NODE_FLAG_COLLAPSED) return UI_LINE_H() * 0.5; return UI_LINE_H() * 1.62 + UI_OUTPUTS_H(node, pos); } @@ -746,7 +746,7 @@ void ui_node_draw(ui_node_t *node, ui_node_canvas_t *canvas) { } // Node preview - if ((node->flags & NODE_FLAG_PREVIEW) && ui_nodes_preview_image != NULL) { + if ((node->flags & UI_NODE_FLAG_PREVIEW) && ui_nodes_preview_image != NULL) { // ui_draw_shadow(nx, ny - w, w * 0.98, w * 0.98); gpu_texture_t *image = ui_nodes_preview_image(node); if (image != NULL) { @@ -774,7 +774,7 @@ void ui_node_draw(ui_node_t *node, ui_node_canvas_t *canvas) { // Collapse button bool hover = current->input_x > wx + nx && current->input_x < wx + nx + ui_p(20) && current->input_y > wy + ny && current->input_y < wy + ny + ui_p(20); if (hover && current->input_started) { - node->flags ^= NODE_FLAG_COLLAPSED; + node->flags ^= UI_NODE_FLAG_COLLAPSED; } draw_set_color(hover ? current->ops->theme->LABEL_COL : current->ops->theme->HOVER_COL); int bx = nx + ui_p(4); @@ -784,7 +784,7 @@ void ui_node_draw(ui_node_t *node, ui_node_canvas_t *canvas) { // Eye button hover = current->input_x > wx + nx + w - ui_p(20) && current->input_x < wx + nx + w && current->input_y > wy + ny && current->input_y < wy + ny + ui_p(20); if (hover && current->input_started) { - node->flags ^= NODE_FLAG_PREVIEW; + node->flags ^= UI_NODE_FLAG_PREVIEW; } draw_set_color(hover ? current->ops->theme->LABEL_COL : current->ops->theme->HOVER_COL); float ex = nx + w - ui_p(10); @@ -809,7 +809,7 @@ void ui_node_draw(ui_node_t *node, ui_node_canvas_t *canvas) { draw_string(text, nx + ui_p(20), ny + ui_p(6)); ny += lineh * 0.5; - if (!(node->flags & NODE_FLAG_COLLAPSED)) { + if (!(node->flags & UI_NODE_FLAG_COLLAPSED)) { bool _changed = current->changed; current->changed = false; ui_node_draw_body(node, canvas, nx, ny); @@ -973,7 +973,7 @@ void ui_node_canvas(ui_nodes_t *nodes, ui_node_canvas_t *canvas) { ui_node_t *node = canvas->nodes->buffer[i]; // Cull - float preview_h = (node->flags & NODE_FLAG_PREVIEW) ? UI_NODE_W(node) : 0.0; + float preview_h = (node->flags & UI_NODE_FLAG_PREVIEW) ? UI_NODE_W(node) : 0.0; if (UI_NODE_X(node) > current->_window_w || UI_NODE_X(node) + UI_NODE_W(node) < 0 || UI_NODE_Y(node) - preview_h > current->_window_h || UI_NODE_Y(node) + UI_NODE_H(canvas, node) < 0) { if (!ui_is_selected(node)) { @@ -1022,7 +1022,7 @@ void ui_node_canvas(ui_nodes_t *nodes, ui_node_canvas_t *canvas) { } } - if (current->input_started && !(node->flags & NODE_FLAG_COLLAPSED) && + if (current->input_started && !(node->flags & UI_NODE_FLAG_COLLAPSED) && ui_input_in_rect(wx + UI_NODE_X(node) - UI_LINE_H() / 2, wy + UI_NODE_Y(node) - UI_LINE_H() / 2, UI_NODE_W(node) + UI_LINE_H(), node_h + UI_LINE_H())) { // Check sockets @@ -1353,7 +1353,7 @@ void ui_node_canvas(ui_nodes_t *nodes, ui_node_canvas_t *canvas) { int nid = current_nodes->nodes_selected_id->buffer[i--]; ui_node_t *n = ui_get_node(canvas->nodes, nid); if (ui_is_node_type_excluded(n->type)) { - n->flags ^= NODE_FLAG_COLLAPSED; + n->flags ^= UI_NODE_FLAG_COLLAPSED; continue; } ui_remove_node(n, canvas); diff --git a/base/sources/iron_ui_nodes.h b/base/sources/iron_ui_nodes.h index 914e1737..8ab1e983 100644 --- a/base/sources/iron_ui_nodes.h +++ b/base/sources/iron_ui_nodes.h @@ -48,9 +48,9 @@ typedef struct ui_node_button_array { } ui_node_button_array_t; typedef enum ui_node_flag { - NODE_FLAG_NONE = 0, - NODE_FLAG_COLLAPSED = 1, - NODE_FLAG_PREVIEW = 2, + UI_NODE_FLAG_NONE = 0, + UI_NODE_FLAG_COLLAPSED = 1, + UI_NODE_FLAG_PREVIEW = 2, } ui_node_flag_t; typedef struct ui_node { diff --git a/base/sources/libs/gc.c b/base/sources/libs/gc.c index 7a430ee9..b8761579 100644 --- a/base/sources/libs/gc.c +++ b/base/sources/libs/gc.c @@ -251,7 +251,7 @@ static void *gc_allocate(size_t count, size_t size) { /* Allocation logic that generalizes over malloc/calloc */ /* Check if we reached the high-water mark and need to clean up */ if (gc->allocs->size > gc->allocs->sweep_limit && !gc->paused) { - size_t freed_mem = _gc_run(); + _gc_run(); } /* With cleanup out of the way, attempt to allocate memory */ void *ptr = gc_mcalloc(count, size); diff --git a/base/sources/ts/iron.ts b/base/sources/ts/iron.ts index 67a1f43a..c1a70a08 100644 --- a/base/sources/ts/iron.ts +++ b/base/sources/ts/iron.ts @@ -277,7 +277,7 @@ declare function gpu_viewport(x: i32, y: i32, width: i32, height: i32): void; declare function gpu_scissor(x: i32, y: i32, width: i32, height: i32): void; declare function gpu_disable_scissor(): void; declare function _gpu_begin(render_target: gpu_texture_t, additional: gpu_texture_t[] = null, depth_buffer: gpu_texture_t = null, - flags: clear_flag_t = clear_flag_t.NONE, color: i32 = 0, depth: f32 = 0.0): void; + flags: gpu_clear_t = gpu_clear_t.NONE, color: i32 = 0, depth: f32 = 0.0): void; declare function gpu_end(): void; declare function gpu_present(): void; declare function iron_file_save_bytes(path: string, bytes: buffer_t, length: i32 = 0): void; @@ -586,7 +586,7 @@ declare type gpu_buffer_t = { impl?: any; }; -enum clear_flag_t { +declare enum gpu_clear_t { NONE = 0, COLOR = 1, DEPTH = 2, @@ -882,18 +882,18 @@ declare type ui_nodes_t = { link_drag_id?: i32; }; -enum ui_layout_t { +declare enum ui_layout_t { VERTICAL, HORIZONTAL, } -enum ui_align_t { +declare enum ui_align_t { LEFT, CENTER, RIGHT, } -enum ui_state_t { +declare enum ui_state_t { IDLE, STARTED, DOWN, @@ -901,7 +901,7 @@ enum ui_state_t { HOVERED, } -enum _ui_node_flag_t { +declare enum ui_node_flag_t { NONE = 0, COLLAPSED = 1, PREVIEW = 2, diff --git a/base/sources/ts/render_path.ts b/base/sources/ts/render_path.ts index 68001b37..f9c9b7ed 100644 --- a/base/sources/ts/render_path.ts +++ b/base/sources/ts/render_path.ts @@ -64,7 +64,7 @@ function render_path_render_frame() { _render_path_frame++; } -function render_path_set_target(target: string, additional: string[] = null, depth_buffer: string = null, flags: clear_flag_t = clear_flag_t.NONE, +function render_path_set_target(target: string, additional: string[] = null, depth_buffer: string = null, flags: gpu_clear_t = gpu_clear_t.NONE, color: i32 = 0, depth: f32 = 0.0) { if (_render_path_current_image != null) { render_path_end(); diff --git a/base/tests/cube/sources/main.ts b/base/tests/cube/sources/main.ts index db7c90d4..afaff93c 100644 --- a/base/tests/cube/sources/main.ts +++ b/base/tests/cube/sources/main.ts @@ -18,7 +18,7 @@ function main() { } function render_commands() { - render_path_set_target("", null, null, clear_flag_t.COLOR | clear_flag_t.DEPTH, 0xff6495ed, 1.0); + render_path_set_target("", null, null, gpu_clear_t.COLOR | gpu_clear_t.DEPTH, 0xff6495ed, 1.0); render_path_draw_meshes("mesh"); } diff --git a/base/tests/fall/sources/main.ts b/base/tests/fall/sources/main.ts index fa937018..74ebb448 100644 --- a/base/tests/fall/sources/main.ts +++ b/base/tests/fall/sources/main.ts @@ -22,7 +22,7 @@ function main() { } function render_commands() { - render_path_set_target("", null, null, clear_flag_t.COLOR | clear_flag_t.DEPTH, 0xff6495ed, 1.0); + render_path_set_target("", null, null, gpu_clear_t.COLOR | gpu_clear_t.DEPTH, 0xff6495ed, 1.0); render_path_draw_meshes("mesh"); } diff --git a/base/tests/triangle/main.ts b/base/tests/triangle/main.ts index 4f962976..4c22c43b 100644 --- a/base/tests/triangle/main.ts +++ b/base/tests/triangle/main.ts @@ -7,7 +7,7 @@ let vb: gpu_buffer_t; let ib: gpu_buffer_t; function render() { - _gpu_begin(null, null, null, clear_flag_t.COLOR | clear_flag_t.DEPTH, 0xff000000, 1.0); + _gpu_begin(null, null, null, gpu_clear_t.COLOR | gpu_clear_t.DEPTH, 0xff000000, 1.0); gpu_set_pipeline(pipeline); gpu_set_vertex_buffer(vb); gpu_set_index_buffer(ib); diff --git a/paint/sources/box_preferences.ts b/paint/sources/box_preferences.ts index 9624a53c..79ec30bc 100644 --- a/paint/sources/box_preferences.ts +++ b/paint/sources/box_preferences.ts @@ -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; } } } diff --git a/paint/sources/export_texture.ts b/paint/sources/export_texture.ts index 0ac9123a..6f45218b 100644 --- a/paint/sources/export_texture.ts +++ b/paint/sources/export_texture.ts @@ -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 diff --git a/paint/sources/render_path_base.ts b/paint/sources/render_path_base.ts index 7a61bc90..da204505 100644 --- a/paint/sources/render_path_base.ts +++ b/paint/sources/render_path_base.ts @@ -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; diff --git a/paint/sources/render_path_paint.ts b/paint/sources/render_path_paint.ts index 05536c69..6e6ed2ac 100644 --- a/paint/sources/render_path_paint.ts +++ b/paint/sources/render_path_paint.ts @@ -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(); } diff --git a/paint/sources/render_path_preview.ts b/paint/sources/render_path_preview.ts index 297a5d87..82d8abec 100644 --- a/paint/sources/render_path_preview.ts +++ b/paint/sources/render_path_preview.ts @@ -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"); diff --git a/paint/sources/render_path_raytrace_bake.ts b/paint/sources/render_path_raytrace_bake.ts index 2a1a37d9..6f73cedb 100644 --- a/paint/sources/render_path_raytrace_bake.ts +++ b/paint/sources/render_path_raytrace_bake.ts @@ -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); diff --git a/paint/sources/slot_layer.ts b/paint/sources/slot_layer.ts index 5d711e54..78f9e91b 100644 --- a/paint/sources/slot_layer.ts +++ b/paint/sources/slot_layer.ts @@ -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) { diff --git a/paint/sources/slot_material.ts b/paint/sources/slot_material.ts index 2ae8d76b..4a232f57 100644 --- a/paint/sources/slot_material.ts +++ b/paint/sources/slot_material.ts @@ -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; } } diff --git a/paint/sources/ui_nodes.ts b/paint/sources/ui_nodes.ts index 55e4003f..8c2fb678 100644 --- a/paint/sources/ui_nodes.ts +++ b/paint/sources/ui_nodes.ts @@ -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) { diff --git a/paint/sources/util_uv.ts b/paint/sources/util_uv.ts index 3e53f5e3..6f074a78 100644 --- a/paint/sources/util_uv.ts +++ b/paint/sources/util_uv.ts @@ -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);