diff options
75 files changed, 1350 insertions, 453 deletions
diff --git a/.gitattributes b/.gitattributes index f8959dd2d1..03c6f96f80 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,3 +8,4 @@ drivers/* linguist-vendored *.h eol=lf *.py eol=lf *.hpp eol=lf +*.xml eol=lf diff --git a/core/image.cpp b/core/image.cpp index c7f21d5599..943cbaf51d 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -2474,6 +2474,7 @@ void Image::fix_alpha_edges() { if (rp[3] < alpha_threshold) continue; + closest_dist = dist; closest_color[0] = rp[0]; closest_color[1] = rp[1]; closest_color[2] = rp[2]; diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp index c93e12f7da..e5da307153 100644 --- a/core/io/file_access_encrypted.cpp +++ b/core/io/file_access_encrypted.cpp @@ -62,12 +62,12 @@ Error FileAccessEncrypted::open_and_parse(FileAccess *p_base, const Vector<uint8 writing = false; key = p_key; uint32_t magic = p_base->get_32(); - print_line("MAGIC: " + itos(magic)); ERR_FAIL_COND_V(magic != COMP_MAGIC, ERR_FILE_UNRECOGNIZED); + mode = Mode(p_base->get_32()); ERR_FAIL_INDEX_V(mode, MODE_MAX, ERR_FILE_CORRUPT); ERR_FAIL_COND_V(mode == 0, ERR_FILE_CORRUPT); - print_line("MODE: " + itos(mode)); + unsigned char md5d[16]; p_base->get_buffer(md5d, 16); length = p_base->get_64(); diff --git a/doc/classes/ARVRScriptInterface.xml b/doc/classes/ARVRScriptInterface.xml deleted file mode 100644 index 182147a015..0000000000 --- a/doc/classes/ARVRScriptInterface.xml +++ /dev/null @@ -1,118 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="ARVRScriptInterface" inherits="ARVRInterface" category="Core" version="3.0.alpha.custom_build"> - <brief_description> - Base class for GDNative based ARVR interfaces. - </brief_description> - <description> - This class is used as a base class/interface class for implementing GDNative based ARVR interfaces and as a result exposes more of the internals of the ARVR server. - </description> - <tutorials> - </tutorials> - <demos> - </demos> - <methods> - <method name="_get_projection_for_eye" qualifiers="virtual"> - <return type="void"> - </return> - <description> - Should return the projection 4x4 matrix for the requested eye. - </description> - </method> - <method name="commit_for_eye" qualifiers="virtual"> - <return type="void"> - </return> - <argument index="0" name="eye" type="int"> - </argument> - <argument index="1" name="render_target" type="RID"> - </argument> - <description> - Outputs a finished render buffer to the AR/VR device for the given eye. - </description> - </method> - <method name="get_anchor_detection_is_enabled" qualifiers="virtual"> - <return type="bool"> - </return> - <description> - Returns true if achor detection is enabled (AR only). - </description> - </method> - <method name="get_capabilities" qualifiers="virtual"> - <return type="int"> - </return> - <description> - Returns a combination of flags providing information about the capabilities of this interface. - </description> - </method> - <method name="get_recommended_render_targetsize" qualifiers="virtual"> - <return type="Vector2"> - </return> - <description> - Returns the size at which we should render our scene to get optimal quality on the output device. - </description> - </method> - <method name="get_tracking_status" qualifiers="virtual"> - <return type="int"> - </return> - <description> - If supported, returns the status of our tracking. This will allow you to provide feedback to the user whether there are issues with positional tracking. - </description> - </method> - <method name="get_transform_for_eye" qualifiers="virtual"> - <return type="Transform"> - </return> - <argument index="0" name="eye" type="int"> - </argument> - <argument index="1" name="cam_transform" type="Transform"> - </argument> - <description> - Get the location and orientation transform used when rendering a specific eye. - </description> - </method> - <method name="initialize" qualifiers="virtual"> - <return type="bool"> - </return> - <description> - Initialize this interface. - </description> - </method> - <method name="is_initialized" qualifiers="virtual"> - <return type="bool"> - </return> - <description> - Returns true if this interface has been initialized and is active. - </description> - </method> - <method name="is_stereo" qualifiers="virtual"> - <return type="bool"> - </return> - <description> - Returns true if we require stereoscopic rendering for this interface. - </description> - </method> - <method name="process" qualifiers="virtual"> - <return type="void"> - </return> - <description> - Gets called before rendering each frame so tracking data gets updated in time. - </description> - </method> - <method name="set_anchor_detection_is_enabled" qualifiers="virtual"> - <return type="void"> - </return> - <argument index="0" name="enabled" type="bool"> - </argument> - <description> - Enables anchor detection, this is used on AR interfaces and enables the extra logic that will detect planes, features, objects, etc. and adds/modifies anchor points. - </description> - </method> - <method name="uninitialize" qualifiers="virtual"> - <return type="void"> - </return> - <description> - Turn this interface off. - </description> - </method> - </methods> - <constants> - </constants> -</class> diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml index e983c59782..07027c4b42 100644 --- a/doc/classes/BitmapFont.xml +++ b/doc/classes/BitmapFont.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="BitmapFont" inherits="Font" category="Core" version="3.0.alpha.custom_build"> <brief_description> + Renders text using [code]*.fnt[/code] fonts. </brief_description> <description> + Renders text using [code]*.fnt[/code] fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see [DynamicFont]. </description> <tutorials> </tutorials> @@ -23,7 +25,7 @@ <argument index="4" name="advance" type="float" default="-1"> </argument> <description> - Add a character to the font, where [i]character[/i] is the unicode value, [i]texture[/i] is the texture index, [i]rect[/i] is the region in the texture (in pixels!), [i]align[/i] is the (optional) alignment for the character and [i]advance[/i] is the (optional) advance. + Adds a character to the font, where [code]character[/code] is the unicode value, [code]texture[/code] is the texture index, [code]rect[/code] is the region in the texture (in pixels!), [code]align[/code] is the (optional) alignment for the character and [code]advance[/code] is the (optional) advance. </description> </method> <method name="add_kerning_pair"> @@ -36,7 +38,7 @@ <argument index="2" name="kerning" type="int"> </argument> <description> - Add a kerning pair to the [BitmapFont] as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character. + Adds a kerning pair to the [BitmapFont] as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character. </description> </method> <method name="add_texture"> @@ -45,14 +47,14 @@ <argument index="0" name="texture" type="Texture"> </argument> <description> - Add a texture to the [BitmapFont]. + Adds a texture to the [BitmapFont]. </description> </method> <method name="clear"> <return type="void"> </return> <description> - Clear all the font data. + Clears all the font data and settings. </description> </method> <method name="create_from_fnt"> @@ -61,6 +63,7 @@ <argument index="0" name="path" type="String"> </argument> <description> + Creates a BitmapFont from the [code]*.fnt[/code] file at [code]path[/code]. </description> </method> <method name="get_char_size" qualifiers="const"> @@ -71,13 +74,14 @@ <argument index="1" name="next" type="int" default="0"> </argument> <description> - Return the size of a character, optionally taking kerning into account if the next character is provided. + Returns the size of a character, optionally taking kerning into account if the next character is provided. </description> </method> <method name="get_fallback" qualifiers="const"> <return type="BitmapFont"> </return> <description> + Returns the fallback BitmapFont. </description> </method> <method name="get_kerning_pair" qualifiers="const"> @@ -88,7 +92,7 @@ <argument index="1" name="char_b" type="int"> </argument> <description> - Return a kerning pair as a difference. + Returns a kerning pair as a difference. </description> </method> <method name="get_texture" qualifiers="const"> @@ -97,12 +101,14 @@ <argument index="0" name="idx" type="int"> </argument> <description> + Returns the font atlas texture at index [code]idx[/code]. </description> </method> <method name="get_texture_count" qualifiers="const"> <return type="int"> </return> <description> + Returns the number of textures in the BitmapFont atlas. </description> </method> <method name="set_ascent"> @@ -111,7 +117,7 @@ <argument index="0" name="px" type="float"> </argument> <description> - Set the font ascent (number of pixels above the baseline). + Sets the font ascent (number of pixels above the baseline). </description> </method> <method name="set_distance_field_hint"> @@ -120,6 +126,7 @@ <argument index="0" name="enable" type="bool"> </argument> <description> + If [code]true[/code] distance field hint is enabled. </description> </method> <method name="set_fallback"> @@ -128,6 +135,7 @@ <argument index="0" name="fallback" type="BitmapFont"> </argument> <description> + Sets the fallback BitmapFont. </description> </method> <method name="set_height"> @@ -136,24 +144,31 @@ <argument index="0" name="px" type="float"> </argument> <description> - Set the total font height (ascent plus descent) in pixels. + Sets the total font height (ascent plus descent) in pixels. </description> </method> </methods> <members> <member name="ascent" type="float" setter="set_ascent" getter="get_ascent"> + Ascent (number of pixels above the baseline). </member> <member name="chars" type="PoolIntArray" setter="_set_chars" getter="_get_chars"> + The characters in the BitmapFont. </member> <member name="distance_field" type="bool" setter="set_distance_field_hint" getter="is_distance_field_hint"> + If [code]true[/code] distance field hint is enabled. </member> <member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback"> + The fallback font. </member> <member name="height" type="float" setter="set_height" getter="get_height"> + Total font height (ascent plus descent) in pixels. </member> <member name="kernings" type="PoolIntArray" setter="_set_kernings" getter="_get_kernings"> + The font's kernings as [PoolIntArray]. </member> <member name="textures" type="Array" setter="_set_textures" getter="_get_textures"> + The font's [Texture]\ s. </member> </members> <constants> diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml index c2d1ec1355..846a100f3c 100644 --- a/doc/classes/ConfigFile.xml +++ b/doc/classes/ConfigFile.xml @@ -4,15 +4,22 @@ Helper class to handle INI-style files. </brief_description> <description> - This helper class can be used to store [Variant] values on the filesystem using an INI-style formatting. The stored values as referenced by a section and a key. The stored data can be saved to or parsed from a file, though ConfigFile objects can also be used directly with accessing the filesystem. - The following example shows how to parse a INI-style file from the system, read its contents and store new values in it: + This helper class can be used to store [Variant] values on the filesystem using INI-style formatting. The stored values are indentified by a section and a key: + [codeblock] + [section] + some_key=42 + string_example="Hello World!" + a_vector=Vector3( 1, 0, 2 ) + [/codeblock] + The stored data can be saved to or parsed from a file, though ConfigFile objects can also be used directly without accessing the filesystem. + The following example shows how to parse an INI-style file from the system, read its contents and store new values in it: [codeblock] var config = ConfigFile.new() var err = config.load("user://settings.cfg") if err == OK: # if not, something went wrong with the file loading # Look for the display/width pair, and default to 1024 if missing var screen_width = get_value("display", "width", 1024) - # Store a variable if and only it hasn't been defined yet + # Store a variable if and only if it hasn't been defined yet if not config.has_section_key("audio", "mute"): config.set_value("audio", "mute", false) # Save the changes by overwriting the previous file @@ -30,6 +37,7 @@ <argument index="0" name="section" type="String"> </argument> <description> + Deletes the specified section along with all the key-value pairs inside. </description> </method> <method name="get_section_keys" qualifiers="const"> @@ -38,14 +46,14 @@ <argument index="0" name="section" type="String"> </argument> <description> - Return an array of all defined key identifiers in the specified section. + Returns an array of all defined key identifiers in the specified section. </description> </method> <method name="get_sections" qualifiers="const"> <return type="PoolStringArray"> </return> <description> - Return an array of all defined section identifiers. + Returns an array of all defined section identifiers. </description> </method> <method name="get_value" qualifiers="const"> @@ -58,7 +66,7 @@ <argument index="2" name="default" type="Variant" default="null"> </argument> <description> - Return the current value for the specified section and key. If the section and/or the key do not exist, the method returns the value of the optional [i]default[/i] argument (and thus [code]NULL[/code] if not specified). + Returns the current value for the specified section and key. If the section and/or the key do not exist, the method returns the value of the optional [code]default[/code] argument, or [code]null[/code] if it is omitted. </description> </method> <method name="has_section" qualifiers="const"> @@ -67,7 +75,7 @@ <argument index="0" name="section" type="String"> </argument> <description> - Check if the specified section exists. + Returns [code]true[/code] if the specified section exists. </description> </method> <method name="has_section_key" qualifiers="const"> @@ -78,7 +86,7 @@ <argument index="1" name="key" type="String"> </argument> <description> - Check if the specified section-key pair exists. + Returns [code]true[/code] if the specified section-key pair exists. </description> </method> <method name="load"> @@ -87,7 +95,7 @@ <argument index="0" name="path" type="String"> </argument> <description> - Load the config file specified as a parameter. The file's contents are parsed and loaded in the ConfigFile object from which the method was called. The return value is one of the OK, FAILED or ERR_* constants listed in [@Global Scope] (if the load was successful, it returns OK). + Loads the config file specified as a parameter. The file's contents are parsed and loaded in the ConfigFile object which the method was called on. Returns one of the [code]OK[/code], [code]FAILED[/code] or [code]ERR_*[/code] constants listed in [@Global Scope]. If the load was successful, the return value is [code]OK[/code]. </description> </method> <method name="save"> @@ -96,8 +104,7 @@ <argument index="0" name="path" type="String"> </argument> <description> - Save the contents of the ConfigFile object to the file specified as a parameter. The output file uses an INI-style structure. - The return value is one of the OK, FAILED or ERR_* constants listed in [@Global Scope] (if the save was successful, it returns OK). + Saves the contents of the ConfigFile object to the file specified as a parameter. The output file uses an INI-style structure. Returns one of the [code]OK[/code], [code]FAILED[/code] or [code]ERR_*[/code] constants listed in [@Global Scope]. If the load was successful, the return value is [code]OK[/code]. </description> </method> <method name="set_value"> @@ -110,7 +117,7 @@ <argument index="2" name="value" type="Variant"> </argument> <description> - Assign a value to the specified key of the the specified section. If the section and/or the key do not exist, they are created. Passing a [code]NULL[/code] value deletes the specified key if it exists (and deletes the section if it ends up empty once the key has been removed). + Assigns a value to the specified key of the the specified section. If the section and/or the key do not exist, they are created. Passing a [code]null[/code] value deletes the specified key if it exists, and deletes the section if it ends up empty once the key has been removed. </description> </method> </methods> diff --git a/doc/classes/DynamicFontData.xml b/doc/classes/DynamicFontData.xml index 51e4e0d231..9012b46e08 100644 --- a/doc/classes/DynamicFontData.xml +++ b/doc/classes/DynamicFontData.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="DynamicFontData" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> <brief_description> + Used with [DynamicFont] to describe the location of a font file. </brief_description> <description> + Used with [DynamicFont] to describe the location of a vector font file for dynamic rendering at runtime. </description> <tutorials> </tutorials> @@ -13,6 +15,7 @@ <return type="String"> </return> <description> + Returns the font path. </description> </method> <method name="set_font_path"> @@ -21,11 +24,13 @@ <argument index="0" name="path" type="String"> </argument> <description> + Sets the font path. </description> </method> </methods> <members> <member name="font_path" type="String" setter="set_font_path" getter="get_font_path"> + The path to the vector font file. </member> </members> <constants> diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index ffe99eb82b..ad02064862 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -16,14 +16,14 @@ <return type="bool"> </return> <description> - Return whether the tabs should be visible or hidden. + Returns [code]true[/code] if the tabs are visible. </description> </method> <method name="get_current_tab" qualifiers="const"> <return type="int"> </return> <description> - Return the current tab index that is being shown. + Returns the current tab index that is being shown. </description> </method> <method name="get_current_tab_control" qualifiers="const"> @@ -42,14 +42,14 @@ <return type="int"> </return> <description> - Return the previous tab index that was being shown. + Returns the previous tab index that was being shown. </description> </method> <method name="get_tab_align" qualifiers="const"> <return type="int" enum="TabContainer.TabAlign"> </return> <description> - Return tab alignment, from the ALIGN_* enum. + Returns the tab alignment.See the ALIGN_* constants. </description> </method> <method name="get_tab_control" qualifiers="const"> @@ -58,14 +58,14 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Return the current tab control that is being shown. + Returns the current tab control that is being shown. </description> </method> <method name="get_tab_count" qualifiers="const"> <return type="int"> </return> <description> - Return the amount of tabs. + Returns the amount of tabs. </description> </method> <method name="get_tab_disabled" qualifiers="const"> @@ -74,6 +74,7 @@ <argument index="0" name="tab_idx" type="int"> </argument> <description> + Returns [code]true[/code] if the tab at index [code]tab_idx[/code] is disabled. </description> </method> <method name="get_tab_icon" qualifiers="const"> @@ -82,6 +83,7 @@ <argument index="0" name="tab_idx" type="int"> </argument> <description> + Returns the [Texture] for the tab at index [code]tab_idx[/code] or null if the tab has no [Texture]. </description> </method> <method name="get_tab_title" qualifiers="const"> @@ -90,7 +92,7 @@ <argument index="0" name="tab_idx" type="int"> </argument> <description> - Return the title for the tab. Tab titles are by default the children node name, but this can be overridden. + Returns the title for the tab at index [code]tab_idx[/code]. Tab titles are by default the children node name, but this can be overridden. </description> </method> <method name="set_current_tab"> @@ -127,6 +129,7 @@ <argument index="1" name="disabled" type="bool"> </argument> <description> + Set tab at index [code]tab_idx[/code] disabled. </description> </method> <method name="set_tab_icon"> @@ -137,7 +140,7 @@ <argument index="1" name="icon" type="Texture"> </argument> <description> - Set an icon for a tab. + Set an icon for a tab at index [code]tab_idx[/code]. </description> </method> <method name="set_tab_title"> @@ -148,7 +151,7 @@ <argument index="1" name="title" type="String"> </argument> <description> - Set a title for the tab. Tab titles are by default the children node name, but this can be overridden. + Set a title for the tab at index [code]tab_idx[/code]. Tab titles are by default the children node name, but this can be overridden. </description> </method> <method name="set_tabs_visible"> @@ -157,16 +160,19 @@ <argument index="0" name="visible" type="bool"> </argument> <description> - Set whether the tabs should be visible or hidden. + If [code]true[/code] all the tabs will be visible. </description> </method> </methods> <members> <member name="current_tab" type="int" setter="set_current_tab" getter="get_current_tab"> + The current tab. </member> <member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" enum="TabContainer.TabAlign"> + The alignment of all the tabs of the tab container. See the [code]ALIGN_*[/code] constants. </member> <member name="tabs_visible" type="bool" setter="set_tabs_visible" getter="are_tabs_visible"> + If [code]true[/code] all tabs that are children of the TabContainer will be visible. </member> </members> <signals> diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml index 8a96fa1454..51cb7f86f2 100644 --- a/doc/classes/TouchScreenButton.xml +++ b/doc/classes/TouchScreenButton.xml @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="TouchScreenButton" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> <brief_description> + Button for touch screen devices. </brief_description> <description> + Button for touch screen devices. You can set it to be visible on all screens, or only on touch devices. </description> <tutorials> </tutorials> @@ -13,36 +15,42 @@ <return type="String"> </return> <description> + Returns the button's action. </description> </method> <method name="get_bitmask" qualifiers="const"> <return type="BitMap"> </return> <description> + Returns the button's bitmask. </description> </method> <method name="get_shape" qualifiers="const"> <return type="Shape2D"> </return> <description> + Returns the button's shape. </description> </method> <method name="get_texture" qualifiers="const"> <return type="Texture"> </return> <description> + Returns the button's texture for the normal state. </description> </method> <method name="get_texture_pressed" qualifiers="const"> <return type="Texture"> </return> <description> + Returns the button's texture for the pressed state. </description> </method> <method name="get_visibility_mode" qualifiers="const"> <return type="int" enum="TouchScreenButton.VisibilityMode"> </return> <description> + Sets the button's visibility mode. See [code]VISIBILITY_*[/code] constants. </description> </method> <method name="is_passby_press_enabled" qualifiers="const"> @@ -55,6 +63,7 @@ <return type="bool"> </return> <description> + Returns [code]true[/code] if this button is currently pressed. </description> </method> <method name="is_shape_centered" qualifiers="const"> @@ -75,6 +84,7 @@ <argument index="0" name="action" type="String"> </argument> <description> + Sets the button's action. </description> </method> <method name="set_bitmask"> @@ -83,6 +93,7 @@ <argument index="0" name="bitmask" type="BitMap"> </argument> <description> + Sets the button's [BitMap] bitmask. </description> </method> <method name="set_passby_press"> @@ -91,6 +102,7 @@ <argument index="0" name="enabled" type="bool"> </argument> <description> + If [code]true[/code] passby presses are enabled for this button. </description> </method> <method name="set_shape"> @@ -99,6 +111,7 @@ <argument index="0" name="shape" type="Shape2D"> </argument> <description> + Sets the button's shape. </description> </method> <method name="set_shape_centered"> @@ -107,6 +120,7 @@ <argument index="0" name="bool" type="bool"> </argument> <description> + If [code]true[/code] the button's shape is centered. </description> </method> <method name="set_shape_visible"> @@ -115,6 +129,7 @@ <argument index="0" name="bool" type="bool"> </argument> <description> + If [code]true[/code] the button's shape is visible. </description> </method> <method name="set_texture"> @@ -123,6 +138,7 @@ <argument index="0" name="texture" type="Texture"> </argument> <description> + Sets the button's [Texture] for the normal state. </description> </method> <method name="set_texture_pressed"> @@ -131,6 +147,7 @@ <argument index="0" name="texture_pressed" type="Texture"> </argument> <description> + Sets the button's [Texture] for the pressed state. </description> </method> <method name="set_visibility_mode"> @@ -139,43 +156,57 @@ <argument index="0" name="mode" type="int" enum="TouchScreenButton.VisibilityMode"> </argument> <description> + Sets the button's visibility mode. See the [code]VISIBILITY_*[/code] constants. </description> </method> </methods> <members> <member name="action" type="String" setter="set_action" getter="get_action"> + The button's action. Actions can be handled with [InputEventAction]. </member> <member name="bitmask" type="BitMap" setter="set_bitmask" getter="get_bitmask"> + The button's bitmask. </member> <member name="normal" type="Texture" setter="set_texture" getter="get_texture"> + The button's texture for the normal state. </member> <member name="passby_press" type="bool" setter="set_passby_press" getter="is_passby_press_enabled"> + If [code]true[/code] passby presses are enabled. </member> <member name="pressed" type="Texture" setter="set_texture_pressed" getter="get_texture_pressed"> + The button's texture for the pressed state. </member> <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape"> + The button's shape. </member> <member name="shape_centered" type="bool" setter="set_shape_centered" getter="is_shape_centered"> + If [code]true[/code] the button's shape is centered. </member> <member name="shape_visible" type="bool" setter="set_shape_visible" getter="is_shape_visible"> + If [code]true[/code] the button's shape is visible. </member> <member name="visibility_mode" type="int" setter="set_visibility_mode" getter="get_visibility_mode" enum="TouchScreenButton.VisibilityMode"> + The button's visibility mode. See [code]VISIBILITY_*[/code] constants. </member> </members> <signals> <signal name="pressed"> <description> + Emitted when the button is pressed (down). </description> </signal> <signal name="released"> <description> + Emitted when the button is released (up). </description> </signal> </signals> <constants> <constant name="VISIBILITY_ALWAYS" value="0"> + Always visible. </constant> <constant name="VISIBILITY_TOUCHSCREEN_ONLY" value="1"> + Visible on touch screens only. </constant> </constants> </class> diff --git a/editor/animation_editor.cpp b/editor/animation_editor.cpp index b832b993bb..5bb10f495e 100644 --- a/editor/animation_editor.cpp +++ b/editor/animation_editor.cpp @@ -1101,7 +1101,7 @@ void AnimationKeyEditor::_track_editor_draw() { Color select_color = color; select_color.a = 0.1; Color invalid_path_color = get_color("error_color", "Editor"); - Color track_select_color = get_color("accent", "Editor"); + Color track_select_color = get_color("highlighted_font_color", "Editor"); Ref<Texture> remove_icon = get_icon("Remove", "EditorIcons"); Ref<Texture> move_up_icon = get_icon("MoveUp", "EditorIcons"); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index cb94ea72d1..20ffbde378 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -694,7 +694,7 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) { inherits = doc->class_list[inherits].inherits; if (inherits != "") { - class_desc->add_text(" , "); + class_desc->add_text(" < "); } } diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 0436ac78df..3fc1dcb0bd 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -350,6 +350,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("contrast_color_2", "Editor", contrast_color_2); theme->set_color("font_color", "Editor", font_color); + theme->set_color("highlighted_font_color", "Editor", font_color_hl); theme->set_color("disabled_font_color", "Editor", font_color_disabled); theme->set_color("mono_color", "Editor", mono_color); diff --git a/editor/icons/icon_GUI_unchecked.svg b/editor/icons/icon_GUI_unchecked.svg index 4adf3dd61e..59df40954f 100644 --- a/editor/icons/icon_GUI_unchecked.svg +++ b/editor/icons/icon_GUI_unchecked.svg @@ -1,5 +1,3 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 15.999999" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)"> -<path transform="translate(0 1036.4)" d="m4 2a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-8zm0.80078 2h6.3984a0.8 0.8 0 0 1 0.80078 0.80078v6.3984a0.8 0.8 0 0 1 -0.80078 0.80078h-6.3984a0.8 0.8 0 0 1 -0.80078 -0.80078v-6.3984a0.8 0.8 0 0 1 0.80078 -0.80078z" fill="#e0e0e0" fill-opacity=".78431"/> -</g> +<path d="m4 2a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-8zm0.80078 2h6.3984a0.8 0.8 0 0 1 0.80078 0.80078v6.3984a0.8 0.8 0 0 1 -0.80078 0.80078h-6.3984a0.8 0.8 0 0 1 -0.80078 -0.80078v-6.3984a0.8 0.8 0 0 1 0.80078 -0.80078z" fill="#e0e0e0" fill-opacity=".78431"/> </svg> diff --git a/editor/icons/icon_a_r_v_r_anchor.svg b/editor/icons/icon_a_r_v_r_anchor.svg new file mode 100644 index 0000000000..1a8398a1be --- /dev/null +++ b/editor/icons/icon_a_r_v_r_anchor.svg @@ -0,0 +1,3 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<path d="m7 1v2h-2v2h2v3.2656l-2.5527-1.2773c-0.15005-0.075253-0.31662-0.11152-0.48438-0.10547-0.36536 0.013648-0.69415 0.2256-0.85742 0.55273-0.24709 0.49403-0.046823 1.0948 0.44727 1.3418l4.4473 2.2227 4.4473-2.2227c0.49409-0.24697 0.69435-0.84777 0.44726-1.3418-0.24697-0.49409-0.84777-0.69435-1.3418-0.44727l-2.5527 1.2773v-3.2656h2v-2h-2v-2zm-3 11v1c0 0.55228 0.44772 1 1 1-0.55228 0-1 0.44772-1 1v1h1v-1h1v1h1v-1c0-0.55228-0.44772-1-1-1 0.55228 0 1-0.44772 1-1v-1h-1v1h-1v-1zm5 0v4h1v-1h1v1h1v-1c-8.34e-4 -0.17579-0.047991-0.34825-0.13672-0.5 0.088728-0.15175 0.13588-0.32421 0.13672-0.5v-1c0-0.55228-0.44772-1-1-1h-1zm1 1h1v1h-1z" fill="#fc9c9c"/> +</svg> diff --git a/editor/icons/icon_a_r_v_r_camera.svg b/editor/icons/icon_a_r_v_r_camera.svg index a02b4d983c..5bf815bcef 100644 --- a/editor/icons/icon_a_r_v_r_camera.svg +++ b/editor/icons/icon_a_r_v_r_camera.svg @@ -1,3 +1,3 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<path d="m2 1c-0.55401 0-1 0.446-1 1v7c0 0.554 0.44599 1 1 1h4l1-2c0.24699-0.494 0.44772-1 1-1s0.75301 0.506 1 1l1 2h4c0.55401 0 1-0.446 1-1v-7c0-0.554-0.44599-1-1-1h-12zm2 3a2 2 0 0 1 2 2 2 2 0 0 1 -2 2 2 2 0 0 1 -2 -2 2 2 0 0 1 2 -2zm8 0a2 2 0 0 1 2 2 2 2 0 0 1 -2 2 2 2 0 0 1 -2 -2 2 2 0 0 1 2 -2zm-8 7v4h2c0.502 4e-4 0.9265-0.37144 0.99219-0.86914 0.0059-0.047 0.0085325-0.094025 0.0078125-0.14062v-2.9902h-1v3h-1v-3h-1zm5 0v4h1v-1h1v1h1v-1c-7.73e-4 -0.1811-0.05073-0.35867-0.14453-0.51367 0.08369-0.1462 0.14453-0.30573 0.14453-0.48633v-1c0-0.5523-0.4485-1.0293-1-1h-2zm1 1h1v1h-1v-1z" fill="#fc9c9c"/> +<path d="m9.5 0a3 3 0 0 0 -2.9883 2.7773 3 3 0 0 0 -2.0117 -0.77734 3 3 0 0 0 -3 3 3 3 0 0 0 2 2.8242v2.1758c0 0.554 0.44599 1 1 1h6c0.55401 0 1-0.446 1-1v-1l3 2v-6l-3 2v-1.7695a3 3 0 0 0 1 -2.2305 3 3 0 0 0 -3 -3zm-5.5 12v1c0 0.55228 0.44772 1 1 1-0.55228 0-1 0.44772-1 1v1h1v-1h1v1h1v-1c0-0.55228-0.44772-1-1-1 0.55228 0 1-0.44772 1-1v-1h-1v1h-1v-1h-1zm5 0v1 3h1v-1h1v1h1v-1c-8.34e-4 -0.17579-0.047991-0.34825-0.13672-0.5 0.088728-0.15175 0.13588-0.32421 0.13672-0.5v-1c0-0.55228-0.44772-1-1-1h-1-1zm1 1h1v1h-1v-1z" fill="#fc9c9c"/> </svg> diff --git a/editor/icons/icon_a_r_v_r_controller.svg b/editor/icons/icon_a_r_v_r_controller.svg new file mode 100644 index 0000000000..a61f99ffdf --- /dev/null +++ b/editor/icons/icon_a_r_v_r_controller.svg @@ -0,0 +1,3 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<path d="m2 1c-0.554 0-1 0.446-1 1v6c0 0.554 0.446 1 1 1h12c0.554 0 1-0.446 1-1v-6c0-0.554-0.446-1-1-1h-12zm2 1h2v2h2v2h-2v2h-2v-2h-2v-2h2v-2zm9 1c0.55228 0 1 0.44772 1 1s-0.44772 1-1 1-1-0.44772-1-1 0.44772-1 1-1zm-2 2c0.55228 0 1 0.44772 1 1s-0.44772 1-1 1-1-0.44772-1-1 0.44772-1 1-1zm-7 7v1c0 0.55228 0.44772 1 1 1-0.55228 0-1 0.44772-1 1v1h1v-1h1v1h1v-1c0-0.55228-0.44772-1-1-1 0.55228 0 1-0.44772 1-1v-1h-1v1h-1v-1h-1zm5 0v1 3h1v-1h1v1h1v-1c-8.34e-4 -0.17579-0.047991-0.34825-0.13672-0.5 0.088728-0.15175 0.13588-0.32421 0.13672-0.5v-1c0-0.55228-0.44772-1-1-1h-1-1zm1 1h1v1h-1v-1z" fill="#fc9c9c"/> +</svg> diff --git a/editor/icons/icon_a_r_v_r_origin.svg b/editor/icons/icon_a_r_v_r_origin.svg new file mode 100644 index 0000000000..53a149cec6 --- /dev/null +++ b/editor/icons/icon_a_r_v_r_origin.svg @@ -0,0 +1,3 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<path d="m7 1v3h2v-3h-2zm-4 4v2h3v-2h-3zm5 0c-0.55228 0-1 0.44772-1 1s0.44772 1 1 1 1-0.44772 1-1-0.44772-1-1-1zm2 0v2h3v-2h-3zm-3 3v3h2v-3h-2zm-3 4v1c0 0.55228 0.44772 1 1 1-0.55228 0-1 0.44772-1 1v1h1v-1h1v1h1v-1c0-0.55228-0.44772-1-1-1 0.55228 0 1-0.44772 1-1v-1h-1v1h-1v-1h-1zm5 0v1 3h1v-1h1v1h1v-1c-8.34e-4 -0.17579-0.047991-0.34825-0.13672-0.5 0.088728-0.15175 0.13588-0.32421 0.13672-0.5v-1c0-0.55228-0.44772-1-1-1h-1-1zm1 1h1v1h-1v-1z" fill="#fc9c9c"/> +</svg> diff --git a/editor/icons/icon_animated_sprite.svg b/editor/icons/icon_animated_sprite.svg index fe7fde5a39..6fdf8a7a40 100644 --- a/editor/icons/icon_animated_sprite.svg +++ b/editor/icons/icon_animated_sprite.svg @@ -1,7 +1,7 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)" fill="#a5b7f3"> -<path transform="translate(0 1036.4)" d="m10.5 0a5.5 5.5 0 0 0 -5.3301 4.1699 5.5 5.5 0 0 1 1.3301 -0.16992 5.5 5.5 0 0 1 5.5 5.5 5.5 5.5 0 0 1 -0.16992 1.3301 5.5 5.5 0 0 0 4.1699 -5.3301 5.5 5.5 0 0 0 -5.5 -5.5z" fill-opacity=".39216"/> -<path transform="translate(0 1036.4)" d="m8.5 2a5.5 5.5 0 0 0 -4.7559 2.748 5.5 5.5 0 0 1 2.7559 -0.74805 5.5 5.5 0 0 1 5.5 5.5 5.5 5.5 0 0 1 -0.74414 2.752 5.5 5.5 0 0 0 2.7441 -4.752 5.5 5.5 0 0 0 -5.5 -5.5z" fill-opacity=".58824"/> -<path transform="translate(0 1036.4)" d="m6.5 4a5.5 5.5 0 0 0 -5.5 5.5 5.5 5.5 0 0 0 5.5 5.5 5.5 5.5 0 0 0 5.5 -5.5 5.5 5.5 0 0 0 -5.5 -5.5zm-2.5 4a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm5 0a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm-5 3h5a2.5 2 0 0 1 -1.25 1.7324 2.5 2 0 0 1 -2.5 0 2.5 2 0 0 1 -1.25 -1.7324z"/> +<g fill="#a5b7f3"> +<path d="m7 0c-1.108 0-2 0.89199-2 2h7c1.108 0 2 0.89199 2 2v6c1.108 0 2-0.89199 2-2v-6c0-1.108-0.89199-2-2-2z" fill-opacity=".39216"/> +<path d="m5 2c-1.108 0-2 0.89199-2 2h7c1.108 0 2 0.89199 2 2v7c1.108 0 2-0.89199 2-2v-7c0-1.108-0.89199-2-2-2h-7z" fill-opacity=".58824"/> +<path d="m3 4c-1.108 0-2 0.89199-2 2v7c0 1.108 0.89199 2 2 2h7c1.108 0 2-0.89199 2-2v-7c0-1.108-0.89199-2-2-2h-7zm0 4c0.554 0 1 0.446 1 1v1c0 0.554-0.446 1-1 1s-1-0.446-1-1v-1c0-0.554 0.446-1 1-1zm7 0c0.554 0 1 0.446 1 1v1c0 0.554-0.446 1-1 1s-1-0.446-1-1v-1c0-0.554 0.446-1 1-1zm-6 4h5a2.5 2 0 0 1 -1.25 1.7324 2.5 2 0 0 1 -2.5 0 2.5 2 0 0 1 -1.25 -1.7324z"/> </g> </svg> diff --git a/editor/icons/icon_animated_sprite_3d.svg b/editor/icons/icon_animated_sprite_3d.svg index 658ba3e5c2..ccc836832c 100644 --- a/editor/icons/icon_animated_sprite_3d.svg +++ b/editor/icons/icon_animated_sprite_3d.svg @@ -1,7 +1,7 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)" fill="#fc9c9c"> -<path transform="translate(0 1036.4)" d="m10.5 0a5.5 5.5 0 0 0 -5.3301 4.1699 5.5 5.5 0 0 1 1.3301 -0.16992 5.5 5.5 0 0 1 5.5 5.5 5.5 5.5 0 0 1 -0.16992 1.3301 5.5 5.5 0 0 0 4.1699 -5.3301 5.5 5.5 0 0 0 -5.5 -5.5z" fill-opacity=".39216"/> -<path transform="translate(0 1036.4)" d="m8.5 2a5.5 5.5 0 0 0 -4.7559 2.748 5.5 5.5 0 0 1 2.7559 -0.74805 5.5 5.5 0 0 1 5.5 5.5 5.5 5.5 0 0 1 -0.74414 2.752 5.5 5.5 0 0 0 2.7441 -4.752 5.5 5.5 0 0 0 -5.5 -5.5z" fill-opacity=".58824"/> -<path transform="translate(0 1036.4)" d="m6.5 4a5.5 5.5 0 0 0 -5.5 5.5 5.5 5.5 0 0 0 5.5 5.5 5.5 5.5 0 0 0 5.5 -5.5 5.5 5.5 0 0 0 -5.5 -5.5zm-2.5 4a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm5 0a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm-5 3h5a2.5 2 0 0 1 -1.25 1.7324 2.5 2 0 0 1 -2.5 0 2.5 2 0 0 1 -1.25 -1.7324z"/> +<g fill="#fc9c9c"> +<path d="m7 0c-1.108 0-2 0.89199-2 2h7c1.108 0 2 0.89199 2 2v6c1.108 0 2-0.89199 2-2v-6c0-1.108-0.89199-2-2-2z" fill-opacity=".39216"/> +<path d="m5 2c-1.108 0-2 0.89199-2 2h7c1.108 0 2 0.89199 2 2v7c1.108 0 2-0.89199 2-2v-7c0-1.108-0.89199-2-2-2h-7z" fill-opacity=".58824"/> +<path d="m3 4c-1.108 0-2 0.89199-2 2v7c0 1.108 0.89199 2 2 2h7c1.108 0 2-0.89199 2-2v-7c0-1.108-0.89199-2-2-2h-7zm0 4c0.554 0 1 0.446 1 1v1c0 0.554-0.446 1-1 1s-1-0.446-1-1v-1c0-0.554 0.446-1 1-1zm7 0c0.554 0 1 0.446 1 1v1c0 0.554-0.446 1-1 1s-1-0.446-1-1v-1c0-0.554 0.446-1 1-1zm-6 4h5a2.5 2 0 0 1 -1.25 1.7324 2.5 2 0 0 1 -2.5 0 2.5 2 0 0 1 -1.25 -1.7324z"/> </g> </svg> diff --git a/editor/icons/icon_center_container.svg b/editor/icons/icon_center_container.svg index 446e9e0f9c..fc0abc5c28 100644 --- a/editor/icons/icon_center_container.svg +++ b/editor/icons/icon_center_container.svg @@ -1,5 +1,3 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)"> -<path transform="translate(0 1036.4)" d="m3 1c-1.1046 0-2 0.89543-2 2v10c0 1.1046 0.89543 2 2 2h10c1.1046 0 2-0.89543 2-2v-10c0-1.1046-0.89543-2-2-2h-10zm0 2h10v10h-10v-10zm3 1l2 2 2-2h-4zm-2 2v4l2-2-2-2zm8 0l-2 2 2 2v-4zm-4 4l-2 2h4l-2-2z" fill="#a5efac"/> -</g> +<path d="m3 1c-1.1046 0-2 0.89543-2 2v10c0 1.1046 0.89543 2 2 2h10c1.1046 0 2-0.89543 2-2v-10c0-1.1046-0.89543-2-2-2h-10zm0 2h10v10h-10v-10zm3 1l2 2 2-2h-4zm-2 2v4l2-2-2-2zm8 0l-2 2 2 2v-4zm-4 4l-2 2h4l-2-2z" fill="#a5efac"/> </svg> diff --git a/editor/icons/icon_color_pick.svg b/editor/icons/icon_color_pick.svg index 893afb4eb4..5c21eeba8b 100644 --- a/editor/icons/icon_color_pick.svg +++ b/editor/icons/icon_color_pick.svg @@ -1,5 +1,5 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <g transform="translate(0 -1036.4)"> -<path transform="translate(0 1036.4)" d="m13.051 0.97852a2 2 0 0 0 -1.4434 0.58594l-1.4141 1.4141-1.416-1.4141-1.4141 1.4141 1.4141 1.4141-7.0703 7.0723-0.35352 1.7676-0.35352 1.7676 1.7676-0.35352 1.7676-0.35352 7.0723-7.0703 1.4141 1.4141 1.4141-1.4141-1.4141-1.416 1.4141-1.4141a2 2 0 0 0 0 -2.8281 2 2 0 0 0 -1.3848 -0.58594zm-3.5664 4.1211l1.416 1.416-7.0723 7.0703-0.70703-0.70703-0.70703-0.70703 7.0703-7.0723z" fill="#e0e0e0" fill-opacity=".99608"/> +<path transform="translate(0 1036.4)" d="m8 1c-1.108 0-2 0.892-2 2v2h-1v2h1v5a2 2 0 0 0 1 1.7285v1.2715h2v-1.2695a2 2 0 0 0 1 -1.7305v-5h1v-2h-1v-2c0-1.108-0.892-2-2-2zm-1 6h2v5a1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1v-5z" fill="#e0e0e0"/> </g> </svg> diff --git a/editor/icons/icon_color_picker.svg b/editor/icons/icon_color_picker.svg index 272dfeca48..55c55fe205 100644 --- a/editor/icons/icon_color_picker.svg +++ b/editor/icons/icon_color_picker.svg @@ -1,5 +1,3 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)"> -<path transform="translate(0 1036.4)" d="m13.051 0.97852a2 2 0 0 0 -1.4434 0.58594l-1.4141 1.4141-1.416-1.4141-1.4141 1.4141 1.4141 1.4141-7.0703 7.0723-0.35352 1.7676-0.35352 1.7676 1.7676-0.35352 1.7676-0.35352 7.0723-7.0703 1.4141 1.4141 1.4141-1.4141-1.4141-1.416 1.4141-1.4141a2 2 0 0 0 0 -2.8281 2 2 0 0 0 -1.3848 -0.58594zm-3.5664 4.1211l1.416 1.416-7.0723 7.0703-0.70703-0.70703-0.70703-0.70703 7.0703-7.0723z" fill="#a5efac"/> -</g> +<path d="m8 1c-1.108 0-2 0.892-2 2v2h-1v2h1v5a2 2 0 0 0 1 1.7285v1.2715h2v-1.2695a2 2 0 0 0 1 -1.7305v-5h1v-2h-1v-2c0-1.108-0.892-2-2-2zm-1 6h2v5a1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1v-5z" fill="#a5efac"/> </svg> diff --git a/editor/icons/icon_color_picker_button.svg b/editor/icons/icon_color_picker_button.svg index 5d734a5b20..d8de02b298 100644 --- a/editor/icons/icon_color_picker_button.svg +++ b/editor/icons/icon_color_picker_button.svg @@ -1,7 +1,3 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)"> -<path transform="translate(0 1036.4)" d="m13.051 0.97852a2 2 0 0 0 -1.4434 0.58594l-1.4141 1.4141-1.416-1.4141-1.4141 1.4141 1.4141 1.4141-7.0703 7.0723-0.35352 1.7676-0.35352 1.7676 1.7676-0.35352 1.7676-0.35352 7.0723-7.0703 1.4141 1.4141 1.4141-1.4141-1.4141-1.416 1.4141-1.4141a2 2 0 0 0 0 -2.8281 2 2 0 0 0 -1.3848 -0.58594zm-3.5664 4.1211 1.416 1.416-7.0723 7.0703-0.70703-0.70703-0.70703-0.70703 7.0703-7.0723z" fill="#a5efac"/> -<path transform="translate(0 1036.4)" d="m1 3v6.3438l4.9492-4.9512-1.3926-1.3926h-3.5566zm14 6.4863l-1.5137 1.5137h-0.92969l-0.94922-0.94922-2.9492 2.9492h6.3418v-3.5137z" fill="#a5efac"/> -<path transform="translate(0 1036.4)" d="m10.658 11l-2 2h6.3418v-2h-1.5137-0.92969-1.8984z" fill-opacity=".078431"/> -</g> +<path d="m13 1c-1.108 0-2 0.892-2 2v2h-1v2h1v5a2 2 0 0 0 1 1.7285v1.2715h2v-1.2695a2 2 0 0 0 1 -1.7305v-5h1v-2h-1v-2c0-1.108-0.892-2-2-2zm-9 1v3.1328l-1.4453-0.96484-1.1094 1.6641 3 2c0.3359 0.2239 0.77347 0.2239 1.1094 0l3-2-1.1094-1.6641-1.4453 0.96484v-3.1328h-2zm8 5h2v5a1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1v-5zm-8.5 3c-0.831 0-1.5 0.669-1.5 1.5v0.5 1h-1v2h8v-2h-1v-1-0.5c0-0.831-0.669-1.5-1.5-1.5h-3z" fill="#a5efac"/> </svg> diff --git a/editor/icons/icon_connection_and_groups.svg b/editor/icons/icon_connection_and_groups.svg deleted file mode 100644 index 67a73f02b3..0000000000 --- a/editor/icons/icon_connection_and_groups.svg +++ /dev/null @@ -1,5 +0,0 @@ -<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)"> -<path transform="translate(0 1036.4)" d="m2 0v1 5 1h12v-1-6h-11-1zm1 1h10v5h-10v-5zm2.5 1a1.5 1.5 0 0 0 -1.5 1.5 1.5 1.5 0 0 0 1.5 1.5 1.5 1.5 0 0 0 1.5 -1.5 1.5 1.5 0 0 0 -1.5 -1.5zm5 0a1.5 1.5 0 0 0 -1.5 1.5 1.5 1.5 0 0 0 1.5 1.5 1.5 1.5 0 0 0 1.5 -1.5 1.5 1.5 0 0 0 -1.5 -1.5zm-0.5 7a2 2 0 0 0 -2 2v1h-6v1h6v1a2 2 0 0 0 2 2h2v-1h2v-1h-2v-3h2v-1h-2v-1h-2z" fill="#e0e0e0"/> -</g> -</svg> diff --git a/editor/icons/icon_control_layout.svg b/editor/icons/icon_control_layout.svg new file mode 100644 index 0000000000..4bf60cf751 --- /dev/null +++ b/editor/icons/icon_control_layout.svg @@ -0,0 +1,3 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<path d="m1 1v14h14v-14zm2 2h3v3h-3zm5 0h5v3h-5zm-5 5h3v5h-3zm5 0h5v5h-5z" fill="#a5efac"/> +</svg> diff --git a/editor/icons/icon_edit.svg b/editor/icons/icon_edit.svg index b1bce158c4..1805aab54f 100644 --- a/editor/icons/icon_edit.svg +++ b/editor/icons/icon_edit.svg @@ -1,5 +1,5 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <g transform="translate(0 -1036.4)"> -<path d="m1.7071 1047.8-0.70711 3.5356l3.5355-0.7071 7.7782-7.7782-2.8284-2.8284zm9.1924-9.1924 2.8284 2.8285 1.4142-1.4142-2.8284-2.8285z" fill="#e0e0e0"/> +<path transform="translate(0 1036.4)" d="m7 1c-0.554 0-1 0.446-1 1v2h4v-2c0-0.554-0.446-1-1-1h-2zm-1 4v7l2 3 2-3v-7h-4zm1 1h1v5h-1v-5z" fill="#e0e0e0"/> </g> </svg> diff --git a/editor/icons/icon_edit_key.svg b/editor/icons/icon_edit_key.svg index 2959900d04..443a9a0455 100644 --- a/editor/icons/icon_edit_key.svg +++ b/editor/icons/icon_edit_key.svg @@ -1,6 +1,5 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)" fill="#e0e0e0"> -<path d="m1.7071 1047.8-0.70711 3.5356l3.5355-0.7071 7.7782-7.7782-2.8284-2.8284zm9.1924-9.1924 2.8284 2.8285 1.4142-1.4142-2.8284-2.8285z"/> -<ellipse cx="3.5" cy="1039.9" rx="2.5" ry="2.5"/> +<g transform="translate(0 -1036.4)"> +<path transform="translate(0 1036.4)" d="m12 1c-0.554 0-1 0.446-1 1v2h4v-2c0-0.554-0.446-1-1-1h-2zm-7 3c-0.195 0-0.38964 0.07519-0.53906 0.22461l-3.2363 3.2363c-0.29884 0.29884-0.29884 0.77929 0 1.0781l3.2363 3.2363c0.29884 0.29884 0.77929 0.29884 1.0781 0l3.2363-3.2363c0.29884-0.29884 0.29884-0.77929 0-1.0781l-3.2363-3.2363c-0.14942-0.14942-0.34406-0.22461-0.53906-0.22461zm6 1v7l2 3 2-3v-7h-4zm1 1h1v5h-1v-5z" fill="#e0e0e0"/> </g> </svg> diff --git a/editor/icons/icon_groups.svg b/editor/icons/icon_groups.svg index 37e40749b8..55cf3c48eb 100644 --- a/editor/icons/icon_groups.svg +++ b/editor/icons/icon_groups.svg @@ -1,7 +1,5 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <g transform="translate(0 -1036.4)"> -<rect x="1" y="1040.4" width="14" height="8" fill="none" stroke="#e0e0e0" stroke-linejoin="round" stroke-width="2"/> -<ellipse cx="5" cy="1044.4" rx="2" ry="2" fill="#e0e0e0"/> -<ellipse cx="11" cy="1044.4" rx="2" ry="2" fill="#e0e0e0"/> +<path transform="translate(0 1036.4)" d="m2 1a1.0001 1.0001 0 0 0 -1 1v12a1.0001 1.0001 0 0 0 1 1h12a1.0001 1.0001 0 0 0 1 -1v-12a1.0001 1.0001 0 0 0 -1 -1h-12zm1 2h10v10h-10v-10zm5 2a3 3 0 0 0 -3 3 3 3 0 0 0 3 3 3 3 0 0 0 3 -3 3 3 0 0 0 -3 -3z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#e0e0e0" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/> </g> </svg> diff --git a/editor/icons/icon_key_move_enabled.svg b/editor/icons/icon_key_position.svg index 203b697ad2..203b697ad2 100644 --- a/editor/icons/icon_key_move_enabled.svg +++ b/editor/icons/icon_key_position.svg diff --git a/editor/icons/icon_key_rotate_enabled.svg b/editor/icons/icon_key_rotation.svg index 0f975631b2..0f975631b2 100644 --- a/editor/icons/icon_key_rotate_enabled.svg +++ b/editor/icons/icon_key_rotation.svg diff --git a/editor/icons/icon_key_scale_enabled.svg b/editor/icons/icon_key_scale.svg index eaa12fdf0e..eaa12fdf0e 100644 --- a/editor/icons/icon_key_scale_enabled.svg +++ b/editor/icons/icon_key_scale.svg diff --git a/editor/icons/icon_kinematic_body.svg b/editor/icons/icon_kinematic_body.svg index 393e21a529..6f8d69fa53 100644 --- a/editor/icons/icon_kinematic_body.svg +++ b/editor/icons/icon_kinematic_body.svg @@ -1,5 +1,5 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <g transform="translate(0 -1036.4)"> -<path transform="translate(0 1036.4)" d="m4 4v1h1v-1h-1zm1 1v1h-1v1h-1v1h-1v1 2h1v-2h1v1 1h1v-1h5v1h1v-2h1v2h1v-2-1h-1v-1h-1v-1h-1v-1h-1v1h-3v-1h-1zm5 0h1v-1h-1v1zm0 6h-2v1h2v-1zm-5 0v1h2v-1h-2zm0-4h1v1h-1v-1zm4 0h1v1h-1v-1z" fill="#fc9c9c" fill-opacity=".99608"/> +<path transform="translate(0 1036.4)" d="m6 1c-0.55401 0-1 0.44599-1 1v3c0 0.55401 0.44599 1 1 1h1v0.99023a1.0001 1.0001 0 0 0 -0.31641 0.0625l-2.0508 0.68359-0.68359-2.0508a1.0001 1.0001 0 0 0 -0.99023 -0.69727 1.0001 1.0001 0 0 0 -0.9082 1.3281l1 3a1.0001 1.0001 0 0 0 1.2656 0.63281l1.6836-0.56055v0.61133c0 0.040884 0.018715 0.075662 0.023438 0.11523l-4.5781 3.0527a1.0001 1.0001 0 1 0 1.1094 1.6641l5.0566-3.3711 1.4941 2.9863a1.0001 1.0001 0 0 0 1.2109 0.50195l3-1a1.0001 1.0001 0 1 0 -0.63281 -1.8965l-2.1777 0.72461-0.97461-1.9512c0.2759-0.17764 0.46875-0.47227 0.46875-0.82617v-1h1.3828l0.72266 1.4473a1.0001 1.0001 0 1 0 1.7891 -0.89453l-1-2a1.0001 1.0001 0 0 0 -0.89453 -0.55273h-3v-1h1c0.55401 0 1-0.44599 1-1v-3c0-0.55401-0.44599-1-1-1h-4zm0 2h1v2h-1v-2z" fill="#fc9c9c" fill-opacity=".99608"/> </g> </svg> diff --git a/editor/icons/icon_kinematic_body_2d.svg b/editor/icons/icon_kinematic_body_2d.svg index e269efd12a..51026e5f28 100644 --- a/editor/icons/icon_kinematic_body_2d.svg +++ b/editor/icons/icon_kinematic_body_2d.svg @@ -1,5 +1,7 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <g transform="translate(0 -1036.4)"> -<path transform="translate(0 1036.4)" d="m4 4v1h1v-1h-1zm1 1v1h-1v1h-1v1h-1v1 2h1v-2h1v1 1h1v-1h5v1h1v-2h1v2h1v-2-1h-1v-1h-1v-1h-1v-1h-1v1h-3v-1h-1zm5 0h1v-1h-1v1zm0 6h-2v1h2v-1zm-5 0v1h2v-1h-2zm0-4h1v1h-1v-1zm4 0h1v1h-1v-1z" fill="#a5b7f3" fill-opacity=".98824"/> +<g transform="translate(.49212 -.0044019)" fill="#a5b7f5" fill-opacity=".98824"> +<path transform="translate(0 1036.4)" d="m6 1c-0.55401 0-1 0.44599-1 1v3c0 0.55401 0.44599 1 1 1h1v0.99023a1.0001 1.0001 0 0 0 -0.31641 0.0625l-2.0508 0.68359-0.68359-2.0508a1.0001 1.0001 0 0 0 -0.99023 -0.69727 1.0001 1.0001 0 0 0 -0.9082 1.3281l1 3a1.0001 1.0001 0 0 0 1.2656 0.63281l1.6836-0.56055v0.61133c0 0.04088 0.018715 0.07566 0.023437 0.11523l-4.5781 3.0527a1.0001 1.0001 0 1 0 1.1094 1.6641l5.0566-3.3711 1.4941 2.9863a1.0001 1.0001 0 0 0 1.2109 0.50195l3-1a1.0001 1.0001 0 1 0 -0.63281 -1.8965l-2.1777 0.72461-0.97461-1.9512c0.2759-0.17764 0.46875-0.47227 0.46875-0.82617v-1h1.3828l0.72266 1.4473a1.0001 1.0001 0 1 0 1.7891 -0.89453l-1-2a1.0001 1.0001 0 0 0 -0.89453 -0.55273h-3v-1h1c0.55401 0 1-0.44599 1-1v-3c0-0.55401-0.44599-1-1-1zm0 2h1v2h-1z" fill="#a5b7f5" fill-opacity=".98824"/> +</g> </g> </svg> diff --git a/editor/icons/icon_multi_edit.svg b/editor/icons/icon_multi_edit.svg index 36f62006e0..9a1cfe8e16 100644 --- a/editor/icons/icon_multi_edit.svg +++ b/editor/icons/icon_multi_edit.svg @@ -1,5 +1,5 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <g transform="translate(0 -1036.4)"> -<path transform="translate(0 1036.4)" d="m12.314 0.85742l-1.4141 1.4141 2.8281 2.8281 1.4141-1.4141-2.8281-2.8281zm-11.314 0.14258v2h2v-2h-2zm4 0v2h2v-2h-2zm4.4844 2.6855l-7.7773 7.7793-0.70703 3.5352 3.5352-0.70703 7.7793-7.7773-2.8301-2.8301zm-8.4844 1.3145v2h2v-2h-2z" fill="#e0e0e0"/> +<path transform="translate(0 1036.4)" d="m2 1c-0.554 0-1 0.446-1 1v2h4v-2c0-0.554-0.446-1-1-1h-2zm-1 4v7l2 3 2-3v-7h-4zm1 1h1v5h-1v-5zm8 1v3h-3v2h3v3h2v-3h3v-2h-3v-3h-2z" fill="#e0e0e0"/> </g> </svg> diff --git a/editor/icons/icon_shader.svg b/editor/icons/icon_shader.svg new file mode 100644 index 0000000000..659d81519a --- /dev/null +++ b/editor/icons/icon_shader.svg @@ -0,0 +1,12 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<g> +<path d="m2 1c-0.55226 1e-4 -0.99994 0.4477-1 1v12c5.52e-5 0.5523 0.44774 0.9999 1 1h12c0.55226-1e-4 0.99994-0.4477 1-1v-8l-5-5zm1 2h6v3c0 0.554 0.44599 1 1 1h3v6h-10z" fill="#e0e0e0"/> +<path d="m10 11h2v1h-2z" fill="#9f70ff"/> +<path d="m4 6h2v1h-2z" fill="#ffeb70"/> +<path d="m8 8h4v1h-4z" fill="#9dff70"/> +<path d="m7 6h1v1h-1z" fill="#70deff"/> +<path d="m4 11h5v1h-5z" fill="#ff70ac"/> +<path d="m4 4h3v1h-3z" fill="#ff7070"/> +<path d="m4 8h3v1h-3z" fill="#70ffb9"/> +</g> +</svg> diff --git a/editor/icons/icon_connect.svg b/editor/icons/icon_signals.svg index 97859370b7..97859370b7 100644 --- a/editor/icons/icon_connect.svg +++ b/editor/icons/icon_signals.svg diff --git a/editor/icons/icon_signals_and_groups.svg b/editor/icons/icon_signals_and_groups.svg new file mode 100644 index 0000000000..5dedbaa433 --- /dev/null +++ b/editor/icons/icon_signals_and_groups.svg @@ -0,0 +1,5 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1036.4)"> +<path transform="translate(0 1036.4)" d="m6 0c-0.55228 0-1 0.4477-1 1s0.44772 1 1 1c4.4301 0 8 3.5699 8 8 0 0.5523 0.44772 1 1 1s1-0.4477 1-1c0-5.511-4.489-10-10-10zm0 4c-0.55228 0-1 0.4477-1 1s0.44772 1 1 1c2.221 0 4 1.779 4 4 0 0.5523 0.44772 1 1 1s1-0.4477 1-1c0-3.3018-2.6981-6-6-6zm-5 4a1.0001 1.0001 0 0 0 -1 1v6a1.0001 1.0001 0 0 0 1 1h6a1.0001 1.0001 0 0 0 1 -1v-6a1.0001 1.0001 0 0 0 -1 -1h-6zm1 2h4v4h-4v-4z" fill="#e0e0e0"/> +</g> +</svg> diff --git a/editor/icons/icon_sprite.svg b/editor/icons/icon_sprite.svg index 4feea4d265..09fc2f0979 100644 --- a/editor/icons/icon_sprite.svg +++ b/editor/icons/icon_sprite.svg @@ -1,5 +1,3 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)"> -<path transform="translate(0 1036.4)" d="m8 1a7 7 0 0 0 -7 7 7 7 0 0 0 7 7 7 7 0 0 0 7 -7 7 7 0 0 0 -7 -7zm-4 5a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm8 0a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm-7 3h6a3 3 0 0 1 -1.5 2.5977 3 3 0 0 1 -3 0 3 3 0 0 1 -1.5 -2.5977z" fill="#a5b7f3"/> -</g> +<path d="m5 1c-2.216 0-4 1.784-4 4v6c0 2.216 1.784 4 4 4h6c2.216 0 4-1.784 4-4v-6c0-2.216-1.784-4-4-4h-6zm-1 5c0.554 0 1 0.446 1 1v2c0 0.554-0.446 1-1 1s-1-0.446-1-1v-2c0-0.554 0.446-1 1-1zm8 0c0.554 0 1 0.446 1 1v2c0 0.554-0.446 1-1 1s-1-0.446-1-1v-2c0-0.554 0.446-1 1-1zm-1.8887 5.1074a1.0001 1.0001 0 0 1 0.7168 1.7207c-0.74987 0.74987-1.7676 1.1719-2.8281 1.1719s-2.0783-0.422-2.8281-1.1719a1.0001 1.0001 0 0 1 0.69727 -1.7168 1.0001 1.0001 0 0 1 0.7168 0.30273c0.37534 0.37535 0.88325 0.58594 1.4141 0.58594s1.0387-0.21059 1.4141-0.58594a1.0001 1.0001 0 0 1 0.69727 -0.30664z" fill="#a5b7f6" fill-opacity=".98824"/> </svg> diff --git a/editor/icons/icon_sprite_3d.svg b/editor/icons/icon_sprite_3d.svg index 0d5caae501..eb163e3f43 100644 --- a/editor/icons/icon_sprite_3d.svg +++ b/editor/icons/icon_sprite_3d.svg @@ -1,5 +1,5 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)"> -<path transform="translate(0 1036.4)" d="m8 1a7 7 0 0 0 -7 7 7 7 0 0 0 7 7 7 7 0 0 0 7 -7 7 7 0 0 0 -7 -7zm-4 5a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm8 0a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm-7 3h6a3 3 0 0 1 -1.5 2.5977 3 3 0 0 1 -3 0 3 3 0 0 1 -1.5 -2.5977z" fill="#fc9c9c" fill-opacity=".99608"/> +<g fill="#fc9c9c"> +<path d="m5 1c-2.216 0-4 1.784-4 4v6c0 2.216 1.784 4 4 4h6c2.216 0 4-1.784 4-4v-6c0-2.216-1.784-4-4-4zm-1 5c0.554 0 1 0.446 1 1v2c0 0.554-0.446 1-1 1s-1-0.446-1-1v-2c0-0.554 0.446-1 1-1zm8 0c0.554 0 1 0.446 1 1v2c0 0.554-0.446 1-1 1s-1-0.446-1-1v-2c0-0.554 0.446-1 1-1zm-1.8887 5.1074a1.0001 1.0001 0 0 1 0.7168 1.7207c-0.74987 0.74987-1.7676 1.1719-2.8281 1.1719s-2.0783-0.422-2.8281-1.1719a1.0001 1.0001 0 0 1 0.69727 -1.7168 1.0001 1.0001 0 0 1 0.7168 0.30273c0.37534 0.37535 0.88325 0.58594 1.4141 0.58594s1.0387-0.21059 1.4141-0.58594a1.0001 1.0001 0 0 1 0.69727 -0.30664z" fill="#fc9c9c"/> </g> </svg> diff --git a/editor/icons/icon_sprite_frames.svg b/editor/icons/icon_sprite_frames.svg index e797819892..8123cbd6b4 100644 --- a/editor/icons/icon_sprite_frames.svg +++ b/editor/icons/icon_sprite_frames.svg @@ -1,5 +1,3 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)"> -<path transform="translate(0 1036.4)" d="m6 1a5 5 0 0 0 -5 5 5 5 0 0 0 5 5 5 5 0 0 0 5 -5 5 5 0 0 0 -5 -5zm-3 4a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm6 0a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm4 2v2h2v-2h-2zm-5.0039 0.49219a0.50005 0.50005 0 0 1 0.35742 0.86133c-0.61785 0.6179-1.4924 0.89648-2.3535 0.89648s-1.7357-0.27858-2.3535-0.89648a0.50005 0.50005 0 0 1 0.34766 -0.85742 0.50005 0.50005 0 0 1 0.35938 0.15039c0.38215 0.3822 1.0076 0.60352 1.6465 0.60352s1.2643-0.22132 1.6465-0.60352a0.50005 0.50005 0 0 1 0.34961 -0.1543zm2.0039 2.5078v2h2v-2h-2zm3 0v2h2v-2h-2zm-6 3v2h2v-2h-2zm3 0v2h2v-2h-2zm3 0v2h2v-2h-2z" fill="#e0e0e0"/> -</g> +<path d="m3 1c-1.108 0-2 0.89199-2 2v6c0 1.108 0.89199 2 2 2h6c1.108 0 2-0.89199 2-2v-6c0-1.108-0.89199-2-2-2h-6zm10 0v2h2v-2h-2zm-10 4c0.554 0 1 0.446 1 1v1c0 0.554-0.446 1-1 1s-1-0.446-1-1v-1c0-0.554 0.446-1 1-1zm6 0c0.554 0 1 0.446 1 1v1c0 0.554-0.446 1-1 1s-1-0.446-1-1v-1c0-0.554 0.446-1 1-1zm4 0v2h2v-2h-2zm-9 4h2 2a2 1 0 0 1 -1 0.86523 2 1 0 0 1 -2 0 2 1 0 0 1 -1 -0.86523zm9 0v2h2v-2h-2zm-12 4v2h2v-2h-2zm4 0v2h2v-2h-2zm4 0v2h2v-2h-2zm4 0v2h2v-2h-2z" fill="#e0e0e0"/> </svg> diff --git a/editor/icons/icon_viewport_sprite.svg b/editor/icons/icon_viewport_sprite.svg deleted file mode 100644 index 4b8bbeaeba..0000000000 --- a/editor/icons/icon_viewport_sprite.svg +++ /dev/null @@ -1,7 +0,0 @@ -<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)"> -<rect x="20" y="1042.4" width="1" height="1" fill="#fefeff"/> -<rect x="29" y="1042.4" width="1" height="1" fill="#fefeff"/> -<path transform="translate(0 1036.4)" d="m3 2c-0.5304 8.01e-5 -1.0391 0.21085-1.4141 0.58594-0.37509 0.37501-0.58586 0.88366-0.58594 1.4141v8c8.03e-5 0.5304 0.21085 1.0391 0.58594 1.4141 0.37501 0.37509 0.88366 0.58586 1.4141 0.58594h10c1.1046 0 2-0.89543 2-2v-8c0-1.1046-0.89543-2-2-2h-10zm0 1h10c0.55228 9.6e-6 0.99999 0.44772 1 1v8c-1e-5 0.55228-0.44772 0.99999-1 1h-10c-0.55228-1e-5 -0.99999-0.44772-1-1v-8c9.6e-6 -0.55228 0.44772-0.99999 1-1zm1 3v2h2v-2h-2zm6 0v2h2v-2h-2zm-6 3v1h8v-1h-8z" fill="#a5b7f3" fill-opacity=".98824"/> -</g> -</svg> diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp index 7edaf0e5af..20392a67a7 100644 --- a/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -56,10 +56,10 @@ void NodeDock::_bind_methods() { void NodeDock::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - connections_button->set_icon(get_icon("Connect", "EditorIcons")); + connections_button->set_icon(get_icon("Signals", "EditorIcons")); groups_button->set_icon(get_icon("Groups", "EditorIcons")); } else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - connections_button->set_icon(get_icon("Connect", "EditorIcons")); + connections_button->set_icon(get_icon("Signals", "EditorIcons")); groups_button->set_icon(get_icon("Groups", "EditorIcons")); } } diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index bdfe380211..2b9c625aa4 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -557,7 +557,7 @@ void AnimationPlayerEditor::_animation_blend() { String current = animation->get_item_text(animation->get_selected()); - blend_editor.dialog->popup_centered(Size2(400, 400)); + blend_editor.dialog->popup_centered(Size2(400, 400) * EDSCALE); blend_editor.tree->set_hide_root(true); blend_editor.tree->set_column_min_width(0, 10); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 4b216d63f5..3f64e75bc8 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2806,12 +2806,16 @@ void CanvasItemEditor::_notification(int p_what) { unlock_button->set_icon(get_icon("Unlock", "EditorIcons")); group_button->set_icon(get_icon("Group", "EditorIcons")); ungroup_button->set_icon(get_icon("Ungroup", "EditorIcons")); + key_loc_button->set_icon(get_icon("KeyPosition", "EditorIcons")); + key_rot_button->set_icon(get_icon("KeyRotation", "EditorIcons")); + key_scale_button->set_icon(get_icon("KeyScale", "EditorIcons")); key_insert_button->set_icon(get_icon("Key", "EditorIcons")); zoom_minus->set_icon(get_icon("ZoomLess", "EditorIcons")); zoom_reset->set_icon(get_icon("ZoomReset", "EditorIcons")); zoom_plus->set_icon(get_icon("ZoomMore", "EditorIcons")); + presets_menu->set_icon(get_icon("ControlLayout", "EditorIcons")); PopupMenu *p = presets_menu->get_popup(); p->clear(); @@ -3949,30 +3953,24 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { animation_hb->add_child(memnew(VSeparator)); animation_hb->hide(); - key_loc_button = memnew(Button("loc")); + key_loc_button = memnew(Button); key_loc_button->set_toggle_mode(true); key_loc_button->set_flat(true); key_loc_button->set_pressed(true); key_loc_button->set_focus_mode(FOCUS_NONE); - key_loc_button->add_color_override("font_color", Color(1, 0.6, 0.6)); - key_loc_button->add_color_override("font_color_pressed", Color(0.6, 1, 0.6)); key_loc_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_POS)); animation_hb->add_child(key_loc_button); - key_rot_button = memnew(Button("rot")); + key_rot_button = memnew(Button); key_rot_button->set_toggle_mode(true); key_rot_button->set_flat(true); key_rot_button->set_pressed(true); key_rot_button->set_focus_mode(FOCUS_NONE); - key_rot_button->add_color_override("font_color", Color(1, 0.6, 0.6)); - key_rot_button->add_color_override("font_color_pressed", Color(0.6, 1, 0.6)); key_rot_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_ROT)); animation_hb->add_child(key_rot_button); - key_scale_button = memnew(Button("scl")); + key_scale_button = memnew(Button); key_scale_button->set_toggle_mode(true); key_scale_button->set_flat(true); key_scale_button->set_focus_mode(FOCUS_NONE); - key_scale_button->add_color_override("font_color", Color(1, 0.6, 0.6)); - key_scale_button->add_color_override("font_color_pressed", Color(0.6, 1, 0.6)); key_scale_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_SCALE)); animation_hb->add_child(key_scale_button); key_insert_button = memnew(Button); diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 3b6eeb61d6..dc7acd9fdc 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -43,10 +43,10 @@ void SpriteFramesEditor::_notification(int p_what) { } if (p_what == NOTIFICATION_ENTER_TREE) { - load->set_icon(get_icon("Folder", "EditorIcons")); - _delete->set_icon(get_icon("Del", "EditorIcons")); + load->set_icon(get_icon("Load", "EditorIcons")); + _delete->set_icon(get_icon("Remove", "EditorIcons")); new_anim->set_icon(get_icon("New", "EditorIcons")); - remove_anim->set_icon(get_icon("Del", "EditorIcons")); + remove_anim->set_icon(get_icon("Remove", "EditorIcons")); } if (p_what == NOTIFICATION_READY) { @@ -667,7 +667,7 @@ SpriteFramesEditor::SpriteFramesEditor() { VBoxContainer *vbc_animlist = memnew(VBoxContainer); split->add_child(vbc_animlist); - vbc_animlist->set_custom_minimum_size(Size2(150, 0)); + vbc_animlist->set_custom_minimum_size(Size2(150, 0) * EDSCALE); //vbc_animlist->set_v_size_flags(SIZE_EXPAND_FILL); VBoxContainer *sub_vb = memnew(VBoxContainer); @@ -678,12 +678,13 @@ SpriteFramesEditor::SpriteFramesEditor() { sub_vb->add_child(hbc_animlist); new_anim = memnew(Button); + new_anim->set_flat(true); hbc_animlist->add_child(new_anim); + new_anim->set_h_size_flags(SIZE_EXPAND_FILL); new_anim->connect("pressed", this, "_animation_add"); - hbc_animlist->add_spacer(); - remove_anim = memnew(Button); + remove_anim->set_flat(true); hbc_animlist->add_child(remove_anim); remove_anim->connect("pressed", this, "_animation_remove"); @@ -720,6 +721,7 @@ SpriteFramesEditor::SpriteFramesEditor() { //animations = memnew( ItemList ); load = memnew(Button); + load->set_flat(true); load->set_tooltip(TTR("Load Resource")); hbc->add_child(load); @@ -736,14 +738,15 @@ SpriteFramesEditor::SpriteFramesEditor() { hbc->add_child(empty2); move_up = memnew(Button); - move_up->set_text(TTR("Up")); + move_up->set_text(TTR("Move (Before)")); hbc->add_child(move_up); move_down = memnew(Button); - move_down->set_text(TTR("Down")); + move_down->set_text(TTR("Move (After)")); hbc->add_child(move_down); _delete = memnew(Button); + _delete->set_flat(true); hbc->add_child(_delete); file = memnew(EditorFileDialog); @@ -818,7 +821,7 @@ SpriteFramesEditorPlugin::SpriteFramesEditorPlugin(EditorNode *p_node) { editor = p_node; frames_editor = memnew(SpriteFramesEditor); - frames_editor->set_custom_minimum_size(Size2(0, 300)); + frames_editor->set_custom_minimum_size(Size2(0, 300) * EDSCALE); button = editor->add_bottom_panel_item("SpriteFrames", frames_editor); button->hide(); } diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 6dcd5e54ec..a6e0af05b2 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -215,9 +215,9 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { bool has_groups = p_node->has_persistent_groups(); if (has_connections && has_groups) { - item->add_button(0, get_icon("ConnectionAndGroups", "EditorIcons"), BUTTON_SIGNALS, false, TTR("Node has connection(s) and group(s)\nClick to show signals dock.")); + item->add_button(0, get_icon("SignalsAndGroups", "EditorIcons"), BUTTON_SIGNALS, false, TTR("Node has connection(s) and group(s)\nClick to show signals dock.")); } else if (has_connections) { - item->add_button(0, get_icon("Connect", "EditorIcons"), BUTTON_SIGNALS, false, TTR("Node has connections.\nClick to show signals dock.")); + item->add_button(0, get_icon("Signals", "EditorIcons"), BUTTON_SIGNALS, false, TTR("Node has connections.\nClick to show signals dock.")); } else if (has_groups) { item->add_button(0, get_icon("Groups", "EditorIcons"), BUTTON_GROUPS, false, TTR("Node is in group(s).\nClick to show groups dock.")); } diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 3c1889e829..3f8d93d976 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -298,11 +298,11 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, bool p_bi } } -void EditorSpatialGizmo::add_solid_box(Ref<Material> &p_material, Vector3 size) { +void EditorSpatialGizmo::add_solid_box(Ref<Material> &p_material, Vector3 p_size) { ERR_FAIL_COND(!spatial_node); CubeMesh cubem; - cubem.set_size(size); + cubem.set_size(p_size); Ref<ArrayMesh> m = memnew(ArrayMesh); m->add_surface_from_arrays(cubem.surface_get_primitive_type(0), cubem.surface_get_arrays(0)); m->surface_set_material(0, p_material); diff --git a/main/SCsub b/main/SCsub index 1f97cd1be0..ae63b94864 100644 --- a/main/SCsub +++ b/main/SCsub @@ -16,7 +16,7 @@ def make_splash(target, source, env): g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") g.write("#ifndef BOOT_SPLASH_H\n") g.write("#define BOOT_SPLASH_H\n") - g.write("static const Color boot_splash_bg_color = Color(1,1,1,1);\n") + g.write('static const Color boot_splash_bg_color = Color::html("#232323");\n') g.write("static const unsigned char boot_splash_png[] = {\n") for i in range(len(buf)): g.write(byte_to_str(buf[i]) + ",\n") diff --git a/main/main.cpp b/main/main.cpp index 6fbd906679..68e518ae3d 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -45,6 +45,7 @@ #include "input_map.h" #include "io/resource_loader.h" #include "scene/main/scene_tree.h" +#include "servers/arvr_server.h" #include "servers/audio_server.h" #include "io/resource_loader.h" @@ -82,6 +83,7 @@ static InputMap *input_map = NULL; static bool _start_success = false; static ScriptDebugger *script_debugger = NULL; AudioServer *audio_server = NULL; +ARVRServer *arvr_server = NULL; static MessageQueue *message_queue = NULL; static Performance *performance = NULL; @@ -939,11 +941,14 @@ Error Main::setup2(Thread::ID p_main_tid_override) { OS::get_singleton()->set_window_position(init_custom_pos); } - //right moment to create and initialize the audio server + // right moment to create and initialize the audio server audio_server = memnew(AudioServer); audio_server->init(); + // also init our arvr_server from here + arvr_server = memnew(ARVRServer); + OS::get_singleton()->set_use_vsync(use_vsync); register_core_singletons(); @@ -1775,6 +1780,11 @@ void Main::cleanup() { memdelete(audio_server); } + if (arvr_server) { + // cleanup now before we pull the rug from underneath... + memdelete(arvr_server); + } + unregister_driver_types(); unregister_module_types(); unregister_scene_types(); diff --git a/main/splash.png b/main/splash.png Binary files differindex 894a7d7aba..34be46557f 100644 --- a/main/splash.png +++ b/main/splash.png diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index 6592d0ae1d..ba4163aab7 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -12,6 +12,8 @@ gdn_env.add_source_files(env.modules_sources, "nativescript/*.cpp") gdn_env.Append(CPPPATH=['#modules/gdnative/include/']) +SConscript("nativearvr/SCsub") + def _spaced(e): return e if e[-1] == '*' else e + ' ' @@ -22,6 +24,7 @@ def _build_gdnative_api_struct_header(api): '#define GODOT_GDNATIVE_API_STRUCT_H', '', '#include <gdnative/gdnative.h>', + '#include <nativearvr/godot_nativearvr.h>', '#include <nativescript/godot_nativescript.h>', '', '#define GDNATIVE_API_INIT(options) do { extern const godot_gdnative_api_struct *_gdnative_wrapper_api_struct; _gdnative_wrapper_api_struct = options->api_struct; } while (0)', diff --git a/modules/gdnative/config.py b/modules/gdnative/config.py index 9f57b9bb74..df3556249d 100644 --- a/modules/gdnative/config.py +++ b/modules/gdnative/config.py @@ -1,8 +1,12 @@ - def can_build(platform): return True - def configure(env): env.use_ptrcall = True + +def get_doc_classes(): + return ["GDNative", "GDNativeLibrary", "NativeScript", "ARVRInterfaceGDNative"] + +def get_doc_path(): + return "doc_classes" diff --git a/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml b/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml new file mode 100644 index 0000000000..74f71ff603 --- /dev/null +++ b/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="ARVRInterfaceGDNative" inherits="ARVRInterface" category="Core" version="3.0.alpha.custom_build"> + <brief_description> + GDNative wrapper for an ARVR interface + </brief_description> + <description> + This is a wrapper class for GDNative implementations of the ARVR interface. To use a GDNative ARVR interface simply instantiate this object and set your GDNative library containing the ARVR interface implementation. + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + <method name="set_gdnative_library"> + <return type="void"> + </return> + <argument index="0" name="library" type="GDNativeLibrary"> + </argument> + <description> + Bind this GDNative library to our interface. The library must be a GDNative ARVR Interface for this to work. + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/GDNative.xml b/modules/gdnative/doc_classes/GDNative.xml index ba813c4564..ba813c4564 100644 --- a/doc/classes/GDNative.xml +++ b/modules/gdnative/doc_classes/GDNative.xml diff --git a/doc/classes/GDNativeLibrary.xml b/modules/gdnative/doc_classes/GDNativeLibrary.xml index 361c89e6b3..361c89e6b3 100644 --- a/doc/classes/GDNativeLibrary.xml +++ b/modules/gdnative/doc_classes/GDNativeLibrary.xml diff --git a/doc/classes/NativeScript.xml b/modules/gdnative/doc_classes/NativeScript.xml index b040cfd966..b040cfd966 100644 --- a/doc/classes/NativeScript.xml +++ b/modules/gdnative/doc_classes/NativeScript.xml diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 4d3c024a8f..5ebf26cbf7 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -5229,6 +5229,78 @@ "arguments": [ ["godot_object *", "p_instance"] ] + }, + { + "name": "godot_arvr_get_worldscale", + "return_type": "godot_real", + "arguments": [] + }, + { + "name": "godot_arvr_get_reference_frame", + "return_type": "godot_transform", + "arguments": [] + }, + { + "name": "godot_arvr_blit", + "return_type": "void", + "arguments": [ + ["int", "p_eye"], + ["godot_rid *", "p_render_target"], + ["godot_rect2 *", "p_screen_rect"] + ] + }, + { + "name": "godot_arvr_get_texid", + "return_type": "godot_int", + "arguments": [ + ["godot_rid *", "p_render_target"] + ] + }, + { + "name": "godot_arvr_add_controller", + "return_type": "godot_int", + "arguments": [ + ["char *", "p_device_name"], + ["godot_int", "p_hand"], + ["godot_bool", "p_tracks_orientation"], + ["godot_bool", "p_tracks_position"] + ] + }, + { + "name": "godot_arvr_remove_controller", + "return_type": "void", + "arguments": [ + ["godot_int", "p_controller_id"] + ] + }, + { + "name": "godot_arvr_set_controller_transform", + "return_type": "void", + "arguments": [ + ["godot_int", "p_controller_id"], + ["godot_transform *", "p_transform"], + ["godot_bool", "p_tracks_orientation"], + ["godot_bool", "p_tracks_position"] + ] + }, + { + "name": "godot_arvr_set_controller_button", + "return_type": "void", + "arguments": [ + ["godot_int", "p_controller_id"], + ["godot_int", "p_button"], + ["godot_bool", "p_is_pressed"] + ] + }, + { + "name": "godot_arvr_set_controller_axis", + "return_type": "void", + "arguments": [ + ["godot_int", "p_controller_id"], + ["godot_int", "p_exis"], + ["godot_real", "p_value"], + ["godot_bool", "p_can_be_negative"] + ] } ] } diff --git a/modules/gdnative/include/nativearvr/godot_nativearvr.h b/modules/gdnative/include/nativearvr/godot_nativearvr.h new file mode 100644 index 0000000000..f86919f33a --- /dev/null +++ b/modules/gdnative/include/nativearvr/godot_nativearvr.h @@ -0,0 +1,58 @@ +/*************************************************************************/ +/* godot_nativearvr.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#ifndef GODOT_NATIVEARVR_H +#define GODOT_NATIVEARVR_H + +#include <gdnative/gdnative.h> + +#ifdef __cplusplus +extern "C" { +#endif + +// helper functions to access ARVRServer data +godot_real GDAPI godot_arvr_get_worldscale(); +godot_transform GDAPI godot_arvr_get_reference_frame(); + +// helper functions for rendering +void GDAPI godot_arvr_blit(godot_int p_eye, godot_rid *p_render_target, godot_rect2 *p_rect); +godot_int GDAPI godot_arvr_get_texid(godot_rid *p_render_target); + +// helper functions for updating ARVR controllers +godot_int GDAPI godot_arvr_add_controller(char *p_device_name, godot_int p_hand, godot_bool p_tracks_orientation, godot_bool p_tracks_position); +void GDAPI godot_arvr_remove_controller(godot_int p_controller_id); +void GDAPI godot_arvr_set_controller_transform(godot_int p_controller_id, godot_transform *p_transform, godot_bool p_tracks_orientation, godot_bool p_tracks_position); +void GDAPI godot_arvr_set_controller_button(godot_int p_controller_id, godot_int p_button, godot_bool p_is_pressed); +void GDAPI godot_arvr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_real p_value, godot_bool p_can_be_negative); + +#ifdef __cplusplus +} +#endif + +#endif /* !GODOT_NATIVEARVR_H */
\ No newline at end of file diff --git a/modules/gdnative/nativearvr/SCsub b/modules/gdnative/nativearvr/SCsub new file mode 100644 index 0000000000..ecc5996108 --- /dev/null +++ b/modules/gdnative/nativearvr/SCsub @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +import os +import methods + +Import('env') +Import('env_modules') + +env_arvr_gdnative = env_modules.Clone() + +env_arvr_gdnative.Append(CPPPATH=['#modules/gdnative/include/']) +env_arvr_gdnative.add_source_files(env.modules_sources, '*.cpp') + diff --git a/modules/gdnative/nativearvr/arvr_interface_gdnative.cpp b/modules/gdnative/nativearvr/arvr_interface_gdnative.cpp new file mode 100644 index 0000000000..78b0d1eadd --- /dev/null +++ b/modules/gdnative/nativearvr/arvr_interface_gdnative.cpp @@ -0,0 +1,394 @@ +/*************************************************************************/ +/* arvr_interface_gdnative.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "arvr_interface_gdnative.h" +#include "main/input_default.h" +#include "servers/arvr/arvr_positional_tracker.h" +#include "servers/visual/visual_server_global.h" + +ARVRInterfaceGDNative::ARVRInterfaceGDNative() { + // testing + printf("Construct gdnative interface\n"); + + // we won't have our data pointer until our library gets set + data = NULL; +} + +ARVRInterfaceGDNative::~ARVRInterfaceGDNative() { + printf("Destruct gdnative interface\n"); + + if (is_initialized()) { + uninitialize(); + }; + + // cleanup after ourselves + cleanup(); +} + +void ARVRInterfaceGDNative::cleanup() { + if (data != NULL) { + library->call_native_raw("arvr_call_destructor", "godot_arvr_destructor", data, 0, NULL, NULL); + data = NULL; + }; + + if (library.is_valid()) { + library->terminate(); + }; +}; + +void ARVRInterfaceGDNative::set_gdnative_library(Ref<GDNativeLibrary> p_library) { + if (library.is_null()) { + library.instance(); + } else { + cleanup(); + }; + + library->set_library(p_library); + library->initialize(); + + // Now we do our constructing... + void *parameters[1]; + parameters[0] = (void *)this; + library->call_native_raw("arvr_call_constructor", "godot_arvr_constructor", NULL, 1, parameters, &data); +} + +StringName ARVRInterfaceGDNative::get_name() const { + StringName name; + + ERR_FAIL_COND_V(data == NULL, StringName()); + + const_cast<GDNative *>(library.ptr())->call_native_raw("arvr_return_string", "godot_arvr_get_name", data, 0, NULL, &name); + + return name; +} + +int ARVRInterfaceGDNative::get_capabilities() const { + int capabilities; + + ERR_FAIL_COND_V(data == NULL, 0); // 0 = None + + const_cast<GDNative *>(library.ptr())->call_native_raw("arvr_return_int", "godot_arvr_get_capabilities", data, 0, NULL, &capabilities); + + return capabilities; +}; + +bool ARVRInterfaceGDNative::get_anchor_detection_is_enabled() const { + bool enabled; + + ERR_FAIL_COND_V(data == NULL, false); + + const_cast<GDNative *>(library.ptr())->call_native_raw("arvr_return_bool", "godot_arvr_get_anchor_detection_is_enabled", data, 0, NULL, &enabled); + + return enabled; +}; + +void ARVRInterfaceGDNative::set_anchor_detection_is_enabled(bool p_enable) { + void *parameters[1]; + + ERR_FAIL_COND(data == NULL); + + parameters[0] = (void *)&p_enable; + library->call_native_raw("arvr_set_bool", "godot_arvr_set_anchor_detection_is_enabled", data, 1, parameters, NULL); +}; + +bool ARVRInterfaceGDNative::is_stereo() { + bool stereo; + + ERR_FAIL_COND_V(data == NULL, false); + + library->call_native_raw("arvr_return_bool", "godot_arvr_is_stereo", data, 0, NULL, &stereo); + + return stereo; +}; + +bool ARVRInterfaceGDNative::is_initialized() { + bool initialized; + + ERR_FAIL_COND_V(data == NULL, false); + + library->call_native_raw("arvr_return_bool", "godot_arvr_is_initialized", data, 0, NULL, &initialized); + + return initialized; +}; + +bool ARVRInterfaceGDNative::initialize() { + bool initialized; + + ERR_FAIL_COND_V(data == NULL, false); + + library->call_native_raw("arvr_return_bool", "godot_arvr_initialize", data, 0, NULL, &initialized); + + if (initialized) { + // if we successfully initialize our interface and we don't have a primary interface yet, this becomes our primary interface + + ARVRServer *arvr_server = ARVRServer::get_singleton(); + if ((arvr_server != NULL) && (arvr_server->get_primary_interface() == NULL)) { + arvr_server->set_primary_interface(this); + }; + }; + + return initialized; +} + +void ARVRInterfaceGDNative::uninitialize() { + ERR_FAIL_COND(data == NULL); + + ARVRServer *arvr_server = ARVRServer::get_singleton(); + if (arvr_server != NULL) { + // Whatever happens, make sure this is no longer our primary interface + arvr_server->clear_primary_interface_if(this); + } + + library->call_native_raw("arvr_call_method", "godot_arvr_uninitialize", data, 0, NULL, NULL); +} + +Size2 ARVRInterfaceGDNative::get_recommended_render_targetsize() { + Size2 size; + + ERR_FAIL_COND_V(data == NULL, Size2()); + + library->call_native_raw("arvr_return_vector2", "godot_arvr_get_recommended_render_targetsize", data, 0, NULL, &size); + + return size; +} + +Transform ARVRInterfaceGDNative::get_transform_for_eye(ARVRInterface::Eyes p_eye, const Transform &p_cam_transform) { + void *parameters[2]; + Transform ret; + + ERR_FAIL_COND_V(data == NULL, Transform()); + + parameters[0] = (void *)&p_eye; + parameters[1] = (void *)&p_cam_transform; + library->call_native_raw("arvr_return_transform_for_eye", "godot_arvr_get_transform_for_eye", data, 2, parameters, &ret); + + return ret; +} + +CameraMatrix ARVRInterfaceGDNative::get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far) { + void *parameters[5]; + CameraMatrix cm; + + ERR_FAIL_COND_V(data == NULL, CameraMatrix()); + + parameters[0] = (void *)cm.matrix; + parameters[1] = (void *)&p_eye; + parameters[2] = (void *)&p_aspect; + parameters[3] = (void *)&p_z_near; + parameters[4] = (void *)&p_z_far; + library->call_native_raw("arvr_call_fill_projection_for_eye", "godot_arvr_fill_projection_for_eye", data, 5, parameters, NULL); + + return cm; +} + +void ARVRInterfaceGDNative::commit_for_eye(ARVRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect) { + void *parameters[3]; + + ERR_FAIL_COND(data == NULL); + + parameters[0] = (void *)&p_eye; + parameters[1] = (void *)&p_render_target; + parameters[2] = (void *)&p_screen_rect; + library->call_native_raw("arvr_call_commit_for_eye", "godot_arvr_commit_for_eye", data, 3, parameters, NULL); +} + +void ARVRInterfaceGDNative::process() { + ERR_FAIL_COND(data == NULL); + + library->call_native_raw("arvr_call_method", "godot_arvr_process", data, 0, NULL, NULL); +} + +void ARVRInterfaceGDNative::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_gdnative_library", "library"), &ARVRInterfaceGDNative::set_gdnative_library); +} + +///////////////////////////////////////////////////////////////////////////////////// +// some helper callbacks + +godot_real GDAPI godot_arvr_get_worldscale() { + ARVRServer *arvr_server = ARVRServer::get_singleton(); + ERR_FAIL_NULL_V(arvr_server, 1.0); + + return arvr_server->get_world_scale(); +}; + +godot_transform GDAPI godot_arvr_get_reference_frame() { + godot_transform reference_frame; + Transform *reference_frame_ptr = (Transform *)&reference_frame; + + ARVRServer *arvr_server = ARVRServer::get_singleton(); + if (arvr_server != NULL) { + *reference_frame_ptr = arvr_server->get_reference_frame(); + } else { + godot_transform_new_identity(&reference_frame); + }; + + return reference_frame; +}; + +void GDAPI godot_arvr_blit(godot_int p_eye, godot_rid *p_render_target, godot_rect2 *p_rect) { + // blits out our texture as is, handy for preview display of one of the eyes that is already rendered with lens distortion on an external HMD + ARVRInterface::Eyes eye = (ARVRInterface::Eyes)p_eye; + RID *render_target = (RID *)p_render_target; + Rect2 screen_rect = *(Rect2 *)p_rect; + + if (eye == ARVRInterface::EYE_LEFT) { + screen_rect.size.x /= 2.0; + } else if (p_eye == ARVRInterface::EYE_RIGHT) { + screen_rect.size.x /= 2.0; + screen_rect.position.x += screen_rect.size.x; + } + + VSG::rasterizer->set_current_render_target(RID()); + VSG::rasterizer->blit_render_target_to_screen(*render_target, screen_rect, 0); +}; + +godot_int GDAPI godot_arvr_get_texid(godot_rid *p_render_target) { + // In order to send off our textures to display on our hardware we need the opengl texture ID instead of the render target RID + // This is a handy function to expose that. + RID *render_target = (RID *)p_render_target; + + RID eye_texture = VSG::storage->render_target_get_texture(*render_target); + uint32_t texid = VS::get_singleton()->texture_get_texid(eye_texture); + + return texid; +}; + +godot_int GDAPI godot_arvr_add_controller(char *p_device_name, godot_int p_hand, godot_bool p_tracks_orientation, godot_bool p_tracks_position) { + ARVRServer *arvr_server = ARVRServer::get_singleton(); + ERR_FAIL_NULL_V(arvr_server, 0); + + InputDefault *input = (InputDefault *)Input::get_singleton(); + ERR_FAIL_NULL_V(input, 0); + + ARVRPositionalTracker *new_tracker = memnew(ARVRPositionalTracker); + new_tracker->set_name(p_device_name); + new_tracker->set_type(ARVRServer::TRACKER_CONTROLLER); + if (p_hand == 1) { + new_tracker->set_hand(ARVRPositionalTracker::TRACKER_LEFT_HAND); + } else if (p_hand == 2) { + new_tracker->set_hand(ARVRPositionalTracker::TRACKER_RIGHT_HAND); + }; + + // also register as joystick... + int joyid = input->get_unused_joy_id(); + if (joyid != -1) { + new_tracker->set_joy_id(joyid); + input->joy_connection_changed(joyid, true, p_device_name, ""); + }; + + if (p_tracks_orientation) { + Basis orientation; + new_tracker->set_orientation(orientation); + }; + if (p_tracks_position) { + Vector3 position; + new_tracker->set_position(position); + }; + + // add our tracker to our server and remember its pointer + arvr_server->add_tracker(new_tracker); + + // note, this ID is only unique within controllers! + return new_tracker->get_tracker_id(); +}; + +void GDAPI godot_arvr_remove_controller(godot_int p_controller_id) { + ARVRServer *arvr_server = ARVRServer::get_singleton(); + ERR_FAIL_NULL(arvr_server); + + InputDefault *input = (InputDefault *)Input::get_singleton(); + ERR_FAIL_NULL(input); + + ARVRPositionalTracker *remove_tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, p_controller_id); + if (remove_tracker != NULL) { + // unset our joystick if applicable + int joyid = remove_tracker->get_joy_id(); + if (joyid != -1) { + input->joy_connection_changed(joyid, false, "", ""); + remove_tracker->set_joy_id(-1); + }; + + // remove our tracker from our server + arvr_server->remove_tracker(remove_tracker); + memdelete(remove_tracker); + }; +}; + +void GDAPI godot_arvr_set_controller_transform(godot_int p_controller_id, godot_transform *p_transform, godot_bool p_tracks_orientation, godot_bool p_tracks_position) { + ARVRServer *arvr_server = ARVRServer::get_singleton(); + ERR_FAIL_NULL(arvr_server); + + ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, p_controller_id); + if (tracker != NULL) { + Transform *transform = (Transform *)p_transform; + if (p_tracks_orientation) { + tracker->set_orientation(transform->basis); + }; + if (p_tracks_position) { + tracker->set_position(transform->origin); + }; + }; +}; + +void GDAPI godot_arvr_set_controller_button(godot_int p_controller_id, godot_int p_button, godot_bool p_is_pressed) { + ARVRServer *arvr_server = ARVRServer::get_singleton(); + ERR_FAIL_NULL(arvr_server); + + InputDefault *input = (InputDefault *)Input::get_singleton(); + ERR_FAIL_NULL(input); + + ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, p_controller_id); + if (tracker != NULL) { + int joyid = tracker->get_joy_id(); + if (joyid != -1) { + input->joy_button(joyid, p_button, p_is_pressed); + }; + }; +}; + +void GDAPI godot_arvr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_real p_value, godot_bool p_can_be_negative) { + ARVRServer *arvr_server = ARVRServer::get_singleton(); + ERR_FAIL_NULL(arvr_server); + + InputDefault *input = (InputDefault *)Input::get_singleton(); + ERR_FAIL_NULL(input); + + ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, p_controller_id); + if (tracker != NULL) { + int joyid = tracker->get_joy_id(); + if (joyid != -1) { + InputDefault::JoyAxis jx; + jx.min = p_can_be_negative ? -1 : 0; + jx.value = p_value; + input->joy_axis(joyid, p_axis, jx); + }; + }; +}; diff --git a/modules/gdnative/nativearvr/arvr_interface_gdnative.h b/modules/gdnative/nativearvr/arvr_interface_gdnative.h new file mode 100644 index 0000000000..6995e85c73 --- /dev/null +++ b/modules/gdnative/nativearvr/arvr_interface_gdnative.h @@ -0,0 +1,88 @@ +/*************************************************************************/ +/* arvr_interface_gdnative.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef ARVR_INTERFACE_GDNATIVE_H +#define ARVR_INTERFACE_GDNATIVE_H + +#include "modules/gdnative/gdnative.h" +#include "servers/arvr/arvr_interface.h" + +/** + @authors Hinsbart & Karroffel & Mux213 + + This subclass of our AR/VR interface forms a bridge to GDNative. +*/ + +class ARVRInterfaceGDNative : public ARVRInterface { + GDCLASS(ARVRInterfaceGDNative, ARVRInterface); + + void cleanup(); + +protected: + Ref<GDNative> library; + void *data; + + static void _bind_methods(); + +public: + /** general interface information **/ + ARVRInterfaceGDNative(); + ~ARVRInterfaceGDNative(); + + void set_gdnative_library(Ref<GDNativeLibrary> p_library); + + virtual StringName get_name() const; + virtual int get_capabilities() const; + + virtual bool is_initialized(); + virtual bool initialize(); + virtual void uninitialize(); + + /** specific to AR **/ + virtual bool get_anchor_detection_is_enabled() const; + virtual void set_anchor_detection_is_enabled(bool p_enable); + + /** rendering and internal **/ + virtual Size2 get_recommended_render_targetsize(); + virtual bool is_stereo(); + virtual Transform get_transform_for_eye(ARVRInterface::Eyes p_eye, const Transform &p_cam_transform); + + // we expose a PoolVector<float> version of this function to GDNative + PoolVector<float> _get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far); + + // and a CameraMatrix version to ARVRServer + virtual CameraMatrix get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far); + + virtual void commit_for_eye(ARVRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect); + + virtual void process(); +}; + +#endif // ARVR_INTERFACE_GDNATIVE_H diff --git a/modules/gdnative/nativearvr/config.py b/modules/gdnative/nativearvr/config.py new file mode 100644 index 0000000000..4d1bdfe4d1 --- /dev/null +++ b/modules/gdnative/nativearvr/config.py @@ -0,0 +1,5 @@ +def can_build(platform): + return True + +def configure(env): + pass diff --git a/modules/gdnative/nativearvr/register_types.cpp b/modules/gdnative/nativearvr/register_types.cpp new file mode 100644 index 0000000000..f4dc13ed55 --- /dev/null +++ b/modules/gdnative/nativearvr/register_types.cpp @@ -0,0 +1,414 @@ +/*************************************************************************/ +/* register_types.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "register_types.h" + +#include "arvr_interface_gdnative.h" +#include "core/os/os.h" + +void arvr_call_constructor( + void *p_handle, + godot_string *p_proc_name, + void *p_data, + int p_num_args, + void **p_args, + void *r_return) { + if (p_handle == NULL) { + ERR_PRINT("No valid library handle, can't call standard varcall procedure"); + return; + } + + void *library_proc; + Error err = OS::get_singleton()->get_dynamic_library_symbol_handle( + p_handle, + *(String *)p_proc_name, + library_proc, + true); // we roll our own message + if (err != OK) { + ERR_PRINT((String("GDNative procedure \"" + *(String *)p_proc_name) + "\" does not exists and can't be called").utf8().get_data()); + return; + } + + void *(*proc)(godot_object *); + proc = (void *(*)(godot_object *))library_proc; + + godot_object *this_object = (godot_object *)p_args[0]; + void *p = proc(this_object); + + void **return_ptr = (void **)r_return; + + *return_ptr = p; +}; + +void arvr_call_destructor( + void *p_handle, + godot_string *p_proc_name, + void *p_data, + int p_num_args, + void **p_args, + void *r_return) { + if (p_handle == NULL) { + ERR_PRINT("No valid library handle, can't call standard varcall procedure"); + return; + } + + void *library_proc; + Error err = OS::get_singleton()->get_dynamic_library_symbol_handle( + p_handle, + *(String *)p_proc_name, + library_proc, + true); // we roll our own message + if (err != OK) { + ERR_PRINT((String("GDNative procedure \"" + *(String *)p_proc_name) + "\" does not exists and can't be called").utf8().get_data()); + return; + } + + void (*proc)(void *); + proc = (void (*)(void *))library_proc; + + proc(p_data); +}; + +void arvr_return_string( + void *p_handle, + godot_string *p_proc_name, + void *p_data, + int p_num_args, + void **p_args, + void *r_return) { + if (p_handle == NULL) { + ERR_PRINT("No valid library handle, can't call standard varcall procedure"); + return; + } + + void *library_proc; + Error err = OS::get_singleton()->get_dynamic_library_symbol_handle( + p_handle, + *(String *)p_proc_name, + library_proc, + true); // we roll our own message + if (err != OK) { + ERR_PRINT((String("GDNative procedure \"" + *(String *)p_proc_name) + "\" does not exists and can't be called").utf8().get_data()); + return; + } + + godot_string (*proc)(void *); + proc = (godot_string(*)(void *))library_proc; + + godot_string s = proc(p_data); + + StringName *return_ptr = (StringName *)r_return; + + String *returned_string = (String *)&s; + + *return_ptr = *returned_string; + + godot_string_destroy(&s); +}; + +void arvr_return_int( + void *p_handle, + godot_string *p_proc_name, + void *p_data, + int p_num_args, + void **p_args, + void *r_return) { + if (p_handle == NULL) { + ERR_PRINT("No valid library handle, can't call standard varcall procedure"); + return; + } + + void *library_proc; + Error err = OS::get_singleton()->get_dynamic_library_symbol_handle( + p_handle, + *(String *)p_proc_name, + library_proc, + true); // we roll our own message + if (err != OK) { + ERR_PRINT((String("GDNative procedure \"" + *(String *)p_proc_name) + "\" does not exists and can't be called").utf8().get_data()); + return; + } + + godot_int (*proc)(void *); + proc = (godot_int(*)(void *))library_proc; + + godot_int i = proc(p_data); + + int *return_ptr = (int *)r_return; + + *return_ptr = i; +}; + +void arvr_return_bool( + void *p_handle, + godot_string *p_proc_name, + void *p_data, + int p_num_args, + void **p_args, + void *r_return) { + if (p_handle == NULL) { + ERR_PRINT("No valid library handle, can't call standard varcall procedure"); + return; + } + + void *library_proc; + Error err = OS::get_singleton()->get_dynamic_library_symbol_handle( + p_handle, + *(String *)p_proc_name, + library_proc, + true); // we roll our own message + if (err != OK) { + ERR_PRINT((String("GDNative procedure \"" + *(String *)p_proc_name) + "\" does not exists and can't be called").utf8().get_data()); + return; + } + + godot_bool (*proc)(void *); + proc = (godot_bool(*)(void *))library_proc; + + godot_bool b = proc(p_data); + + int *return_ptr = (int *)r_return; + + *return_ptr = b; +}; + +void arvr_set_bool( + void *p_handle, + godot_string *p_proc_name, + void *p_data, + int p_num_args, + void **p_args, + void *r_return) { + if (p_handle == NULL) { + ERR_PRINT("No valid library handle, can't call standard varcall procedure"); + return; + } + + void *library_proc; + Error err = OS::get_singleton()->get_dynamic_library_symbol_handle( + p_handle, + *(String *)p_proc_name, + library_proc, + true); // we roll our own message + if (err != OK) { + ERR_PRINT((String("GDNative procedure \"" + *(String *)p_proc_name) + "\" does not exists and can't be called").utf8().get_data()); + return; + } + + void (*proc)(void *, bool); + proc = (void (*)(void *, bool))library_proc; + + bool *set_bool = (bool *)p_args[0]; + proc(p_data, *set_bool); +}; + +void arvr_call_method( + void *p_handle, + godot_string *p_proc_name, + void *p_data, + int p_num_args, + void **p_args, + void *r_return) { + if (p_handle == NULL) { + ERR_PRINT("No valid library handle, can't call standard varcall procedure"); + return; + } + + void *library_proc; + Error err = OS::get_singleton()->get_dynamic_library_symbol_handle( + p_handle, + *(String *)p_proc_name, + library_proc, + true); // we roll our own message + if (err != OK) { + ERR_PRINT((String("GDNative procedure \"" + *(String *)p_proc_name) + "\" does not exists and can't be called").utf8().get_data()); + return; + } + + godot_bool (*proc)(void *); + proc = (godot_bool(*)(void *))library_proc; + + proc(p_data); +}; + +void arvr_return_vector2( + void *p_handle, + godot_string *p_proc_name, + void *p_data, + int p_num_args, + void **p_args, + void *r_return) { + if (p_handle == NULL) { + ERR_PRINT("No valid library handle, can't call standard varcall procedure"); + return; + } + + void *library_proc; + Error err = OS::get_singleton()->get_dynamic_library_symbol_handle( + p_handle, + *(String *)p_proc_name, + library_proc, + true); // we roll our own message + if (err != OK) { + ERR_PRINT((String("GDNative procedure \"" + *(String *)p_proc_name) + "\" does not exists and can't be called").utf8().get_data()); + return; + } + + godot_vector2 (*proc)(void *); + proc = (godot_vector2(*)(void *))library_proc; + + godot_vector2 v = proc(p_data); + + godot_vector2 *return_ptr = (godot_vector2 *)r_return; + + *return_ptr = v; +}; + +void arvr_return_transform_for_eye( + void *p_handle, + godot_string *p_proc_name, + void *p_data, + int p_num_args, + void **p_args, + void *r_return) { + if (p_handle == NULL) { + ERR_PRINT("No valid library handle, can't call standard varcall procedure"); + return; + } + + void *library_proc; + Error err = OS::get_singleton()->get_dynamic_library_symbol_handle( + p_handle, + *(String *)p_proc_name, + library_proc, + true); // we roll our own message + if (err != OK) { + ERR_PRINT((String("GDNative procedure \"" + *(String *)p_proc_name) + "\" does not exists and can't be called").utf8().get_data()); + return; + } + + godot_transform (*proc)(void *, int, godot_transform *); + proc = (godot_transform(*)(void *, int, godot_transform *))library_proc; + + int *eye = (int *)p_args[0]; + godot_transform *camera_transform = (godot_transform *)p_args[1]; + godot_transform t = proc(p_data, *eye, camera_transform); + + godot_transform *return_ptr = (godot_transform *)r_return; + + *return_ptr = t; +}; + +void arvr_call_fill_projection_for_eye( + void *p_handle, + godot_string *p_proc_name, + void *p_data, + int p_num_args, + void **p_args, + void *r_return) { + if (p_handle == NULL) { + ERR_PRINT("No valid library handle, can't call standard varcall procedure"); + return; + } + + void *library_proc; + Error err = OS::get_singleton()->get_dynamic_library_symbol_handle( + p_handle, + *(String *)p_proc_name, + library_proc, + true); // we roll our own message + if (err != OK) { + ERR_PRINT((String("GDNative procedure \"" + *(String *)p_proc_name) + "\" does not exists and can't be called").utf8().get_data()); + return; + } + + void (*proc)(void *, real_t *, int, real_t, real_t, real_t); + proc = (void (*)(void *, real_t *, int, real_t, real_t, real_t))library_proc; + + real_t *projection = (real_t *)p_args[0]; // <-- we'll be writing into this buffer, must have enough space for 16 floats! + int *eye = (int *)p_args[1]; + real_t *aspect = (real_t *)p_args[2]; + real_t *zn = (real_t *)p_args[3]; + real_t *zf = (real_t *)p_args[4]; + + proc(p_data, projection, *eye, *aspect, *zn, *zf); +}; + +void arvr_call_commit_for_eye( + void *p_handle, + godot_string *p_proc_name, + void *p_data, + int p_num_args, + void **p_args, + void *r_return) { + if (p_handle == NULL) { + ERR_PRINT("No valid library handle, can't call standard varcall procedure"); + return; + } + + void *library_proc; + Error err = OS::get_singleton()->get_dynamic_library_symbol_handle( + p_handle, + *(String *)p_proc_name, + library_proc, + true); // we roll our own message + if (err != OK) { + ERR_PRINT((String("GDNative procedure \"" + *(String *)p_proc_name) + "\" does not exists and can't be called").utf8().get_data()); + return; + } + + void (*proc)(void *, int, godot_rid *, godot_rect2 *); + proc = (void (*)(void *, int, godot_rid *, godot_rect2 *))library_proc; + + int *eye = (int *)p_args[0]; + godot_rid *rid = (godot_rid *)p_args[1]; + godot_rect2 *screen_rect = (godot_rect2 *)p_args[2]; + + proc(p_data, *eye, rid, screen_rect); +}; + +void register_nativearvr_types() { + GDNativeCallRegistry::singleton->register_native_raw_call_type("arvr_call_constructor", arvr_call_constructor); + GDNativeCallRegistry::singleton->register_native_raw_call_type("arvr_call_destructor", arvr_call_destructor); + GDNativeCallRegistry::singleton->register_native_raw_call_type("arvr_return_string", arvr_return_string); + GDNativeCallRegistry::singleton->register_native_raw_call_type("arvr_return_int", arvr_return_int); + GDNativeCallRegistry::singleton->register_native_raw_call_type("arvr_return_bool", arvr_return_bool); + GDNativeCallRegistry::singleton->register_native_raw_call_type("arvr_set_bool", arvr_set_bool); + GDNativeCallRegistry::singleton->register_native_raw_call_type("arvr_call_method", arvr_call_method); + GDNativeCallRegistry::singleton->register_native_raw_call_type("arvr_return_vector2", arvr_return_vector2); + GDNativeCallRegistry::singleton->register_native_raw_call_type("arvr_return_transform_for_eye", arvr_return_transform_for_eye); + GDNativeCallRegistry::singleton->register_native_raw_call_type("arvr_call_fill_projection_for_eye", arvr_call_fill_projection_for_eye); + GDNativeCallRegistry::singleton->register_native_raw_call_type("arvr_call_commit_for_eye", arvr_call_commit_for_eye); + + ClassDB::register_class<ARVRInterfaceGDNative>(); +} + +void unregister_nativearvr_types() { +} diff --git a/modules/gdnative/nativearvr/register_types.h b/modules/gdnative/nativearvr/register_types.h new file mode 100644 index 0000000000..5e7557c7e9 --- /dev/null +++ b/modules/gdnative/nativearvr/register_types.h @@ -0,0 +1,32 @@ +/*************************************************************************/ +/* register_types.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +void register_nativearvr_types(); +void unregister_nativearvr_types(); diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index 059cd197d1..8f4eed091f 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -35,6 +35,7 @@ #include "io/resource_loader.h" #include "io/resource_saver.h" +#include "nativearvr/register_types.h" #include "nativescript/register_types.h" #include "core/engine.h" @@ -202,6 +203,7 @@ void register_gdnative_types() { GDNativeCallRegistry::singleton->register_native_raw_call_type("gdnative_singleton_call", cb_singleton_call); + register_nativearvr_types(); register_nativescript_types(); // run singletons @@ -249,6 +251,7 @@ void unregister_gdnative_types() { } singleton_gdnatives.clear(); + unregister_nativearvr_types(); unregister_nativescript_types(); memdelete(GDNativeCallRegistry::singleton); @@ -280,4 +283,4 @@ void unregister_gdnative_types() { print_line(String("vector2:\t") + itos(sizeof(Vector2))); print_line(String("vector3:\t") + itos(sizeof(Vector3))); */ -} +}
\ No newline at end of file diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index 27ea310780..5c252bda86 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -129,7 +129,6 @@ AudioStreamPlaybackOGGVorbis::~AudioStreamPlaybackOGGVorbis() { Ref<AudioStreamPlayback> AudioStreamOGGVorbis::instance_playback() { Ref<AudioStreamPlaybackOGGVorbis> ovs; - printf("instance at %p, data %p\n", this, data); ERR_FAIL_COND_V(data == NULL, ovs); @@ -208,8 +207,6 @@ void AudioStreamOGGVorbis::set_data(const PoolVector<uint8_t> &p_data) { break; } } - - printf("create at %p, data %p\n", this, data); } PoolVector<uint8_t> AudioStreamOGGVorbis::get_data() const { diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 80c706898d..73749cacb3 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -462,8 +462,6 @@ void ParticlesMaterial::finish_shaders() { void ParticlesMaterial::_update_shader() { - print_line("updating shader"); - dirty_materials.remove(&element); MaterialKey mk = _compute_key(); @@ -913,9 +911,7 @@ void ParticlesMaterial::_queue_shader_change() { if (material_mutex) material_mutex->lock(); - print_line("queuing change"); if (!element.in_list()) { - print_line("not in list, adding"); dirty_materials.add(&element); } diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index e58cbe373b..dbd7c1bbc0 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -40,12 +40,15 @@ void ColorPicker::_notification(int p_what) { switch (p_what) { case NOTIFICATION_THEME_CHANGED: { //sample->set_texture(get_icon("color_sample")); + btn_pick->set_icon(get_icon("screen_picker", "ColorPicker")); + bt_add_preset->set_icon(get_icon("add_preset")); _update_controls(); } break; case NOTIFICATION_ENTER_TREE: { btn_pick->set_icon(get_icon("screen_picker", "ColorPicker")); + bt_add_preset->set_icon(get_icon("add_preset")); _update_color(); } break; @@ -601,7 +604,6 @@ ColorPicker::ColorPicker() preset->connect("draw", this, "_update_presets"); bt_add_preset = memnew(Button); - bt_add_preset->set_icon(get_icon("add_preset")); bt_add_preset->set_tooltip(TTR("Add current color as a preset")); bt_add_preset->connect("pressed", this, "_add_preset_pressed"); bbc->add_child(bt_add_preset); diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 0d3cccc2b5..946a8c47a3 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -284,7 +284,6 @@ void GraphEdit::_notification(int p_what) { zoom_reset->set_icon(get_icon("reset")); zoom_plus->set_icon(get_icon("more")); snap_button->set_icon(get_icon("snap")); - //zoom_icon->set_texture( get_icon("Zoom", "EditorIcons")); } if (p_what == NOTIFICATION_DRAW) { diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 402e06f621..ce439fece6 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -884,7 +884,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_icon("minus", "GraphEdit", make_icon(icon_zoom_less_png)); theme->set_icon("reset", "GraphEdit", make_icon(icon_zoom_reset_png)); theme->set_icon("more", "GraphEdit", make_icon(icon_zoom_more_png)); - theme->set_icon("SnapGrid", "GraphEdit", make_icon(icon_snap_grid_png)); + theme->set_icon("snap", "GraphEdit", make_icon(icon_snap_grid_png)); theme->set_stylebox("bg", "GraphEdit", make_stylebox(tree_bg_png, 4, 4, 4, 5)); theme->set_color("grid_minor", "GraphEdit", Color(1, 1, 1, 0.05)); theme->set_color("grid_major", "GraphEdit", Color(1, 1, 1, 0.2)); diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp index ec41630258..66df7dfda8 100644 --- a/scene/resources/shader.cpp +++ b/scene/resources/shader.cpp @@ -43,8 +43,6 @@ void Shader::set_code(const String &p_code) { String type = ShaderLanguage::get_shader_type(p_code); - print_line("mode: " + type); - if (type == "canvas_item") { mode = MODE_CANVAS_ITEM; } else if (type == "particles") { diff --git a/servers/arvr/arvr_script_interface.cpp b/servers/arvr/arvr_script_interface.cpp deleted file mode 100644 index 2755605a14..0000000000 --- a/servers/arvr/arvr_script_interface.cpp +++ /dev/null @@ -1,136 +0,0 @@ -#include "arvr_script_interface.h" - -ARVRScriptInterface::ARVRScriptInterface() { - // testing - printf("Construct script interface"); -} - -ARVRScriptInterface::~ARVRScriptInterface() { - if (is_initialized()) { - uninitialize(); - }; - - // testing - printf("Destruct script interface"); -} - -StringName ARVRScriptInterface::get_name() const { - if (get_script_instance() && get_script_instance()->has_method("get_name")) { - return get_script_instance()->call("get_name"); - } else { - // just return something for now - return "ARVR Script interface"; - } -} - -int ARVRScriptInterface::get_capabilities() const { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_capabilities")), ARVRInterface::ARVR_NONE); - return get_script_instance()->call("get_capabilities"); -}; - -ARVRInterface::Tracking_status ARVRScriptInterface::get_tracking_status() const { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_tracking_status")), ARVRInterface::ARVR_NOT_TRACKING); - int status = get_script_instance()->call("get_tracking_status"); - return (ARVRInterface::Tracking_status)status; -} - -bool ARVRScriptInterface::get_anchor_detection_is_enabled() const { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_anchor_detection_is_enabled")), false); - return get_script_instance()->call("get_anchor_detection_is_enabled"); -}; - -void ARVRScriptInterface::set_anchor_detection_is_enabled(bool p_enable) { - ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("set_anchor_detection_is_enabled"))); - get_script_instance()->call("set_anchor_detection_is_enabled"); -}; - -bool ARVRScriptInterface::is_stereo() { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("is_stereo")), false); - return get_script_instance()->call("is_stereo"); -} - -bool ARVRScriptInterface::is_initialized() { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("is_initialized")), false); - return get_script_instance()->call("is_initialized"); -} - -bool ARVRScriptInterface::initialize() { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("initialize")), false); - return get_script_instance()->call("initialize"); -} - -void ARVRScriptInterface::uninitialize() { - ARVRServer *arvr_server = ARVRServer::get_singleton(); - if (arvr_server != NULL) { - // Whatever happens, make sure this is no longer our primary interface - arvr_server->clear_primary_interface_if(this); - } - - ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("uninitialize"))); - get_script_instance()->call("uninitialize"); -} - -Size2 ARVRScriptInterface::get_recommended_render_targetsize() { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_recommended_render_targetsize")), Size2()); - return get_script_instance()->call("get_recommended_render_targetsize"); -} - -Transform ARVRScriptInterface::get_transform_for_eye(Eyes p_eye, const Transform &p_cam_transform) { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("get_transform_for_eye")), Transform()); - return get_script_instance()->call("get_transform_for_eye", p_eye, p_cam_transform); -} - -// Suggestion from Reduz, as we can't return a CameraMatrix, return a PoolVector with our 16 floats -PoolVector<float> ARVRScriptInterface::_get_projection_for_eye(Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far) { - ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("_get_projection_for_eye")), PoolVector<float>()); - return get_script_instance()->call("_get_projection_for_eye", p_eye, p_aspect, p_z_near, p_z_far); -} - -CameraMatrix ARVRScriptInterface::get_projection_for_eye(Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far) { - CameraMatrix cm; - int i = 0; - int j = 0; - - PoolVector<float> cm_as_floats = _get_projection_for_eye(p_eye, p_aspect, p_z_near, p_z_far); - - for (int k = 0; k < cm_as_floats.size() && i < 4; k++) { - cm.matrix[i][j] = cm_as_floats[k]; - j++; - if (j == 4) { - j = 0; - i++; - }; - }; - - return cm; -} - -void ARVRScriptInterface::commit_for_eye(ARVRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect) { - ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("commit_for_eye"))); - get_script_instance()->call("commit_for_eye"); -} - -void ARVRScriptInterface::process() { - ERR_FAIL_COND(!(get_script_instance() && get_script_instance()->has_method("process"))); - get_script_instance()->call("process"); -} - -void ARVRScriptInterface::_bind_methods() { - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::INT, "get_capabilities")); - - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "is_initialized")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "initialize")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("uninitialize")); - - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::INT, "get_tracking_status")); - - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "get_anchor_detection_is_enabled")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("set_anchor_detection_is_enabled", PropertyInfo(Variant::BOOL, "enabled"))); - - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "is_stereo")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::VECTOR2, "get_recommended_render_targetsize")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::TRANSFORM, "get_transform_for_eye", PropertyInfo(Variant::INT, "eye"), PropertyInfo(Variant::TRANSFORM, "cam_transform"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("_get_projection_for_eye")); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("commit_for_eye", PropertyInfo(Variant::INT, "eye"), PropertyInfo(Variant::_RID, "render_target"))); - ClassDB::add_virtual_method(get_class_static(), MethodInfo("process")); -} diff --git a/servers/arvr/arvr_script_interface.h b/servers/arvr/arvr_script_interface.h deleted file mode 100644 index b1393b4fdb..0000000000 --- a/servers/arvr/arvr_script_interface.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef SCRIPT_INTERFACE_H -#define SCRIPT_INTERFACE_H - -#include "arvr_interface.h" - -/** - @authors Hinsbart & Karroffel - - This subclass of our AR/VR interface forms a bridge to GDNative. -*/ - -class ARVRScriptInterface : public ARVRInterface { - GDCLASS(ARVRScriptInterface, ARVRInterface); - -protected: - static void _bind_methods(); - -public: - /** general interface information **/ - ARVRScriptInterface(); - ~ARVRScriptInterface(); - - virtual StringName get_name() const; - virtual int get_capabilities() const; - - virtual bool is_initialized(); - virtual bool initialize(); - virtual void uninitialize(); - - ARVRInterface::Tracking_status get_tracking_status() const; /* get the status of our current tracking */ - - /** specific to AR **/ - virtual bool get_anchor_detection_is_enabled() const; - virtual void set_anchor_detection_is_enabled(bool p_enable); - - /** rendering and internal **/ - virtual Size2 get_recommended_render_targetsize(); - virtual bool is_stereo(); - virtual Transform get_transform_for_eye(ARVRInterface::Eyes p_eye, const Transform &p_cam_transform); - - // we expose a PoolVector<float> version of this function to GDNative - PoolVector<float> _get_projection_for_eye(Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far); - - // and a CameraMatrix version to ARVRServer - virtual CameraMatrix get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far); - - virtual void commit_for_eye(ARVRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect); - - virtual void process(); -}; - -#endif // SCRIPT_INTERFACE_H diff --git a/servers/physics_2d/collision_object_2d_sw.h b/servers/physics_2d/collision_object_2d_sw.h index db1270633f..627ba8ea15 100644 --- a/servers/physics_2d/collision_object_2d_sw.h +++ b/servers/physics_2d/collision_object_2d_sw.h @@ -110,21 +110,48 @@ public: void set_shape_metadata(int p_index, const Variant &p_metadata); _FORCE_INLINE_ int get_shape_count() const { return shapes.size(); } - _FORCE_INLINE_ Shape2DSW *get_shape(int p_index) const { return shapes[p_index].shape; } - _FORCE_INLINE_ const Transform2D &get_shape_transform(int p_index) const { return shapes[p_index].xform; } - _FORCE_INLINE_ const Transform2D &get_shape_inv_transform(int p_index) const { return shapes[p_index].xform_inv; } - _FORCE_INLINE_ const Rect2 &get_shape_aabb(int p_index) const { return shapes[p_index].aabb_cache; } - _FORCE_INLINE_ const Variant &get_shape_metadata(int p_index) const { return shapes[p_index].metadata; } + _FORCE_INLINE_ Shape2DSW *get_shape(int p_index) const { + ERR_FAIL_INDEX_V(p_index, shapes.size(), NULL); + return shapes[p_index].shape; + } + _FORCE_INLINE_ const Transform2D &get_shape_transform(int p_index) const { + ERR_FAIL_INDEX_V(p_index, shapes.size(), Transform2D()); + return shapes[p_index].xform; + } + _FORCE_INLINE_ const Transform2D &get_shape_inv_transform(int p_index) const { + ERR_FAIL_INDEX_V(p_index, shapes.size(), Transform2D()); + return shapes[p_index].xform_inv; + } + _FORCE_INLINE_ const Rect2 &get_shape_aabb(int p_index) const { + ERR_FAIL_INDEX_V(p_index, shapes.size(), Rect2()); + return shapes[p_index].aabb_cache; + } + _FORCE_INLINE_ const Variant &get_shape_metadata(int p_index) const { + ERR_FAIL_INDEX_V(p_index, shapes.size(), Variant()); + return shapes[p_index].metadata; + } _FORCE_INLINE_ Transform2D get_transform() const { return transform; } _FORCE_INLINE_ Transform2D get_inv_transform() const { return inv_transform; } _FORCE_INLINE_ Space2DSW *get_space() const { return space; } - _FORCE_INLINE_ void set_shape_as_disabled(int p_idx, bool p_disabled) { shapes[p_idx].disabled = p_disabled; } - _FORCE_INLINE_ bool is_shape_set_as_disabled(int p_idx) const { return shapes[p_idx].disabled; } + _FORCE_INLINE_ void set_shape_as_disabled(int p_idx, bool p_disabled) { + ERR_FAIL_INDEX(p_idx, shapes.size()); + shapes[p_idx].disabled = p_disabled; + } + _FORCE_INLINE_ bool is_shape_set_as_disabled(int p_idx) const { + ERR_FAIL_INDEX_V(p_idx, shapes.size(), false); + return shapes[p_idx].disabled; + } - _FORCE_INLINE_ void set_shape_as_one_way_collision(int p_idx, bool p_one_way_collision) { shapes[p_idx].one_way_collision = p_one_way_collision; } - _FORCE_INLINE_ bool is_shape_set_as_one_way_collision(int p_idx) const { return shapes[p_idx].one_way_collision; } + _FORCE_INLINE_ void set_shape_as_one_way_collision(int p_idx, bool p_one_way_collision) { + ERR_FAIL_INDEX(p_idx, shapes.size()); + shapes[p_idx].one_way_collision = p_one_way_collision; + } + _FORCE_INLINE_ bool is_shape_set_as_one_way_collision(int p_idx) const { + ERR_FAIL_INDEX_V(p_idx, shapes.size(), false); + return shapes[p_idx].one_way_collision; + } void set_collision_mask(uint32_t p_mask) { collision_mask = p_mask; } _FORCE_INLINE_ uint32_t get_collision_mask() const { return collision_mask; } diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 1aee2144aa..7a9328e30f 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -32,7 +32,6 @@ #include "arvr/arvr_interface.h" #include "arvr/arvr_positional_tracker.h" -#include "arvr/arvr_script_interface.h" #include "arvr_server.h" #include "audio/audio_effect.h" #include "audio/audio_stream.h" @@ -74,10 +73,8 @@ static void _debugger_get_resource_usage(List<ScriptDebuggerRemote::ResourceUsag } ShaderTypes *shader_types = NULL; -ARVRServer *arvr_server = NULL; void register_server_types() { - arvr_server = memnew(ARVRServer); ClassDB::register_virtual_class<VisualServer>(); ClassDB::register_class<AudioServer>(); @@ -95,7 +92,6 @@ void register_server_types() { ClassDB::register_virtual_class<ARVRInterface>(); ClassDB::register_class<ARVRPositionalTracker>(); - ClassDB::register_class<ARVRScriptInterface>(); ClassDB::register_virtual_class<AudioStream>(); ClassDB::register_virtual_class<AudioStreamPlayback>(); @@ -152,9 +148,5 @@ void register_server_types() { void unregister_server_types() { - //@TODO move this into iPhone/Android implementation? just have this here for testing... - // mobile_interface = NULL; - memdelete(shader_types); - memdelete(arvr_server); } |