luboslenco 11 ay önce
ebeveyn
işleme
e922ef9447

+ 1 - 2
armorlab/plugins/plugins.c

@@ -1,8 +1,7 @@
 
 #include "../../../base/sources/plugin_api.h"
 #include "iron_array.h"
-
-void texsynth_inpaint(int w, int h, void *output_ptr, void *image_ptr, void *mask_ptr, bool tiling);
+#include "proc_texsynth/proc_texsynth.h"
 
 FN(texsynth_inpaint) {
 	int32_t w;

+ 3 - 0
armorlab/plugins/proc_texsynth/proc_texsynth.h

@@ -0,0 +1,3 @@
+#pragma once
+
+void texsynth_inpaint(int w, int h, void *output_ptr, void *image_ptr, void *mask_ptr, bool tiling);

+ 2 - 2
armorlab/sources/nodes/inpaint_node.ts

@@ -1,5 +1,5 @@
 
-declare let iron_texsynth: any;
+///include "../plugins/proc_texsynth/proc_texsynth.h"
 
 type inpaint_node_t = {
 	base?: logic_node_t;
@@ -116,7 +116,7 @@ function inpaint_node_texsynth_inpaint(image: image_t, tiling: bool, mask: image
 	let bytes_img: buffer_t = image_get_pixels(image);
 	let bytes_mask: buffer_t = mask != null ? image_get_pixels(mask) : buffer_create(w * h);
 	let bytes_out: buffer_t = buffer_create(w * h * 4);
-	// texsynth_inpaint(w, h, bytes_out, bytes_img, bytes_mask, tiling);
+	texsynth_inpaint(w, h, bytes_out.buffer, bytes_img.buffer, bytes_mask.buffer, tiling);
 
 	inpaint_node_result = image_from_bytes(bytes_out, w, h);
 	return inpaint_node_result;

+ 2 - 2
armorlab/sources/render_path_paint.ts

@@ -165,7 +165,7 @@ function render_path_paint_commands_cursor() {
 
 	let nodes: ui_nodes_t = ui_nodes_get_nodes();
 	let canvas: ui_node_canvas_t = ui_nodes_get_canvas(true);
-	let inpaint: bool = nodes.nodes_selected_id.length > 0 && ui_get_node(canvas.nodes, nodes.nodes_selected_id[0]).type == "InpaintNode";
+	let inpaint: bool = nodes.nodes_selected_id.length > 0 && ui_get_node(canvas.nodes, nodes.nodes_selected_id[0]).type == "inpaint_node";
 
 	if (!base_ui_enabled || base_is_dragging || !inpaint) {
 		return;
@@ -302,7 +302,7 @@ function render_path_paint_bind_layers() {
 		let nodes: ui_nodes_t = ui_nodes_get_nodes();
 		let canvas: ui_node_canvas_t = ui_nodes_get_canvas(true);
 		let node: ui_node_t = ui_get_node(canvas.nodes, nodes.nodes_selected_id[0]);
-		let inpaint: bool = node.type == "InpaintNode";
+		let inpaint: bool = node.type == "inpaint_node";
 		if (inpaint) {
 			let texpaint_node_target_rt: render_target_t = map_get(render_path_render_targets, "texpaint_node_target");
 			texpaint_node_target_rt._image = inpaint_node_get_target();

+ 2 - 6
armorlab/sources/ui_nodes_ext.ts

@@ -121,18 +121,14 @@ function ui_nodes_ext_draw_buttons(ew: f32, start_y: f32) {
 	ui._x += ew + 3;
 	ui._y = 2 + start_y;
 
-	base_res_handle.position -= 4;
-
 	///if (arm_android || arm_ios)
-	let base_res_combo: string[] = ["2K", "4K"];
+	let base_res_combo: string[] = ["128", "256", "512", "1K", "2K", "4K"];
 	ui_combo(base_res_handle, base_res_combo, tr("Resolution"));
 	///else
-	let base_res_combo: string[] = ["2K", "4K", "8K", "16K"];
+	let base_res_combo: string[] = ["128", "256", "512", "1K", "2K", "4K", "8K", "16K"];
 	ui_combo(base_res_handle, base_res_combo, tr("Resolution"));
 	///end
 
-	base_res_handle.position += 4;
-
 	if (base_res_handle.changed) {
 		base_on_layers_resized();
 	}

+ 0 - 12
base/sources/box_export.ts

@@ -67,7 +67,6 @@ function box_export_tab_export_textures(ui: ui_t, title: string, bake_material:
 		let row: f32[] = [0.5, 0.5];
 		ui_row(row);
 
-		///if is_paint
 		///if (arm_android || arm_ios)
 		let base_res_combo: string[] = ["128", "256", "512", "1K", "2K", "4K"];
 		ui_combo(base_res_handle, base_res_combo, tr("Resolution"), true);
@@ -75,17 +74,6 @@ function box_export_tab_export_textures(ui: ui_t, title: string, bake_material:
 		let base_res_combo: string[] = ["128", "256", "512", "1K", "2K", "4K", "8K", "16K"];
 		ui_combo(base_res_handle, base_res_combo, tr("Resolution"), true);
 		///end
-		///end
-
-		///if is_lab
-		///if (arm_android || arm_ios)
-		let base_res_combo: string[] = ["2K", "4K"];
-		ui_combo(base_res_handle, base_res_combo, tr("Resolution"), true);
-		///else
-		let base_res_combo: string[] = ["2K", "4K", "8K", "16K"];
-		ui_combo(base_res_handle, base_res_combo, tr("Resolution"), true);
-		///end
-		///end
 
 		if (base_res_handle.changed) {
 			base_on_layers_resized();

+ 0 - 12
base/sources/box_preferences.ts

@@ -425,7 +425,6 @@ function box_preferences_show() {
 				layer_res_handle.position = config_raw.layer_res;
 			}
 
-			///if is_paint
 			///if (arm_android || arm_ios)
 			let layer_res_combo: string[] = ["128", "256", "512", "1K", "2K", "4K"];
 			ui_combo(layer_res_handle, layer_res_combo, tr("Default Layer Resolution"), true);
@@ -433,17 +432,6 @@ function box_preferences_show() {
 			let layer_res_combo: string[] = ["128", "256", "512", "1K", "2K", "4K", "8K"];
 			ui_combo(layer_res_handle, layer_res_combo, tr("Default Layer Resolution"), true);
 			///end
-			///end
-
-			///if is_lab
-			///if (arm_android || arm_ios)
-			let layer_res_combo: string[] = ["2K", "4K"];
-			ui_combo(layer_res_handle, layer_res_combo, tr("Default Layer Resolution"), true);
-			///else
-			let layer_res_combo: string[] = ["2K", "4K", "8K", "16K"];
-			ui_combo(layer_res_handle, layer_res_combo, tr("Default Layer Resolution"), true);
-			///end
-			///end
 
 			if (layer_res_handle.changed) {
 				config_raw.layer_res = layer_res_handle.position;

+ 1 - 1
base/sources/context.ts

@@ -880,7 +880,7 @@ function context_run_brush(from: i32) {
 
 	let nodes: ui_nodes_t = ui_nodes_get_nodes();
 	let canvas: ui_node_canvas_t = ui_nodes_get_canvas(true);
-	let inpaint: bool = nodes.nodes_selected_id.length > 0 && ui_get_node(canvas.nodes, nodes.nodes_selected_id[0]).type == "InpaintNode";
+	let inpaint: bool = nodes.nodes_selected_id.length > 0 && ui_get_node(canvas.nodes, nodes.nodes_selected_id[0]).type == "inpaint_node";
 
 	// Paint bounds
 	if (inpaint &&

+ 1 - 1
base/sources/ui_header.ts

@@ -618,7 +618,7 @@ function ui_header_draw_tool_properties(ui: ui_t) {
 
 		let nodes: ui_nodes_t = ui_nodes_get_nodes();
 		let canvas: ui_node_canvas_t = ui_nodes_get_canvas(true);
-		let inpaint: bool = nodes.nodes_selected_id.length > 0 && ui_get_node(canvas.nodes, nodes.nodes_selected_id[0]).type == "InpaintNode";
+		let inpaint: bool = nodes.nodes_selected_id.length > 0 && ui_get_node(canvas.nodes, nodes.nodes_selected_id[0]).type == "inpaint_node";
 		if (inpaint) {
 			context_raw.brush_radius = ui_slider(context_raw.brush_radius_handle, tr("Radius"), 0.01, 2.0, true);
 			if (ui.is_hovered) {