From af075de9bc4e5db372268d7a86a0ff293bfdd848 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Sat, 12 Jul 2025 14:27:51 +0200 Subject: [PATCH] Cleanup --- armorlab/sources/render_path_paint.ts | 2 -- armorpaint/sources/render_path_paint.ts | 2 -- base/sources/ts/iron/render_path.ts | 22 +--------------------- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/armorlab/sources/render_path_paint.ts b/armorlab/sources/render_path_paint.ts index 9fa0c968..6bb3a9b9 100644 --- a/armorlab/sources/render_path_paint.ts +++ b/armorlab/sources/render_path_paint.ts @@ -192,8 +192,6 @@ function render_path_paint_draw_cursor(mx: f32, my: f32, radius: f32, tint_r: f3 gpu_set_vertex_buffer(geom._.vertex_buffer); gpu_set_index_buffer(geom._.index_buffers[0]); gpu_draw(); - - gpu_disable_scissor(); render_path_end(); } diff --git a/armorpaint/sources/render_path_paint.ts b/armorpaint/sources/render_path_paint.ts index b2550d0b..93806ee0 100644 --- a/armorpaint/sources/render_path_paint.ts +++ b/armorpaint/sources/render_path_paint.ts @@ -455,8 +455,6 @@ function render_path_paint_draw_cursor(mx: f32, my: f32, radius: f32, tint_r: f3 gpu_set_vertex_buffer(geom._.vertex_buffer); gpu_set_index_buffer(geom._.index_buffers[0]); gpu_draw(); - - gpu_disable_scissor(); render_path_end(); } diff --git a/base/sources/ts/iron/render_path.ts b/base/sources/ts/iron/render_path.ts index 1f6b6c46..c15dcd57 100644 --- a/base/sources/ts/iron/render_path.ts +++ b/base/sources/ts/iron/render_path.ts @@ -33,7 +33,6 @@ let _render_path_last_w: i32 = 0; let _render_path_last_h: i32 = 0; let _render_path_bind_params: string[]; let _render_path_meshes_sorted: bool; -let _render_path_scissor_set: bool = false; let _render_path_last_frame_time: f32 = 0.0; let _render_path_loading: i32 = 0; let _render_path_cached_shader_contexts: map_t = map_create(); @@ -75,8 +74,7 @@ function render_path_set_target(target: string, additional: string[] = null, dep render_path_current_w = sys_w(); render_path_current_h = sys_h(); _gpu_begin(null, null, null, flags, color, depth); - render_path_set_current_viewport(sys_w(), sys_h()); - render_path_set_current_scissor(sys_w(), sys_h()); + gpu_viewport(sys_x(), render_path_current_h - (sys_h() - sys_y()), sys_w(), sys_h()); } else { // Render target let rt: render_target_t = map_get(render_path_render_targets, target); @@ -100,29 +98,11 @@ function render_path_set_target(target: string, additional: string[] = null, dep } function render_path_end() { - if (_render_path_scissor_set) { - gpu_disable_scissor(); - _render_path_scissor_set = false; - } gpu_end(); _render_path_current_image = null; _render_path_bind_params = null; } -function render_path_set_current_viewport(view_w: i32, view_h: i32) { - gpu_viewport(sys_x(),render_path_current_h - (view_h - sys_y()), view_w, view_h); -} - -function render_path_set_current_scissor(view_w: i32, view_h: i32) { - gpu_scissor(sys_x(),render_path_current_h - (view_h - sys_y()), view_w, view_h); - _render_path_scissor_set = true; -} - -function render_path_set_viewport(view_w: i32, view_h: i32) { - render_path_set_current_viewport(view_w, view_h); - render_path_set_current_scissor(view_w, view_h); -} - function _render_path_sort_dist(a: any_ptr, b: any_ptr): i32 { let ma: mesh_object_t = DEREFERENCE(a); let mb: mesh_object_t = DEREFERENCE(b);