From 47592927b31b7655b55383d72665c94176008477 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 7 Jan 2023 20:37:21 +0100 Subject: [PATCH] Use BitField<> hint for ArrayFormat This was missing in the conversion of bitflags to BitField<>. --- doc/classes/ArrayMesh.xml | 4 +- doc/classes/Control.xml | 16 ++--- doc/classes/EditorSpinSlider.xml | 2 +- doc/classes/Label.xml | 2 +- doc/classes/Mesh.xml | 50 +++++++------- doc/classes/Range.xml | 2 +- doc/classes/RenderingServer.xml | 60 ++++++++-------- doc/classes/SpinBox.xml | 2 +- doc/classes/TextureProgressBar.xml | 2 +- doc/classes/VScrollBar.xml | 4 +- doc/classes/VSlider.xml | 4 +- .../GodotTools/Build/BuildOutputView.cs | 14 ++-- .../GodotTools/Build/MSBuildPanel.cs | 4 +- scene/gui/box_container.cpp | 4 +- scene/gui/container.cpp | 12 ++-- scene/gui/control.cpp | 24 +++---- scene/gui/control.h | 14 ++-- scene/gui/flow_container.cpp | 12 ++-- scene/gui/graph_node.cpp | 2 +- scene/gui/grid_container.cpp | 4 +- scene/gui/scroll_container.cpp | 4 +- scene/resources/immediate_mesh.cpp | 2 +- scene/resources/immediate_mesh.h | 2 +- scene/resources/mesh.cpp | 58 ++++++++-------- scene/resources/mesh.h | 12 ++-- scene/resources/primitive_meshes.cpp | 2 +- scene/resources/primitive_meshes.h | 2 +- servers/rendering_server.cpp | 68 +++++++++---------- servers/rendering_server.h | 12 ++-- 29 files changed, 200 insertions(+), 200 deletions(-) diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index 70ce4ad516b..f7764d5e32c 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -65,7 +65,7 @@ - + Creates a new surface. Surfaces are created to be rendered using a [param primitive], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface. @@ -141,7 +141,7 @@ - + Returns the format mask of the requested surface (see [method add_surface_from_arrays]). diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index b0351559ee3..b9f3275dfee 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -1064,13 +1064,13 @@ The size of the node's bounding rectangle, in pixels. [Container] nodes update this property automatically. - + Tells the parent [Container] nodes how they should resize and place the node on the X axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does. If the node and at least one of its neighbors uses the [constant SIZE_EXPAND] size flag, the parent [Container] will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbor a ratio of 1, this node will take two thirds of the available space. - + Tells the parent [Container] nodes how they should resize and place the node on the Y axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does. @@ -1315,23 +1315,23 @@ The control's size will not change. - + Tells the parent [Container] to align the node with its start, either the top or the left edge. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical]. [b]Note:[/b] Setting this flag is equal to not having any size flags. - + Tells the parent [Container] to expand the bounds of this node to fill all the available space without pushing any other node. It is mutually exclusive with shrink size flags. Use with [member size_flags_horizontal] and [member size_flags_vertical]. - + Tells the parent [Container] to let this node take all the available space on the axis you flag. If multiple neighboring nodes are set to expand, they'll share the space based on their stretch ratio. See [member size_flags_stretch_ratio]. Use with [member size_flags_horizontal] and [member size_flags_vertical]. - + Sets the node's size flags to both fill and expand. See [constant SIZE_FILL] and [constant SIZE_EXPAND] for more information. - + Tells the parent [Container] to center the node in the available space. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical]. - + Tells the parent [Container] to align the node with its end, either the bottom or the right edge. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical]. diff --git a/doc/classes/EditorSpinSlider.xml b/doc/classes/EditorSpinSlider.xml index d270d32df7b..1aef79f6e58 100644 --- a/doc/classes/EditorSpinSlider.xml +++ b/doc/classes/EditorSpinSlider.xml @@ -22,7 +22,7 @@ If [code]true[/code], the slider can't be interacted with. - + The suffix to display after the value (in a faded color). This should generally be a plural word. You may have to use an abbreviation if the suffix is too long to be displayed. diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index 1a8cbf05846..a14856b9b2b 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -62,7 +62,7 @@ Limits the lines of text the node shows on screen. - + Set BiDi algorithm override for the structured text. diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index 4d3fb7ed5c5..94e80ffb2b9 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -266,79 +266,79 @@ Represents the size of the [enum ArrayCustomFormat] enum. - + Mesh array contains vertices. All meshes require a vertex array so this should always be present. - + Mesh array contains normals. - + Mesh array contains tangents. - + Mesh array contains colors. - + Mesh array contains UVs. - + Mesh array contains second UV. - + Mesh array contains custom channel index 0. - + Mesh array contains custom channel index 1. - + Mesh array contains custom channel index 2. - + Mesh array contains custom channel index 3. - + Mesh array contains bones. - + Mesh array contains bone weights. - + Mesh array uses indices. - + Mask of mesh channels permitted in blend shapes. - + Shift of first custom channel. - + Number of format bits per custom channel. See [enum ArrayCustomFormat]. - + Amount to shift [enum ArrayCustomFormat] for custom channel index 0. - + Amount to shift [enum ArrayCustomFormat] for custom channel index 1. - + Amount to shift [enum ArrayCustomFormat] for custom channel index 2. - + Amount to shift [enum ArrayCustomFormat] for custom channel index 3. - + Mask of custom format bits per custom channel. Must be shifted by one of the SHIFT constants. See [enum ArrayCustomFormat]. - + Shift of first compress flag. Compress flags should be passed to [method ArrayMesh.add_surface_from_arrays] and [method SurfaceTool.commit]. - + Flag used to mark that the array contains 2D vertices. - + Flag indices that the mesh data will use [code]GL_DYNAMIC_DRAW[/code] on GLES. Unused on Vulkan. - + Flag used to mark that the mesh contains up to 8 bone influences per vertex. This flag indicates that [constant ARRAY_BONES] and [constant ARRAY_WEIGHTS] elements will have double length. diff --git a/doc/classes/Range.xml b/doc/classes/Range.xml index 2dcfc909554..4803ea9bfbe 100644 --- a/doc/classes/Range.xml +++ b/doc/classes/Range.xml @@ -62,7 +62,7 @@ If [code]true[/code], [code]value[/code] will always be rounded to the nearest integer. - + If greater than 0, [code]value[/code] will always be rounded to a multiple of [code]step[/code]. If [code]rounded[/code] is also [code]true[/code], [code]value[/code] will first be rounded to a multiple of [code]step[/code] then rounded to the nearest integer. diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 87e569ba20d..937d36d4226 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -1930,7 +1930,7 @@ - + @@ -2032,14 +2032,14 @@ - + - + @@ -2047,14 +2047,14 @@ - + - + @@ -3745,65 +3745,65 @@ - + Flag used to mark a vertex array. - + Flag used to mark a normal array. - + Flag used to mark a tangent array. - + Flag used to mark a color array. - + Flag used to mark an UV coordinates array. - + Flag used to mark an UV coordinates array for the second UV coordinates. - + - + - + - + - + Flag used to mark a bone information array. - + Flag used to mark a weights array. - + Flag used to mark an index array. - + - + - + - + - + - + - + - + - + - + Flag used to mark that the array contains 2D vertices. - + - + Primitive to draw consists of points. diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml index 7d63747bd2e..e2db2166edf 100644 --- a/doc/classes/SpinBox.xml +++ b/doc/classes/SpinBox.xml @@ -60,7 +60,7 @@ If [code]true[/code], the [SpinBox] will select the whole text when the [LineEdit] gains focus. Clicking the up and down arrows won't trigger this behavior. - + Adds the specified [code]suffix[/code] string after the numerical value of the [SpinBox]. diff --git a/doc/classes/TextureProgressBar.xml b/doc/classes/TextureProgressBar.xml index d7a9d06a153..f381ee771e1 100644 --- a/doc/classes/TextureProgressBar.xml +++ b/doc/classes/TextureProgressBar.xml @@ -43,7 +43,7 @@ Starting angle for the fill of [member texture_progress] if [member fill_mode] is [constant FILL_CLOCKWISE] or [constant FILL_COUNTER_CLOCKWISE]. When the node's [code]value[/code] is equal to its [code]min_value[/code], the texture doesn't show up at all. When the [code]value[/code] increases, the texture fills and tends towards [member radial_fill_degrees]. - + The height of the 9-patch's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. diff --git a/doc/classes/VScrollBar.xml b/doc/classes/VScrollBar.xml index f9baf194b7d..41a87ba8860 100644 --- a/doc/classes/VScrollBar.xml +++ b/doc/classes/VScrollBar.xml @@ -9,8 +9,8 @@ - - + + diff --git a/doc/classes/VSlider.xml b/doc/classes/VSlider.xml index 4bc98dea6ff..2a5b5c1e0af 100644 --- a/doc/classes/VSlider.xml +++ b/doc/classes/VSlider.xml @@ -10,8 +10,8 @@ - - + + diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildOutputView.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildOutputView.cs index 4d40724a836..e4398226666 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildOutputView.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildOutputView.cs @@ -356,19 +356,19 @@ namespace GodotTools.Build { base._Ready(); - SizeFlagsVertical = (int)SizeFlags.ExpandFill; + SizeFlagsVertical = SizeFlags.ExpandFill; var hsc = new HSplitContainer { - SizeFlagsHorizontal = (int)SizeFlags.ExpandFill, - SizeFlagsVertical = (int)SizeFlags.ExpandFill + SizeFlagsHorizontal = SizeFlags.ExpandFill, + SizeFlagsVertical = SizeFlags.ExpandFill }; AddChild(hsc); _issuesList = new ItemList { - SizeFlagsVertical = (int)SizeFlags.ExpandFill, - SizeFlagsHorizontal = (int)SizeFlags.ExpandFill // Avoid being squashed by the build log + SizeFlagsVertical = SizeFlags.ExpandFill, + SizeFlagsHorizontal = SizeFlags.ExpandFill // Avoid being squashed by the build log }; _issuesList.ItemActivated += IssueActivated; _issuesList.AllowRmbSelect = true; @@ -382,8 +382,8 @@ namespace GodotTools.Build _buildLog = new TextEdit { Editable = false, - SizeFlagsVertical = (int)SizeFlags.ExpandFill, - SizeFlagsHorizontal = (int)SizeFlags.ExpandFill // Avoid being squashed by the issues list + SizeFlagsVertical = SizeFlags.ExpandFill, + SizeFlagsHorizontal = SizeFlags.ExpandFill // Avoid being squashed by the issues list }; hsc.AddChild(_buildLog); diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs b/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs index 237ac85267f..2e438f3f8fd 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/MSBuildPanel.cs @@ -123,9 +123,9 @@ namespace GodotTools.Build base._Ready(); CustomMinimumSize = new Vector2i(0, (int)(228 * EditorScale)); - SizeFlagsVertical = (int)SizeFlags.ExpandFill; + SizeFlagsVertical = SizeFlags.ExpandFill; - var toolBarHBox = new HBoxContainer { SizeFlagsHorizontal = (int)SizeFlags.ExpandFill }; + var toolBarHBox = new HBoxContainer { SizeFlagsHorizontal = SizeFlags.ExpandFill }; AddChild(toolBarHBox); _buildMenuBtn = new MenuButton { Text = "Build", Icon = GetThemeIcon("Play", "EditorIcons") }; diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp index 1e75659a8c5..97729b1ac54 100644 --- a/scene/gui/box_container.cpp +++ b/scene/gui/box_container.cpp @@ -68,12 +68,12 @@ void BoxContainer::_resort() { if (vertical) { /* VERTICAL */ stretch_min += size.height; msc.min_size = size.height; - msc.will_stretch = c->get_v_size_flags() & SIZE_EXPAND; + msc.will_stretch = c->get_v_size_flags().has_flag(SIZE_EXPAND); } else { /* HORIZONTAL */ stretch_min += size.width; msc.min_size = size.width; - msc.will_stretch = c->get_h_size_flags() & SIZE_EXPAND; + msc.will_stretch = c->get_h_size_flags().has_flag(SIZE_EXPAND); } if (msc.will_stretch) { diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index 8d251951998..145074a626f 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -104,22 +104,22 @@ void Container::fit_child_in_rect(Control *p_child, const Rect2 &p_rect) { Size2 minsize = p_child->get_combined_minimum_size(); Rect2 r = p_rect; - if (!(p_child->get_h_size_flags() & SIZE_FILL)) { + if (!(p_child->get_h_size_flags().has_flag(SIZE_FILL))) { r.size.x = minsize.width; - if (p_child->get_h_size_flags() & SIZE_SHRINK_END) { + if (p_child->get_h_size_flags().has_flag(SIZE_SHRINK_END)) { r.position.x += rtl ? 0 : (p_rect.size.width - minsize.width); - } else if (p_child->get_h_size_flags() & SIZE_SHRINK_CENTER) { + } else if (p_child->get_h_size_flags().has_flag(SIZE_SHRINK_CENTER)) { r.position.x += Math::floor((p_rect.size.x - minsize.width) / 2); } else { r.position.x += rtl ? (p_rect.size.width - minsize.width) : 0; } } - if (!(p_child->get_v_size_flags() & SIZE_FILL)) { + if (!(p_child->get_v_size_flags().has_flag(SIZE_FILL))) { r.size.y = minsize.y; - if (p_child->get_v_size_flags() & SIZE_SHRINK_END) { + if (p_child->get_v_size_flags().has_flag(SIZE_SHRINK_END)) { r.position.y += p_rect.size.height - minsize.height; - } else if (p_child->get_v_size_flags() & SIZE_SHRINK_CENTER) { + } else if (p_child->get_v_size_flags().has_flag(SIZE_SHRINK_CENTER)) { r.position.y += Math::floor((p_rect.size.y - minsize.height) / 2); } else { r.position.y += 0; diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 7daeb6eab6a..177b9902b42 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1684,27 +1684,27 @@ void Control::_clear_size_warning() { // Container sizing. -void Control::set_h_size_flags(int p_flags) { - if (data.h_size_flags == p_flags) { +void Control::set_h_size_flags(BitField p_flags) { + if ((int)data.h_size_flags == (int)p_flags) { return; } data.h_size_flags = p_flags; emit_signal(SceneStringNames::get_singleton()->size_flags_changed); } -int Control::get_h_size_flags() const { +BitField Control::get_h_size_flags() const { return data.h_size_flags; } -void Control::set_v_size_flags(int p_flags) { - if (data.v_size_flags == p_flags) { +void Control::set_v_size_flags(BitField p_flags) { + if ((int)data.v_size_flags == (int)p_flags) { return; } data.v_size_flags = p_flags; emit_signal(SceneStringNames::get_singleton()->size_flags_changed); } -int Control::get_v_size_flags() const { +BitField Control::get_v_size_flags() const { return data.v_size_flags; } @@ -3326,12 +3326,12 @@ void Control::_bind_methods() { BIND_ENUM_CONSTANT(PRESET_MODE_KEEP_HEIGHT); BIND_ENUM_CONSTANT(PRESET_MODE_KEEP_SIZE); - BIND_ENUM_CONSTANT(SIZE_SHRINK_BEGIN); - BIND_ENUM_CONSTANT(SIZE_FILL); - BIND_ENUM_CONSTANT(SIZE_EXPAND); - BIND_ENUM_CONSTANT(SIZE_EXPAND_FILL); - BIND_ENUM_CONSTANT(SIZE_SHRINK_CENTER); - BIND_ENUM_CONSTANT(SIZE_SHRINK_END); + BIND_BITFIELD_FLAG(SIZE_SHRINK_BEGIN); + BIND_BITFIELD_FLAG(SIZE_FILL); + BIND_BITFIELD_FLAG(SIZE_EXPAND); + BIND_BITFIELD_FLAG(SIZE_EXPAND_FILL); + BIND_BITFIELD_FLAG(SIZE_SHRINK_CENTER); + BIND_BITFIELD_FLAG(SIZE_SHRINK_END); BIND_ENUM_CONSTANT(MOUSE_FILTER_STOP); BIND_ENUM_CONSTANT(MOUSE_FILTER_PASS); diff --git a/scene/gui/control.h b/scene/gui/control.h index a11f7da00f3..c8098565381 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -198,8 +198,8 @@ private: // Container sizing. - int h_size_flags = SIZE_FILL; - int v_size_flags = SIZE_FILL; + BitField h_size_flags = SIZE_FILL; + BitField v_size_flags = SIZE_FILL; real_t expand = 1.0; Point2 custom_minimum_size; @@ -471,10 +471,10 @@ public: // Container sizing. - void set_h_size_flags(int p_flags); - int get_h_size_flags() const; - void set_v_size_flags(int p_flags); - int get_v_size_flags() const; + void set_h_size_flags(BitField p_flags); + BitField get_h_size_flags() const; + void set_v_size_flags(BitField p_flags); + BitField get_v_size_flags() const; void set_stretch_ratio(real_t p_ratio); real_t get_stretch_ratio() const; @@ -619,7 +619,7 @@ public: }; VARIANT_ENUM_CAST(Control::FocusMode); -VARIANT_ENUM_CAST(Control::SizeFlags); +VARIANT_BITFIELD_CAST(Control::SizeFlags); VARIANT_ENUM_CAST(Control::CursorShape); VARIANT_ENUM_CAST(Control::LayoutPreset); VARIANT_ENUM_CAST(Control::LayoutPresetMode); diff --git a/scene/gui/flow_container.cpp b/scene/gui/flow_container.cpp index e0a303651af..12ce6e17cb7 100644 --- a/scene/gui/flow_container.cpp +++ b/scene/gui/flow_container.cpp @@ -86,7 +86,7 @@ void FlowContainer::_resort() { } line_height = MAX(line_height, child_msc.x); - if (child->get_v_size_flags() & SIZE_EXPAND) { + if (child->get_v_size_flags().has_flag(SIZE_EXPAND)) { line_stretch_ratio_total += child->get_stretch_ratio(); } ofs.y += child_msc.y; @@ -108,7 +108,7 @@ void FlowContainer::_resort() { } line_height = MAX(line_height, child_msc.y); - if (child->get_h_size_flags() & SIZE_EXPAND) { + if (child->get_h_size_flags().has_flag(SIZE_EXPAND)) { line_stretch_ratio_total += child->get_stretch_ratio(); } ofs.x += child_msc.x; @@ -175,21 +175,21 @@ void FlowContainer::_resort() { } if (vertical) { /* VERTICAL */ - if (child->get_h_size_flags() & (SIZE_FILL | SIZE_SHRINK_CENTER | SIZE_SHRINK_END)) { + if (child->get_h_size_flags().has_flag(SIZE_FILL) || child->get_h_size_flags().has_flag(SIZE_SHRINK_CENTER) || child->get_h_size_flags().has_flag(SIZE_SHRINK_END)) { child_size.width = line_data.min_line_height; } - if (child->get_v_size_flags() & SIZE_EXPAND) { + if (child->get_v_size_flags().has_flag(SIZE_EXPAND)) { int stretch = line_data.stretch_avail * child->get_stretch_ratio() / line_data.stretch_ratio_total; child_size.height += stretch; } } else { /* HORIZONTAL */ - if (child->get_v_size_flags() & (SIZE_FILL | SIZE_SHRINK_CENTER | SIZE_SHRINK_END)) { + if (child->get_v_size_flags().has_flag(SIZE_FILL) || child->get_v_size_flags().has_flag(SIZE_SHRINK_CENTER) || child->get_v_size_flags().has_flag(SIZE_SHRINK_END)) { child_size.height = line_data.min_line_height; } - if (child->get_h_size_flags() & SIZE_EXPAND) { + if (child->get_h_size_flags().has_flag(SIZE_EXPAND)) { int stretch = line_data.stretch_avail * child->get_stretch_ratio() / line_data.stretch_ratio_total; child_size.width += stretch; } diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index b0318b3e8fc..fe1987d8096 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -174,7 +174,7 @@ void GraphNode::_resort() { stretch_min += size.height; msc.min_size = size.height; - msc.will_stretch = c->get_v_size_flags() & SIZE_EXPAND; + msc.will_stretch = c->get_v_size_flags().has_flag(SIZE_EXPAND); if (msc.will_stretch) { stretch_avail += msc.min_size; diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index e11afdf00d9..28f86369a24 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -73,10 +73,10 @@ void GridContainer::_notification(int p_what) { row_minh[row] = ms.height; } - if (c->get_h_size_flags() & SIZE_EXPAND) { + if (c->get_h_size_flags().has_flag(SIZE_EXPAND)) { col_expanded.insert(col); } - if (c->get_v_size_flags() & SIZE_EXPAND) { + if (c->get_v_size_flags().has_flag(SIZE_EXPAND)) { row_expanded.insert(row); } } diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index ed24f301970..b678f46091e 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -327,10 +327,10 @@ void ScrollContainer::_reposition_children() { Size2 minsize = c->get_combined_minimum_size(); Rect2 r = Rect2(-Size2(get_h_scroll(), get_v_scroll()), minsize); - if (c->get_h_size_flags() & SIZE_EXPAND) { + if (c->get_h_size_flags().has_flag(SIZE_EXPAND)) { r.size.width = MAX(size.width, minsize.width); } - if (c->get_v_size_flags() & SIZE_EXPAND) { + if (c->get_v_size_flags().has_flag(SIZE_EXPAND)) { r.size.height = MAX(size.height, minsize.height); } r.position += ofs; diff --git a/scene/resources/immediate_mesh.cpp b/scene/resources/immediate_mesh.cpp index 2254c193277..247927163b9 100644 --- a/scene/resources/immediate_mesh.cpp +++ b/scene/resources/immediate_mesh.cpp @@ -346,7 +346,7 @@ TypedArray ImmediateMesh::surface_get_blend_shape_arrays(int p_surface) c Dictionary ImmediateMesh::surface_get_lods(int p_surface) const { return Dictionary(); } -uint32_t ImmediateMesh::surface_get_format(int p_idx) const { +BitField ImmediateMesh::surface_get_format(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, int(surfaces.size()), 0); return surfaces[p_idx].format; } diff --git a/scene/resources/immediate_mesh.h b/scene/resources/immediate_mesh.h index 9407ecd98c4..bf07c82a0c7 100644 --- a/scene/resources/immediate_mesh.h +++ b/scene/resources/immediate_mesh.h @@ -99,7 +99,7 @@ public: virtual Array surface_get_arrays(int p_surface) const override; virtual TypedArray surface_get_blend_shape_arrays(int p_surface) const override; virtual Dictionary surface_get_lods(int p_surface) const override; - virtual uint32_t surface_get_format(int p_idx) const override; + virtual BitField surface_get_format(int p_idx) const override; virtual PrimitiveType surface_get_primitive_type(int p_idx) const override; virtual void surface_set_material(int p_idx, const Ref &p_material) override; virtual Ref surface_get_material(int p_idx) const override; diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 07baa0ad968..5e18b5df37a 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -75,7 +75,7 @@ Dictionary Mesh::surface_get_lods(int p_surface) const { return ret; } -uint32_t Mesh::surface_get_format(int p_idx) const { +BitField Mesh::surface_get_format(int p_idx) const { uint32_t ret = 0; GDVIRTUAL_REQUIRED_CALL(_surface_get_format, p_idx, ret); return ret; @@ -658,35 +658,35 @@ void Mesh::_bind_methods() { BIND_ENUM_CONSTANT(ARRAY_CUSTOM_RGBA_FLOAT); BIND_ENUM_CONSTANT(ARRAY_CUSTOM_MAX); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_VERTEX); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_NORMAL); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_TANGENT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_COLOR); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_TEX_UV); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_TEX_UV2); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM0); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM1); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM2); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM3); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_BONES); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_WEIGHTS); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_INDEX); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_VERTEX); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_NORMAL); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_TANGENT); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_COLOR); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_TEX_UV); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_TEX_UV2); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM0); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM1); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM2); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM3); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_BONES); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_WEIGHTS); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_INDEX); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_BLEND_SHAPE_MASK); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_BLEND_SHAPE_MASK); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM_BASE); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM_BITS); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM0_SHIFT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM1_SHIFT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM2_SHIFT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM3_SHIFT); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM_BASE); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM_BITS); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM0_SHIFT); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM1_SHIFT); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM2_SHIFT); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM3_SHIFT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM_MASK); - BIND_ENUM_CONSTANT(ARRAY_COMPRESS_FLAGS_BASE); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM_MASK); + BIND_BITFIELD_FLAG(ARRAY_COMPRESS_FLAGS_BASE); - BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_2D_VERTICES); - BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_DYNAMIC_UPDATE); - BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_8_BONE_WEIGHTS); + BIND_BITFIELD_FLAG(ARRAY_FLAG_USE_2D_VERTICES); + BIND_BITFIELD_FLAG(ARRAY_FLAG_USE_DYNAMIC_UPDATE); + BIND_BITFIELD_FLAG(ARRAY_FLAG_USE_8_BONE_WEIGHTS); BIND_ENUM_CONSTANT(BLEND_SHAPE_MODE_NORMALIZED); BIND_ENUM_CONSTANT(BLEND_SHAPE_MODE_RELATIVE); @@ -1554,7 +1554,7 @@ void ArrayMesh::_recompute_aabb() { } // TODO: Need to add binding to add_surface using future MeshSurfaceData object. -void ArrayMesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const Vector &p_array, const Vector &p_attribute_array, const Vector &p_skin_array, int p_vertex_count, const Vector &p_index_array, int p_index_count, const AABB &p_aabb, const Vector &p_blend_shape_data, const Vector &p_bone_aabbs, const Vector &p_lods) { +void ArrayMesh::add_surface(BitField p_format, PrimitiveType p_primitive, const Vector &p_array, const Vector &p_attribute_array, const Vector &p_skin_array, int p_vertex_count, const Vector &p_index_array, int p_index_count, const AABB &p_aabb, const Vector &p_blend_shape_data, const Vector &p_bone_aabbs, const Vector &p_lods) { _create_if_empty(); Surface s; @@ -1589,7 +1589,7 @@ void ArrayMesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const emit_changed(); } -void ArrayMesh::add_surface_from_arrays(PrimitiveType p_primitive, const Array &p_arrays, const TypedArray &p_blend_shapes, const Dictionary &p_lods, uint32_t p_flags) { +void ArrayMesh::add_surface_from_arrays(PrimitiveType p_primitive, const Array &p_arrays, const TypedArray &p_blend_shapes, const Dictionary &p_lods, BitField p_flags) { ERR_FAIL_COND(p_arrays.size() != ARRAY_MAX); RS::SurfaceData surface; @@ -1705,7 +1705,7 @@ int ArrayMesh::surface_get_array_index_len(int p_idx) const { return surfaces[p_idx].index_array_length; } -uint32_t ArrayMesh::surface_get_format(int p_idx) const { +BitField ArrayMesh::surface_get_format(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, surfaces.size(), 0); return surfaces[p_idx].format; } diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index f62f0606828..1baa4663122 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -156,7 +156,7 @@ public: virtual Array surface_get_arrays(int p_surface) const; virtual TypedArray surface_get_blend_shape_arrays(int p_surface) const; virtual Dictionary surface_get_lods(int p_surface) const; - virtual uint32_t surface_get_format(int p_idx) const; + virtual BitField surface_get_format(int p_idx) const; virtual PrimitiveType surface_get_primitive_type(int p_idx) const; virtual void surface_set_material(int p_idx, const Ref &p_material); virtual Ref surface_get_material(int p_idx) const; @@ -269,9 +269,9 @@ protected: static void _bind_methods(); public: - void add_surface_from_arrays(PrimitiveType p_primitive, const Array &p_arrays, const TypedArray &p_blend_shapes = TypedArray(), const Dictionary &p_lods = Dictionary(), uint32_t p_flags = 0); + void add_surface_from_arrays(PrimitiveType p_primitive, const Array &p_arrays, const TypedArray &p_blend_shapes = TypedArray(), const Dictionary &p_lods = Dictionary(), BitField p_flags = 0); - void add_surface(uint32_t p_format, PrimitiveType p_primitive, const Vector &p_array, const Vector &p_attribute_array, const Vector &p_skin_array, int p_vertex_count, const Vector &p_index_array, int p_index_count, const AABB &p_aabb, const Vector &p_blend_shape_data = Vector(), const Vector &p_bone_aabbs = Vector(), const Vector &p_lods = Vector()); + void add_surface(BitField p_format, PrimitiveType p_primitive, const Vector &p_array, const Vector &p_attribute_array, const Vector &p_skin_array, int p_vertex_count, const Vector &p_index_array, int p_index_count, const AABB &p_aabb, const Vector &p_blend_shape_data = Vector(), const Vector &p_bone_aabbs = Vector(), const Vector &p_lods = Vector()); Array surface_get_arrays(int p_surface) const override; TypedArray surface_get_blend_shape_arrays(int p_surface) const override; @@ -298,7 +298,7 @@ public: int surface_get_array_len(int p_idx) const override; int surface_get_array_index_len(int p_idx) const override; - uint32_t surface_get_format(int p_idx) const override; + BitField surface_get_format(int p_idx) const override; PrimitiveType surface_get_primitive_type(int p_idx) const override; virtual void surface_set_material(int p_idx, const Ref &p_material) override; @@ -330,7 +330,7 @@ public: }; VARIANT_ENUM_CAST(Mesh::ArrayType); -VARIANT_ENUM_CAST(Mesh::ArrayFormat); +VARIANT_BITFIELD_CAST(Mesh::ArrayFormat); VARIANT_ENUM_CAST(Mesh::ArrayCustomFormat); VARIANT_ENUM_CAST(Mesh::PrimitiveType); VARIANT_ENUM_CAST(Mesh::BlendShapeMode); @@ -351,7 +351,7 @@ public: virtual Array surface_get_arrays(int p_surface) const override { return Array(); } virtual TypedArray surface_get_blend_shape_arrays(int p_surface) const override { return TypedArray(); } virtual Dictionary surface_get_lods(int p_surface) const override { return Dictionary(); } - virtual uint32_t surface_get_format(int p_idx) const override { return 0; } + virtual BitField surface_get_format(int p_idx) const override { return 0; } virtual PrimitiveType surface_get_primitive_type(int p_idx) const override { return PRIMITIVE_TRIANGLES; } virtual void surface_set_material(int p_idx, const Ref &p_material) override {} virtual Ref surface_get_material(int p_idx) const override { return Ref(); } diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index b6e953dd56f..5ef66a22b62 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -180,7 +180,7 @@ TypedArray PrimitiveMesh::surface_get_blend_shape_arrays(int p_surface) c return TypedArray(); //not really supported } -uint32_t PrimitiveMesh::surface_get_format(int p_idx) const { +BitField PrimitiveMesh::surface_get_format(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, 1, 0); uint32_t mesh_format = RS::ARRAY_FORMAT_VERTEX | RS::ARRAY_FORMAT_NORMAL | RS::ARRAY_FORMAT_TANGENT | RS::ARRAY_FORMAT_TEX_UV | RS::ARRAY_FORMAT_INDEX; diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h index c1c51b350b3..22cd12b0049 100644 --- a/scene/resources/primitive_meshes.h +++ b/scene/resources/primitive_meshes.h @@ -84,7 +84,7 @@ public: virtual Array surface_get_arrays(int p_surface) const override; virtual TypedArray surface_get_blend_shape_arrays(int p_surface) const override; virtual Dictionary surface_get_lods(int p_surface) const override; - virtual uint32_t surface_get_format(int p_idx) const override; + virtual BitField surface_get_format(int p_idx) const override; virtual Mesh::PrimitiveType surface_get_primitive_type(int p_idx) const override; virtual void surface_set_material(int p_idx, const Ref &p_material) override; virtual Ref surface_get_material(int p_idx) const override; diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 13891e59fba..658d683398a 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -700,9 +700,9 @@ Error RenderingServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint return OK; } -uint32_t RenderingServer::mesh_surface_get_format_offset(uint32_t p_format, int p_vertex_len, int p_array_index) const { +uint32_t RenderingServer::mesh_surface_get_format_offset(BitField p_format, int p_vertex_len, int p_array_index) const { ERR_FAIL_INDEX_V(p_array_index, ARRAY_MAX, 0); - p_format &= ~ARRAY_FORMAT_INDEX; + p_format = int64_t(p_format) & ~ARRAY_FORMAT_INDEX; uint32_t offsets[ARRAY_MAX]; uint32_t vstr; uint32_t astr; @@ -711,8 +711,8 @@ uint32_t RenderingServer::mesh_surface_get_format_offset(uint32_t p_format, int return offsets[p_array_index]; } -uint32_t RenderingServer::mesh_surface_get_format_vertex_stride(uint32_t p_format, int p_vertex_len) const { - p_format &= ~ARRAY_FORMAT_INDEX; +uint32_t RenderingServer::mesh_surface_get_format_vertex_stride(BitField p_format, int p_vertex_len) const { + p_format = int64_t(p_format) & ~ARRAY_FORMAT_INDEX; uint32_t offsets[ARRAY_MAX]; uint32_t vstr; uint32_t astr; @@ -720,8 +720,8 @@ uint32_t RenderingServer::mesh_surface_get_format_vertex_stride(uint32_t p_forma mesh_surface_make_offsets_from_format(p_format, p_vertex_len, 0, offsets, vstr, astr, sstr); return vstr; } -uint32_t RenderingServer::mesh_surface_get_format_attribute_stride(uint32_t p_format, int p_vertex_len) const { - p_format &= ~ARRAY_FORMAT_INDEX; +uint32_t RenderingServer::mesh_surface_get_format_attribute_stride(BitField p_format, int p_vertex_len) const { + p_format = int64_t(p_format) & ~ARRAY_FORMAT_INDEX; uint32_t offsets[ARRAY_MAX]; uint32_t vstr; uint32_t astr; @@ -729,8 +729,8 @@ uint32_t RenderingServer::mesh_surface_get_format_attribute_stride(uint32_t p_fo mesh_surface_make_offsets_from_format(p_format, p_vertex_len, 0, offsets, vstr, astr, sstr); return astr; } -uint32_t RenderingServer::mesh_surface_get_format_skin_stride(uint32_t p_format, int p_vertex_len) const { - p_format &= ~ARRAY_FORMAT_INDEX; +uint32_t RenderingServer::mesh_surface_get_format_skin_stride(BitField p_format, int p_vertex_len) const { + p_format = int64_t(p_format) & ~ARRAY_FORMAT_INDEX; uint32_t offsets[ARRAY_MAX]; uint32_t vstr; uint32_t astr; @@ -1049,7 +1049,7 @@ Error RenderingServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surfa return OK; } -void RenderingServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, const Dictionary &p_lods, uint32_t p_compress_format) { +void RenderingServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, const Dictionary &p_lods, BitField p_compress_format) { SurfaceData sd; Error err = mesh_create_surface_data_from_arrays(&sd, p_primitive, p_arrays, p_blend_shapes, p_lods, p_compress_format); if (err != OK) { @@ -1797,35 +1797,35 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(ARRAY_CUSTOM_RGBA_FLOAT); BIND_ENUM_CONSTANT(ARRAY_CUSTOM_MAX); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_VERTEX); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_NORMAL); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_TANGENT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_COLOR); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_TEX_UV); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_TEX_UV2); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM0); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM1); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM2); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM3); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_BONES); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_WEIGHTS); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_INDEX); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_VERTEX); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_NORMAL); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_TANGENT); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_COLOR); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_TEX_UV); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_TEX_UV2); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM0); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM1); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM2); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM3); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_BONES); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_WEIGHTS); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_INDEX); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_BLEND_SHAPE_MASK); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_BLEND_SHAPE_MASK); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM_BASE); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM_BITS); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM0_SHIFT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM1_SHIFT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM2_SHIFT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM3_SHIFT); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM_BASE); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM_BITS); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM0_SHIFT); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM1_SHIFT); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM2_SHIFT); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM3_SHIFT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM_MASK); - BIND_ENUM_CONSTANT(ARRAY_COMPRESS_FLAGS_BASE); + BIND_BITFIELD_FLAG(ARRAY_FORMAT_CUSTOM_MASK); + BIND_BITFIELD_FLAG(ARRAY_COMPRESS_FLAGS_BASE); - BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_2D_VERTICES); - BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_DYNAMIC_UPDATE); - BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_8_BONE_WEIGHTS); + BIND_BITFIELD_FLAG(ARRAY_FLAG_USE_2D_VERTICES); + BIND_BITFIELD_FLAG(ARRAY_FLAG_USE_DYNAMIC_UPDATE); + BIND_BITFIELD_FLAG(ARRAY_FLAG_USE_8_BONE_WEIGHTS); BIND_ENUM_CONSTANT(PRIMITIVE_POINTS); BIND_ENUM_CONSTANT(PRIMITIVE_LINES); diff --git a/servers/rendering_server.h b/servers/rendering_server.h index a5862b80cdf..88144cfeeb9 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -320,10 +320,10 @@ public: virtual void mesh_set_blend_shape_count(RID p_mesh, int p_blend_shape_count) = 0; - virtual uint32_t mesh_surface_get_format_offset(uint32_t p_format, int p_vertex_len, int p_array_index) const; - virtual uint32_t mesh_surface_get_format_vertex_stride(uint32_t p_format, int p_vertex_len) const; - virtual uint32_t mesh_surface_get_format_attribute_stride(uint32_t p_format, int p_vertex_len) const; - virtual uint32_t mesh_surface_get_format_skin_stride(uint32_t p_format, int p_vertex_len) const; + virtual uint32_t mesh_surface_get_format_offset(BitField p_format, int p_vertex_len, int p_array_index) const; + virtual uint32_t mesh_surface_get_format_vertex_stride(BitField p_format, int p_vertex_len) const; + virtual uint32_t mesh_surface_get_format_attribute_stride(BitField p_format, int p_vertex_len) const; + virtual uint32_t mesh_surface_get_format_skin_stride(BitField p_format, int p_vertex_len) const; /// Returns stride virtual void mesh_surface_make_offsets_from_format(uint32_t p_format, int p_vertex_len, int p_index_len, uint32_t *r_offsets, uint32_t &r_vertex_element_size, uint32_t &r_attrib_element_size, uint32_t &r_skin_element_size) const; @@ -333,7 +333,7 @@ public: TypedArray mesh_surface_get_blend_shape_arrays(RID p_mesh, int p_surface) const; Dictionary mesh_surface_get_lods(RID p_mesh, int p_surface) const; - virtual void mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes = Array(), const Dictionary &p_lods = Dictionary(), uint32_t p_compress_format = 0); + virtual void mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes = Array(), const Dictionary &p_lods = Dictionary(), BitField p_compress_format = 0); virtual void mesh_add_surface(RID p_mesh, const SurfaceData &p_surface) = 0; virtual int mesh_get_blend_shape_count(RID p_mesh) const = 0; @@ -1610,7 +1610,7 @@ VARIANT_ENUM_CAST(RenderingServer::TextureLayeredType); VARIANT_ENUM_CAST(RenderingServer::CubeMapLayer); VARIANT_ENUM_CAST(RenderingServer::ShaderMode); VARIANT_ENUM_CAST(RenderingServer::ArrayType); -VARIANT_ENUM_CAST(RenderingServer::ArrayFormat); +VARIANT_BITFIELD_CAST(RenderingServer::ArrayFormat); VARIANT_ENUM_CAST(RenderingServer::ArrayCustomFormat); VARIANT_ENUM_CAST(RenderingServer::PrimitiveType); VARIANT_ENUM_CAST(RenderingServer::BlendShapeMode);