From 14e01de285f97505ea5ac7e390e7bb7783bbb61d Mon Sep 17 00:00:00 2001 From: luboslenco Date: Fri, 6 Sep 2024 21:11:46 +0200 Subject: [PATCH] Defines cleanup --- armorlab/sources/make_material.ts | 2 +- armorlab/sources/make_mesh.ts | 2 +- armorlab/sources/make_paint.ts | 20 ++++---- armorlab/sources/nodes/photo_to_pbr_node.ts | 4 +- armorlab/sources/render_path_paint.ts | 8 ++-- armorlab/sources/ui_nodes_ext.ts | 4 +- armorpaint/sources/make_bake.ts | 2 +- armorpaint/sources/make_blur.ts | 8 ++-- armorpaint/sources/make_brush.ts | 6 +-- armorpaint/sources/make_clone.ts | 2 +- armorpaint/sources/make_colorid_picker.ts | 2 +- armorpaint/sources/make_discard.ts | 8 ++-- armorpaint/sources/make_material.ts | 2 +- armorpaint/sources/make_mesh.ts | 8 ++-- armorpaint/sources/make_mesh_preview.ts | 2 +- armorpaint/sources/make_node_preview.ts | 2 +- armorpaint/sources/make_paint.ts | 12 ++--- armorpaint/sources/make_particle.ts | 2 +- armorpaint/sources/render_path_paint.ts | 12 ++--- armorpaint/sources/render_path_preview.ts | 10 ++-- armorpaint/sources/slot_material.ts | 2 +- armorpaint/sources/tab_layers.ts | 12 ++--- armorsculpt/sources/import_mesh.ts | 2 +- armorsculpt/sources/make_brush.ts | 4 +- armorsculpt/sources/make_mesh.ts | 6 +-- armorsculpt/sources/make_mesh_preview.ts | 2 +- armorsculpt/sources/make_sculpt.ts | 2 +- base/sources/base.ts | 52 ++++++++++----------- base/sources/box_export.ts | 14 +++--- base/sources/box_preferences.ts | 10 ++-- base/sources/box_projects.ts | 12 ++--- base/sources/config.ts | 10 ++-- base/sources/context.ts | 16 +++---- base/sources/export_arm.ts | 30 ++++++------ base/sources/export_texture.ts | 8 ++-- base/sources/file.ts | 22 ++++----- base/sources/history.ts | 2 +- base/sources/import_arm.ts | 14 +++--- base/sources/import_asset.ts | 2 +- base/sources/import_envmap.ts | 2 +- base/sources/import_mesh.ts | 4 +- base/sources/make_voxel.ts | 2 +- base/sources/node_shader.ts | 16 +++---- base/sources/parser_material.ts | 14 +++--- base/sources/path.ts | 10 ++-- base/sources/project.ts | 16 +++---- base/sources/render_path_base.ts | 14 +++--- base/sources/render_path_deferred.ts | 6 +-- base/sources/render_path_raytrace.ts | 12 ++--- base/sources/render_path_raytrace_bake.ts | 4 +- base/sources/strings.ts | 10 ++-- base/sources/tab_browser.ts | 8 ++-- base/sources/tab_console.ts | 4 +- base/sources/tab_fonts.ts | 2 +- base/sources/tab_materials.ts | 4 +- base/sources/tab_meshes.ts | 2 +- base/sources/tab_swatches.ts | 4 +- base/sources/ui_base.ts | 22 ++++----- base/sources/ui_box.ts | 16 +++---- base/sources/ui_files.ts | 18 +++---- base/sources/ui_header.ts | 12 ++--- base/sources/ui_menu.ts | 18 +++---- base/sources/ui_menubar.ts | 4 +- base/sources/ui_nodes.ts | 4 +- base/sources/ui_view2d.ts | 6 +-- base/sources/util_mesh.ts | 6 +-- base/sources/util_render.ts | 4 +- base/sources/util_uv.ts | 4 +- base/tools/pad/sources/main.ts | 2 +- 69 files changed, 295 insertions(+), 295 deletions(-) diff --git a/armorlab/sources/make_material.ts b/armorlab/sources/make_material.ts index 4b7b4b8c..31a77ec1 100644 --- a/armorlab/sources/make_material.ts +++ b/armorlab/sources/make_material.ts @@ -42,7 +42,7 @@ function make_material_parse_mesh_material() { make_material_make_voxel(m); ///end - ///if (iron_direct3d12 || iron_vulkan) + ///if (arm_direct3d12 || arm_vulkan) render_path_raytrace_dirty = 1; ///end } diff --git a/armorlab/sources/make_mesh.ts b/armorlab/sources/make_mesh.ts index 4a35146c..f8109c20 100644 --- a/armorlab/sources/make_mesh.ts +++ b/armorlab/sources/make_mesh.ts @@ -148,7 +148,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte } frag.vvec = true; - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "mat3 TBN = cotangent_frame(n, vvec, tex_coord);"); ///else node_shader_write(frag, "mat3 TBN = cotangent_frame(n, -vvec, tex_coord);"); diff --git a/armorlab/sources/make_paint.ts b/armorlab/sources/make_paint.ts index 32a287bc..2b406806 100644 --- a/armorlab/sources/make_paint.ts +++ b/armorlab/sources/make_paint.ts @@ -51,7 +51,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad node_shader_add_uniform(frag, "vec2 gbuffer_size", "_gbuffer_size"); node_shader_add_uniform(frag, "vec4 inp", "_input_brush"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(inp.x * gbuffer_size.x, inp.y * gbuffer_size.y), 0).ba;"); ///else node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(inp.x * gbuffer_size.x, (1.0 - inp.y) * gbuffer_size.y), 0).ba;"); @@ -71,7 +71,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad return con_paint; } - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(vert, "vec2 tpos = vec2(tex.x * 2.0 - 1.0, (1.0 - tex.y) * 2.0 - 1.0);"); // node_shader_write(vert, "vec2 tpos = vec2(frac(tex.x * tex_scale) * 2.0 - 1.0, (1.0 - frac(tex.y * tex_scale)) * 2.0 - 1.0);"); // 3D View ///else @@ -111,7 +111,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad node_shader_write(frag, "float dist = 0.0;"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "float depth = textureLod(gbufferD, inp.xy, 0.0).r;"); ///else node_shader_write(frag, "float depth = textureLod(gbufferD, vec2(inp.x, 1.0 - inp.y), 0.0).r;"); @@ -123,7 +123,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad node_shader_write(frag, "winp.xyz /= winp.w;"); frag.wposition = true; - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "float depthlast = textureLod(gbufferD, inplast.xy, 0.0).r;"); ///else node_shader_write(frag, "float depthlast = textureLod(gbufferD, vec2(inplast.x, 1.0 - inplast.y), 0.0).r;"); @@ -157,7 +157,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad if (context_raw.tool == workspace_tool_t.CLONE) { // node_shader_add_uniform(frag, "vec2 clone_delta", "_clone_delta"); - // ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + // ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) // node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2((sp.xy + clone_delta) * gbuffer_size), 0).ba;"); // ///else // node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2((sp.x + clone_delta.x) * gbuffer_size.x, (1.0 - (sp.y + clone_delta.y)) * gbuffer_size.y), 0).ba;"); @@ -181,7 +181,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad // node_shader_write(frag, "float opacity = mat_opacity * brush_opacity;"); } else { // Blur - // ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + // ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) // node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(sp.x * gbuffer_size.x, sp.y * gbuffer_size.y), 0).ba;"); // ///else // node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(sp.x * gbuffer_size.x, (1.0 - sp.y) * gbuffer_size.y), 0).ba;"); @@ -199,7 +199,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad // node_shader_add_uniform(frag, "vec2 texpaint_size", "_texpaint_size"); // node_shader_write(frag, "float blur_step = 1.0 / texpaint_size.x;"); // if (context_raw.blur_directional) { - // ///if (iron_direct3d11 || iron_direct3d12 || iron_metal) + // ///if (arm_direct3d11 || arm_direct3d12 || arm_metal) // node_shader_write(frag, "const float blur_weight[7] = {1.0 / 28.0, 2.0 / 28.0, 3.0 / 28.0, 4.0 / 28.0, 5.0 / 28.0, 6.0 / 28.0, 7.0 / 28.0};"); // ///else // node_shader_write(frag, "const float blur_weight[7] = float[](1.0 / 28.0, 2.0 / 28.0, 3.0 / 28.0, 4.0 / 28.0, 5.0 / 28.0, 6.0 / 28.0, 7.0 / 28.0);"); @@ -207,7 +207,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad // node_shader_add_uniform(frag, "vec3 brush_direction", "_brush_direction"); // node_shader_write(frag, "vec2 blur_direction = brush_direction.yx;"); // node_shader_write(frag, "for (int i = 0; i < 7; ++i) {"); - // ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + // ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) // node_shader_write(frag, "vec2 tex_coord_inp2 = texelFetch(gbuffer2, ivec2((sp.x + blur_direction.x * blur_step * float(i)) * gbuffer_size.x, (sp.y + blur_direction.y * blur_step * float(i)) * gbuffer_size.y), 0).ba;"); // ///else // node_shader_write(frag, "vec2 tex_coord_inp2 = texelFetch(gbuffer2, ivec2((sp.x + blur_direction.x * blur_step * float(i)) * gbuffer_size.x, (1.0 - (sp.y + blur_direction.y * blur_step * float(i))) * gbuffer_size.y), 0).ba;"); @@ -224,7 +224,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad // node_shader_write(frag, "}"); // } // else { - // ///if (iron_direct3d11 || iron_direct3d12 || iron_metal) + // ///if (arm_direct3d11 || arm_direct3d12 || arm_metal) // node_shader_write(frag, "const float blur_weight[15] = {0.034619 / 2.0, 0.044859 / 2.0, 0.055857 / 2.0, 0.066833 / 2.0, 0.076841 / 2.0, 0.084894 / 2.0, 0.090126 / 2.0, 0.09194 / 2.0, 0.090126 / 2.0, 0.084894 / 2.0, 0.076841 / 2.0, 0.066833 / 2.0, 0.055857 / 2.0, 0.044859 / 2.0, 0.034619 / 2.0};"); // ///else // node_shader_write(frag, "const float blur_weight[15] = float[](0.034619 / 2.0, 0.044859 / 2.0, 0.055857 / 2.0, 0.066833 / 2.0, 0.076841 / 2.0, 0.084894 / 2.0, 0.090126 / 2.0, 0.09194 / 2.0, 0.090126 / 2.0, 0.084894 / 2.0, 0.076841 / 2.0, 0.066833 / 2.0, 0.055857 / 2.0, 0.044859 / 2.0, 0.034619 / 2.0);"); @@ -266,7 +266,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad // Manual blending to preserve memory frag.wvpposition = true; node_shader_write(frag, "vec2 sample_tc = vec2(wvpposition.xy / wvpposition.w) * 0.5 + 0.5;"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "sample_tc.y = 1.0 - sample_tc.y;"); ///end node_shader_add_uniform(frag, "sampler2D paintmask"); diff --git a/armorlab/sources/nodes/photo_to_pbr_node.ts b/armorlab/sources/nodes/photo_to_pbr_node.ts index 946461b9..0935627f 100644 --- a/armorlab/sources/nodes/photo_to_pbr_node.ts +++ b/armorlab/sources/nodes/photo_to_pbr_node.ts @@ -147,7 +147,7 @@ function photo_to_pbr_node_get_as_image(self: photo_to_pbr_node_t, from: i32): i } } - ///if (iron_metal || iron_vulkan) + ///if (arm_metal || arm_vulkan) if (from == channel_type_t.BASE_COLOR) { photo_to_pbr_node_bgra_swap(u8a.buffer); } @@ -165,7 +165,7 @@ function photo_to_pbr_node_get_as_image(self: photo_to_pbr_node_t, from: i32): i return photo_to_pbr_node_images[from]; } -///if (iron_metal || iron_vulkan) +///if (arm_metal || arm_vulkan) function photo_to_pbr_node_bgra_swap(buffer: buffer_t) { let u8a: buffer_t = buffer; for (let i: i32 = 0; i < math_floor(buffer.length / 4); ++i) { diff --git a/armorlab/sources/render_path_paint.ts b/armorlab/sources/render_path_paint.ts index 86fe5ab9..060bbd7c 100644 --- a/armorlab/sources/render_path_paint.ts +++ b/armorlab/sources/render_path_paint.ts @@ -62,7 +62,7 @@ function render_path_paint_commands_paint(dilation: bool = true) { if (context_raw.tool == workspace_tool_t.PICKER) { - ///if iron_metal + ///if arm_metal // render_path_set_target("texpaint_picker"); // render_path_clear_target(0xff000000); // render_path_set_target("texpaint_nor_picker"); @@ -96,7 +96,7 @@ function render_path_paint_commands_paint(dilation: bool = true) { } // Picked surface values - // ///if (iron_metal || iron_vulkan) + // ///if (arm_metal || arm_vulkan) // context_raw.pickedColor.base.Rb = a.get(2); // context_raw.pickedColor.base.Gb = a.get(1); // context_raw.pickedColor.base.Bb = a.get(0); @@ -202,7 +202,7 @@ function render_path_paint_draw_cursor(mx: f32, my: f32, radius: f32, tint_r: f3 let help_mat: mat4_t = mat4_identity(); mat4_get_inv(help_mat, scene_camera.vp); g4_set_mat(base_cursor_inv_vp, help_mat); - ///if (iron_metal || iron_vulkan) + ///if (arm_metal || arm_vulkan) let vs: vertex_structure_t[] = [{name: "tex", data: "short2norm"}]; g4_set_vertex_buffer(mesh_data_get(geom, vs)); ///else @@ -245,7 +245,7 @@ function render_path_paint_draw() { if (context_raw.brush_blend_dirty) { context_raw.brush_blend_dirty = false; - ///if iron_metal + ///if arm_metal render_path_set_target("texpaint_blend0"); render_path_clear_target(0x00000000); render_path_set_target("texpaint_blend1"); diff --git a/armorlab/sources/ui_nodes_ext.ts b/armorlab/sources/ui_nodes_ext.ts index 1740793b..1a4286fc 100644 --- a/armorlab/sources/ui_nodes_ext.ts +++ b/armorlab/sources/ui_nodes_ext.ts @@ -114,14 +114,14 @@ function ui_nodes_ext_draw_buttons(ew: f32, start_y: f32) { context_raw.ddirty = 2; app_remove_render_2d(ui_nodes_ext_delay_idle_sleep); - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_ready = false; ///end } ui._x += ew + 3; ui._y = 2 + start_y; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) let base_res_combo: string[] = ["2K", "4K"]; ui_combo(base_res_handle, base_res_combo, tr("Resolution")); ///else diff --git a/armorpaint/sources/make_bake.ts b/armorpaint/sources/make_bake.ts index fc30d5a7..f89a5a0f 100644 --- a/armorpaint/sources/make_bake.ts +++ b/armorpaint/sources/make_bake.ts @@ -7,7 +7,7 @@ function make_bake_run(con: node_shader_context_t, vert: node_shader_t, frag: no frag.n = true; frag.vvec = true; node_shader_add_function(frag, str_cotangent_frame); - ///if iron_direct3d11 + ///if arm_direct3d11 node_shader_write(frag, "mat3 TBN = cotangent_frame(n, vvec, tex_coord);"); ///else node_shader_write(frag, "mat3 TBN = cotangent_frame(n, -vvec, tex_coord);"); diff --git a/armorpaint/sources/make_blur.ts b/armorpaint/sources/make_blur.ts index dcb669f9..9269290b 100644 --- a/armorpaint/sources/make_blur.ts +++ b/armorpaint/sources/make_blur.ts @@ -1,6 +1,6 @@ function make_blur_run(vert: node_shader_t, frag: node_shader_t) { - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(sp.x * gbuffer_size.x, sp.y * gbuffer_size.y), 0).ba;"); ///else node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(sp.x * gbuffer_size.x, (1.0 - sp.y) * gbuffer_size.y), 0).ba;"); @@ -30,7 +30,7 @@ function make_blur_run(vert: node_shader_t, frag: node_shader_t) { node_shader_add_uniform(frag, "vec2 texpaint_size", "_texpaint_size"); node_shader_write(frag, "float blur_step = 1.0 / texpaint_size.x;"); if (context_raw.tool == workspace_tool_t.SMUDGE) { - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal) node_shader_write(frag, "const float blur_weight[7] = {1.0 / 28.0, 2.0 / 28.0, 3.0 / 28.0, 4.0 / 28.0, 5.0 / 28.0, 6.0 / 28.0, 7.0 / 28.0};"); ///else node_shader_write(frag, "const float blur_weight[7] = float[](1.0 / 28.0, 2.0 / 28.0, 3.0 / 28.0, 4.0 / 28.0, 5.0 / 28.0, 6.0 / 28.0, 7.0 / 28.0);"); @@ -38,7 +38,7 @@ function make_blur_run(vert: node_shader_t, frag: node_shader_t) { node_shader_add_uniform(frag, "vec3 brush_direction", "_brush_direction"); node_shader_write(frag, "vec2 blur_direction = brush_direction.yx;"); node_shader_write(frag, "for (int i = 0; i < 7; ++i) {"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "vec2 tex_coord_inp2 = texelFetch(gbuffer2, ivec2((sp.x + blur_direction.x * blur_step * float(i)) * gbuffer_size.x, (sp.y + blur_direction.y * blur_step * float(i)) * gbuffer_size.y), 0).ba;"); ///else node_shader_write(frag, "vec2 tex_coord_inp2 = texelFetch(gbuffer2, ivec2((sp.x + blur_direction.x * blur_step * float(i)) * gbuffer_size.x, (1.0 - (sp.y + blur_direction.y * blur_step * float(i))) * gbuffer_size.y), 0).ba;"); @@ -55,7 +55,7 @@ function make_blur_run(vert: node_shader_t, frag: node_shader_t) { node_shader_write(frag, "}"); } else { - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal) node_shader_write(frag, "const float blur_weight[15] = {0.034619 / 2.0, 0.044859 / 2.0, 0.055857 / 2.0, 0.066833 / 2.0, 0.076841 / 2.0, 0.084894 / 2.0, 0.090126 / 2.0, 0.09194 / 2.0, 0.090126 / 2.0, 0.084894 / 2.0, 0.076841 / 2.0, 0.066833 / 2.0, 0.055857 / 2.0, 0.044859 / 2.0, 0.034619 / 2.0};"); ///else node_shader_write(frag, "const float blur_weight[15] = float[](0.034619 / 2.0, 0.044859 / 2.0, 0.055857 / 2.0, 0.066833 / 2.0, 0.076841 / 2.0, 0.084894 / 2.0, 0.090126 / 2.0, 0.09194 / 2.0, 0.090126 / 2.0, 0.084894 / 2.0, 0.076841 / 2.0, 0.066833 / 2.0, 0.055857 / 2.0, 0.044859 / 2.0, 0.034619 / 2.0);"); diff --git a/armorpaint/sources/make_brush.ts b/armorpaint/sources/make_brush.ts index 6be6ad6d..148bcbe1 100644 --- a/armorpaint/sources/make_brush.ts +++ b/armorpaint/sources/make_brush.ts @@ -14,7 +14,7 @@ function make_brush_run(vert: node_shader_t, frag: node_shader_t) { } if (config_raw.brush_3d) { - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "float depth = textureLod(gbufferD, inp.xy, 0.0).r;"); ///else node_shader_write(frag, "float depth = textureLod(gbufferD, vec2(inp.x, 1.0 - inp.y), 0.0).r;"); @@ -29,7 +29,7 @@ function make_brush_run(vert: node_shader_t, frag: node_shader_t) { if (config_raw.brush_angle_reject || context_raw.xray) { node_shader_add_function(frag, str_octahedron_wrap); node_shader_add_uniform(frag, "sampler2D gbuffer0"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "vec2 g0 = textureLod(gbuffer0, inp.xy, 0.0).rg;"); ///else node_shader_write(frag, "vec2 g0 = textureLod(gbuffer0, vec2(inp.x, 1.0 - inp.y), 0.0).rg;"); @@ -48,7 +48,7 @@ function make_brush_run(vert: node_shader_t, frag: node_shader_t) { } } - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "float depthlast = textureLod(gbufferD, inplast.xy, 0.0).r;"); ///else node_shader_write(frag, "float depthlast = textureLod(gbufferD, vec2(inplast.x, 1.0 - inplast.y), 0.0).r;"); diff --git a/armorpaint/sources/make_clone.ts b/armorpaint/sources/make_clone.ts index 5b7ea9b9..24470ecd 100644 --- a/armorpaint/sources/make_clone.ts +++ b/armorpaint/sources/make_clone.ts @@ -1,7 +1,7 @@ function make_clone_run(vert: node_shader_t, frag: node_shader_t) { node_shader_add_uniform(frag, "vec2 clone_delta", "_clone_delta"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2((sp.xy + clone_delta) * gbuffer_size), 0).ba;"); ///else node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2((sp.x + clone_delta.x) * gbuffer_size.x, (1.0 - (sp.y + clone_delta.y)) * gbuffer_size.y), 0).ba;"); diff --git a/armorpaint/sources/make_colorid_picker.ts b/armorpaint/sources/make_colorid_picker.ts index 19a1efb7..8a152306 100644 --- a/armorpaint/sources/make_colorid_picker.ts +++ b/armorpaint/sources/make_colorid_picker.ts @@ -7,7 +7,7 @@ function make_colorid_picker_run(vert: node_shader_t, frag: node_shader_t) { node_shader_add_uniform(frag, "vec2 gbuffer_size", "_gbuffer_size"); node_shader_add_uniform(frag, "vec4 inp", "_input_brush"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(inp.x * gbuffer_size.x, inp.y * gbuffer_size.y), 0).ba;"); ///else node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(inp.x * gbuffer_size.x, (1.0 - inp.y) * gbuffer_size.y), 0).ba;"); diff --git a/armorpaint/sources/make_discard.ts b/armorpaint/sources/make_discard.ts index e4771a01..7531deb7 100644 --- a/armorpaint/sources/make_discard.ts +++ b/armorpaint/sources/make_discard.ts @@ -4,7 +4,7 @@ function make_discard_color_id(vert: node_shader_t, frag: node_shader_t) { node_shader_add_uniform(frag, "sampler2D texcolorid", "_texcolorid"); // color map node_shader_write(frag, "vec3 colorid_c1 = texelFetch(texpaint_colorid, ivec2(0, 0), 0).rgb;"); node_shader_write(frag, "vec3 colorid_c2 = textureLod(texcolorid, tex_coord_pick, 0).rgb;"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal) node_shader_write(frag, "if (any(colorid_c1 != colorid_c2)) discard;"); ///else node_shader_write(frag, "if (colorid_c1 != colorid_c2) discard;"); @@ -16,14 +16,14 @@ function make_discard_face(vert: node_shader_t, frag: node_shader_t) { node_shader_add_uniform(frag, "sampler2D textrianglemap", "_textrianglemap"); node_shader_add_uniform(frag, "vec2 textrianglemap_size", "_texpaint_size"); node_shader_add_uniform(frag, "vec2 gbuffer_size", "_gbuffer_size"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(inp.x * gbuffer_size.x, inp.y * gbuffer_size.y), 0).ba;"); ///else node_shader_write(frag, "vec2 tex_coord_inp = texelFetch(gbuffer2, ivec2(inp.x * gbuffer_size.x, (1.0 - inp.y) * gbuffer_size.y), 0).ba;"); ///end node_shader_write(frag, "vec4 face_c1 = texelFetch(textrianglemap, ivec2(tex_coord_inp * textrianglemap_size), 0);"); node_shader_write(frag, "vec4 face_c2 = textureLod(textrianglemap, tex_coord_pick, 0);"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal) node_shader_write(frag, "if (any(face_c1 != face_c2)) discard;"); ///else node_shader_write(frag, "if (face_c1 != face_c2) discard;"); @@ -38,7 +38,7 @@ function make_discard_uv_island(vert: node_shader_t, frag: node_shader_t) { function make_discard_material_id(vert: node_shader_t, frag: node_shader_t) { frag.wvpposition = true; node_shader_write(frag, "vec2 picker_sample_tc = vec2(wvpposition.x / wvpposition.w, wvpposition.y / wvpposition.w) * 0.5 + 0.5;"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "picker_sample_tc.y = 1.0 - picker_sample_tc.y;"); ///end node_shader_add_uniform(frag, "sampler2D texpaint_nor_undo", "_texpaint_nor_undo"); diff --git a/armorpaint/sources/make_material.ts b/armorpaint/sources/make_material.ts index ea64ede4..a015cf88 100644 --- a/armorpaint/sources/make_material.ts +++ b/armorpaint/sources/make_material.ts @@ -104,7 +104,7 @@ function make_material_parse_mesh_material() { make_material_make_voxel(m); ///end - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_dirty = 1; ///end } diff --git a/armorpaint/sources/make_mesh.ts b/armorpaint/sources/make_mesh.ts index 7c37719f..56a4d147 100644 --- a/armorpaint/sources/make_mesh.ts +++ b/armorpaint/sources/make_mesh.ts @@ -101,7 +101,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte node_shader_add_uniform(frag, "sampler2D gbuffer1"); node_shader_add_uniform(frag, "sampler2D gbuffer2"); node_shader_write(frag, "vec2 fragcoord = (wvpposition.xy / wvpposition.w) * 0.5 + 0.5;"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "fragcoord.y = 1.0 - fragcoord.y;"); ///end node_shader_write(frag, "vec4 gbuffer0_sample = textureLod(gbuffer0, fragcoord, 0.0);"); @@ -219,7 +219,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte node_shader_add_shared_sampler(frag, "sampler2D texpaint" + l.id); node_shader_write(frag, "texpaint_sample = textureLodShared(texpaint" + l.id + ", tex_coord, 0.0);"); node_shader_write(frag, "texpaint_opac = texpaint_sample.a;"); - // ///if (iron_direct3d12 || iron_vulkan) + // ///if (arm_direct3d12 || arm_vulkan) // if (raw.viewportMode == ViewLit) { // write(frag, "if (texpaint_opac < 0.1) discard;"); // } @@ -363,7 +363,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte } frag.vvec = true; - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "mat3 TBN = cotangent_frame(n, vvec, tex_coord);"); ///else node_shader_write(frag, "mat3 TBN = cotangent_frame(n, -vvec, tex_coord);"); @@ -531,7 +531,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte } function make_mesh_get_max_textures(): i32 { - ///if iron_direct3d11 + ///if arm_direct3d11 return 128 - 66; ///else return 16 - 3; // G4onG5/G4.c.h MAX_TEXTURES diff --git a/armorpaint/sources/make_mesh_preview.ts b/armorpaint/sources/make_mesh_preview.ts index 90f710cf..cdfa9183 100644 --- a/armorpaint/sources/make_mesh_preview.ts +++ b/armorpaint/sources/make_mesh_preview.ts @@ -131,7 +131,7 @@ function make_mesh_preview_run(data: material_t, matcon: material_context_t): no } else { frag.vvec = true; - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "mat3 TBN = cotangent_frame(n, vvec, tex_coord);"); ///else node_shader_write(frag, "mat3 TBN = cotangent_frame(n, -vvec, tex_coord);"); diff --git a/armorpaint/sources/make_node_preview.ts b/armorpaint/sources/make_node_preview.ts index a3fb8d47..78171180 100644 --- a/armorpaint/sources/make_node_preview.ts +++ b/armorpaint/sources/make_node_preview.ts @@ -37,7 +37,7 @@ function make_node_preview_run(data: material_t, matcon: material_context_t, nod node_shader_write_attrib(vert, "const vec2 madd = vec2(0.5, 0.5);"); node_shader_add_out(vert, "vec2 tex_coord"); node_shader_write_attrib(vert, "tex_coord = gl_Position.xy * madd + madd;"); - ///if (!iron_opengl) + ///if (!arm_opengl) node_shader_write_attrib(vert, "tex_coord.y = 1.0 - tex_coord.y;"); ///end diff --git a/armorpaint/sources/make_paint.ts b/armorpaint/sources/make_paint.ts index 941bb2ad..4a3cf29c 100644 --- a/armorpaint/sources/make_paint.ts +++ b/armorpaint/sources/make_paint.ts @@ -2,7 +2,7 @@ ///if (is_paint || is_forge) function make_paint_is_raytraced_bake(): bool { - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) return context_raw.bake_type == bake_type_t.INIT; ///else return false; @@ -66,7 +66,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad let frag: node_shader_t = node_shader_context_make_frag(con_paint); frag.ins = vert.outs; - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) if (context_raw.tool == workspace_tool_t.BAKE && context_raw.bake_type == bake_type_t.INIT) { // Init raytraced bake make_bake_position_normal(vert, frag); @@ -93,7 +93,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad let uv_island_fill: bool = context_raw.tool == workspace_tool_t.FILL && context_raw.fill_type_handle.position == fill_type_t.UV_ISLAND; let decal: bool = context_raw.tool == workspace_tool_t.DECAL || context_raw.tool == workspace_tool_t.TEXT; - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(vert, "vec2 tpos = vec2(tex.x * 2.0 - 1.0, (1.0 - tex.y) * 2.0 - 1.0);"); ///else node_shader_write(vert, "vec2 tpos = vec2(tex.xy * 2.0 - 1.0);"); @@ -158,7 +158,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad } if (depth_reject) { - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "if (sp.z > textureLod(gbufferD, sp.xy, 0.0).r + 0.0005) discard;"); ///else node_shader_write(frag, "if (sp.z > textureLod(gbufferD, vec2(sp.x, 1.0 - sp.y), 0.0).r + 0.0005) discard;"); @@ -184,7 +184,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad } let stencil_fill: bool = context_raw.tool == workspace_tool_t.FILL && context_raw.brush_stencil_image != null; if (stencil_fill) { - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "if (sp.z > textureLod(gbufferD, sp.xy, 0.0).r + 0.0005) discard;"); ///else node_shader_write(frag, "if (sp.z > textureLod(gbufferD, vec2(sp.x, 1.0 - sp.y), 0.0).r + 0.0005) discard;"); @@ -368,7 +368,7 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad // Manual blending to preserve memory frag.wvpposition = true; node_shader_write(frag, "vec2 sample_tc = vec2(wvpposition.xy / wvpposition.w) * 0.5 + 0.5;"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "sample_tc.y = 1.0 - sample_tc.y;"); ///end node_shader_add_uniform(frag, "sampler2D paintmask"); diff --git a/armorpaint/sources/make_particle.ts b/armorpaint/sources/make_particle.ts index 1441045f..e1734e5b 100644 --- a/armorpaint/sources/make_particle.ts +++ b/armorpaint/sources/make_particle.ts @@ -113,7 +113,7 @@ function make_particle_mask(vert: node_shader_t, frag: node_shader_t) { ///end node_shader_add_uniform(frag, "sampler2D texparticle", "_texparticle"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "float str = textureLod(texparticle, sp.xy, 0.0).r;"); ///else node_shader_write(frag, "float str = textureLod(texparticle, vec2(sp.x, (1.0 - sp.y)), 0.0).r;"); diff --git a/armorpaint/sources/render_path_paint.ts b/armorpaint/sources/render_path_paint.ts index fbf33805..32c0787d 100644 --- a/armorpaint/sources/render_path_paint.ts +++ b/armorpaint/sources/render_path_paint.ts @@ -199,7 +199,7 @@ function render_path_paint_commands_paint(dilation: bool = true) { } // Picked surface values - ///if (iron_metal || iron_vulkan) + ///if (arm_metal || arm_vulkan) let i0: i32 = 2; let i1: i32 = 1; let i2: i32 = 0; @@ -539,7 +539,7 @@ function render_path_paint_draw_cursor(mx: f32, my: f32, radius: f32, tint_r: f3 let help_mat: mat4_t = mat4_identity(); mat4_get_inv(help_mat, scene_camera.vp); g4_set_mat(base_cursor_inv_vp, help_mat); - ///if (iron_metal || iron_vulkan) + ///if (arm_metal || arm_vulkan) let vs: vertex_element_t[] = [ { name: "tex", @@ -695,7 +695,7 @@ function render_path_paint_draw() { return; } - ///if (!iron_ios) // No hover on iPad, decals are painted by pen release + ///if (!arm_ios) // No hover on iPad, decals are painted by pen release if (config_raw.brush_live && context_raw.pdirty <= 0 && context_raw.ddirty > 0 && context_raw.brush_time == 0) { // gbuffer has been updated now but brush will lag 1 frame render_path_paint_commands_live_brush(); @@ -712,7 +712,7 @@ function render_path_paint_draw() { ///if is_paint if (context_raw.tool == workspace_tool_t.BAKE) { - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) let is_raytraced_bake: bool = (context_raw.bake_type == bake_type_t.AO || context_raw.bake_type == bake_type_t.LIGHTMAP || context_raw.bake_type == bake_type_t.BENT_NORMAL || @@ -782,7 +782,7 @@ function render_path_paint_draw() { context_select_paint_object(_paint_object); if (is_merged) context_raw.merged_object.base.visible = _visible; } - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) else if (is_raytraced_bake) { let dirty: bool = render_path_raytrace_bake_commands(make_material_parse_paint_material); if (dirty) ui_header_handle.redraws = 2; @@ -807,7 +807,7 @@ function render_path_paint_draw() { if (context_raw.brush_blend_dirty) { context_raw.brush_blend_dirty = false; - ///if iron_metal + ///if arm_metal render_path_set_target("texpaint_blend0"); render_path_clear_target(0x00000000); render_path_set_target("texpaint_blend1"); diff --git a/armorpaint/sources/render_path_preview.ts b/armorpaint/sources/render_path_preview.ts index b72b266b..073dca39 100644 --- a/armorpaint/sources/render_path_preview.ts +++ b/armorpaint/sources/render_path_preview.ts @@ -27,7 +27,7 @@ function render_path_preview_init() { t.height = math_floor(util_render_material_preview_size * 2.0); t.format = "RGBA64"; t.scale = render_path_base_get_super_sampling(); - ///if iron_opengl + ///if arm_opengl t.depth_buffer = "mmain"; ///end render_path_create_render_target(t); @@ -85,14 +85,14 @@ function render_path_preview_commands_preview() { } render_path_draw_shader("shader_datas/deferred_light/deferred_light"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) render_path_set_depth_from("mtex", "mgbuffer0"); // Bind depth for world pass ///end render_path_set_target("mtex"); // Re-binds depth render_path_draw_skydome("shader_datas/world_pass/world_pass"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) render_path_set_depth_from("mtex", "mgbuffer1"); // Unbind depth ///end @@ -132,14 +132,14 @@ function render_path_preview_commands_decal() { } render_path_draw_shader("shader_datas/deferred_light/deferred_light"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) render_path_set_depth_from("tex", "gbuffer0"); // Bind depth for world pass ///end render_path_set_target("tex"); render_path_draw_skydome("shader_datas/world_pass/world_pass"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) render_path_set_depth_from("tex", "gbuffer1"); // Unbind depth ///end diff --git a/armorpaint/sources/slot_material.ts b/armorpaint/sources/slot_material.ts index 44a703e0..57b96141 100644 --- a/armorpaint/sources/slot_material.ts +++ b/armorpaint/sources/slot_material.ts @@ -61,7 +61,7 @@ function slot_material_create(m: material_data_t = null, c: ui_node_canvas_t = n raw.canvas = c; } - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) raw.nodes.pan_x -= 50; // Center initial position ///end diff --git a/armorpaint/sources/tab_layers.ts b/armorpaint/sources/tab_layers.ts index 09ead891..e7842e92 100644 --- a/armorpaint/sources/tab_layers.ts +++ b/armorpaint/sources/tab_layers.ts @@ -203,7 +203,7 @@ function tab_layers_combo_filter() { base_set_object_mask(); util_uv_uvmap_cached = false; context_raw.ddirty = 2; - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_ready = false; ///end } @@ -363,7 +363,7 @@ function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) { ui._y -= 3; ui._y -= center; - ///if iron_opengl + ///if arm_opengl ui.image_invert_y = l.fill_layer != null; ///end @@ -385,7 +385,7 @@ function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) { ui._x += 12 * ui_SCALE(ui); } - ///if iron_opengl + ///if arm_opengl ui.image_invert_y = false; ///end @@ -669,7 +669,7 @@ function tab_layers_draw_layer_icon(l: slot_layer_t, i: i32, uix: f32, uiy: f32, } if (l.fill_layer == null && slot_layer_is_mask(l)) { g2_set_pipeline(ui_view2d_pipe); - ///if iron_opengl + ///if arm_opengl iron_g4_set_pipeline(ui_view2d_pipe.pipeline_); ///end iron_g4_set_int(ui_view2d_channel_loc, 1); @@ -920,7 +920,7 @@ function tab_layers_draw_layer_context_menu(l: slot_layer_t, mini: bool) { ui_menu_fill(ui); ui_menu_align(ui); let res_handle_changed_last: bool = base_res_handle.changed; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) let ar: string[] = ["128", "256", "512", "1K", "2K", "4K"]; ///else let ar: string[] = ["128", "256", "512", "1K", "2K", "4K", "8K", "16K"]; @@ -940,7 +940,7 @@ function tab_layers_draw_layer_context_menu(l: slot_layer_t, mini: bool) { ui_menu_fill(ui); ui_menu_align(ui); - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) let bits_items: string[] = ["8bit"]; ui_inline_radio(base_bits_handle, bits_items, ui_align_t.LEFT); ///else diff --git a/armorsculpt/sources/import_mesh.ts b/armorsculpt/sources/import_mesh.ts index 2f0117b7..61595860 100644 --- a/armorsculpt/sources/import_mesh.ts +++ b/armorsculpt/sources/import_mesh.ts @@ -33,7 +33,7 @@ function import_mesh_run(path: string, _clear_layers: bool = true, replace_exist project_mesh_assets = [path]; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) sys_title_set(substring(path, string_last_index_of(path, path_sep) + 1, string_last_index_of(path, "."))); ///end } diff --git a/armorsculpt/sources/make_brush.ts b/armorsculpt/sources/make_brush.ts index 6e0c36e2..123f0756 100644 --- a/armorsculpt/sources/make_brush.ts +++ b/armorsculpt/sources/make_brush.ts @@ -4,7 +4,7 @@ function make_brush_run(vert: node_shader_t, frag: node_shader_t) { node_shader_write(frag, "float dist = 0.0;"); if (config_raw.brush_3d) { - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "float depth = textureLod(gbufferD, inp.xy, 0.0).r;"); ///else node_shader_write(frag, "float depth = textureLod(gbufferD, vec2(inp.x, 1.0 - inp.y), 0.0).r;"); @@ -19,7 +19,7 @@ function make_brush_run(vert: node_shader_t, frag: node_shader_t) { node_shader_write_attrib(frag, "vec3 wposition = mul(texelFetch(texpaint_undo, ivec2(tex_coord.x * textureSize(texpaint_undo, 0).x, tex_coord.y * textureSize(texpaint_undo, 0).y), 0), W).xyz;"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "float depthlast = textureLod(gbufferD, inplast.xy, 0.0).r;"); ///else node_shader_write(frag, "float depthlast = textureLod(gbufferD, vec2(inplast.x, 1.0 - inplast.y), 0.0).r;"); diff --git a/armorsculpt/sources/make_mesh.ts b/armorsculpt/sources/make_mesh.ts index f7f971ec..5970fc08 100644 --- a/armorsculpt/sources/make_mesh.ts +++ b/armorsculpt/sources/make_mesh.ts @@ -75,7 +75,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte node_shader_add_uniform(frag, "sampler2D gbuffer1"); node_shader_add_uniform(frag, "sampler2D gbuffer2"); node_shader_write(frag, "vec2 fragcoord = (wvpposition.xy / wvpposition.w) * 0.5 + 0.5;"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "fragcoord.y = 1.0 - fragcoord.y;"); ///end node_shader_write(frag, "vec4 gbuffer0_sample = textureLod(gbuffer0, fragcoord, 0.0);"); @@ -253,7 +253,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte } frag.vvec = true; - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "mat3 TBN = cotangent_frame(n, vvec, tex_coord);"); ///else node_shader_write(frag, "mat3 TBN = cotangent_frame(n, -vvec, tex_coord);"); @@ -358,7 +358,7 @@ function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_conte } function make_mesh_get_max_textures(): i32 { - ///if iron_direct3d11 + ///if arm_direct3d11 return 128 - 66; ///else return 16 - 3; // G4onG5/G4.c.h MAX_TEXTURES diff --git a/armorsculpt/sources/make_mesh_preview.ts b/armorsculpt/sources/make_mesh_preview.ts index 82c14582..950b9708 100644 --- a/armorsculpt/sources/make_mesh_preview.ts +++ b/armorsculpt/sources/make_mesh_preview.ts @@ -137,7 +137,7 @@ function make_mesh_preview_run(data: material_t, matcon: material_context_t): no } else { frag.vvec = true; - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(frag, "mat3 TBN = cotangent_frame(n, vvec, tex_coord);"); ///else node_shader_write(frag, "mat3 TBN = cotangent_frame(n, -vvec, tex_coord);"); diff --git a/armorsculpt/sources/make_sculpt.ts b/armorsculpt/sources/make_sculpt.ts index eb0f7391..c5abfe42 100644 --- a/armorsculpt/sources/make_sculpt.ts +++ b/armorsculpt/sources/make_sculpt.ts @@ -38,7 +38,7 @@ function make_sculpt_run(data: material_t, matcon: material_context_t): node_sha node_shader_add_out(vert, "vec2 tex_coord"); node_shader_write(vert, "const vec2 madd = vec2(0.5, 0.5);"); node_shader_write(vert, "tex_coord = pos.xy * madd + madd;"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(vert, "tex_coord.y = 1.0 - tex_coord.y;"); ///end node_shader_write(vert, "gl_Position = vec4(pos.xy, 0.0, 1.0);"); diff --git a/base/sources/base.ts b/base/sources/base.ts index 2cbb8093..c2e17e7b 100644 --- a/base/sources/base.ts +++ b/base/sources/base.ts @@ -94,7 +94,7 @@ let base_cursor_gbufferd: kinc_tex_unit_t; ///if (is_paint || is_sculpt) let base_default_base: f32 = 0.5; let base_default_rough: f32 = 0.4; -///if (iron_android || iron_ios) +///if (arm_android || arm_ios) let base_max_layers: i32 = 18; ///else let base_max_layers: i32 = 255; @@ -183,7 +183,7 @@ function base_init() { base_last_window_height = sys_height(); sys_notify_on_drop_files(function (drop_path: string) { - ///if iron_linux + ///if arm_linux drop_path = uri_decode(drop_path); ///end drop_path = trim_end(drop_path); @@ -204,7 +204,7 @@ function base_init() { keyboard_up_listener(key_code_t.WIN); }, function () { // Shutdown - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) project_save(); ///end } @@ -222,7 +222,7 @@ function base_init() { base_default_font_size = base_theme.FONT_SIZE; translator_load_translations(config_raw.locale); ui_files_filename = tr("untitled"); - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) sys_title_set(tr("untitled")); ///end @@ -297,7 +297,7 @@ function base_init() { args_run(); - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) let has_projects: bool = config_raw.recent_projects.length > 0; ///else let has_projects: bool = true; @@ -370,7 +370,7 @@ function base_h(): i32 { if (config_raw.layout == null) { res -= ui_header_default_h * 2 + ui_status_default_status_h; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) let layout_header: i32 = 0; ///else let layout_header: i32 = 1; @@ -447,13 +447,13 @@ function base_on_resize() { base_resize(); - ///if (iron_linux || iron_macos) + ///if (arm_linux || arm_macos) base_save_window_rect(); ///end } function base_save_window_rect() { - ///if (iron_windows || iron_linux || iron_macos) + ///if (arm_windows || arm_linux || arm_macos) config_raw.window_w = sys_width(); config_raw.window_h = sys_height(); config_raw.window_x = sys_x(); @@ -666,7 +666,7 @@ function base_update() { base_handle_drop_paths(); ///if (is_paint || is_sculpt) - ///if iron_windows + ///if arm_windows let is_picker: bool = context_raw.tool == workspace_tool_t.PICKER || context_raw.tool == workspace_tool_t.MATERIAL; let decal: bool = context_raw.tool == workspace_tool_t.DECAL || context_raw.tool == workspace_tool_t.TEXT; ui_always_redraw_window = !context_raw.cache_draws || @@ -706,7 +706,7 @@ function base_material_dropped() { function base_handle_drop_paths() { if (base_drop_paths.length > 0) { - ///if (iron_linux || iron_macos) + ///if (arm_linux || arm_macos) let wait: bool = !mouse_moved; // Mouse coords not updated during drag ///else let wait: bool = false; @@ -848,7 +848,7 @@ function base_render() { let ratio: f32 = size / img.width; let h: f32 = img.height * ratio; - ///if (is_lab || iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (is_lab || arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) let inv: i32 = 0; ///else let inv: i32 = (base_drag_material != null || (base_drag_layer != null && base_drag_layer.fill_layer != null)) ? h : 0; @@ -882,7 +882,7 @@ function base_render() { context_raw.last_paint_vec_x = context_raw.paint_vec.x; context_raw.last_paint_vec_y = context_raw.paint_vec.y; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) // No mouse move events for touch, re-init last paint position on touch start if (!mouse_down()) { context_raw.last_paint_x = -1; @@ -942,7 +942,7 @@ function base_get_asset_index(file_name: string): i32 { function base_toggle_fullscreen() { if (sys_mode() == window_mode_t.WINDOWED) { - ///if (iron_windows || iron_linux || iron_macos) + ///if (arm_windows || arm_linux || arm_macos) config_raw.window_w = sys_width(); config_raw.window_h = sys_height(); config_raw.window_x = sys_x(); @@ -1016,9 +1016,9 @@ function base_init_layout() { array_push(raw.layout, math_floor(sys_height() / 2)); // LayoutSidebarH1 ///end - ///if iron_ios + ///if arm_ios array_push(raw.layout, show2d ? math_floor((app_w() + raw.layout[layout_size_t.NODES_W]) * 0.473) : math_floor(app_w() * 0.473)); // LayoutNodesW - ///elseif iron_android + ///elseif arm_android array_push(raw.layout, show2d ? math_floor((app_w() + raw.layout[layout_size_t.NODES_W]) * 0.473) : math_floor(app_w() * 0.473)); ///else array_push(raw.layout, show2d ? math_floor((app_w() + raw.layout[layout_size_t.NODES_W]) * 0.515) : math_floor(app_w() * 0.515)); // Align with ui header controls @@ -1027,7 +1027,7 @@ function base_init_layout() { array_push(raw.layout, math_floor(app_h() / 2)); // LayoutNodesH array_push(raw.layout, math_floor(ui_status_default_status_h * raw.window_scale)); // LayoutStatusH - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) array_push(raw.layout, 0); // LayoutHeader ///else array_push(raw.layout, 1); @@ -1047,7 +1047,7 @@ function base_init_config() { raw.recent_projects = []; raw.bookmarks = []; raw.plugins = []; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) raw.keymap = "touch.json"; ///else raw.keymap = "default.json"; @@ -1076,13 +1076,13 @@ function base_init_config() { ///if is_lab raw.workspace = space_type_t.SPACE2D; ///end - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) raw.camera_controls = camera_controls_t.ROTATE; ///else raw.camera_controls = camera_controls_t.ORBIT; ///end raw.layer_res = texture_res_t.RES2048; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) raw.touch_ui = true; raw.splash_screen = true; ///else @@ -1099,7 +1099,7 @@ function base_init_config() { raw.pressure_hardness = true; raw.pressure_angle = false; raw.pressure_opacity = false; - ///if (iron_vulkan || iron_ios) + ///if (arm_vulkan || arm_ios) raw.material_live = false; ///else raw.material_live = true; @@ -1211,7 +1211,7 @@ function base_resize_layers() { if (render_path_paint_live_layer != null) { slot_layer_resize_and_set_bits(render_path_paint_live_layer); } - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_ready = false; // Rebuild baketex ///end context_raw.ddirty = 2; @@ -1283,7 +1283,7 @@ function base_make_pipe() { g4_pipeline_compile(base_pipe_copy_bgra); } - ///if (iron_metal || iron_vulkan || iron_direct3d12) + ///if (arm_metal || arm_vulkan || arm_direct3d12) { base_pipe_copy8 = g4_pipeline_create(); base_pipe_copy8.vertex_shader = sys_get_shader("layer_view.vert"); @@ -1464,7 +1464,7 @@ function base_make_cursor_pipe() { base_pipe_cursor.vertex_shader = sys_get_shader("cursor.vert"); base_pipe_cursor.fragment_shader = sys_get_shader("cursor.frag"); let vs: vertex_struct_t = g4_vertex_struct_create(); - ///if (iron_metal || iron_vulkan) + ///if (arm_metal || arm_vulkan) g4_vertex_struct_add(vs, "tex", vertex_data_t.I16_2X_NORM); ///else g4_vertex_struct_add(vs, "pos", vertex_data_t.I16_4X_NORM); @@ -1968,7 +1968,7 @@ function base_flatten(height_to_normal: bool = false, layers: slot_layer_t[] = n ///end } - ///if iron_metal + ///if arm_metal // Flush command list g2_begin(base_expa); g2_end(); @@ -2382,7 +2382,7 @@ function base_on_layers_resized() { util_uv_trianglemap = null; util_uv_trianglemap_cached = false; util_uv_dilatemap_cached = false; - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_ready = false; ///end } @@ -2456,7 +2456,7 @@ function base_on_layers_resized() { base_init_layers(); }); - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_ready = false; ///end } diff --git a/base/sources/box_export.ts b/base/sources/box_export.ts index d8fdd569..861d1f43 100644 --- a/base/sources/box_export.ts +++ b/base/sources/box_export.ts @@ -28,7 +28,7 @@ function box_export_show_textures() { ///if is_paint box_export_tab_atlases(ui); - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) box_export_tab_export_mesh(ui, box_export_htab); ///end ///end @@ -68,7 +68,7 @@ function box_export_tab_export_textures(ui: ui_t, title: string, bake_material: ui_row(row); ///if is_paint - ///if (iron_android || iron_ios) + ///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); ///else @@ -78,7 +78,7 @@ function box_export_tab_export_textures(ui: ui_t, title: string, bake_material: ///end ///if is_lab - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) let base_res_combo: string[] = ["2K", "4K"]; ui_combo(base_res_handle, base_res_combo, tr("Resolution"), true); ///else @@ -91,7 +91,7 @@ function box_export_tab_export_textures(ui: ui_t, title: string, bake_material: base_on_layers_resized(); } - ///if (is_lab || iron_android || iron_ios) + ///if (is_lab || arm_android || arm_ios) let base_bits_combo: string[] = ["8bit"]; ui_combo(base_bits_handle, base_bits_combo, tr("Color"), true); ///else @@ -176,7 +176,7 @@ function box_export_tab_export_textures(ui: ui_t, title: string, bake_material: _box_export_bake_material = bake_material; ui_files_show(filters, true, false, function (path: string) { context_raw.texture_export_path = path; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) console_toast(tr("Exporting textures")); iron_g4_swap_buffers(); ///end @@ -427,7 +427,7 @@ function box_export_tab_export_mesh(ui: ui_t, htab: ui_handle_t) { ui_box_hide(); _box_export_apply_displacement = apply_displacement; ui_files_show(context_raw.export_mesh_format == mesh_format_t.OBJ ? "obj" : "arm", true, false, function (path: string) { - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) let f: string = sys_title(); ///else let f: string = ui_files_filename; @@ -435,7 +435,7 @@ function box_export_tab_export_mesh(ui: ui_t, htab: ui_handle_t) { if (f == "") { f = tr("untitled"); } - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) console_toast(tr("Exporting mesh")); iron_g4_swap_buffers(); ///end diff --git a/base/sources/box_preferences.ts b/base/sources/box_preferences.ts index 2a0e3e29..caa3a520 100644 --- a/base/sources/box_preferences.ts +++ b/base/sources/box_preferences.ts @@ -102,7 +102,7 @@ function box_preferences_show() { ui_base_tag_ui_redraw(); } - ///if !(iron_android || iron_ios) + ///if !(arm_android || arm_ios) ui.changed = false; let h_touch_ui: ui_handle_t = ui_handle(__ID__); if (h_touch_ui.init) { @@ -427,7 +427,7 @@ function box_preferences_show() { } ///if is_paint - ///if (iron_android || iron_ios) + ///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); ///else @@ -437,7 +437,7 @@ function box_preferences_show() { ///end ///if is_lab - ///if (iron_android || iron_ios) + ///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 @@ -534,7 +534,7 @@ function box_preferences_show() { } let pen_name: string; - ///if iron_ios + ///if arm_ios pen_name = tr("Pencil"); ///else pen_name = tr("Pen"); @@ -613,7 +613,7 @@ function box_preferences_show() { } if (ui_tab(box_preferences_htab, tr("Viewport"), true)) { - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) let hpathtrace_mode: ui_handle_t = ui_handle(__ID__); if (hpathtrace_mode.init) { diff --git a/base/sources/box_projects.ts b/base/sources/box_projects.ts index 1e1c035b..4ebb5aae 100644 --- a/base/sources/box_projects.ts +++ b/base/sources/box_projects.ts @@ -14,18 +14,18 @@ function box_projects_show() { } let draggable: bool; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) draggable = false; ///else draggable = true; ///end ui_box_show_custom(function (ui: ui_t) { - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) box_projects_align_to_fullscreen(); ///end - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) box_projects_tab(ui); box_projects_get_started_tab(ui); ///else @@ -100,7 +100,7 @@ function box_projects_tab(ui: ui_t) { let path: string = recent_projects[i]; - ///if iron_ios + ///if arm_ios let document_directory: string = iron_save_dialog("", ""); document_directory = substring(document_directory, 0, document_directory.length - 8); // Strip /"untitled" path = document_directory + path; @@ -127,7 +127,7 @@ function box_projects_tab(ui: ui_t) { ui._x = uix; ui_fill(0, 0, 128, 128, 0x66000000); ui._x = _uix; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) console_toast(tr("Opening project")); iron_g4_swap_buffers(); ///end @@ -196,7 +196,7 @@ function box_projects_recent_tab(ui: ui_t) { for (let i: i32 = 0; i < config_raw.recent_projects.length; ++i) { let path: string = config_raw.recent_projects[i]; let file: string = path; - ///if iron_windows + ///if arm_windows file = string_replace_all(path, "/", "\\"); ///else file = string_replace_all(path, "\\", "/"); diff --git a/base/sources/config.ts b/base/sources/config.ts index 80481eeb..869917c8 100644 --- a/base/sources/config.ts +++ b/base/sources/config.ts @@ -14,7 +14,7 @@ function config_load() { path += "config.json"; let blob: buffer_t = data_get_blob(path); - ///if iron_linux + ///if arm_linux if (blob == null) { // Protected directory blob = data_get_blob(iron_save_path() + "config.json"); } @@ -104,7 +104,7 @@ function config_save() { let buffer: buffer_t = sys_string_to_buffer(config_json); iron_file_save_bytes(path, buffer, 0); - ///if iron_linux // Protected directory + ///if arm_linux // Protected directory if (!file_exists(path)) { iron_file_save_bytes(iron_save_path() + "config.json", buffer, 0); } @@ -121,7 +121,7 @@ function config_init() { config_raw.window_maximizable = true; config_raw.window_w = 1600; config_raw.window_h = 900; - ///if iron_macos + ///if arm_macos config_raw.window_w *= 2; config_raw.window_h *= 2; ///end @@ -131,7 +131,7 @@ function config_init() { if (sys_display_width() >= 2560 && sys_display_height() >= 1600) { config_raw.window_scale = 2.0; } - ///if (iron_android || iron_ios || iron_macos) + ///if (arm_android || arm_ios || arm_macos) config_raw.window_scale = 2.0; ///end config_raw.window_vsync = true; @@ -141,7 +141,7 @@ function config_init() { config_raw.rp_vignette = 0.2; config_raw.rp_grain = 0.09; config_raw.rp_motionblur = false; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) config_raw.rp_ssao = false; ///else config_raw.rp_ssao = true; diff --git a/base/sources/context.ts b/base/sources/context.ts index 2085554f..aef0487b 100644 --- a/base/sources/context.ts +++ b/base/sources/context.ts @@ -43,15 +43,15 @@ type context_t = { parse_vcols?: bool; select_time?: f32; - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) pathtrace_mode?: path_trace_mode_t; ///end - ///if (iron_direct3d12 || iron_vulkan) // || iron_metal) + ///if (arm_direct3d12 || arm_vulkan) // || arm_metal) viewport_mode?: viewport_mode_t; ///else viewport_mode?: viewport_mode_t; ///end - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) render_mode?: render_mode_t; ///else render_mode?: render_mode_t; @@ -331,15 +331,15 @@ function context_create(): context_t { c.parse_transform = true; c.parse_vcols = false; c.select_time = 0.0; - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) c.pathtrace_mode = path_trace_mode_t.CORE; ///end - ///if (iron_direct3d12 || iron_vulkan) // || iron_metal) + ///if (arm_direct3d12 || arm_vulkan) // || arm_metal) c.viewport_mode = viewport_mode_t.PATH_TRACE; ///else c.viewport_mode = viewport_mode_t.LIT; ///end - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) c.render_mode = render_mode_t.FORWARD; ///else c.render_mode = render_mode_t.DEFERRED; @@ -666,7 +666,7 @@ function context_init_tool() { } else if (context_raw.tool == workspace_tool_t.BAKE) { - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) // Bake in lit mode for now if (context_raw.viewport_mode == viewport_mode_t.PATH_TRACE) { context_raw.viewport_mode = viewport_mode_t.LIT; @@ -679,7 +679,7 @@ function context_init_tool() { context_main_object().skip_context = null; } - ///if iron_ios + ///if arm_ios // No hover on iPad, decals are painted by pen release config_raw.brush_live = decal; ///end diff --git a/base/sources/export_arm.ts b/base/sources/export_arm.ts index 5be9b879..feaae719 100644 --- a/base/sources/export_arm.ts +++ b/base/sources/export_arm.ts @@ -119,7 +119,7 @@ function export_arm_run_project() { ///end let packed_assets: packed_asset_t[] = (project_raw.packed_assets == null || project_raw.packed_assets.length == 0) ? null : project_raw.packed_assets; - ///if iron_ios + ///if arm_ios let same_drive: bool = false; ///else let same_drive: bool = project_raw.envmap != null ? char_at(project_filepath, 0) == char_at(project_raw.envmap, 0) : true; @@ -156,26 +156,26 @@ function export_arm_run_project() { material: c, ///end - ///if (iron_metal || iron_vulkan) + ///if (arm_metal || arm_vulkan) is_bgra: true ///else is_bgra: false ///end }; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) let rt: render_target_t = map_get(render_path_render_targets, context_raw.render_mode == render_mode_t.FORWARD ? "buf" : "tex"); let tex: image_t = rt._image; let mesh_icon: image_t = image_create_render_target(256, 256); let r: f32 = app_w() / app_h(); g2_begin(mesh_icon); - ///if iron_opengl + ///if arm_opengl g2_draw_scaled_image(tex, -(256 * r - 256) / 2, 256, 256 * r, -256); ///else g2_draw_scaled_image(tex, -(256 * r - 256) / 2, 0, 256 * r, 256); ///end g2_end(); - ///if iron_metal + ///if arm_metal // Flush command list g2_begin(mesh_icon); g2_end(); @@ -185,14 +185,14 @@ function export_arm_run_project() { for (let i: i32 = 0; i < 256 * 256 * 4; ++i) { u8a[i] = math_floor(math_pow(u8a[i] / 255, 1.0 / 2.2) * 255); } - ///if (iron_metal || iron_vulkan) + ///if (arm_metal || arm_vulkan) export_arm_bgra_swap(mesh_icon_pixels); ///end app_notify_on_next_frame(function (mesh_icon: image_t) { image_unload(mesh_icon); }); // raw.mesh_icons = - // ///if (iron_metal || iron_vulkan) + // ///if (arm_metal || arm_vulkan) // [encode(bgraSwap(mesh_icon_pixels)]; // ///else // [encode(mesh_icon_pixels)]; @@ -211,7 +211,7 @@ function export_arm_run_project() { iron_file_save_bytes(project_filepath, buffer, buffer.length + 1); // Save to recent - ///if iron_ios + ///if arm_ios let recent_path: string = substring(project_filepath, string_last_index_of(project_filepath, "/") + 1, project_filepath.length); ///else let recent_path: string = project_filepath; @@ -299,7 +299,7 @@ function export_arm_run_material(path: string) { let micons: buffer_t[] = null; if (!is_cloud) { - ///if (iron_metal || iron_vulkan) + ///if (arm_metal || arm_vulkan) let buf: buffer_t = lz4_encode(export_arm_bgra_swap(image_get_pixels(m.image))); ///else let buf: buffer_t = lz4_encode(image_get_pixels(m.image)); @@ -332,7 +332,7 @@ function export_arm_run_material(path: string) { } ///end -///if (iron_metal || iron_vulkan) +///if (arm_metal || arm_vulkan) function export_arm_bgra_swap(buffer: buffer_t): buffer_t { for (let i: i32 = 0; i < math_floor((buffer.length) / 4); ++i) { let r: i32 = buffer[i * 4]; @@ -370,7 +370,7 @@ function export_arm_run_brush(path: string) { let bicons: buffer_t[] = null; if (!is_cloud) { - ///if (iron_metal || iron_vulkan) + ///if (arm_metal || arm_vulkan) let buf: buffer_t = lz4_encode(export_arm_bgra_swap(image_get_pixels(b.image))); ///else let buf: buffer_t = lz4_encode(image_get_pixels(b.image)); @@ -403,7 +403,7 @@ function export_arm_assets_to_files(project_path: string, assets: asset_t[]): st let texture_files: string[] = []; for (let i: i32 = 0; i < assets.length; ++i) { let a: asset_t = assets[i]; - ///if iron_ios + ///if arm_ios let same_drive: bool = false; ///else let same_drive: bool = char_at(project_path, 0) == char_at(a.file, 0); @@ -424,7 +424,7 @@ function export_arm_meshes_to_files(project_path: string): string[] { let mesh_files: string[] = []; for (let i: i32 = 0; i < project_mesh_assets.length; ++i) { let file: string = project_mesh_assets[i]; - ///if iron_ios + ///if arm_ios let same_drive: bool = false; ///else let same_drive: bool = char_at(project_path, 0) == char_at(file, 0); @@ -444,7 +444,7 @@ function export_arm_fonts_to_files(project_path: string, fonts: slot_font_t[]): let font_files: string[] = []; for (let i: i32 = 1; i < fonts.length; ++i) { let f: slot_font_t = fonts[i]; - ///if iron_ios + ///if arm_ios let same_drive: bool = false; ///else let same_drive: bool = char_at(project_path, 0) == char_at(f.file, 0); @@ -466,7 +466,7 @@ function export_arm_get_packed_assets(project_path: string, texture_files: strin if (project_raw.packed_assets != null) { for (let i: i32 = 0; i < project_raw.packed_assets.length; ++i) { let pa: packed_asset_t = project_raw.packed_assets[i]; - ///if iron_ios + ///if arm_ios let same_drive: bool = false; ///else let same_drive: bool = char_at(project_path, 0) == char_at(pa.name, 0); diff --git a/base/sources/export_texture.ts b/base/sources/export_texture.ts index 2bdaa33f..c337f4c4 100644 --- a/base/sources/export_texture.ts +++ b/base/sources/export_texture.ts @@ -103,9 +103,9 @@ function export_texture_run(path: string, bake_material: bool = false) { export_texture_run_layers(path, layers); ///end - ///if iron_ios + ///if arm_ios console_info(tr("Textures exported") + " (\"Files/On My iPad/" + manifest_title + "\")"); - ///elseif iron_android + ///elseif arm_android console_info(tr("Textures exported") + " (\"Files/Internal storage/Pictures/" + manifest_title + "\")"); ///else console_info(tr("Textures exported")); @@ -164,7 +164,7 @@ function export_texture_run_layers(path: string, layers: any[], object_name: str let texture_size_x: i32 = config_get_texture_res_x(); let texture_size_y: i32 = config_get_texture_res_y(); - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) let f: string = sys_title(); ///else let f: string = ui_files_filename; @@ -317,7 +317,7 @@ function export_texture_run_layers(path: string, layers: any[], object_name: str } } - ///if iron_metal + ///if arm_metal // Flush command list g2_begin(base_expa); g2_end(); diff --git a/base/sources/file.ts b/base/sources/file.ts index acb0e5dc..d4c611be 100644 --- a/base/sources/file.ts +++ b/base/sources/file.ts @@ -1,5 +1,5 @@ -///if iron_windows +///if arm_windows let file_cmd_mkdir: string = "mkdir"; let file_cmd_copy: string = "copy"; ///else @@ -10,7 +10,7 @@ let file_cmd_copy: string = "cp"; let file_cloud: map_t = null; let file_cloud_sizes: map_t = null; -// ///if iron_android +// ///if arm_android // let let file_internal: map_t = null; // .apk contents // ///end @@ -25,7 +25,7 @@ function file_read_directory(path: string, folders_only: bool = false): string[] return empty; } } - // ///if iron_android + // ///if arm_android // path = string_replace_all(path, "//", "/"); // if (file_internal == null) { // file_internal = []; @@ -50,9 +50,9 @@ function file_copy(srcPath: string, dst_path: string) { } function file_start(path: string) { - ///if iron_windows + ///if arm_windows iron_sys_command("start \"\" \"" + path + "\""); - ///elseif iron_linux + ///elseif arm_linux iron_sys_command("xdg-open \"" + path + "\""); ///else iron_sys_command("open \"" + path + "\""); @@ -79,7 +79,7 @@ type file_download_data_t = { let _file_download_map: map_t = map_create(); function file_download(url: string, dst_path: string, done: (url: string)=>void, size: i32 = 0) { - ///if (iron_windows || iron_macos || iron_ios || iron_android) + ///if (arm_windows || arm_macos || arm_ios || arm_android) let fdd: file_download_data_t = { dst_path: dst_path, done: done }; map_set(_file_download_map, url, fdd); iron_http_request(url, size, function (url: string, ab: buffer_t) { @@ -89,7 +89,7 @@ function file_download(url: string, dst_path: string, done: (url: string)=>void, } fdd.done(url); }); - ///elseif iron_linux + ///elseif arm_linux iron_sys_command("wget -O \"" + dst_path + "\" \"" + url + "\""); done(url); ///else @@ -134,7 +134,7 @@ type file_cache_cloud_data_t = { let _file_cache_cloud_map: map_t = map_create(); function file_cache_cloud(path: string, done: (s: string)=>void) { - ///if iron_ios + ///if arm_ios let path2: string = string_replace_all(path, "/", "_"); // Cache everything into root folder ///else let path2: string = path; @@ -149,7 +149,7 @@ function file_cache_cloud(path: string, done: (s: string)=>void) { dest += path2; if (file_exists(dest)) { - ///if (iron_macos || iron_ios) + ///if (arm_macos || arm_ios) done(dest); ///else let p: string; @@ -169,7 +169,7 @@ function file_cache_cloud(path: string, done: (s: string)=>void) { if (file_read_directory(file_dir)[0] == "") { file_create_directory(file_dir); } - ///if iron_windows + ///if arm_windows path = string_replace_all(path, "\\", "/"); ///end let url: string = config_raw.server + "/" + path; @@ -184,7 +184,7 @@ function file_cache_cloud(path: string, done: (s: string)=>void) { fccd.done(null); return; } - ///if (iron_macos || iron_ios) + ///if (arm_macos || arm_ios) fccd.done(fccd.dest); ///else let p: string; diff --git a/base/sources/history.ts b/base/sources/history.ts index c0375ed5..fdac4459 100644 --- a/base/sources/history.ts +++ b/base/sources/history.ts @@ -623,7 +623,7 @@ function history_delete_material_group(group: node_group_t) { ///end function history_push(name: string): step_t { - ///if (iron_windows || iron_linux || iron_macos) + ///if (arm_windows || arm_linux || arm_macos) let filename: string = project_filepath == "" ? ui_files_filename : substring(project_filepath, string_last_index_of(project_filepath, path_sep) + 1, project_filepath.length - 4); sys_title_set(filename + "* - " + manifest_title); ///end diff --git a/base/sources/import_arm.ts b/base/sources/import_arm.ts index dc171ffb..18f28f6e 100644 --- a/base/sources/import_arm.ts +++ b/base/sources/import_arm.ts @@ -32,7 +32,7 @@ function import_arm_run_project(path: string) { project_new(import_as_mesh); project_filepath = path; ui_files_filename = substring(path, string_last_index_of(path, path_sep) + 1, string_last_index_of(path, ".")); - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) sys_title_set(ui_files_filename); ///else sys_title_set(ui_files_filename + " - " + manifest_title); @@ -47,7 +47,7 @@ function import_arm_run_project(path: string) { ///end // Save to recent - ///if iron_ios + ///if arm_ios let recent_path: string = substring(path, string_last_index_of(path, "/") + 1, path.length); ///else let recent_path: string = path; @@ -87,7 +87,7 @@ function import_arm_run_project(path: string) { for (let i: i32 = 0; i < project.assets.length; ++i) { let file: string = project.assets[i]; - ///if iron_windows + ///if arm_windows file = string_replace_all(file, "/", "\\"); ///else file = string_replace_all(file, "\\", "/"); @@ -109,7 +109,7 @@ function import_arm_run_project(path: string) { if (project.font_assets != null) { for (let i: i32 = 0; i < project.font_assets.length; ++i) { let file: string = project.font_assets[i]; - ///if iron_windows + ///if arm_windows file = string_replace_all(file, "/", "\\"); ///else file = string_replace_all(file, "\\", "/"); @@ -435,7 +435,7 @@ function import_arm_run_material_from_project(project: project_format_t, path: s let base: string = path_base_dir(path); for (let i: i32 = 0; i < project.assets.length; ++i) { let file: string = project.assets[i]; - ///if iron_windows + ///if arm_windows file = string_replace_all(file, "/", "\\"); ///else file = string_replace_all(file, "\\", "/"); @@ -542,7 +542,7 @@ function import_arm_run_brush_from_project(project: project_format_t, path: stri let base: string = path_base_dir(path); for (let i: i32 = 0; i < project.assets.length; ++i) { let file: string = project.assets[i]; - ///if iron_windows + ///if arm_windows file = string_replace_all(file, "/", "\\"); ///else file = string_replace_all(file, "\\", "/"); @@ -646,7 +646,7 @@ function import_arm_unpack_asset(project: project_format_t, abs: string, file: s } for (let i: i32 = 0; i < project.packed_assets.length; ++i) { let pa: packed_asset_t = project.packed_assets[i]; - ///if iron_windows + ///if arm_windows pa.name = string_replace_all(pa.name, "/", "\\"); ///else pa.name = string_replace_all(pa.name, "\\", "/"); diff --git a/base/sources/import_asset.ts b/base/sources/import_asset.ts index 0b12ee1e..3c6b1736 100644 --- a/base/sources/import_asset.ts +++ b/base/sources/import_asset.ts @@ -8,7 +8,7 @@ let _import_asset_done: ()=>void; function import_asset_run(path: string, drop_x: f32 = -1.0, drop_y: f32 = -1.0, show_box: bool = true, hdr_as_envmap: bool = true, done: ()=>void = null) { if (starts_with(path, "cloud")) { - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) console_toast(tr("Downloading")); iron_g4_swap_buffers(); ///end diff --git a/base/sources/import_envmap.ts b/base/sources/import_envmap.ts index d79b9a25..53c7e46f 100644 --- a/base/sources/import_envmap.ts +++ b/base/sources/import_envmap.ts @@ -59,7 +59,7 @@ function import_envmap_run(path: string, image: image_t) { for (let i: i32 = 0; i < import_envmap_mips_cpu.length; ++i) { let mip: image_t = import_envmap_mips_cpu[i]; app_notify_on_next_frame(function (mip: image_t) { - ///if (!iron_direct3d12) // TODO: crashes after 50+ imports + ///if (!arm_direct3d12) // TODO: crashes after 50+ imports image_unload(mip); ///end }, mip); diff --git a/base/sources/import_mesh.ts b/base/sources/import_mesh.ts index 731e6340..b0207e22 100644 --- a/base/sources/import_mesh.ts +++ b/base/sources/import_mesh.ts @@ -57,7 +57,7 @@ function import_mesh_run(path: string, replace_existing: bool = true) { project_mesh_assets = [path]; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) sys_title_set(substring(path, string_last_index_of(path, path_sep) + 1, string_last_index_of(path, "."))); ///end } @@ -103,7 +103,7 @@ function import_mesh_finish_import() { ui_view2d_hwnd.redraws = 2; ///end - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_ready = false; ///end diff --git a/base/sources/make_voxel.ts b/base/sources/make_voxel.ts index 86068726..5127de91 100644 --- a/base/sources/make_voxel.ts +++ b/base/sources/make_voxel.ts @@ -72,7 +72,7 @@ function make_voxel_run(data: shader_context_t) { function make_voxel_source(): string { let ds: f32 = make_material_get_displace_strength(); - ///if iron_direct3d11 + ///if arm_direct3d11 return "#define vec3 float3 \ uniform float4x4 W; \ uniform float3x3 N; \ diff --git a/base/sources/node_shader.ts b/base/sources/node_shader.ts index a117b815..7942dbeb 100644 --- a/base/sources/node_shader.ts +++ b/base/sources/node_shader.ts @@ -195,7 +195,7 @@ function node_shader_vstruct_to_vsin(raw: node_shader_t) { } } -///if (iron_direct3d11 || iron_direct3d12) +///if (arm_direct3d11 || arm_direct3d12) function node_shader_get_hlsl(raw: node_shader_t, shared_sampler: string): string { let s: string = "#define HLSL\n"; s += "#define textureArg(tex) Texture2D tex,SamplerState tex ## _sampler\n"; @@ -398,7 +398,7 @@ function node_shader_get_hlsl(raw: node_shader_t, shared_sampler: string): strin } ///end -///if iron_metal +///if arm_metal function node_shader_get_msl(raw: node_shader_t, shared_sampler: string): string { let s: string = "#define METAL\n"; s += "#include \n"; @@ -656,7 +656,7 @@ function node_shader_get_msl(raw: node_shader_t, shared_sampler: string): string } ///end -///if (iron_opengl || iron_vulkan) +///if (arm_opengl || arm_vulkan) function node_shader_get_glsl(raw: node_shader_t, shared_sampler: string, version_header: string): string { let s: string = version_header; s += "#define textureArg(tex) sampler2D tex\n"; @@ -718,21 +718,21 @@ function node_shader_get(raw: node_shader_t): string { shared_sampler = string_split(raw.shared_samplers[0], " ")[1] + "_sampler"; } - ///if (iron_direct3d11 || iron_direct3d12) + ///if (arm_direct3d11 || arm_direct3d12) let s: string = node_shader_get_hlsl(raw, shared_sampler); - ///elseif iron_metal + ///elseif arm_metal let s: string = node_shader_get_msl(raw, shared_sampler); - ///elseif iron_vulkan + ///elseif arm_vulkan let version_header: string = "#version 450\n"; let s: string = node_shader_get_glsl(raw, shared_sampler, version_header); - ///elseif iron_android + ///elseif arm_android let version_header: string = "#version 300 es\n"; if (raw.shader_type == "frag") { version_header += "precision highp float;\n"; version_header += "precision mediump int;\n"; } let s: string = node_shader_get_glsl(raw, shared_sampler, version_header); - ///elseif iron_opengl + ///elseif arm_opengl let version_header: string = "#version 330\n"; let s: string = node_shader_get_glsl(raw, shared_sampler, version_header); ///end diff --git a/base/sources/parser_material.ts b/base/sources/parser_material.ts index 63e299d4..da6b58ba 100644 --- a/base/sources/parser_material.ts +++ b/base/sources/parser_material.ts @@ -1160,7 +1160,7 @@ function parse_normal_map_color_input(inp: ui_node_socket_t) { node_shader_add_function(parser_material_frag, str_cotangent_frame); } parser_material_frag.n = true; - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) node_shader_write(parser_material_frag, "mat3 TBN = cotangent_frame(n, vvec, tex_coord);"); ///else node_shader_write(parser_material_frag, "mat3 TBN = cotangent_frame(n, -vvec, tex_coord);"); @@ -1221,7 +1221,7 @@ function parser_material_parse_value(node: ui_node_t, socket: ui_node_socket_t): else if (node.type == "CAMERA") { if (socket == node.outputs[1]) { // View Z Depth node_shader_add_uniform(parser_material_curshader, "vec2 camera_proj", "_camera_plane_proj"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) parser_material_curshader.wvpposition = true; return "(camera_proj.y / ((wvpposition.z / wvpposition.w) - camera_proj.x))"; ///else @@ -1324,7 +1324,7 @@ function parser_material_parse_value(node: ui_node_t, socket: ui_node_socket_t): } else if (node.type == "NEW_GEOMETRY") { if (socket == node.outputs[6]) { // Backfacing - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) return "0.0"; // SV_IsFrontFace ///else return "(1.0 - float(gl_FrontFacing))"; @@ -1881,7 +1881,7 @@ function parser_material_texture_store(node: ui_node_t, tex: bind_tex_t, tex_nam } function parser_material_vec1(v: f32): string { - ///if iron_android + ///if arm_android return "float(" + v + ")"; ///else return v + ""; @@ -1892,7 +1892,7 @@ function parser_material_vec3(v: f32_array_t): string { let v0: f32 = v[0]; let v1: f32 = v[1]; let v2: f32 = v[2]; - ///if iron_android + ///if arm_android return "vec3(float(" + v0 + "), float(" + v1 + "), float(" + v2 + "))"; ///else return "vec3(" + v0 + ", " + v1 + ", " + v2 + ")"; @@ -1900,7 +1900,7 @@ function parser_material_vec3(v: f32_array_t): string { } function parser_material_to_vec3(s: string): string { - ///if (iron_direct3d11 || iron_direct3d12) + ///if (arm_direct3d11 || arm_direct3d12) return "(" + s + ").xxx"; ///else return "vec3(" + s + ")"; @@ -1953,7 +1953,7 @@ function parser_material_safesrc(s: string): string { s = "_" + s; } } - ///if iron_opengl + ///if arm_opengl while (string_index_of(s, "__") >= 0) { s = string_replace_all(s, "__", "_"); } diff --git a/base/sources/path.ts b/base/sources/path.ts index eedc2987..08fa15c8 100644 --- a/base/sources/path.ts +++ b/base/sources/path.ts @@ -1,11 +1,11 @@ -///if iron_windows +///if arm_windows let path_sep: string = "\\"; ///else let path_sep: string = "/"; ///end -///if iron_windows +///if arm_windows let path_pwd: string = "cd"; ///else let path_pwd: string = "echo $PWD"; @@ -191,11 +191,11 @@ function path_is_folder(p: string): bool { } function path_is_protected(): bool { - ///if iron_windows + ///if arm_windows return string_index_of(iron_get_files_location(), "Program Files") >= 0; - ///elseif iron_android + ///elseif arm_android return true; - ///elseif iron_ios + ///elseif arm_ios return true; ///else return false; diff --git a/base/sources/project.ts b/base/sources/project.ts index fdc925be..9495e45f 100644 --- a/base/sources/project.ts +++ b/base/sources/project.ts @@ -46,11 +46,11 @@ let _project_save_and_quit: bool; function project_save(save_and_quit: bool = false) { if (project_filepath == "") { - ///if iron_ios + ///if arm_ios let document_directory: string = iron_save_dialog("", ""); document_directory = substring(document_directory, 0, document_directory.length - 8); // Strip /"untitled" project_filepath = document_directory + "/" + sys_title() + ".arm"; - ///elseif iron_android + ///elseif arm_android project_filepath = iron_save_path() + "/" + sys_title() + ".arm"; ///else project_save_as(save_and_quit); @@ -58,7 +58,7 @@ function project_save(save_and_quit: bool = false) { ///end } - ///if (iron_windows || iron_linux || iron_macos) + ///if (arm_windows || arm_linux || arm_macos) let filename: string = substring(project_filepath, string_last_index_of(project_filepath, path_sep) + 1, project_filepath.length - 4); sys_title_set(filename + " - " + manifest_title); ///end @@ -139,7 +139,7 @@ function project_new_box() { } function project_new(reset_layers: bool = true) { - ///if (iron_windows || iron_linux || iron_macos) + ///if (arm_windows || arm_linux || arm_macos) sys_title_set(manifest_title); ///end project_filepath = ""; @@ -335,7 +335,7 @@ function project_new(reset_layers: bool = true) { context_init_tool(); ///end - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_ready = false; ///end } @@ -424,7 +424,7 @@ function project_import_mesh_box(path: string, replace_existing: bool = true, cl _project_import_mesh_box_clear_layers = clear_layers; _project_import_mesh_box_done = done; - ///if iron_ios + ///if arm_ios // Import immediately while access to resource is unlocked // data_get_blob(path); ///end @@ -469,7 +469,7 @@ function project_import_mesh_box(path: string, replace_existing: bool = true, cl if (ui_button(tr("Import")) || ui.is_return_down) { ui_box_hide(); - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) console_toast(tr("Importing mesh")); iron_g4_swap_buffers(); ///end @@ -543,7 +543,7 @@ function project_unwrap_mesh_box(mesh: raw_mesh_t, done: (a: raw_mesh_t)=>void, if (ui_button(tr("Unwrap")) || ui.is_return_down || skip_ui) { ui_box_hide(); - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) console_toast(tr("Unwrapping mesh")); iron_g4_swap_buffers(); ///end diff --git a/base/sources/render_path_base.ts b/base/sources/render_path_base.ts index 950d89ae..0751469a 100644 --- a/base/sources/render_path_base.ts +++ b/base/sources/render_path_base.ts @@ -160,7 +160,7 @@ function render_path_base_is_cached(): bool { if (mx != render_path_base_last_x || my != render_path_base_last_y || mouse_locked) { context_raw.ddirty = 0; } - ///if (iron_metal || iron_android) + ///if (arm_metal || arm_android) if (context_raw.ddirty > -6) { ///else if (context_raw.ddirty > -2) { @@ -192,7 +192,7 @@ function render_path_base_commands(draw_commands: ()=>void) { render_path_base_draw_gbuffer(); render_path_paint_draw(); - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) if (context_raw.viewport_mode == viewport_mode_t.PATH_TRACE) { ///if is_paint let use_live_layer: bool = context_raw.tool == workspace_tool_t.MATERIAL; @@ -264,7 +264,7 @@ function render_path_base_draw_split(draw_commands: ()=>void) { render_path_base_draw_gbuffer(); - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) ///if is_paint let use_live_layer: bool = context_raw.tool == workspace_tool_t.MATERIAL; ///else @@ -375,14 +375,14 @@ function render_path_base_draw_deferred_light() { render_path_draw_shader("shader_datas/deferred_light/deferred_light_voxel") : render_path_draw_shader("shader_datas/deferred_light/deferred_light"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) render_path_set_depth_from("tex", "gbuffer0"); // Bind depth for world pass ///end render_path_set_target("tex"); render_path_draw_skydome("shader_datas/world_pass/world_pass"); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) render_path_set_depth_from("tex", "gbuffer1"); // Unbind depth ///end } @@ -511,7 +511,7 @@ function render_path_base_draw_taa() { function render_path_base_draw_gbuffer() { render_path_set_target("gbuffer0"); // Only clear gbuffer0 - ///if iron_metal + ///if arm_metal render_path_clear_target(0x00000000, 1.0, clear_flag_t.COLOR | clear_flag_t.DEPTH); ///else render_path_clear_target(0, 1.0, clear_flag_t.DEPTH); @@ -590,7 +590,7 @@ function render_path_base_make_gbuffer_copy_textures() { render_path_create_render_target(t); } - ///if iron_metal + ///if arm_metal // TODO: Fix depth attach for gbuffer0_copy on metal // Use resize to re-create buffers from scratch for now render_path_resize(); diff --git a/base/sources/render_path_deferred.ts b/base/sources/render_path_deferred.ts index 48b13030..c228ef8f 100644 --- a/base/sources/render_path_deferred.ts +++ b/base/sources/render_path_deferred.ts @@ -37,7 +37,7 @@ function render_path_deferred_init() { t.height = 0; t.format = "RGBA64"; t.scale = render_path_base_get_super_sampling(); - ///if iron_opengl + ///if arm_opengl t.depth_buffer = "main"; ///end render_path_create_render_target(t); @@ -47,7 +47,7 @@ function render_path_deferred_init() { t.name = "buf"; t.width = 0; t.height = 0; - ///if (iron_direct3d12 || iron_vulkan)// || iron_metal) + ///if (arm_direct3d12 || arm_vulkan)// || arm_metal) // Match raytrace_target format // Will cause "The render target format in slot 0 does not match that specified by the current pipeline state" t.format = "RGBA64"; @@ -160,7 +160,7 @@ function render_path_deferred_init() { render_path_preview_init(); ///end - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_init(); ///end } diff --git a/base/sources/render_path_raytrace.ts b/base/sources/render_path_raytrace.ts index 15175009..ea42f888 100644 --- a/base/sources/render_path_raytrace.ts +++ b/base/sources/render_path_raytrace.ts @@ -1,5 +1,5 @@ -///if (iron_direct3d12 || iron_vulkan || iron_metal) +///if (arm_direct3d12 || arm_vulkan || arm_metal) let render_path_raytrace_frame: i32 = 0; let render_path_raytrace_ready: bool = false; @@ -15,9 +15,9 @@ let render_path_raytrace_ib: index_buffer_t; let render_path_raytrace_last_envmap: image_t = null; let render_path_raytrace_is_bake: bool = false; -///if iron_direct3d12 +///if arm_direct3d12 let render_path_raytrace_ext: string = ".cso"; -///elseif iron_metal +///elseif arm_metal let render_path_raytrace_ext: string = ".metal"; ///else let render_path_raytrace_ext: string = ".spirv"; @@ -84,7 +84,7 @@ function render_path_raytrace_commands(use_live_layer: bool) { render_path_raytrace_f32a[1] = transform_world_y(ct); render_path_raytrace_f32a[2] = transform_world_z(ct); render_path_raytrace_f32a[3] = render_path_raytrace_frame; - ///if iron_metal + ///if arm_metal // frame = (frame % (16)) + 1; // _PAINT render_path_raytrace_frame = render_path_raytrace_frame + 1; // _RENDER ///else @@ -121,7 +121,7 @@ function render_path_raytrace_commands(use_live_layer: bool) { iron_raytrace_dispatch_rays(framebuffer._image.render_target_, render_path_raytrace_f32a); if (context_raw.ddirty == 1 || context_raw.pdirty == 1) { - ///if iron_metal + ///if arm_metal context_raw.rdirty = 128; ///else context_raw.rdirty = 4; @@ -174,7 +174,7 @@ function render_path_raytrace_draw(useLiveLayer: bool) { render_path_raytrace_frame = 0; } - ///if iron_metal + ///if arm_metal // Delay path tracing additional samples while painting let down: bool = mouse_down() || pen_down(); if (context_in_viewport() && down) { diff --git a/base/sources/render_path_raytrace_bake.ts b/base/sources/render_path_raytrace_bake.ts index ec357cc3..08f7fb54 100644 --- a/base/sources/render_path_raytrace_bake.ts +++ b/base/sources/render_path_raytrace_bake.ts @@ -1,5 +1,5 @@ -///if (iron_direct3d12 || iron_vulkan || iron_metal) +///if (arm_direct3d12 || arm_vulkan || arm_metal) let render_path_raytrace_bake_rays_pix: i32 = 0; let render_path_raytrace_bake_rays_sec: i32 = 0; @@ -112,7 +112,7 @@ function render_path_raytrace_bake_commands(parse_paint_material: (b?: bool)=>vo render_path_bind_target("baketex2", "tex"); render_path_draw_shader("shader_datas/copy_pass/copy_pass"); - ///if iron_metal + ///if arm_metal let samples_per_frame: i32 = 4; ///else let samples_per_frame: i32 = 64; diff --git a/base/sources/strings.ts b/base/sources/strings.ts index d8f9c9cc..9f3a10d1 100644 --- a/base/sources/strings.ts +++ b/base/sources/strings.ts @@ -24,13 +24,13 @@ function strings_info0(): string { } function strings_graphics_api(): string { - ///if iron_direct3d11 + ///if arm_direct3d11 return "Direct3D11"; - ///elseif iron_direct3d12 + ///elseif arm_direct3d12 return "Direct3D12"; - ///elseif iron_metal + ///elseif arm_metal return "Metal"; - ///elseif iron_vulkan + ///elseif arm_vulkan return "Vulkan"; ///else return "OpenGL"; @@ -351,7 +351,7 @@ void create_basis(vec3 normal, out vec3 tangent, out vec3 binormal) { \ "; function str_sh_irradiance(): string { -///if iron_metal +///if arm_metal return "vec3 sh_irradiance(const vec3 nor, constant vec4 shirr[7]) { \ const float c1 = 0.429043; \ const float c2 = 0.511664; \ diff --git a/base/sources/tab_browser.ts b/base/sources/tab_browser.ts index fad42bb2..02c31240 100644 --- a/base/sources/tab_browser.ts +++ b/base/sources/tab_browser.ts @@ -47,7 +47,7 @@ function tab_browser_draw(htab: ui_handle_t) { ui_tooltip(tr("Add bookmark")); } - ///if iron_android + ///if arm_android let stripped: bool = false; let strip: string = "/storage/emulated/0/"; if (starts_with(tab_browser_hpath.text, strip)) { @@ -58,7 +58,7 @@ function tab_browser_draw(htab: ui_handle_t) { tab_browser_hpath.text = ui_text_input(tab_browser_hpath, tr("Path")); - ///if iron_android + ///if arm_android if (stripped) { tab_browser_hpath.text = "/storage/emulated/0" + tab_browser_hpath.text; } @@ -191,7 +191,7 @@ function tab_browser_draw(htab: ui_handle_t) { } let hpath_text: string = tab_browser_hpath.text; tab_browser_known = string_index_of(substring(tab_browser_hpath.text, string_last_index_of(tab_browser_hpath.text, path_sep), hpath_text.length), ".") > 0; - ///if iron_android + ///if arm_android if (ends_with(tab_browser_hpath.text, "." + to_lower_case(manifest_title))) { tab_browser_known = false; } @@ -207,7 +207,7 @@ function tab_browser_draw(htab: ui_handle_t) { } if (ui_button(tr("Disk"), ui_align_t.LEFT)) { - ///if iron_android + ///if arm_android ui_menu_draw(function (ui: ui_t) { if (ui_menu_button(ui, tr("Download"))) { tab_browser_hpath.text = ui_files_default_path; diff --git a/base/sources/tab_console.ts b/base/sources/tab_console.ts index ba901fec..cb238828 100644 --- a/base/sources/tab_console.ts +++ b/base/sources/tab_console.ts @@ -9,7 +9,7 @@ function tab_console_draw(htab: ui_handle_t) { if (ui_tab(htab, title, false, color) && statush > ui_status_default_status_h * ui_SCALE(ui)) { ui_begin_sticky(); - ///if (iron_windows || iron_linux || iron_macos) // Copy + ///if (arm_windows || arm_linux || arm_macos) // Copy if (config_raw.touch_ui) { let row: f32[] = [1 / 4, 1 / 4, 1 / 4]; ui_row(row); @@ -46,7 +46,7 @@ function tab_console_draw(htab: ui_handle_t) { iron_file_save_bytes(path, sys_string_to_buffer(str), 0); }); } - ///if (iron_windows || iron_linux || iron_macos) + ///if (arm_windows || arm_linux || arm_macos) if (ui_button(tr("Copy"))) { let str: string = string_array_join(console_last_traces, "\n"); iron_copy_to_clipboard(str); diff --git a/base/sources/tab_fonts.ts b/base/sources/tab_fonts.ts index 09ef0bc7..4b665ddd 100644 --- a/base/sources/tab_fonts.ts +++ b/base/sources/tab_fonts.ts @@ -79,7 +79,7 @@ function tab_fonts_draw(htab: ui_handle_t) { let state: ui_state_t = ui_state_t.IDLE; if (project_fonts[i].preview_ready) { // g2_set_pipeline(pipe); // L8 - // ///if iron_opengl + // ///if arm_opengl // g4_set_pipeline(pipe); // ///end // g4_set_int(channelLocation, 1); diff --git a/base/sources/tab_materials.ts b/base/sources/tab_materials.ts index dcdc0cd7..d0915017 100644 --- a/base/sources/tab_materials.ts +++ b/base/sources/tab_materials.ts @@ -101,7 +101,7 @@ function tab_materials_draw_slots(mini: bool) { } } - ///if iron_opengl + ///if arm_opengl ui.image_invert_y = project_materials[i].preview_ready; ///end @@ -304,7 +304,7 @@ function tab_materials_draw_slots(mini: bool) { ui._y += mini ? 0 : 6; - ///if iron_opengl + ///if arm_opengl ui.image_invert_y = false; // Material preview ///end } diff --git a/base/sources/tab_meshes.ts b/base/sources/tab_meshes.ts index 1e7895ce..d28470f0 100644 --- a/base/sources/tab_meshes.ts +++ b/base/sources/tab_meshes.ts @@ -208,7 +208,7 @@ function tab_meshes_set_default_mesh(name: string) { scene_meshes = [mo]; } - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_ready = false; ///end } diff --git a/base/sources/tab_swatches.ts b/base/sources/tab_swatches.ts index 0a38ae32..c146e2bb 100644 --- a/base/sources/tab_swatches.ts +++ b/base/sources/tab_swatches.ts @@ -183,7 +183,7 @@ function tab_swatches_draw(htab: ui_handle_t) { if (ui.is_hovered && ui.input_released_r) { context_set_swatch(project_raw.swatches[i]); let add: i32 = project_raw.swatches.length > 1 ? 1 : 0; - ///if (iron_windows || iron_linux || iron_macos) + ///if (arm_windows || arm_linux || arm_macos) add += 1; // Copy ///end @@ -203,7 +203,7 @@ function tab_swatches_draw(htab: ui_handle_t) { context_set_swatch(project_clone_swatch(context_raw.swatch)); array_push(project_raw.swatches, context_raw.swatch); } - ///if (iron_windows || iron_linux || iron_macos) + ///if (arm_windows || arm_linux || arm_macos) else if (ui_menu_button(ui, tr("Copy Hex Code"))) { let color: i32 = context_raw.swatch.base; color = color_set_ab(color, context_raw.swatch.opacity * 255); diff --git a/base/sources/ui_base.ts b/base/sources/ui_base.ts index 0815f8fa..db11543d 100644 --- a/base/sources/ui_base.ts +++ b/base/sources/ui_base.ts @@ -20,7 +20,7 @@ let ui_base_hwnd_tabs: tab_draw_array_t[] = ui_base_init_hwnd_tabs(); ///if (is_paint || is_sculpt) let ui_base_default_sidebar_mini_w: i32 = 56; let ui_base_default_sidebar_full_w: i32 = 280; -///if (iron_android || iron_ios) +///if (arm_android || arm_ios) let ui_base_default_sidebar_w: i32 = ui_base_default_sidebar_mini_w; ///else let ui_base_default_sidebar_w: i32 = ui_base_default_sidebar_full_w; @@ -381,7 +381,7 @@ function ui_base_update() { ui_base_toggle_distract_free(); } - ///if iron_linux + ///if arm_linux if (operator_shortcut("alt+enter", shortcut_type_t.STARTED)) { base_toggle_fullscreen(); } @@ -663,14 +663,14 @@ function ui_base_update() { ///if (is_paint || is_sculpt) count = 16; - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) count += 1; ///end ///end ///if is_lab count = 9; - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) count += 1; ///end ///end @@ -701,7 +701,7 @@ function ui_base_update() { let shortcuts: string[] = ["l", "b", "n", "o", "r", "m", "a", "h", "e", "s", "t", "1", "2", "3", "4"]; - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) if (iron_raytrace_supported()) { array_push(modes, tr("Path Traced")); array_push(shortcuts, "p"); @@ -1029,7 +1029,7 @@ function ui_base_update_ui() { ui_base_action_paint_remap = map_get(config_keymap, "action_paint"); util_render_pick_pos_nor_tex(); let is_mesh: bool = math_abs(context_raw.posx_picked) < 50 && math_abs(context_raw.posy_picked) < 50 && math_abs(context_raw.posz_picked) < 50; - ///if iron_android + ///if arm_android // Allow rotating with both pen and touch, because hovering a pen prevents touch input on android let pen_only: bool = false; ///else @@ -1141,7 +1141,7 @@ function ui_base_update_ui() { ///end ///if (is_paint || is_sculpt) - ///if iron_ios + ///if arm_ios // No hover on iPad, decals are painted by pen release if (decal) { down = pen_released(); @@ -1229,7 +1229,7 @@ function ui_base_update_ui() { context_raw.brush_time = 0; context_raw.prev_paint_vec_x = -1; context_raw.prev_paint_vec_y = -1; - ///if (!iron_direct3d12 && !iron_vulkan && !iron_metal) // Keep accumulated samples for D3D12 + ///if (!arm_direct3d12 && !arm_vulkan && !arm_metal) // Keep accumulated samples for D3D12 context_raw.ddirty = 3; ///end context_raw.brush_blend_dirty = true; // Update brush mask @@ -1521,7 +1521,7 @@ function ui_base_render_cursor() { // Show picked material next to cursor if (context_raw.tool == workspace_tool_t.PICKER && context_raw.picker_select_material && context_raw.color_picker_callback == null) { let img: image_t = context_raw.material.image_icon; - ///if iron_opengl + ///if arm_opengl g2_draw_scaled_image(img, mx + 10, my + 10 + img.height, img.width, -img.height); ///else g2_draw_image(img, mx + 10, my + 10); @@ -1575,7 +1575,7 @@ function ui_base_render_cursor() { let cx: f32 = decalx + psizex / 2; let cy: f32 = decaly + psizey / 2; g2_set_transformation(mat3_multmat(mat3_multmat(mat3_translation(cx, cy), mat3_rotation(angle)), mat3_translation(-cx, -cy))); - ///if (iron_direct3d11 || iron_direct3d12 || iron_metal || iron_vulkan) + ///if (arm_direct3d11 || arm_direct3d12 || arm_metal || arm_vulkan) g2_draw_scaled_image(context_raw.decal_image, decalx, decaly, psizex, psizey); ///else g2_draw_scaled_image(context_raw.decal_image, decalx, decaly + psizey, psizex, -psizey); @@ -1739,7 +1739,7 @@ function ui_base_on_text_hover() { } function ui_base_on_deselect_text() { - ///if iron_ios + ///if arm_ios keyboard_up_listener(key_code_t.SHIFT); ///end } diff --git a/base/sources/ui_box.ts b/base/sources/ui_box.ts index 5382c563..2673c794 100644 --- a/base/sources/ui_box.ts +++ b/base/sources/ui_box.ts @@ -11,7 +11,7 @@ let ui_box_modalh: i32 = 170; let ui_box_modal_on_hide: ()=>void = null; let ui_box_draws: i32 = 0; let ui_box_copyable: bool = false; -///if (iron_android || iron_ios) +///if (arm_android || arm_ios) let ui_box_tween_alpha: f32 = 0.0; ///end @@ -47,7 +47,7 @@ function ui_box_render() { } if (config_raw.touch_ui) { // Darken bg - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) g2_set_color(color_from_floats(0, 0, 0, ui_box_tween_alpha)); ///else g2_set_color(color_from_floats(0, 0, 0, 0.5)); @@ -87,7 +87,7 @@ function ui_box_render() { } _ui_end_element(); - ///if (iron_windows || iron_linux || iron_macos) + ///if (arm_windows || arm_linux || arm_macos) if (ui_box_copyable) { let row: f32[] = [1 / 3, 1 / 3, 1 / 3]; ui_row(row); @@ -103,7 +103,7 @@ function ui_box_render() { _ui_end_element(); - ///if (iron_windows || iron_linux || iron_macos) + ///if (arm_windows || arm_linux || arm_macos) if (ui_box_copyable && ui_button(tr("Copy"))) { iron_copy_to_clipboard(ui_box_text); } @@ -140,7 +140,7 @@ function ui_box_show_message(title: string, text: string, copyable: bool = false ui_box_commands = null; ui_box_copyable = copyable; ui_box_draggable = true; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) ui_box_tween_in(); ///end } @@ -152,13 +152,13 @@ function ui_box_show_custom(commands: (ui: ui_t)=>void = null, mw: i32 = 400, mh ui_box_modal_on_hide = on_hide; ui_box_commands = commands; ui_box_draggable = draggable; - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) ui_box_tween_in(); ///end } function ui_box_hide() { - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) ui_box_tween_out(); ///else ui_box_hide_internal(); @@ -173,7 +173,7 @@ function ui_box_hide_internal() { base_redraw_ui(); } -///if (iron_android || iron_ios) +///if (arm_android || arm_ios) function ui_box_tween_in() { tween_reset(); diff --git a/base/sources/ui_files.ts b/base/sources/ui_files.ts index d9fb4817..a2d670a6 100644 --- a/base/sources/ui_files.ts +++ b/base/sources/ui_files.ts @@ -1,10 +1,10 @@ let ui_files_default_path: string = - ///if iron_windows + ///if arm_windows "C:\\Users" - ///elseif iron_android + ///elseif arm_android "/storage/emulated/0/Download" - ///elseif iron_macos + ///elseif arm_macos "/Users" ///else "/" @@ -58,7 +58,7 @@ function ui_files_release_keys() { // File dialog may prevent firing key up events keyboard_up_listener(key_code_t.SHIFT); keyboard_up_listener(key_code_t.CONTROL); - ///if iron_macos + ///if arm_macos keyboard_up_listener(key_code_t.META); ///end } @@ -82,7 +82,7 @@ function ui_files_file_browser(ui: ui_t, handle: ui_handle_t, folders_only: bool return handle.text; } - ///if iron_ios + ///if arm_ios let document_directory: string = iron_save_dialog("", ""); document_directory = substring(document_directory, 0, document_directory.length - 8); // Strip /"untitled" ///end @@ -95,7 +95,7 @@ function ui_files_file_browser(ui: ui_t, handle: ui_handle_t, folders_only: bool let text: string = handle.text; let i1: i32 = string_index_of(text, path_sep); let nested: bool = i1 > -1 && text.length - 1 > i1; - ///if iron_windows + ///if arm_windows // Server addresses like \\server are not nested nested = nested && !(text.length >= 2 && char_at(text, 0) == path_sep && char_at(text, 1) == path_sep && string_last_index_of(text, path_sep) == 1); ///end @@ -104,7 +104,7 @@ function ui_files_file_browser(ui: ui_t, handle: ui_handle_t, folders_only: bool } let dir_path: string = text; - ///if iron_ios + ///if arm_ios if (!is_cloud) { dir_path = document_directory + dir_path; } @@ -246,7 +246,7 @@ function ui_files_file_browser(ui: ui_t, handle: ui_handle_t, folders_only: bool if (map_get(ui_files_icon_map, key) == null) { let blob_path: string = key; - ///if iron_ios + ///if arm_ios blob_path = document_directory + blob_path; // TODO: implement native .arm parsing first ///else @@ -341,7 +341,7 @@ function ui_files_file_browser(ui: ui_t, handle: ui_handle_t, folders_only: bool base_drag_off_x = -(mouse_x - uix - ui._window_x - 3); base_drag_off_y = -(mouse_y - uiy - ui._window_y + 1); base_drag_file = handle.text; - ///if iron_ios + ///if arm_ios if (!is_cloud) { base_drag_file = document_directory + base_drag_file; } diff --git a/base/sources/ui_header.ts b/base/sources/ui_header.ts index 2b079c67..80d0f733 100644 --- a/base/sources/ui_header.ts +++ b/base/sources/ui_header.ts @@ -187,7 +187,7 @@ function ui_header_draw_tool_properties(ui: ui_t) { else if (context_raw.tool == workspace_tool_t.BAKE) { ui.changed = false; - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) let baking: bool = context_raw.pdirty > 0; let rt_bake: bool = context_raw.bake_type == bake_type_t.AO || context_raw.bake_type == bake_type_t.LIGHTMAP || context_raw.bake_type == bake_type_t.BENT_NORMAL || context_raw.bake_type == bake_type_t.THICKNESS; if (baking && ui_button(tr("Stop"))) { @@ -207,7 +207,7 @@ function ui_header_draw_tool_properties(ui: ui_t) { }); ui_base_hwnds[0].redraws = 2; history_push_undo = true; - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_bake_current_sample = 0; ///end } @@ -229,7 +229,7 @@ function ui_header_draw_tool_properties(ui: ui_t) { tr("Object ID"), tr("Vertex Color"), ]; - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) if (iron_raytrace_supported()) { array_push(bakes, tr("Lightmap")); array_push(bakes, tr("Bent Normal")); @@ -242,13 +242,13 @@ function ui_header_draw_tool_properties(ui: ui_t) { context_raw.bake_type = ui_combo(bake_handle, bakes, tr("Bake")); - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) if (!iron_raytrace_supported()) { context_raw.bake_type += 1; // Offset for removed AO } ///end - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) if (rt_bake) { let samples_handle: ui_handle_t = ui_handle(__ID__); if (samples_handle.init) { @@ -291,7 +291,7 @@ function ui_header_draw_tool_properties(ui: ui_t) { } context_raw.bake_ao_offset = ui_slider(offset_handle, tr("Offset"), 0.0, 2.0, true); } - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) if (rt_bake) { let progress: f32 = render_path_raytrace_bake_current_sample / context_raw.bake_samples; if (progress > 1.0) progress = 1.0; diff --git a/base/sources/ui_menu.ts b/base/sources/ui_menu.ts index 917d0237..cc2a32f2 100644 --- a/base/sources/ui_menu.ts +++ b/base/sources/ui_menu.ts @@ -160,7 +160,7 @@ function ui_menu_render() { ui_base_ui.is_hovered = false; } - ///if !(iron_android || iron_ios) + ///if !(arm_android || arm_ios) if (ui_menu_button(ui, tr("Toggle Fullscreen"), "alt+enter")) { base_toggle_fullscreen(); } @@ -270,7 +270,7 @@ function ui_menu_render() { context_raw.brush_scale = ui_slider(brush_scale_handle, tr("UV Scale"), 0.01, 5.0, true); if (brush_scale_handle.changed) { make_material_parse_mesh_material(); - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_uv_scale = context_raw.brush_scale; render_path_raytrace_ready = false; ///end @@ -375,7 +375,7 @@ function ui_menu_render() { ]; let shortcuts: string[] = ["l", "b", "n", "o", "r", "m", "a", "h", "e", "s", "t", "1", "2", "3", "4"]; - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) if (iron_raytrace_supported()) { array_push(modes, tr("Path Traced")); array_push(shortcuts, "p"); @@ -506,14 +506,14 @@ function ui_menu_render() { file_load_url("https://github.com/armory3d/armortools/issues"); } if (ui_menu_button(ui, tr("Report Bug"))) { - ///if (iron_macos || iron_ios) // Limited url length + ///if (arm_macos || arm_ios) // Limited url length file_load_url("https://github.com/armory3d/armortools/issues/new?labels=bug&template=bug_report.md&body=*" + manifest_title + "%20" + manifest_version + "-" + config_get_sha() + ",%20" + sys_system_id()); ///else file_load_url("https://github.com/armory3d/armortools/issues/new?labels=bug&template=bug_report.md&body=*" + manifest_title + "%20" + manifest_version + "-" + config_get_sha() + ",%20" + sys_system_id() + "*%0A%0A**Issue description:**%0A%0A**Steps to reproduce:**%0A%0A"); ///end } if (ui_menu_button(ui, tr("Request Feature"))) { - ///if (iron_macos || iron_ios) // Limited url length + ///if (arm_macos || arm_ios) // Limited url length file_load_url("https://github.com/armory3d/armortools/issues/new?labels=feature%20request&template=feature_request.md&body=*" + manifest_title + "%20" + manifest_version + "-" + config_get_sha() + ",%20" + sys_system_id()); ///else file_load_url("https://github.com/armory3d/armortools/issues/new?labels=feature%20request&template=feature_request.md&body=*" + manifest_title + "%20" + manifest_version + "-" + config_get_sha() + ",%20" + sys_system_id() + "*%0A%0A**Feature description:**%0A%0A"); @@ -522,9 +522,9 @@ function ui_menu_render() { ui_menu_separator(ui); if (ui_menu_button(ui, tr("Check for Updates..."))) { - ///if iron_android + ///if arm_android file_load_url(manifest_url_android); - ///elseif iron_ios + ///elseif arm_ios file_load_url(manifest_url_ios); ///else // Retrieve latest version number @@ -561,7 +561,7 @@ function ui_menu_render() { let msg: string = manifest_title + ".org - v" + manifest_version + " (" + config_get_date() + ") - " + config_get_sha() + "\n"; msg += sys_system_id() + " - " + strings_graphics_api(); - ///if iron_windows + ///if arm_windows let save: string; if (path_is_protected()) { save = iron_save_path(); @@ -611,7 +611,7 @@ function ui_menu_render() { let row: f32[] = [1 / 3, 1 / 3, 1 / 3]; ui_row(row); - ///if (iron_windows || iron_linux || iron_macos) + ///if (arm_windows || arm_linux || arm_macos) if (ui_button(tr("Copy"))) { iron_copy_to_clipboard(_ui_menu_render_msg); } diff --git a/base/sources/ui_menubar.ts b/base/sources/ui_menubar.ts index 51b3b60a..e02fefa8 100644 --- a/base/sources/ui_menubar.ts +++ b/base/sources/ui_menubar.ts @@ -40,7 +40,7 @@ function ui_menubar_render_ui() { if (ui_menubar_icon_button(ui, 0, 2)) box_preferences_show(); if (ui_menubar_icon_button(ui, 0, 3)) { - ///if (iron_android || iron_ios) + ///if (arm_android || arm_ios) console_toast(tr("Saving project")); project_save(); ///end @@ -189,7 +189,7 @@ function ui_menubar_render_ui() { mat4_translate(m, 0, 0, 1.6); transform_set_matrix(scene_camera.base.transform, m); } - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_ready = false; ///end } diff --git a/base/sources/ui_nodes.ts b/base/sources/ui_nodes.ts index d1d7a5c0..c4be2915 100644 --- a/base/sources/ui_nodes.ts +++ b/base/sources/ui_nodes.ts @@ -1031,7 +1031,7 @@ function ui_nodes_render() { let tx: f32 = ui_nodes_ww - tw - 8 * ui_SCALE(ui_nodes_ui); let ty: f32 = ui_nodes_wh - th - 8 * ui_SCALE(ui_nodes_ui); - ///if iron_opengl + ///if arm_opengl let invert_y: bool = sel.type == "MATERIAL"; ///else let invert_y: bool = false; @@ -1040,7 +1040,7 @@ function ui_nodes_render() { ///if (is_paint || is_sculpt) if (single_channel) { g2_set_pipeline(ui_view2d_pipe); - ///if iron_opengl + ///if arm_opengl iron_g4_set_pipeline(ui_view2d_pipe.pipeline_); ///end iron_g4_set_int(ui_view2d_channel_loc, 1); diff --git a/base/sources/ui_view2d.ts b/base/sources/ui_view2d.ts index da3ab96b..e00a42c6 100644 --- a/base/sources/ui_view2d.ts +++ b/base/sources/ui_view2d.ts @@ -221,13 +221,13 @@ function ui_view2d_render() { ///if (is_paint || is_sculpt) if (ui_view2d_type == view_2d_type_t.LAYER) { - ///if (!iron_opengl) + ///if (!arm_opengl) g2_set_pipeline(ui_view2d_pipe); ///end if (!context_raw.texture_filter) { g2_set_bilinear_filter(false); } - ///if iron_opengl + ///if arm_opengl iron_g4_set_pipeline(ui_view2d_pipe.pipeline_); ///end iron_g4_set_int(ui_view2d_channel_loc, channel); @@ -270,7 +270,7 @@ function ui_view2d_render() { g2_draw_scaled_image(_ui_view2d_render_tex, -_ui_view2d_render_x, -_ui_view2d_render_y, _ui_view2d_render_tw, _ui_view2d_render_th); g2_end(); let a: buffer_t = image_get_pixels(texpaint_picker); - ///if (iron_metal || iron_vulkan) + ///if (arm_metal || arm_vulkan) let i0: i32 = 2; let i1: i32 = 1; let i2: i32 = 0; diff --git a/base/sources/util_mesh.ts b/base/sources/util_mesh.ts index 3722eaf4..e5aeb362 100644 --- a/base/sources/util_mesh.ts +++ b/base/sources/util_mesh.ts @@ -121,7 +121,7 @@ function util_mesh_merge(paint_objects: mesh_object_t[] = null) { context_raw.merged_object.force_context = "paint"; object_set_parent(context_raw.merged_object.base, context_main_object().base); - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_ready = false; ///end } @@ -197,7 +197,7 @@ function util_mesh_flip_normals() { g4_vertex_buffer_unlock(g._.vertex_buffer); } - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) render_path_raytrace_ready = false; ///end } @@ -296,7 +296,7 @@ function util_mesh_calc_normals(smooth: bool = false) { } } - ///if (iron_direct3d12 || iron_vulkan || iron_metal) + ///if (arm_direct3d12 || arm_vulkan || arm_metal) util_mesh_merge(); render_path_raytrace_ready = false; ///end diff --git a/base/sources/util_render.ts b/base/sources/util_render.ts index fc0bde30..fc8a8f3b 100644 --- a/base/sources/util_render.ts +++ b/base/sources/util_render.ts @@ -162,7 +162,7 @@ function util_render_make_text_preview() { context_raw.text_tool_image = null; } if (context_raw.text_tool_image == null) { - ///if iron_metal + ///if arm_metal context_raw.text_tool_image = image_create_render_target(texW, texW, tex_format_t.RGBA32); ///else context_raw.text_tool_image = image_create_render_target(texW, texW, tex_format_t.R8); @@ -412,7 +412,7 @@ function util_render_pick_pos_nor_tex() { render_path_paint_set_plane_mesh(); } render_path_paint_commands_paint(false); - ///if iron_metal + ///if arm_metal // Flush command list render_path_paint_commands_paint(false); ///end diff --git a/base/sources/util_uv.ts b/base/sources/util_uv.ts index a406c8ca..2f802359 100644 --- a/base/sources/util_uv.ts +++ b/base/sources/util_uv.ts @@ -112,7 +112,7 @@ function util_uv_cache_dilate_map() { util_uv_pipe_dilate.vertex_shader = sys_get_shader("dilate_map.vert"); util_uv_pipe_dilate.fragment_shader = sys_get_shader("dilate_map.frag"); let vs: vertex_struct_t = g4_vertex_struct_create(); - ///if (iron_metal || iron_vulkan) + ///if (arm_metal || arm_vulkan) g4_vertex_struct_add(vs, "tex", vertex_data_t.I16_2X_NORM); ///else g4_vertex_struct_add(vs, "pos", vertex_data_t.I16_4X_NORM); @@ -135,7 +135,7 @@ function util_uv_cache_dilate_map() { g4_begin(util_uv_dilatemap); g4_clear(0x00000000); g4_set_pipeline(util_uv_pipe_dilate); - ///if (iron_metal || iron_vulkan) + ///if (arm_metal || arm_vulkan) let vs: vertex_element_t[] = [ { name: "tex", diff --git a/base/tools/pad/sources/main.ts b/base/tools/pad/sources/main.ts index 66244597..28beb4da 100644 --- a/base/tools/pad/sources/main.ts +++ b/base/tools/pad/sources/main.ts @@ -268,7 +268,7 @@ function save_file() { } function build_file(): string { - ///if iron_windows + ///if arm_windows return "\\build.bat"; ///else return "/build.sh";