summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/input_map.cpp4
-rw-r--r--core/io/file_access_compressed.cpp1
-rw-r--r--core/io/multiplayer_api.cpp23
-rw-r--r--core/io/multiplayer_api.h9
-rw-r--r--core/os/input_event.cpp16
-rw-r--r--core/os/input_event.h2
-rw-r--r--doc/classes/AnimatedTexture.xml1060
-rw-r--r--doc/classes/MultiplayerAPI.xml29
-rw-r--r--doc/classes/Node.xml7
-rw-r--r--doc/classes/ProjectSettings.xml4
-rw-r--r--doc/classes/SceneTree.xml2
-rw-r--r--doc/classes/ShaderMaterial.xml16
-rw-r--r--doc/classes/StreamPeerTCP.xml2
-rw-r--r--doc/classes/Viewport.xml7
-rw-r--r--doc/classes/VisualServer.xml10
-rw-r--r--drivers/dummy/rasterizer_dummy.h1
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp13
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.h1
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp14
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.h1
-rw-r--r--editor/animation_bezier_editor.cpp9
-rw-r--r--editor/create_dialog.cpp46
-rw-r--r--editor/dependency_editor.cpp31
-rw-r--r--editor/editor_audio_buses.cpp5
-rw-r--r--editor/editor_data.cpp45
-rw-r--r--editor/editor_data.h11
-rw-r--r--editor/editor_file_system.cpp1
-rw-r--r--editor/editor_help.cpp18
-rw-r--r--editor/editor_inspector.cpp5
-rw-r--r--editor/editor_node.cpp100
-rw-r--r--editor/editor_node.h2
-rw-r--r--editor/editor_path.cpp14
-rw-r--r--editor/editor_plugin_settings.cpp2
-rw-r--r--editor/editor_properties.cpp26
-rw-r--r--editor/editor_sub_scene.cpp5
-rw-r--r--editor/groups_editor.cpp7
-rw-r--r--editor/icons/icon_g_l_e_s_2.svg69
-rw-r--r--editor/icons/icon_g_l_e_s_3.svg67
-rw-r--r--editor/inspector_dock.cpp7
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp6
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp13
-rw-r--r--editor/plugins/item_list_editor_plugin.cpp5
-rw-r--r--editor/plugins/resource_preloader_editor_plugin.cpp3
-rw-r--r--editor/plugins/root_motion_editor_plugin.cpp15
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp6
-rw-r--r--editor/plugins/text_editor.cpp7
-rw-r--r--editor/project_export.cpp9
-rw-r--r--editor/project_settings_editor.cpp4
-rw-r--r--editor/property_editor.cpp153
-rw-r--r--editor/property_editor.h3
-rw-r--r--editor/property_selector.cpp9
-rw-r--r--editor/scene_tree_dock.cpp27
-rw-r--r--editor/scene_tree_editor.cpp6
-rw-r--r--editor/script_editor_debugger.cpp5
-rw-r--r--main/main.cpp14
-rw-r--r--methods.py3
-rw-r--r--modules/gdnative/gdnative/variant.cpp18
-rw-r--r--modules/gdnative/gdnative_api.json18
-rw-r--r--modules/gdnative/include/gdnative/variant.h44
-rw-r--r--modules/gdnative/include/nativescript/godot_nativescript.h7
-rw-r--r--modules/gdnative/nativescript/nativescript.cpp22
-rw-r--r--modules/gdscript/gdscript.cpp8
-rw-r--r--modules/gdscript/gdscript.h1
-rw-r--r--modules/gdscript/gdscript_editor.cpp4
-rw-r--r--modules/gdscript/gdscript_parser.cpp16
-rw-r--r--modules/gdscript/gdscript_tokenizer.cpp10
-rw-r--r--modules/gdscript/gdscript_tokenizer.h3
-rw-r--r--modules/mono/csharp_script.cpp12
-rw-r--r--modules/mono/glue/Managed/Files/Attributes/RPCAttributes.cs5
-rw-r--r--modules/mono/mono_gd/gd_mono_utils.cpp6
-rw-r--r--modules/mono/mono_gd/gd_mono_utils.h3
-rw-r--r--modules/opensimplex/SCsub4
-rw-r--r--modules/opensimplex/config.py14
-rw-r--r--modules/opensimplex/doc_classes/NoiseTexture.xml50
-rw-r--r--modules/opensimplex/doc_classes/SimplexNoise.xml131
-rw-r--r--modules/opensimplex/noise_texture.cpp244
-rw-r--r--modules/opensimplex/noise_texture.h104
-rw-r--r--modules/opensimplex/register_types.cpp42
-rw-r--r--modules/opensimplex/register_types.h32
-rw-r--r--modules/opensimplex/simplex_noise.cpp257
-rw-r--r--modules/opensimplex/simplex_noise.h93
-rw-r--r--modules/visual_script/visual_script_nodes.cpp2
-rw-r--r--modules/visual_script/visual_script_property_selector.cpp9
-rw-r--r--scene/3d/sprite_3d.cpp20
-rw-r--r--scene/gui/rich_text_label.cpp5
-rw-r--r--scene/gui/scroll_bar.cpp152
-rw-r--r--scene/gui/scroll_bar.h27
-rw-r--r--scene/main/viewport.cpp2
-rw-r--r--scene/resources/material.cpp27
-rw-r--r--scene/resources/material.h2
-rw-r--r--scene/resources/texture.cpp11
-rw-r--r--scene/resources/texture.h3
-rw-r--r--servers/visual/rasterizer.h1
-rw-r--r--servers/visual/shader_language.cpp84
-rw-r--r--servers/visual/shader_language.h1
-rw-r--r--servers/visual/visual_server_raster.h1
-rw-r--r--servers/visual/visual_server_wrap_mt.h1
-rw-r--r--servers/visual_server.cpp1
-rw-r--r--servers/visual_server.h1
-rw-r--r--thirdparty/README.md5
-rw-r--r--thirdparty/misc/open-simplex-noise-LICENSE25
-rw-r--r--thirdparty/misc/open-simplex-noise-no-allocate.patch133
-rw-r--r--thirdparty/misc/open-simplex-noise.c2254
-rw-r--r--thirdparty/misc/open-simplex-noise.h58
104 files changed, 4230 insertions, 1723 deletions
diff --git a/core/input_map.cpp b/core/input_map.cpp
index 51e3f311a9..b88d99470a 100644
--- a/core/input_map.cpp
+++ b/core/input_map.cpp
@@ -199,6 +199,10 @@ bool InputMap::event_get_action_status(const Ref<InputEvent> &p_event, const Str
Ref<InputEventAction> input_event_action = p_event;
if (input_event_action.is_valid()) {
+ if (p_pressed != NULL)
+ *p_pressed = input_event_action->is_pressed();
+ if (p_strength != NULL)
+ *p_strength = (*p_pressed) ? 1.0f : 0.0f;
return input_event_action->get_action() == p_action;
}
diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp
index 6290913503..645d97ae7e 100644
--- a/core/io/file_access_compressed.cpp
+++ b/core/io/file_access_compressed.cpp
@@ -293,7 +293,6 @@ uint8_t FileAccessCompressed::get_8() const {
} else {
read_block--;
at_end = true;
- ret = 0;
}
}
diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp
index 1179b1bfd6..5503b8d59c 100644
--- a/core/io/multiplayer_api.cpp
+++ b/core/io/multiplayer_api.cpp
@@ -45,8 +45,7 @@ _FORCE_INLINE_ bool _should_call_local(MultiplayerAPI::RPCMode mode, bool is_mas
} break;
case MultiplayerAPI::RPC_MODE_REMOTESYNC:
case MultiplayerAPI::RPC_MODE_MASTERSYNC:
- case MultiplayerAPI::RPC_MODE_SLAVESYNC:
- case MultiplayerAPI::RPC_MODE_SYNC: {
+ case MultiplayerAPI::RPC_MODE_PUPPETSYNC: {
//call it, sync always results in call
return true;
} break;
@@ -55,7 +54,7 @@ _FORCE_INLINE_ bool _should_call_local(MultiplayerAPI::RPCMode mode, bool is_mas
r_skip_rpc = true; //no other master so..
return is_master;
} break;
- case MultiplayerAPI::RPC_MODE_SLAVE: {
+ case MultiplayerAPI::RPC_MODE_PUPPET: {
return !is_master;
} break;
}
@@ -68,19 +67,16 @@ _FORCE_INLINE_ bool _can_call_mode(Node *p_node, MultiplayerAPI::RPCMode mode, i
case MultiplayerAPI::RPC_MODE_DISABLED: {
return false;
} break;
- case MultiplayerAPI::RPC_MODE_REMOTE: {
- return true;
- } break;
- case MultiplayerAPI::RPC_MODE_REMOTESYNC:
- case MultiplayerAPI::RPC_MODE_SYNC: {
+ case MultiplayerAPI::RPC_MODE_REMOTE:
+ case MultiplayerAPI::RPC_MODE_REMOTESYNC: {
return true;
} break;
case MultiplayerAPI::RPC_MODE_MASTERSYNC:
case MultiplayerAPI::RPC_MODE_MASTER: {
return p_node->is_network_master();
} break;
- case MultiplayerAPI::RPC_MODE_SLAVESYNC:
- case MultiplayerAPI::RPC_MODE_SLAVE: {
+ case MultiplayerAPI::RPC_MODE_PUPPETSYNC:
+ case MultiplayerAPI::RPC_MODE_PUPPET: {
return !p_node->is_network_master() && p_remote_id == p_node->get_network_master();
} break;
}
@@ -804,12 +800,13 @@ void MultiplayerAPI::_bind_methods() {
BIND_ENUM_CONSTANT(RPC_MODE_DISABLED);
BIND_ENUM_CONSTANT(RPC_MODE_REMOTE);
- BIND_ENUM_CONSTANT(RPC_MODE_SYNC);
BIND_ENUM_CONSTANT(RPC_MODE_MASTER);
- BIND_ENUM_CONSTANT(RPC_MODE_SLAVE);
+ BIND_ENUM_CONSTANT(RPC_MODE_PUPPET);
+ BIND_ENUM_CONSTANT(RPC_MODE_SLAVE); // deprecated
BIND_ENUM_CONSTANT(RPC_MODE_REMOTESYNC);
+ BIND_ENUM_CONSTANT(RPC_MODE_SYNC); // deprecated
BIND_ENUM_CONSTANT(RPC_MODE_MASTERSYNC);
- BIND_ENUM_CONSTANT(RPC_MODE_SLAVESYNC);
+ BIND_ENUM_CONSTANT(RPC_MODE_PUPPETSYNC);
}
MultiplayerAPI::MultiplayerAPI() {
diff --git a/core/io/multiplayer_api.h b/core/io/multiplayer_api.h
index e47b1830e8..c86e76e91a 100644
--- a/core/io/multiplayer_api.h
+++ b/core/io/multiplayer_api.h
@@ -91,12 +91,13 @@ public:
RPC_MODE_DISABLED, // No rpc for this method, calls to this will be blocked (default)
RPC_MODE_REMOTE, // Using rpc() on it will call method / set property in all remote peers
- RPC_MODE_SYNC, // Using rpc() on it will call method / set property in all remote peers and locally
RPC_MODE_MASTER, // Using rpc() on it will call method on wherever the master is, be it local or remote
- RPC_MODE_SLAVE, // Using rpc() on it will call method for all slaves
- RPC_MODE_REMOTESYNC, // Same as RPC_MODE_SYNC, compatibility
+ RPC_MODE_PUPPET, // Using rpc() on it will call method for all puppets
+ RPC_MODE_SLAVE = RPC_MODE_PUPPET, // Deprecated, same as puppet
+ RPC_MODE_REMOTESYNC, // Using rpc() on it will call method / set property in all remote peers and locally
+ RPC_MODE_SYNC = RPC_MODE_REMOTESYNC, // Deprecated. Same as RPC_MODE_REMOTESYNC
RPC_MODE_MASTERSYNC, // Using rpc() on it will call method / set property in the master peer and locally
- RPC_MODE_SLAVESYNC, // Using rpc() on it will call method / set property in all slave peers and locally
+ RPC_MODE_PUPPETSYNC, // Using rpc() on it will call method / set property in all puppets peers and locally
};
void poll();
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index cc359ef2ac..5bbdd7efb2 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -962,6 +962,22 @@ bool InputEventAction::is_action(const StringName &p_action) const {
return action == p_action;
}
+bool InputEventAction::action_match(const Ref<InputEvent> &p_event, bool *p_pressed, float *p_strength, float p_deadzone) const {
+
+ Ref<InputEventAction> act = p_event;
+ if (act.is_null())
+ return false;
+
+ bool match = action == act->action;
+ if (match) {
+ if (p_pressed != NULL)
+ *p_pressed = act->pressed;
+ if (p_strength != NULL)
+ *p_strength = (*p_pressed) ? 1.0f : 0.0f;
+ }
+ return match;
+}
+
String InputEventAction::as_text() const {
return "InputEventAction : action=" + action + ", pressed=(" + (pressed ? "true" : "false");
diff --git a/core/os/input_event.h b/core/os/input_event.h
index cb61e61e7c..789d19c5b2 100644
--- a/core/os/input_event.h
+++ b/core/os/input_event.h
@@ -481,6 +481,8 @@ public:
virtual bool is_action(const StringName &p_action) const;
+ virtual bool action_match(const Ref<InputEvent> &p_event, bool *p_pressed, float *p_strength, float p_deadzone) const;
+
virtual bool shortcut_match(const Ref<InputEvent> &p_event) const;
virtual bool is_action_type() const { return true; }
virtual String as_text() const;
diff --git a/doc/classes/AnimatedTexture.xml b/doc/classes/AnimatedTexture.xml
index f874c43ef1..9dc58ed195 100644
--- a/doc/classes/AnimatedTexture.xml
+++ b/doc/classes/AnimatedTexture.xml
@@ -9,1034 +9,46 @@
<demos>
</demos>
<methods>
+ <method name="get_frame_delay" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="frame" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_frame_texture" qualifiers="const">
+ <return type="Texture">
+ </return>
+ <argument index="0" name="frame" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_frame_delay">
+ <return type="void">
+ </return>
+ <argument index="0" name="frame" type="int">
+ </argument>
+ <argument index="1" name="delay" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_frame_texture">
+ <return type="void">
+ </return>
+ <argument index="0" name="frame" type="int">
+ </argument>
+ <argument index="1" name="texture" type="Texture">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<members>
<member name="fps" type="float" setter="set_fps" getter="get_fps">
</member>
- <member name="frame_0/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_0/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_1/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_1/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_10/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_10/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_100/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_100/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_101/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_101/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_102/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_102/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_103/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_103/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_104/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_104/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_105/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_105/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_106/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_106/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_107/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_107/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_108/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_108/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_109/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_109/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_11/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_11/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_110/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_110/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_111/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_111/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_112/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_112/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_113/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_113/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_114/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_114/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_115/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_115/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_116/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_116/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_117/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_117/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_118/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_118/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_119/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_119/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_12/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_12/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_120/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_120/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_121/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_121/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_122/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_122/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_123/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_123/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_124/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_124/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_125/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_125/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_126/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_126/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_127/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_127/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_128/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_128/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_129/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_129/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_13/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_13/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_130/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_130/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_131/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_131/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_132/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_132/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_133/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_133/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_134/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_134/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_135/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_135/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_136/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_136/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_137/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_137/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_138/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_138/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_139/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_139/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_14/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_14/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_140/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_140/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_141/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_141/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_142/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_142/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_143/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_143/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_144/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_144/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_145/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_145/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_146/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_146/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_147/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_147/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_148/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_148/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_149/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_149/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_15/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_15/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_150/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_150/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_151/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_151/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_152/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_152/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_153/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_153/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_154/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_154/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_155/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_155/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_156/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_156/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_157/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_157/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_158/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_158/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_159/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_159/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_16/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_16/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_160/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_160/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_161/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_161/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_162/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_162/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_163/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_163/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_164/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_164/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_165/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_165/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_166/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_166/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_167/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_167/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_168/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_168/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_169/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_169/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_17/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_17/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_170/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_170/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_171/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_171/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_172/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_172/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_173/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_173/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_174/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_174/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_175/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_175/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_176/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_176/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_177/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_177/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_178/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_178/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_179/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_179/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_18/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_18/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_180/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_180/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_181/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_181/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_182/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_182/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_183/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_183/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_184/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_184/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_185/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_185/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_186/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_186/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_187/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_187/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_188/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_188/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_189/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_189/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_19/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_19/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_190/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_190/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_191/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_191/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_192/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_192/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_193/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_193/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_194/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_194/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_195/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_195/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_196/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_196/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_197/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_197/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_198/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_198/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_199/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_199/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_2/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_2/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_20/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_20/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_200/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_200/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_201/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_201/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_202/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_202/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_203/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_203/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_204/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_204/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_205/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_205/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_206/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_206/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_207/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_207/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_208/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_208/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_209/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_209/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_21/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_21/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_210/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_210/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_211/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_211/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_212/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_212/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_213/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_213/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_214/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_214/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_215/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_215/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_216/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_216/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_217/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_217/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_218/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_218/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_219/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_219/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_22/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_22/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_220/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_220/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_221/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_221/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_222/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_222/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_223/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_223/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_224/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_224/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_225/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_225/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_226/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_226/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_227/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_227/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_228/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_228/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_229/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_229/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_23/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_23/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_230/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_230/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_231/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_231/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_232/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_232/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_233/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_233/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_234/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_234/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_235/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_235/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_236/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_236/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_237/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_237/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_238/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_238/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_239/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_239/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_24/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_24/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_240/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_240/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_241/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_241/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_242/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_242/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_243/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_243/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_244/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_244/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_245/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_245/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_246/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_246/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_247/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_247/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_248/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_248/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_249/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_249/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_25/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_25/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_250/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_250/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_251/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_251/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_252/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_252/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_253/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_253/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_254/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_254/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_255/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_255/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_26/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_26/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_27/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_27/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_28/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_28/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_29/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_29/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_3/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_3/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_30/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_30/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_31/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_31/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_32/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_32/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_33/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_33/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_34/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_34/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_35/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_35/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_36/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_36/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_37/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_37/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_38/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_38/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_39/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_39/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_4/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_4/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_40/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_40/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_41/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_41/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_42/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_42/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_43/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_43/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_44/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_44/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_45/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_45/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_46/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_46/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_47/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_47/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_48/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_48/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_49/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_49/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_5/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_5/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_50/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_50/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_51/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_51/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_52/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_52/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_53/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_53/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_54/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_54/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_55/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_55/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_56/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_56/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_57/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_57/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_58/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_58/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_59/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_59/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_6/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_6/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_60/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_60/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_61/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_61/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_62/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_62/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_63/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_63/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_64/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_64/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_65/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_65/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_66/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_66/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_67/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_67/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_68/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_68/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_69/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_69/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_7/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_7/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_70/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_70/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_71/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_71/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_72/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_72/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_73/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_73/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_74/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_74/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_75/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_75/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_76/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_76/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_77/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_77/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_78/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_78/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_79/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_79/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_8/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_8/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_80/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_80/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_81/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_81/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_82/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_82/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_83/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_83/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_84/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_84/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_85/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_85/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_86/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_86/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_87/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_87/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_88/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_88/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_89/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_89/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_9/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_9/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_90/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_90/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_91/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_91/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_92/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_92/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_93/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_93/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_94/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_94/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_95/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_95/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_96/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_96/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_97/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_97/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_98/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_98/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
- <member name="frame_99/delay_sec" type="float" setter="set_frame_delay" getter="get_frame_delay">
- </member>
- <member name="frame_99/texture" type="Texture" setter="set_frame_texture" getter="get_frame_texture">
- </member>
<member name="frames" type="int" setter="set_frames" getter="get_frames">
</member>
</members>
diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml
index 10e7f1b172..d8d7d9acfc 100644
--- a/doc/classes/MultiplayerAPI.xml
+++ b/doc/classes/MultiplayerAPI.xml
@@ -90,7 +90,7 @@
</methods>
<members>
<member name="network_peer" type="NetworkedMultiplayerPeer" setter="set_network_peer" getter="get_network_peer">
- The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_network_server]) and will set root node's network mode to master (see NETWORK_MODE_* constants in [Node]), or it will become a regular peer with root node set to slave. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals.
+ The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_network_server]) and will set root node's network mode to master (see NETWORK_MODE_* constants in [Node]), or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals.
</member>
<member name="refuse_new_network_connections" type="bool" setter="set_refuse_new_network_connections" getter="is_refusing_new_network_connections">
If [code]true[/code] the MultiplayerAPI's [member network_peer] refuses new incoming connections.
@@ -141,25 +141,28 @@
Used with [method Node.rpc_config] or [method Node.rset_config] to disable a method or property for all RPC calls, making it unavailable. Default for all methods.
</constant>
<constant name="RPC_MODE_REMOTE" value="1" enum="RPCMode">
- Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on the remote end, not locally. Analogous to the [code]remote[/code] keyword. Calls and property changes are accepted from all remote peers, no matter if they are node's master or slaves.
+ Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on the remote end, not locally. Analogous to the [code]remote[/code] keyword. Calls and property changes are accepted from all remote peers, no matter if they are node's master or puppets.
</constant>
- <constant name="RPC_MODE_SYNC" value="2" enum="RPCMode">
- Behave like [code]RPC_MODE_REMOTE[/code] but also make the call or property change locally. Analogous to the [code]sync[/code] keyword.
+ <constant name="RPC_MODE_MASTER" value="2" enum="RPCMode">
+ Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on the network master for this node. Analogous to the [code]master[/code] keyword. Only accepts calls or property changes from the node's network puppets, see [method Node.set_network_master].
</constant>
- <constant name="RPC_MODE_MASTER" value="3" enum="RPCMode">
- Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on the network master for this node. Analogous to the [code]master[/code] keyword. Only accepts calls or property changes from the node's network slaves, see [method Node.set_network_master].
+ <constant name="RPC_MODE_PUPPET" value="3" enum="RPCMode">
+ Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on puppets for this node. Analogous to the [code]puppet[/code] keyword. Only accepts calls or property changes from the node's network master, see [method Node.set_network_master].
</constant>
- <constant name="RPC_MODE_SLAVE" value="4" enum="RPCMode">
- Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on slaves for this node. Analogous to the [code]slave[/code] keyword. Only accepts calls or property changes from the node's network master, see [method Node.set_network_master].
+ <constant name="RPC_MODE_SLAVE" value="3" enum="RPCMode">
+ Deprecated. Use [code]RPC_MODE_PUPPET[/code] instead. Analogous to the [code]slave[/code] keyword.
</constant>
- <constant name="RPC_MODE_REMOTESYNC" value="5" enum="RPCMode">
- Behave like [code]RPC_MODE_REMOTE[/code] but also make the call or property change locally. Same as [code]RPC_MODE_SYNC[/code] which is only kept for compatibility. Analogous to the [code]remotesync[/code] keyword.
+ <constant name="RPC_MODE_REMOTESYNC" value="4" enum="RPCMode">
+ Behave like [code]RPC_MODE_REMOTE[/code] but also make the call or property change locally. Analogous to the [code]remotesync[/code] keyword.
</constant>
- <constant name="RPC_MODE_MASTERSYNC" value="6" enum="RPCMode">
+ <constant name="RPC_MODE_SYNC" value="4" enum="RPCMode">
+ Deprecated. Use [code]RPC_MODE_REMOTESYNC[/code] instead. Analogous to the [code]sync[/code] keyword.
+ </constant>
+ <constant name="RPC_MODE_MASTERSYNC" value="5" enum="RPCMode">
Behave like [code]RPC_MODE_MASTER[/code] but also make the call or property change locally. Analogous to the [code]mastersync[/code] keyword.
</constant>
- <constant name="RPC_MODE_SLAVESYNC" value="7" enum="RPCMode">
- Behave like [code]RPC_MODE_SLAVE[/code] but also make the call or property change locally. Analogous to the [code]slavesync[/code] keyword.
+ <constant name="RPC_MODE_PUPPETSYNC" value="6" enum="RPCMode">
+ Behave like [code]RPC_MODE_PUPPET[/code] but also make the call or property change locally. Analogous to the [code]puppetsync[/code] keyword.
</constant>
</constants>
</class>
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index dd496e79dd..d00652d40c 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -185,6 +185,7 @@
</argument>
<description>
Returns a child node by its index (see [method get_child_count]). This method is often used for iterating all children of a node.
+ To access a child node via its name, use [method get_node].
</description>
</method>
<method name="get_child_count" qualifiers="const">
@@ -581,7 +582,7 @@
<argument index="1" name="mode" type="int" enum="MultiplayerAPI.RPCMode">
</argument>
<description>
- Changes the RPC mode for the given [code]method[/code] to the given [code]mode[/code]. See [enum MultiplayerAPI.RPCMode]. An alternative is annotating methods and properties with the corresponding keywords ([code]remote[/code], [code]sync[/code], [code]master[/code], [code]slave[/code]). By default, methods are not exposed to networking (and RPCs). Also see [method rset] and [method rset_config] for properties.
+ Changes the RPC mode for the given [code]method[/code] to the given [code]mode[/code]. See [enum MultiplayerAPI.RPCMode]. An alternative is annotating methods and properties with the corresponding keywords ([code]remote[/code], [code]master[/code], [code]puppet[/code], [code]remotesync[/code], [code]mastersync[/code], [code]puppetsync[/code]). By default, methods are not exposed to networking (and RPCs). Also see [method rset] and [method rset_config] for properties.
</description>
</method>
<method name="rpc_id" qualifiers="vararg">
@@ -634,7 +635,7 @@
<argument index="1" name="mode" type="int" enum="MultiplayerAPI.RPCMode">
</argument>
<description>
- Changes the RPC mode for the given [code]property[/code] to the given [code]mode[/code]. See [enum MultiplayerAPI.RPCMode]. An alternative is annotating methods and properties with the corresponding keywords ([code]remote[/code], [code]sync[/code], [code]master[/code], [code]slave[/code]). By default, properties are not exposed to networking (and RPCs). Also see [method rpc] and [method rpc_config] for methods.
+ Changes the RPC mode for the given [code]property[/code] to the given [code]mode[/code]. See [enum MultiplayerAPI.RPCMode]. An alternative is annotating methods and properties with the corresponding keywords ([code]remote[/code], [code]master[/code], [code]puppet[/code], [code]remotesync[/code], [code]mastersync[/code], [code]puppetsync[/code]). By default, properties are not exposed to networking (and RPCs). Also see [method rpc] and [method rpc_config] for methods.
</description>
</method>
<method name="rset_id">
@@ -691,7 +692,7 @@
<argument index="1" name="recursive" type="bool" default="true">
</argument>
<description>
- Sets the node's network master to the peer with the given peer ID. The network master is the peer that has authority over the node on the network. Useful in conjunction with the [code]master[/code] and [code]slave[/code] keywords. Inherited from the parent node by default, which ultimately defaults to peer ID 1 (the server). If [code]recursive[/code], the given peer is recursively set as the master for all children of this node.
+ Sets the node's network master to the peer with the given peer ID. The network master is the peer that has authority over the node on the network. Useful in conjunction with the [code]master[/code] and [code]puppet[/code] keywords. Inherited from the parent node by default, which ultimately defaults to peer ID 1 (the server). If [code]recursive[/code], the given peer is recursively set as the master for all children of this node.
</description>
</method>
<method name="set_physics_process">
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index b0d1cf8619..548d60fe35 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -157,6 +157,8 @@
</method>
</methods>
<members>
+ <member name="application/boot_splash/bg_color" type="Color" setter="" getter="">
+ </member>
<member name="application/boot_splash/fullsize" type="bool" setter="" getter="">
Scale the boot splash image to the full window length when engine starts (will leave it as default pixel size otherwise).
</member>
@@ -226,6 +228,8 @@
</member>
<member name="debug/gdscript/warnings/constant_used_as_function" type="bool" setter="" getter="">
</member>
+ <member name="debug/gdscript/warnings/deprecated_keyword" type="bool" setter="" getter="">
+ </member>
<member name="debug/gdscript/warnings/enable" type="bool" setter="" getter="">
</member>
<member name="debug/gdscript/warnings/function_conflicts_constant" type="bool" setter="" getter="">
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index a447294fea..1985845552 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -274,7 +274,7 @@
When [code]false[/code] you need to manually call [method MultiplayerAPI.poll] for processing network packets and delivering RPCs/RSETs. This allows to run RPCs/RSETs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex] protection when accessing the [MultiplayerAPI] from threads.
</member>
<member name="network_peer" type="NetworkedMultiplayerPeer" setter="set_network_peer" getter="get_network_peer">
- The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the SceneTree will become a network server (check with [method is_network_server()]) and will set root node's network mode to master (see NETWORK_MODE_* constants in [Node]), or it will become a regular peer with root node set to slave. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to SceneTree's signals.
+ The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the SceneTree will become a network server (check with [method is_network_server()]) and will set root node's network mode to master (see NETWORK_MODE_* constants in [Node]), or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to SceneTree's signals.
</member>
<member name="paused" type="bool" setter="set_pause" getter="is_paused">
If [code]true[/code] the SceneTree is paused.
diff --git a/doc/classes/ShaderMaterial.xml b/doc/classes/ShaderMaterial.xml
index 5abba9fba9..7491d22479 100644
--- a/doc/classes/ShaderMaterial.xml
+++ b/doc/classes/ShaderMaterial.xml
@@ -20,6 +20,22 @@
Returns the current value set for this material of a uniform in the shader.
</description>
</method>
+ <method name="property_can_revert">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="property_get_revert">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_shader_param">
<return type="void">
</return>
diff --git a/doc/classes/StreamPeerTCP.xml b/doc/classes/StreamPeerTCP.xml
index e1f1dcb8fa..664ffc60c3 100644
--- a/doc/classes/StreamPeerTCP.xml
+++ b/doc/classes/StreamPeerTCP.xml
@@ -43,7 +43,7 @@
Return the port of this peer.
</description>
</method>
- <method name="get_status" qualifiers="const">
+ <method name="get_status">
<return type="int" enum="StreamPeerTCP.Status">
</return>
<description>
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index 2f5710da51..9cd501630e 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -46,6 +46,13 @@
Returns the total transform of the viewport.
</description>
</method>
+ <method name="get_modal_stack_top" qualifiers="const">
+ <return type="Control">
+ </return>
+ <description>
+ Returns the topmost modal in the stack.
+ </description>
+ </method>
<method name="get_mouse_position" qualifiers="const">
<return type="Vector2">
</return>
diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml
index afada05bf7..58b3d33cdb 100644
--- a/doc/classes/VisualServer.xml
+++ b/doc/classes/VisualServer.xml
@@ -2185,6 +2185,16 @@
Returns the value of a certain material's parameter.
</description>
</method>
+ <method name="material_get_param_default" qualifiers="const">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="material" type="RID">
+ </argument>
+ <argument index="1" name="parameter" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="material_get_shader" qualifiers="const">
<return type="RID">
</return>
diff --git a/drivers/dummy/rasterizer_dummy.h b/drivers/dummy/rasterizer_dummy.h
index bb4511ecc3..126f23feeb 100644
--- a/drivers/dummy/rasterizer_dummy.h
+++ b/drivers/dummy/rasterizer_dummy.h
@@ -267,6 +267,7 @@ public:
void material_set_param(RID p_material, const StringName &p_param, const Variant &p_value) {}
Variant material_get_param(RID p_material, const StringName &p_param) const { return Variant(); }
+ Variant material_get_param_default(RID p_material, const StringName &p_param) const { return Variant(); }
void material_set_line_width(RID p_material, float p_width) {}
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index fdc110be9e..d945132dc2 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -1419,6 +1419,19 @@ Variant RasterizerStorageGLES2::material_get_param(RID p_material, const StringN
return material->params[p_param];
}
+ return material_get_param_default(p_material, p_param);
+}
+
+Variant RasterizerStorageGLES2::material_get_param_default(RID p_material, const StringName &p_param) const {
+ const Material *material = material_owner.get(p_material);
+ ERR_FAIL_COND_V(!material, Variant());
+
+ if (material->shader) {
+ if (material->shader->uniforms.has(p_param)) {
+ Vector<ShaderLanguage::ConstantNode::Value> default_value = material->shader->uniforms[p_param].default_value;
+ return ShaderLanguage::constant_value_to_variant(default_value, material->shader->uniforms[p_param].type);
+ }
+ }
return Variant();
}
diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h
index e42eb67d3d..d9bf6b3ccb 100644
--- a/drivers/gles2/rasterizer_storage_gles2.h
+++ b/drivers/gles2/rasterizer_storage_gles2.h
@@ -563,6 +563,7 @@ public:
virtual void material_set_param(RID p_material, const StringName &p_param, const Variant &p_value);
virtual Variant material_get_param(RID p_material, const StringName &p_param) const;
+ virtual Variant material_get_param_default(RID p_material, const StringName &p_param) const;
virtual void material_set_line_width(RID p_material, float p_width);
virtual void material_set_next_pass(RID p_material, RID p_next_material);
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index c05f4cfbe3..25e7bd0424 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -29,7 +29,6 @@
/*************************************************************************/
#include "rasterizer_storage_gles3.h"
-
#include "core/engine.h"
#include "core/project_settings.h"
#include "rasterizer_canvas_gles3.h"
@@ -2140,6 +2139,19 @@ Variant RasterizerStorageGLES3::material_get_param(RID p_material, const StringN
if (material->params.has(p_param))
return material->params[p_param];
+ return material_get_param_default(p_material, p_param);
+}
+
+Variant RasterizerStorageGLES3::material_get_param_default(RID p_material, const StringName &p_param) const {
+ const Material *material = material_owner.get(p_material);
+ ERR_FAIL_COND_V(!material, Variant());
+
+ if (material->shader) {
+ if (material->shader->uniforms.has(p_param)) {
+ Vector<ShaderLanguage::ConstantNode::Value> default_value = material->shader->uniforms[p_param].default_value;
+ return ShaderLanguage::constant_value_to_variant(default_value, material->shader->uniforms[p_param].type);
+ }
+ }
return Variant();
}
diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h
index 33f0853d60..0bd9c22be5 100644
--- a/drivers/gles3/rasterizer_storage_gles3.h
+++ b/drivers/gles3/rasterizer_storage_gles3.h
@@ -583,6 +583,7 @@ public:
virtual void material_set_param(RID p_material, const StringName &p_param, const Variant &p_value);
virtual Variant material_get_param(RID p_material, const StringName &p_param) const;
+ virtual Variant material_get_param_default(RID p_material, const StringName &p_param) const;
virtual void material_set_line_width(RID p_material, float p_width);
virtual void material_set_next_pass(RID p_material, RID p_next_material);
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp
index 04977dbb47..f0dc3ce305 100644
--- a/editor/animation_bezier_editor.cpp
+++ b/editor/animation_bezier_editor.cpp
@@ -30,6 +30,8 @@
#include "animation_bezier_editor.h"
+#include "editor/editor_node.h"
+
float AnimationBezierTrackEdit::_bezier_h_to_pixel(float p_h) {
float h = p_h;
h = (h - v_scroll) / v_zoom;
@@ -288,12 +290,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
int h = font->get_height();
if (node) {
- Ref<Texture> icon;
- if (has_icon(node->get_class(), "EditorIcons")) {
- icon = get_icon(node->get_class(), "EditorIcons");
- } else {
- icon = get_icon("Node", "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(node, "Node");
h = MAX(h, icon->get_height());
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 8bef94d8a8..ff34618b04 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -60,7 +60,7 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode) {
TreeItem *ti = recent->create_item(root);
ti->set_text(0, l);
- ti->set_icon(0, _get_editor_icon(l));
+ ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(l, base_type));
}
}
@@ -151,41 +151,6 @@ void CreateDialog::_sbox_input(const Ref<InputEvent> &p_ie) {
}
}
-Ref<Texture> CreateDialog::_get_editor_icon(const String &p_type) const {
-
- if (has_icon(p_type, "EditorIcons")) {
- return get_icon(p_type, "EditorIcons");
- }
-
- if (ScriptServer::is_global_class(p_type)) {
- String icon_path = EditorNode::get_editor_data().script_class_get_icon_path(p_type);
- RES icon;
- if (FileAccess::exists(icon_path)) {
- icon = ResourceLoader::load(icon_path);
- }
- if (!icon.is_valid()) {
- icon = get_icon(ScriptServer::get_global_class_base(p_type), "EditorIcons");
- }
- return icon;
- }
-
- const Map<String, Vector<EditorData::CustomType> > &p_map = EditorNode::get_editor_data().get_custom_types();
- for (const Map<String, Vector<EditorData::CustomType> >::Element *E = p_map.front(); E; E = E->next()) {
- const Vector<EditorData::CustomType> &ct = E->value();
- for (int i = 0; i < ct.size(); ++i) {
- if (ct[i].name == p_type) {
- if (ct[i].icon.is_valid()) {
- return ct[i].icon;
- } else {
- return get_icon("Object", "EditorIcons");
- }
- }
- }
- }
-
- return get_icon("Object", "EditorIcons");
-}
-
void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p_types, TreeItem *p_root, TreeItem **to_select) {
if (p_types.has(p_type))
@@ -246,7 +211,10 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p
to_select_type = to_select_type.split(" ")[0];
bool current_item_is_preferred;
if (cpp_type) {
- current_item_is_preferred = ClassDB::is_parent_class(p_type, preferred_search_result_type) && !ClassDB::is_parent_class(to_select_type, preferred_search_result_type) && search_box->get_text() != to_select_type;
+ String cpp_to_select_type = to_select_type;
+ if (ScriptServer::is_global_class(to_select_type))
+ cpp_to_select_type = ScriptServer::get_global_class_base(to_select_type);
+ current_item_is_preferred = ClassDB::is_parent_class(p_type, preferred_search_result_type) && !ClassDB::is_parent_class(cpp_to_select_type, preferred_search_result_type);
} else {
current_item_is_preferred = ed.script_class_is_parent(p_type, preferred_search_result_type) && !ed.script_class_is_parent(to_select_type, preferred_search_result_type) && search_box->get_text() != to_select_type;
}
@@ -274,7 +242,7 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p
const String &description = EditorHelp::get_doc_data()->class_list[p_type].brief_description;
item->set_tooltip(0, description);
- item->set_icon(0, _get_editor_icon(p_type));
+ item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, base_type));
p_types[p_type] = item;
}
@@ -578,7 +546,7 @@ void CreateDialog::_update_favorite_list() {
continue;
TreeItem *ti = favorites->create_item(root);
ti->set_text(0, l);
- ti->set_icon(0, _get_editor_icon(l));
+ ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(l, base_type));
}
emit_signal("favorites_updated");
}
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index 9f04d40763..037543f45c 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -198,12 +198,7 @@ void DependencyEditor::_update_list() {
}
String name = path.get_file();
- Ref<Texture> icon;
- if (has_icon(type, "EditorIcons")) {
- icon = get_icon(type, "EditorIcons");
- } else {
- icon = get_icon("Object", "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(type);
item->set_text(0, name);
item->set_icon(0, icon);
item->set_metadata(0, type);
@@ -346,13 +341,7 @@ void DependencyEditorOwners::_fill_owners(EditorFileSystemDirectory *efsd) {
if (!found)
continue;
- Ref<Texture> icon;
- String type = efsd->get_file_type(i);
- if (!has_icon(type, "EditorIcons")) {
- icon = get_icon("Object", "EditorIcons");
- } else {
- icon = get_icon(type, "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(efsd->get_file_type(i));
owners->add_item(efsd->get_file_path(i), icon);
}
@@ -460,7 +449,7 @@ void DependencyRemoveDialog::_build_removed_dependency_tree(const Vector<Removed
}
//List this file under this dependency
- Ref<Texture> icon = has_icon(rd.file_type, "EditorIcons") ? get_icon(rd.file_type, "EditorIcons") : get_icon("Object", "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(rd.file_type);
TreeItem *file_item = owners->create_item(tree_items[rd.dependency]);
file_item->set_text(0, rd.file);
file_item->set_icon(0, icon);
@@ -579,12 +568,7 @@ void DependencyErrorDialog::show(const String &p_for_file, const Vector<String>
if (report[i].get_slice_count("::") > 0)
type = report[i].get_slice("::", 1);
- Ref<Texture> icon;
- if (!has_icon(type, "EditorIcons")) {
- icon = get_icon("Object", "EditorIcons");
- } else {
- icon = get_icon(type, "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(type);
TreeItem *ti = files->create_item(root);
ti->set_text(0, dep);
@@ -687,12 +671,7 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMa
String type = efsd->get_file_type(i);
- Ref<Texture> icon;
- if (has_icon(type, "EditorIcons")) {
- icon = get_icon(type, "EditorIcons");
- } else {
- icon = get_icon("Object", "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(type);
ti->set_icon(0, icon);
int ds = efsd->get_file_deps(i).size();
ti->set_text(1, itos(ds));
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index 96110b61ab..6cd81626c7 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -765,10 +765,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
if (!ClassDB::can_instance(E->get()))
continue;
- Ref<Texture> icon;
- if (has_icon(E->get(), "EditorIcons")) {
- icon = get_icon(E->get(), "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(E->get());
String name = E->get().operator String().replace("AudioEffect", "");
effect_options->add_item(name);
effect_options->set_item_metadata(effect_options->get_item_count() - 1, E->get());
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 6187c6b318..9420452da1 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -869,7 +869,7 @@ bool EditorData::script_class_is_parent(const String &p_class, const String &p_i
return true;
}
-StringName EditorData::script_class_get_base(const String &p_class) {
+StringName EditorData::script_class_get_base(const String &p_class) const {
if (!ScriptServer::is_global_class(p_class))
return StringName();
@@ -895,24 +895,48 @@ Object *EditorData::script_class_instance(const String &p_class) {
RES script = ResourceLoader::load(ScriptServer::get_global_class_path(p_class));
if (script.is_valid())
obj->set_script(script.get_ref_ptr());
-
- RES icon = ResourceLoader::load(script_class_get_icon_path(p_class));
- if (icon.is_valid())
- obj->set_meta("_editor_icon", icon);
-
return obj;
}
}
return NULL;
}
+void EditorData::script_class_set_icon_path(const String &p_class, const String &p_icon_path) {
+ _script_class_icon_paths[p_class] = p_icon_path;
+}
+
+String EditorData::script_class_get_icon_path(const String &p_class) const {
+ if (!ScriptServer::is_global_class(p_class))
+ return String();
+
+ String current = p_class;
+ String ret = _script_class_icon_paths[current];
+ while (ret.empty()) {
+ current = script_class_get_base(current);
+ if (!ScriptServer::is_global_class(current))
+ return String();
+ ret = _script_class_icon_paths.has(current) ? _script_class_icon_paths[current] : String();
+ }
+
+ return ret;
+}
+
+StringName EditorData::script_class_get_name(const String &p_path) const {
+ return _script_class_file_to_path.has(p_path) ? _script_class_file_to_path[p_path] : StringName();
+}
+
+void EditorData::script_class_set_name(const String &p_path, const StringName &p_class) {
+ _script_class_file_to_path[p_path] = p_class;
+}
+
void EditorData::script_class_save_icon_paths() {
List<StringName> keys;
_script_class_icon_paths.get_key_list(&keys);
Dictionary d;
for (List<StringName>::Element *E = keys.front(); E; E = E->next()) {
- d[E->get()] = _script_class_icon_paths[E->get()];
+ if (ScriptServer::is_global_class(E->get()))
+ d[E->get()] = _script_class_icon_paths[E->get()];
}
ProjectSettings::get_singleton()->set("_global_script_class_icons", d);
@@ -927,8 +951,11 @@ void EditorData::script_class_load_icon_paths() {
d.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
- String key = E->get().operator String();
- _script_class_icon_paths[key] = d[key];
+ String name = E->get().operator String();
+ _script_class_icon_paths[name] = d[name];
+
+ String path = ScriptServer::get_global_class_path(name);
+ script_class_set_name(path, name);
}
}
diff --git a/editor/editor_data.h b/editor/editor_data.h
index 9f5d3e2a15..87a76ee5ba 100644
--- a/editor/editor_data.h
+++ b/editor/editor_data.h
@@ -147,6 +147,7 @@ private:
bool _find_updated_instances(Node *p_root, Node *p_node, Set<String> &checked_paths);
HashMap<StringName, String> _script_class_icon_paths;
+ HashMap<String, StringName> _script_class_file_to_path;
public:
EditorPlugin *get_editor(Object *p_object);
@@ -214,10 +215,14 @@ public:
void notify_resource_saved(const Ref<Resource> &p_resource);
bool script_class_is_parent(const String &p_class, const String &p_inherits);
- StringName script_class_get_base(const String &p_class);
+ StringName script_class_get_base(const String &p_class) const;
Object *script_class_instance(const String &p_class);
- String script_class_get_icon_path(const String &p_class) const { return _script_class_icon_paths.has(p_class) ? _script_class_icon_paths[p_class] : String(); }
- void script_class_set_icon_path(const String &p_class, const String &p_icon_path) { _script_class_icon_paths[p_class] = p_icon_path; }
+
+ StringName script_class_get_name(const String &p_path) const;
+ void script_class_set_name(const String &p_path, const StringName &p_class);
+
+ String script_class_get_icon_path(const String &p_class) const;
+ void script_class_set_icon_path(const String &p_class, const String &p_icon_path);
void script_class_clear_icon_paths() { _script_class_icon_paths.clear(); }
void script_class_save_icon_paths();
void script_class_load_icon_paths();
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 3d034989ed..56358cf5b7 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -1358,6 +1358,7 @@ void EditorFileSystem::_scan_script_classes(EditorFileSystemDirectory *p_dir) {
}
ScriptServer::add_global_class(files[i]->script_class_name, files[i]->script_class_extends, lang, p_dir->get_file_path(i));
EditorNode::get_editor_data().script_class_set_icon_path(files[i]->script_class_name, files[i]->script_class_icon_path);
+ EditorNode::get_editor_data().script_class_set_name(files[i]->file, files[i]->script_class_name);
}
for (int i = 0; i < p_dir->get_subdir_count(); i++) {
_scan_script_classes(p_dir->get_subdir(i));
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 5b9e7b29a9..728c4affbd 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -88,10 +88,8 @@ void EditorHelpSearch::IncrementalSearch::phase1(Map<String, DocData::ClassDoc>:
TreeItem *item = search_options->create_item(root);
item->set_metadata(0, "class_name:" + E->key());
item->set_text(0, E->key() + " (Class)");
- if (search->has_icon(E->key(), "EditorIcons"))
- item->set_icon(0, search->get_icon(E->key(), "EditorIcons"));
- else
- item->set_icon(0, def_icon);
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(E->key(), "Node");
+ item->set_icon(0, icon);
}
}
@@ -99,11 +97,7 @@ void EditorHelpSearch::IncrementalSearch::phase2(Map<String, DocData::ClassDoc>:
DocData::ClassDoc &c = E->get();
- Ref<Texture> cicon;
- if (search->has_icon(E->key(), "EditorIcons"))
- cicon = search->get_icon(E->key(), "EditorIcons");
- else
- cicon = def_icon;
+ Ref<Texture> cicon = EditorNode::get_singleton()->get_class_icon(E->key(), "Node");
for (int i = 0; i < c.methods.size(); i++) {
if ((term.begins_with(".") && c.methods[i].name.begins_with(term.right(1))) || (term.ends_with("(") && c.methods[i].name.ends_with(term.left(term.length() - 1).strip_edges())) || (term.begins_with(".") && term.ends_with("(") && c.methods[i].name == term.substr(1, term.length() - 2).strip_edges()) || c.methods[i].name.findn(term) != -1) {
@@ -343,10 +337,8 @@ void EditorHelpIndex::add_type(const String &p_type, HashMap<String, TreeItem *>
item->set_tooltip(0, EditorHelp::get_doc_data()->class_list[p_type].brief_description);
item->set_text(0, p_type);
- if (has_icon(p_type, "EditorIcons")) {
-
- item->set_icon(0, get_icon(p_type, "EditorIcons"));
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(p_type);
+ item->set_icon(0, icon);
p_types[p_type] = item;
}
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index b64570f312..36c3102840 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -1423,10 +1423,7 @@ void EditorInspector::update_tree() {
category_vbox = NULL; //reset
String type = p.name;
- if (has_icon(type, "EditorIcons"))
- category->icon = get_icon(type, "EditorIcons");
- else
- category->icon = get_icon("Object", "EditorIcons");
+ category->icon = EditorNode::get_singleton()->get_class_icon(type, "Object");
category->label = type;
category->bg_color = get_color("prop_category", "Editor");
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index bef754853c..d8e6f711ff 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -141,12 +141,7 @@ void EditorNode::_update_scene_tabs() {
String type = editor_data.get_scene_type(i);
Ref<Texture> icon;
if (type != String()) {
-
- if (!gui_base->has_icon(type, "EditorIcons")) {
- type = "Node";
- }
-
- icon = gui_base->get_icon(type, "EditorIcons");
+ icon = get_class_icon(type, "Node");
}
int current = editor_data.get_edited_scene();
@@ -3126,6 +3121,86 @@ void EditorNode::stop_child_process() {
_menu_option_confirm(RUN_STOP, false);
}
+Ref<Texture> EditorNode::get_object_icon(const Object *p_object, const String &p_fallback) const {
+ ERR_FAIL_COND_V(!p_object || !gui_base, NULL);
+
+ Ref<Script> script = p_object->get_script();
+ if (script.is_null() && p_object->is_class("Script")) {
+ script = p_object;
+ }
+
+ StringName name;
+ String icon_path;
+ if (script.is_valid()) {
+ name = EditorNode::get_editor_data().script_class_get_name(script->get_path());
+ icon_path = EditorNode::get_editor_data().script_class_get_icon_path(name);
+ name = script->get_instance_base_type();
+ }
+
+ if (gui_base->has_icon(p_object->get_class(), "EditorIcons"))
+ return gui_base->get_icon(p_object->get_class(), "EditorIcons");
+
+ if (icon_path.length())
+ return ResourceLoader::load(icon_path);
+
+ if (p_object->has_meta("_editor_icon"))
+ return p_object->get_meta("_editor_icon");
+
+ if (name != StringName()) {
+ const Map<String, Vector<EditorData::CustomType> > &p_map = EditorNode::get_editor_data().get_custom_types();
+ for (const Map<String, Vector<EditorData::CustomType> >::Element *E = p_map.front(); E; E = E->next()) {
+ const Vector<EditorData::CustomType> &ct = E->value();
+ for (int i = 0; i < ct.size(); ++i) {
+ if (ct[i].name == name && ct[i].icon.is_valid()) {
+ return ct[i].icon;
+ }
+ }
+ }
+ }
+
+ if (p_fallback.length())
+ return gui_base->get_icon(p_fallback, "EditorIcons");
+
+ return NULL;
+}
+
+Ref<Texture> EditorNode::get_class_icon(const String &p_class, const String &p_fallback) const {
+ ERR_FAIL_COND_V(p_class.empty(), NULL);
+
+ if (gui_base->has_icon(p_class, "EditorIcons")) {
+ return gui_base->get_icon(p_class, "EditorIcons");
+ }
+
+ if (ScriptServer::is_global_class(p_class)) {
+ String icon_path = EditorNode::get_editor_data().script_class_get_icon_path(p_class);
+ RES icon;
+ if (FileAccess::exists(icon_path)) {
+ icon = ResourceLoader::load(icon_path);
+ }
+ if (!icon.is_valid()) {
+ icon = gui_base->get_icon(ScriptServer::get_global_class_base(p_class), "EditorIcons");
+ }
+ return icon;
+ }
+
+ const Map<String, Vector<EditorData::CustomType> > &p_map = EditorNode::get_editor_data().get_custom_types();
+ for (const Map<String, Vector<EditorData::CustomType> >::Element *E = p_map.front(); E; E = E->next()) {
+ const Vector<EditorData::CustomType> &ct = E->value();
+ for (int i = 0; i < ct.size(); ++i) {
+ if (ct[i].name == p_class) {
+ if (ct[i].icon.is_valid()) {
+ return ct[i].icon;
+ }
+ }
+ }
+ }
+
+ if (p_fallback.length())
+ return gui_base->get_icon(p_fallback, "EditorIcons");
+
+ return NULL;
+}
+
void EditorNode::progress_add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel) {
singleton->progress_dialog->add_task(p_task, p_label, p_steps, p_can_cancel);
@@ -5358,22 +5433,20 @@ EditorNode::EditorNode() {
play_custom_scene_button->set_shortcut(ED_SHORTCUT("editor/play_custom_scene", TTR("Play Custom Scene"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F5));
#endif
+ // Toggle for video driver
video_driver = memnew(OptionButton);
video_driver->set_flat(true);
video_driver->set_focus_mode(Control::FOCUS_NONE);
video_driver->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
+ video_driver->connect("item_selected", this, "_video_driver_selected");
+ menu_hb->add_child(video_driver);
+
String video_drivers = ProjectSettings::get_singleton()->get_custom_property_info()["rendering/quality/driver/driver_name"].hint_string;
String current_video_driver = OS::get_singleton()->get_video_driver_name(OS::get_singleton()->get_current_video_driver());
- menu_hb->add_child(video_driver);
video_driver_current = 0;
for (int i = 0; i < video_drivers.get_slice_count(","); i++) {
String driver = video_drivers.get_slice(",", i);
- if (gui_base->has_icon(driver, "EditorIcons")) {
- video_driver->add_icon_item(gui_base->get_icon(driver, "EditorIcons"), "");
- } else {
- video_driver->add_item(driver);
- }
-
+ video_driver->add_item(driver);
video_driver->set_item_metadata(i, driver);
if (current_video_driver == driver) {
@@ -5382,7 +5455,6 @@ EditorNode::EditorNode() {
}
}
- video_driver->connect("item_selected", this, "_video_driver_selected");
video_restart_dialog = memnew(ConfirmationDialog);
video_restart_dialog->set_text(TTR("Changing the video driver requires restarting the editor."));
video_restart_dialog->get_ok()->set_text(TTR("Save & Restart"));
diff --git a/editor/editor_node.h b/editor/editor_node.h
index 5a17ab6ca0..7409c64a64 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -706,6 +706,8 @@ public:
void stop_child_process();
Ref<Theme> get_editor_theme() const { return theme; }
+ Ref<Texture> get_object_icon(const Object *p_object, const String &p_fallback = "Object") const;
+ Ref<Texture> get_class_icon(const String &p_class, const String &p_fallback = "Object") const;
void show_accept(const String &p_text, const String &p_title);
void show_warning(const String &p_text, const String &p_title = "Warning!");
diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp
index 9506a0e951..0eff1fd7dd 100644
--- a/editor/editor_path.cpp
+++ b/editor/editor_path.cpp
@@ -54,12 +54,7 @@ void EditorPath::_add_children_to_popup(Object *p_obj, int p_depth) {
if (!obj)
continue;
- Ref<Texture> icon;
-
- if (has_icon(obj->get_class(), "EditorIcons"))
- icon = get_icon(obj->get_class(), "EditorIcons");
- else
- icon = get_icon("Object", "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(obj);
int index = popup->get_item_count();
popup->add_icon_item(icon, E->get().name.capitalize(), objects.size());
@@ -122,12 +117,7 @@ void EditorPath::_notification(int p_what) {
String type = obj->get_class();
- Ref<Texture> icon;
-
- if (has_icon(obj->get_class(), "EditorIcons"))
- icon = get_icon(obj->get_class(), "EditorIcons");
- else
- icon = get_icon("Object", "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(obj);
icon->draw(ci, Point2i(ofs, (size.height - icon->get_height()) / 2));
diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp
index ef0b61e882..30027c0c34 100644
--- a/editor/editor_plugin_settings.cpp
+++ b/editor/editor_plugin_settings.cpp
@@ -117,7 +117,7 @@ void EditorPluginSettings::update_plugins() {
TreeItem *item = plugin_list->create_item(root);
item->set_text(0, name);
- item->set_tooltip(0, "Name: " + name + "\nPath: " + path + "\nMain Script: " + script);
+ item->set_tooltip(0, "Name: " + name + "\nPath: " + path + "\nMain Script: " + script + "\nDescription: " + description);
item->set_metadata(0, d);
item->set_text(1, version);
item->set_metadata(1, script);
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index f932aa9927..3439133809 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -846,18 +846,11 @@ void EditorPropertyObjectID::update_property() {
if (type == "")
type = "Object";
- String icon_type = type;
- if (has_icon(icon_type, "EditorIcons")) {
- type = icon_type;
- } else {
- type = "Object";
- }
-
ObjectID id = get_edited_object()->get(get_edited_property());
if (id != 0) {
edit->set_text(type + " ID: " + itos(id));
edit->set_disabled(false);
- edit->set_icon(get_icon(icon_type, "EditorIcons"));
+ edit->set_icon(EditorNode::get_singleton()->get_class_icon(type));
} else {
edit->set_text(TTR("[Empty]"));
edit->set_disabled(true);
@@ -1858,14 +1851,7 @@ void EditorPropertyNodePath::update_property() {
ERR_FAIL_COND(!target_node);
assign->set_text(target_node->get_name());
-
- Ref<Texture> icon;
- if (has_icon(target_node->get_class(), "EditorIcons"))
- icon = get_icon(target_node->get_class(), "EditorIcons");
- else
- icon = get_icon("Node", "EditorIcons");
-
- assign->set_icon(icon);
+ assign->set_icon(EditorNode::get_singleton()->get_object_icon(target_node, "Node"));
}
void EditorPropertyNodePath::setup(const NodePath &p_base_hint, Vector<StringName> p_valid_types) {
@@ -2363,13 +2349,7 @@ void EditorPropertyResource::update_property() {
assign->set_text(TTR("[empty]"));
} else {
- Ref<Texture> icon;
- if (has_icon(res->get_class(), "EditorIcons"))
- icon = get_icon(res->get_class(), "EditorIcons");
- else
- icon = get_icon("Node", "EditorIcons");
-
- assign->set_icon(icon);
+ assign->set_icon(EditorNode::get_singleton()->get_object_icon(res.operator->(), "Node"));
if (res->get_name() != String()) {
assign->set_text(res->get_name());
diff --git a/editor/editor_sub_scene.cpp b/editor/editor_sub_scene.cpp
index 056ee59860..7036a0ddaa 100644
--- a/editor/editor_sub_scene.cpp
+++ b/editor/editor_sub_scene.cpp
@@ -30,6 +30,7 @@
#include "editor_sub_scene.h"
+#include "editor/editor_node.h"
#include "scene/gui/margin_container.h"
#include "scene/resources/packed_scene.h"
@@ -84,9 +85,7 @@ void EditorSubScene::_fill_tree(Node *p_node, TreeItem *p_parent) {
it->set_text(0, p_node->get_name());
it->set_editable(0, false);
it->set_selectable(0, true);
- if (has_icon(p_node->get_class(), "EditorIcons")) {
- it->set_icon(0, get_icon(p_node->get_class(), "EditorIcons"));
- }
+ it->set_icon(0, EditorNode::get_singleton()->get_object_icon(p_node, "Node"));
for (int i = 0; i < p_node->get_child_count(); i++) {
diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp
index 0efd14e932..cb9703342f 100644
--- a/editor/groups_editor.cpp
+++ b/editor/groups_editor.cpp
@@ -90,12 +90,7 @@ void GroupDialog::_load_nodes(Node *p_current) {
node->set_metadata(0, path);
node->set_tooltip(0, path);
- Ref<Texture> icon;
- if (p_current->has_meta("_editor_icon")) {
- icon = p_current->get_meta("_editor_icon");
- } else {
- icon = get_icon((has_icon(p_current->get_class(), "EditorIcons") ? p_current->get_class() : String("Object")), "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(p_current, "Node");
node->set_icon(0, icon);
if (!_can_edit(p_current, selected_group)) {
diff --git a/editor/icons/icon_g_l_e_s_2.svg b/editor/icons/icon_g_l_e_s_2.svg
deleted file mode 100644
index efc4f01e4f..0000000000
--- a/editor/icons/icon_g_l_e_s_2.svg
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- id="svg2"
- width="48"
- height="16"
- viewBox="0 0 47.999999 16"
- sodipodi:docname="icon_g_l_e_s_2.svg"
- inkscape:version="0.92.3 (2405546, 2018-03-11)">
- <metadata
- id="metadata8">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <defs
- id="defs6" />
- <sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="1484"
- inkscape:window-height="697"
- id="namedview4"
- showgrid="false"
- inkscape:zoom="13.520979"
- inkscape:cx="20.549976"
- inkscape:cy="7.9399684"
- inkscape:window-x="67"
- inkscape:window-y="27"
- inkscape:window-maximized="0"
- inkscape:current-layer="svg2" />
- <path
- inkscape:connector-curvature="0"
- id="path835"
- d="m 19.839879,15.499154 c -0.0652,-0.0268 -0.141743,-0.1098 -0.170113,-0.184417 -0.03304,-0.08688 -0.05158,-0.95731 -0.05158,-5.912028 V 3.1830459 l 0.108486,-0.1379162 c 0.150269,-0.1910365 0.41814,-0.1907342 0.568677,6.436e-4 l 0.10899,0.1385579 -0.01358,6.2990785 c -0.01194,6.8660953 -0.0921,5.3381383 -0.0921,5.9327083 -0.106573,0.104434 -0.315006,0.142158 -0.458762,0.08303 z M 5.3808767,14.575188 C 4.5309456,14.518738 3.6260357,14.196602 2.9750499,13.718734 2.5767564,13.42636 2.0035795,12.787236 1.747789,12.350269 1.2385669,11.480363 1.0170768,10.580508 1.0213778,9.399057 1.0293972,7.2009406 1.9726797,5.5285643 3.6891526,4.6693537 4.7813316,4.1226444 6.2246017,4.0371807 7.4330177,4.4476602 8.1309525,4.6847376 8.4685433,4.8972607 9.0207129,5.4471587 9.4063328,5.8311907 9.5338898,6.0004852 9.7108978,6.3631718 9.8335428,6.6144683 9.9681328,6.9987435 10.020175,7.2461971 10.145759,7.8433551 10.170431,7.8289765 9.0218356,7.828057 8.5307356,7.8276009 8.0769363,7.8134035 8.0133918,7.7963663 7.9392662,7.7764919 7.8757344,7.6970176 7.8361313,7.5746239 7.5012661,6.5397183 6.6297764,6.0267536 5.4889128,6.193037 4.244092,6.3744711 3.4980921,7.3344965 3.343357,8.9541432 3.2260083,10.182472 3.5434132,11.329338 4.1781352,11.97041 c 0.46237,0.466997 0.9869175,0.673904 1.7084683,0.673904 1.2025378,0 1.9439704,-0.533034 2.1862936,-1.57178 0.055989,-0.240028 0.059178,-0.324448 0.012859,-0.341503 -0.033838,-0.01246 -0.5090516,-0.02871 -1.0560342,-0.03612 L 6.0352096,10.681458 V 9.8178001 8.9541431 l 1.9890278,-0.014575 c 1.0939663,-0.00802 2.0422396,-0.00163 2.1072756,0.014201 l 0.118246,0.028779 -0.01356,2.6814549 -0.01356,2.681455 -0.7170922,0.01455 c -0.8295927,0.01682 -0.7753286,0.05076 -0.8815155,-0.55106 -0.036825,-0.208719 -0.077853,-0.379487 -0.091164,-0.379487 -0.013311,0 -0.16916,0.135437 -0.3463303,0.300972 -0.3894417,0.363866 -0.8188673,0.600316 -1.3418506,0.738852 -0.4725114,0.125166 -0.8081647,0.149449 -1.4638111,0.10591 z M 32.49721,14.469781 c -0.928547,-0.194854 -1.630354,-0.56605 -2.174913,-1.150343 -0.515384,-0.552992 -0.832054,-1.344249 -0.800629,-2.000518 l 0.01549,-0.323408 1.060826,-0.01418 1.060825,-0.01418 0.05146,0.135352 c 0.0283,0.07444 0.0517,0.198593 0.05197,0.275887 8.54e-4,0.230559 0.229434,0.649361 0.479979,0.879354 0.347226,0.318744 0.735307,0.44853 1.431019,0.478576 1.267096,0.05472 2.007349,-0.393206 1.947849,-1.178652 -0.0456,-0.601928 -0.471503,-0.860841 -2.12876,-1.294103 C 32.881626,10.103917 32.242852,9.9264243 32.07283,9.8691486 30.95902,9.4939337 30.283515,8.9537559 29.97948,8.195172 29.836139,7.8375288 29.784025,7.0484225 29.874852,6.6109088 30.100606,5.5234588 31.071976,4.6456053 32.416011,4.314394 33.01697,4.1662997 34.128873,4.156633 34.77144,4.293917 c 1.67335,0.3575071 2.584333,1.270761 2.774448,2.7813655 0.0543,0.4314615 0.0347,0.4394334 -1.080484,0.4394334 -0.521251,0 -0.9851,-0.023133 -1.038665,-0.051802 C 35.367672,7.4313026 35.307808,7.3078793 35.273143,7.1462409 35.195527,6.7843357 35.099156,6.6147944 34.849667,6.4012402 34.543832,6.1394568 34.14764,6.029069 33.515213,6.0294329 c -0.428465,2.111e-4 -0.570793,0.021517 -0.784491,0.1172346 -0.47592,0.2131691 -0.654939,0.4628549 -0.654939,0.9134748 0,0.5904894 0.225799,0.7059322 2.58195,1.3200619 1.350552,0.3520209 1.903346,0.598685 2.415601,1.0778741 0.591219,0.5530567 0.852295,1.2543747 0.796412,2.1393787 -0.07929,1.255762 -0.891416,2.255747 -2.192274,2.699402 -0.885807,0.302103 -2.21918,0.374602 -3.180262,0.172924 z M 11.476954,14.306572 c -0.0138,-0.03619 -0.019,-2.268126 -0.01158,-4.9598581 l 0.0135,-4.8940567 1.066335,-0.01419 c 0.742348,-0.00988 1.088249,0.00399 1.138458,0.045665 0.06009,0.049873 0.07211,0.7135739 0.07211,3.9791612 v 3.9193056 h 2.293081 c 1.756352,0 2.314103,0.01538 2.382892,0.06567 0.07993,0.05845 0.08822,0.166396 0.07543,0.981428 l -0.01437,0.915757 -3.495384,0.01345 c -2.768549,0.0107 -3.500605,-1.69e-4 -3.520473,-0.05234 z m 10.193414,0.0026 c -0.04842,-0.04842 -0.06297,-1.193838 -0.06236,-4.9074882 4.61e-4,-2.6643823 0.01959,-4.8739347 0.04256,-4.9101166 0.03301,-0.05201 0.813774,-0.062971 3.728627,-0.052342 l 3.686862,0.013441 V 5.3948518 6.337024 l -2.5648,0.026171 -2.5648,0.026172 v 0.9421438 0.9421716 l 2.313597,0.026171 c 1.548367,0.017515 2.332217,0.044804 2.36989,0.082507 0.03673,0.036745 0.05127,0.3461819 0.04183,0.889829 l -0.01446,0.8334926 -2.355428,0.02617 -2.355429,0.02617 v 1.0992 1.099199 l 2.617143,0.0274 c 1.439428,0.01507 2.623562,0.03274 2.63141,0.03926 0.0078,0.0065 0.0078,0.441727 0,0.967118 l -0.01427,0.955257 -3.718613,0.01343 c -2.848812,0.01027 -3.733388,-0.0013 -3.781773,-0.04973 z m 17.753791,-0.378679 c -0.04061,-0.105824 0.0759,-0.828141 0.198829,-1.232689 0.288088,-0.948035 0.88431,-1.590368 2.319422,-2.498804 1.100465,-0.6965999 1.86374,-1.2293374 2.17747,-1.5198007 0.515251,-0.477031 0.731074,-1.0868265 0.620161,-1.7522036 -0.126353,-0.7579473 -0.607483,-1.1395723 -1.436711,-1.1395723 -0.930964,0 -1.401324,0.4507271 -1.481617,1.4197789 l -0.03634,0.4383927 h -1.099202 -1.099196 l -0.01524,-0.3725124 c -0.03408,-0.8332648 0.288934,-1.6827799 0.855164,-2.2490093 0.399774,-0.3997734 1.09283,-0.7574546 1.70958,-0.8822975 0.580047,-0.1174131 1.71432,-0.1077309 2.332892,0.019914 1.258364,0.2596698 2.203978,1.0560413 2.520675,2.1228587 0.104477,0.3519131 0.117355,0.4871812 0.09657,1.0144101 -0.01959,0.4962935 -0.04847,0.667451 -0.157022,0.9292002 -0.313508,0.7560998 -0.900391,1.3802206 -1.888823,2.0086882 -1.507571,0.958543 -1.915442,1.243322 -2.230808,1.557578 -0.26352,0.262604 -0.32016,0.345357 -0.261709,0.382352 0.04123,0.0261 1.061246,0.04757 2.280484,0.04802 1.96272,7.11e-4 2.209393,0.0099 2.237659,0.0836 0.01749,0.04554 0.03178,0.408703 0.03178,0.807033 0,0.398331 -0.0143,0.761495 -0.03178,0.807033 -0.0286,0.07445 -0.414152,0.0828 -3.822672,0.0828 -3.236429,0 -3.795092,-0.01093 -3.819578,-0.07475 z"
- style="fill:#5586a4;fill-opacity:1;stroke-width:0.05234285"
- sodipodi:nodetypes="ccscccccccccsscsscccccscccsccsccccccccccssscccccccccccccccscsccsccccsssscscccccccscscscccccccscccccccscccccccscccccccccccscccccsssccccccccscscc" />
- <path
- style="fill:#000000;stroke-width:1.06666672"
- d=""
- id="path819"
- inkscape:connector-curvature="0" />
- <path
- style="fill:#000000;stroke-width:1.06666672"
- d=""
- id="path817"
- inkscape:connector-curvature="0" />
-</svg>
diff --git a/editor/icons/icon_g_l_e_s_3.svg b/editor/icons/icon_g_l_e_s_3.svg
deleted file mode 100644
index dfa3c26b38..0000000000
--- a/editor/icons/icon_g_l_e_s_3.svg
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- id="svg2"
- width="48"
- height="16"
- viewBox="0 0 47.999999 16"
- sodipodi:docname="icon_g_l_e_s_3.svg"
- inkscape:version="0.92.3 (2405546, 2018-03-11)">
- <metadata
- id="metadata8">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <defs
- id="defs6" />
- <sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="1484"
- inkscape:window-height="697"
- id="namedview4"
- showgrid="false"
- inkscape:zoom="13.520979"
- inkscape:cx="20.549976"
- inkscape:cy="7.9399684"
- inkscape:window-x="67"
- inkscape:window-y="27"
- inkscape:window-maximized="0"
- inkscape:current-layer="svg2" />
- <path
- style="fill:#6aa455;fill-opacity:1;stroke-width:0.05234285"
- d="M 20.011719 2.9023438 C 19.90715 2.9022255 19.801697 2.9494036 19.726562 3.0449219 L 19.619141 3.1835938 L 19.619141 9.4023438 C 19.619141 14.357062 19.636882 15.227573 19.669922 15.314453 C 19.698292 15.38907 19.774644 15.4732 19.839844 15.5 C 19.9836 15.559128 20.192255 15.52045 20.298828 15.416016 C 20.298828 14.821446 20.378685 16.35047 20.390625 9.484375 L 20.404297 3.1835938 L 20.294922 3.0449219 C 20.219653 2.949233 20.116287 2.902462 20.011719 2.9023438 z M 33.578125 4.1972656 C 33.144709 4.2010336 32.716495 4.240406 32.416016 4.3144531 C 31.071981 4.6456644 30.100754 5.5238781 29.875 6.6113281 C 29.784173 7.0488418 29.835175 7.8376693 29.978516 8.1953125 C 30.282551 8.9538964 30.958456 9.4939257 32.072266 9.8691406 C 32.242288 9.9264163 32.881487 10.104023 33.492188 10.263672 C 35.149445 10.696934 35.575494 10.956666 35.621094 11.558594 C 35.680594 12.34404 34.940924 12.791048 33.673828 12.736328 C 32.978116 12.706282 32.589413 12.576557 32.242188 12.257812 C 31.991643 12.02782 31.762573 11.609465 31.761719 11.378906 C 31.761449 11.301612 31.739238 11.176002 31.710938 11.101562 L 31.658203 10.966797 L 30.597656 10.980469 L 29.537109 10.996094 L 29.521484 11.318359 C 29.490059 11.974628 29.806882 12.767321 30.322266 13.320312 C 30.866825 13.904606 31.5695 14.275849 32.498047 14.470703 C 33.459129 14.672381 34.791927 14.598978 35.677734 14.296875 C 36.978592 13.85322 37.789851 12.853418 37.869141 11.597656 C 37.925024 10.712652 37.665438 10.012041 37.074219 9.4589844 C 36.561964 8.9797953 36.008755 8.7328803 34.658203 8.3808594 C 32.302052 7.7667297 32.076172 7.6510363 32.076172 7.0605469 C 32.076172 6.609927 32.254549 6.3596535 32.730469 6.1464844 C 32.944167 6.0507668 33.08716 6.029508 33.515625 6.0292969 C 34.148052 6.028933 34.543774 6.1386072 34.849609 6.4003906 C 35.099098 6.6139448 35.195822 6.7845792 35.273438 7.1464844 C 35.308103 7.3081228 35.366714 7.4312793 35.425781 7.4628906 C 35.479346 7.4915596 35.943593 7.515625 36.464844 7.515625 C 37.580028 7.515625 37.599222 7.5076334 37.544922 7.0761719 C 37.354807 5.5655674 36.444834 4.6504759 34.771484 4.2929688 C 34.450201 4.2243268 34.011541 4.1934977 33.578125 4.1972656 z M 5.5175781 4.1992188 C 4.8691862 4.2376134 4.2355426 4.3965672 3.6894531 4.6699219 C 1.9729802 5.5291325 1.0295038 7.2003211 1.0214844 9.3984375 C 1.0171834 10.579889 1.2388248 11.479703 1.7480469 12.349609 C 2.0038374 12.786576 2.5763159 13.426376 2.9746094 13.71875 C 3.6255952 14.196618 4.5309283 14.517769 5.3808594 14.574219 C 6.0365058 14.617758 6.3712386 14.593916 6.84375 14.46875 C 7.3667333 14.330214 7.7980583 14.094335 8.1875 13.730469 C 8.3646703 13.564934 8.5198921 13.429688 8.5332031 13.429688 C 8.5465141 13.429688 8.588175 13.599875 8.625 13.808594 C 8.7311869 14.410414 8.6762667 14.376195 9.5058594 14.359375 L 10.222656 14.345703 L 10.236328 11.664062 L 10.25 8.9824219 L 10.130859 8.953125 C 10.065823 8.937294 9.1174038 8.9314331 8.0234375 8.9394531 L 6.0351562 8.9550781 L 6.0351562 9.8183594 L 6.0351562 10.681641 L 7.0292969 10.695312 C 7.5762795 10.702722 8.0520995 10.718009 8.0859375 10.730469 C 8.1322565 10.747524 8.1282546 10.832238 8.0722656 11.072266 C 7.8299424 12.111012 7.0892565 12.644531 5.8867188 12.644531 C 5.1651679 12.644531 4.6401044 12.4377 4.1777344 11.970703 C 3.5430124 11.329631 3.2264013 10.183407 3.34375 8.9550781 C 3.4984851 7.3354314 4.2434605 6.3747935 5.4882812 6.1933594 C 6.6291449 6.027076 7.5010723 6.5393131 7.8359375 7.5742188 C 7.8755406 7.6966124 7.9395463 7.7770006 8.0136719 7.796875 C 8.0772164 7.8139122 8.5303844 7.8276689 9.0214844 7.828125 C 10.17008 7.8290445 10.145115 7.8432518 10.019531 7.2460938 C 9.967489 6.9986401 9.8335825 6.6145778 9.7109375 6.3632812 C 9.5339295 6.0005947 9.4071043 5.8312976 9.0214844 5.4472656 C 8.4693148 4.8973676 8.1315285 4.684343 7.4335938 4.4472656 C 6.8293858 4.2420259 6.16597 4.1608241 5.5175781 4.1992188 z M 42.03125 4.2617188 L 41.537109 4.4335938 C 40.933232 4.6433398 40.657695 4.8014669 40.300781 5.1386719 C 39.969225 5.4519119 39.761404 5.8046136 39.621094 6.2910156 C 39.502474 6.7023596 39.433137 7.3494687 39.498047 7.4492188 C 39.531044 7.4999487 39.783863 7.5127831 40.576172 7.5019531 L 41.611328 7.4863281 L 41.691406 7.0703125 C 41.808812 6.4678105 41.927622 6.2685471 42.265625 6.0957031 C 42.510424 5.9705181 42.604184 5.953125 43.019531 5.953125 C 43.426321 5.953125 43.533311 5.9721266 43.765625 6.0878906 C 44.253715 6.3311276 44.455638 6.904517 44.273438 7.53125 C 44.105442 8.109131 43.697334 8.363965 42.791016 8.453125 C 42.521874 8.479605 42.288464 8.51424 42.271484 8.53125 C 42.225224 8.577174 42.232777 9.7874244 42.279297 9.8339844 C 42.301291 9.8559744 42.598053 9.8907794 42.939453 9.9121094 C 43.836652 9.9681724 44.239534 10.166191 44.525391 10.691406 C 44.916028 11.409137 44.561069 12.318315 43.787109 12.582031 C 43.476088 12.688024 42.767292 12.688624 42.470703 12.583984 C 42.00204 12.418633 41.795632 12.174325 41.642578 11.597656 L 41.560547 11.285156 L 40.46875 11.285156 L 39.376953 11.285156 L 39.361328 11.527344 C 39.352678 11.660649 39.384791 11.918152 39.431641 12.099609 C 39.739925 13.294376 40.783209 14.156157 42.212891 14.396484 C 42.284425 14.408514 42.682741 14.422181 43.097656 14.425781 C 44.074936 14.434074 44.653306 14.320796 45.308594 13.996094 C 46.07786 13.61492 46.610204 13.058412 46.847656 12.382812 C 47.087412 11.700564 47.08166 10.999125 46.833984 10.333984 C 46.695621 9.962377 46.130198 9.3782416 45.6875 9.1503906 C 45.523031 9.0657476 45.386773 8.9810006 45.386719 8.9628906 C 45.386654 8.9447846 45.539488 8.8195027 45.724609 8.6835938 C 46.129744 8.3861558 46.390215 8.064434 46.53125 7.6875 C 46.963216 6.532963 46.370297 5.2063894 45.166016 4.6308594 C 44.482944 4.3044164 44.23589 4.2611938 43.072266 4.2617188 L 42.03125 4.2617188 z M 12.544922 4.4375 L 11.478516 4.453125 L 11.464844 9.3476562 C 11.457424 12.039388 11.462763 14.270451 11.476562 14.306641 C 11.49643 14.358812 12.229498 14.370075 14.998047 14.359375 L 18.492188 14.345703 L 18.507812 13.429688 C 18.520602 12.614656 18.511571 12.507669 18.431641 12.449219 C 18.362852 12.398929 17.80518 12.382812 16.048828 12.382812 L 13.755859 12.382812 L 13.755859 8.4628906 C 13.755859 5.1973033 13.743684 4.534248 13.683594 4.484375 C 13.633385 4.4427 13.28727 4.42762 12.544922 4.4375 z M 25.378906 4.4394531 C 22.464053 4.4288241 21.683401 4.4401775 21.650391 4.4921875 C 21.627421 4.5283694 21.607883 6.7379615 21.607422 9.4023438 C 21.606812 13.115994 21.621502 14.260174 21.669922 14.308594 C 21.718307 14.357024 22.60236 14.369645 25.451172 14.359375 L 29.169922 14.345703 L 29.185547 13.390625 C 29.193347 12.865234 29.193347 12.430328 29.185547 12.423828 C 29.177699 12.417308 27.992162 12.399836 26.552734 12.384766 L 23.935547 12.355469 L 23.935547 11.257812 L 23.935547 10.158203 L 26.291016 10.132812 L 28.646484 10.105469 L 28.662109 9.2714844 C 28.671549 8.7278373 28.655871 8.4195575 28.619141 8.3828125 C 28.581468 8.3451095 27.798367 8.3182962 26.25 8.3007812 L 23.935547 8.2734375 L 23.935547 7.3320312 L 23.935547 6.3886719 L 26.501953 6.3632812 L 29.066406 6.3378906 L 29.066406 5.3945312 L 29.066406 4.453125 L 25.378906 4.4394531 z "
- id="path3424" />
- <path
- style="fill:#000000;stroke-width:1.06666672"
- d=""
- id="path819"
- inkscape:connector-curvature="0" />
- <path
- style="fill:#000000;stroke-width:1.06666672"
- d=""
- id="path817"
- inkscape:connector-curvature="0" />
-</svg>
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index 7aad973a96..5ab764fb15 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -231,11 +231,10 @@ void InspectorDock::_prepare_history() {
already.insert(id);
- Ref<Texture> icon = get_icon("Object", "EditorIcons");
- if (has_icon(obj->get_class(), "EditorIcons"))
- icon = get_icon(obj->get_class(), "EditorIcons");
- else
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(obj, "");
+ if (icon.is_null()) {
icon = base_icon;
+ }
String text;
if (Object::cast_to<Resource>(obj)) {
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp
index abf703cfd4..19d5243776 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp
@@ -542,11 +542,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
if (base->has_node(accum)) {
Node *node = base->get_node(accum);
- if (has_icon(node->get_class(), "EditorIcons")) {
- ti->set_icon(0, get_icon(node->get_class(), "EditorIcons"));
- } else {
- ti->set_icon(0, get_icon("Node", "EditorIcons"));
- }
+ ti->set_icon(0, EditorNode::get_singleton()->get_object_icon(node, "Node"));
}
} else {
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index eae3775e6b..34159964a5 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -1905,11 +1905,7 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
for (int i = 0; i < selection_results.size(); i++) {
CanvasItem *item = selection_results[i].item;
- Ref<Texture> icon;
- if (item->has_meta("_editor_icon"))
- icon = item->get_meta("_editor_icon");
- else
- icon = get_icon(has_icon(item->get_class(), "EditorIcons") ? item->get_class() : String("Object"), "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(item, "Node");
String node_path = "/" + root_name + "/" + root_path.rel_path_to(item->get_path());
selection_menu->add_item(item->get_name());
@@ -2046,10 +2042,7 @@ bool CanvasItemEditor::_gui_input_hover(const Ref<InputEvent> &p_event) {
_HoverResult hover_result;
hover_result.position = canvas_item->get_global_transform_with_canvas().get_origin();
- if (has_icon(canvas_item->get_class(), "EditorIcons"))
- hover_result.icon = get_icon(canvas_item->get_class(), "EditorIcons");
- else
- hover_result.icon = get_icon("Object", "EditorIcons");
+ hover_result.icon = EditorNode::get_singleton()->get_object_icon(canvas_item);
hover_result.name = canvas_item->get_name();
hovering_results_tmp.push_back(hover_result);
@@ -4397,7 +4390,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
zoom_plus = memnew(ToolButton);
zoom_hb->add_child(zoom_plus);
zoom_plus->connect("pressed", this, "_button_zoom_plus");
- zoom_plus->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_plus", TTR("Zoom in"), KEY_MASK_CMD | KEY_PLUS));
+ zoom_plus->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_plus", TTR("Zoom in"), KEY_MASK_CMD | KEY_EQUAL)); // Usually direct access key for PLUS
zoom_plus->set_focus_mode(FOCUS_NONE);
updating_scroll = false;
diff --git a/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp
index 7b5de9c009..186e66f980 100644
--- a/editor/plugins/item_list_editor_plugin.cpp
+++ b/editor/plugins/item_list_editor_plugin.cpp
@@ -317,10 +317,7 @@ void ItemListEditor::edit(Node *p_item_list) {
item_plugins[i]->set_object(p_item_list);
property_editor->edit(item_plugins[i]);
- if (has_icon(item_list->get_class(), "EditorIcons"))
- toolbar_button->set_icon(get_icon(item_list->get_class(), "EditorIcons"));
- else
- toolbar_button->set_icon(Ref<Texture>());
+ toolbar_button->set_icon(EditorNode::get_singleton()->get_object_icon(item_list, ""));
selected_idx = i;
return;
diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp
index da6aa48f9c..dd327d0a2c 100644
--- a/editor/plugins/resource_preloader_editor_plugin.cpp
+++ b/editor/plugins/resource_preloader_editor_plugin.cpp
@@ -238,8 +238,7 @@ void ResourcePreloaderEditor::_update_library() {
ti->set_text(2, type);
ti->set_selectable(2, false);
- if (has_icon(type, "EditorIcons"))
- ti->set_icon(2, get_icon(type, "EditorIcons"));
+ ti->set_icon(2, EditorNode::get_singleton()->get_class_icon(type, ""));
}
//player->add_resource("default",resource);
diff --git a/editor/plugins/root_motion_editor_plugin.cpp b/editor/plugins/root_motion_editor_plugin.cpp
index 1961f3786c..b3adf19a64 100644
--- a/editor/plugins/root_motion_editor_plugin.cpp
+++ b/editor/plugins/root_motion_editor_plugin.cpp
@@ -109,11 +109,7 @@ void EditorPropertyRootMotion::_node_assign() {
if (base->has_node(accum)) {
Node *node = base->get_node(accum);
- if (has_icon(node->get_class(), "EditorIcons")) {
- ti->set_icon(0, get_icon(node->get_class(), "EditorIcons"));
- } else {
- ti->set_icon(0, get_icon("Node", "EditorIcons"));
- }
+ ti->set_icon(0, EditorNode::get_singleton()->get_object_icon(node, "Node"));
}
} else {
@@ -235,14 +231,7 @@ void EditorPropertyRootMotion::update_property() {
ERR_FAIL_COND(!target_node);
assign->set_text(target_node->get_name());
-
- Ref<Texture> icon;
- if (has_icon(target_node->get_class(), "EditorIcons"))
- icon = get_icon(target_node->get_class(), "EditorIcons");
- else
- icon = get_icon("Node", "EditorIcons");
-
- assign->set_icon(icon);
+ assign->set_icon(EditorNode::get_singleton()->get_object_icon(target_node, "Node"));
}
void EditorPropertyRootMotion::setup(const NodePath &p_base_hint) {
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index e86424ee51..c2554acd49 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -847,11 +847,7 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
Spatial *spat = selection_results[i].item;
- Ref<Texture> icon;
- if (spat->has_meta("_editor_icon"))
- icon = spat->get_meta("_editor_icon");
- else
- icon = get_icon(has_icon(spat->get_class(), "EditorIcons") ? spat->get_class() : String("Object"), "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(spat, "Node");
String node_path = "/" + root_name + "/" + root_path.rel_path_to(spat->get_path());
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp
index 5d379fb8b3..3bf4140591 100644
--- a/editor/plugins/text_editor.cpp
+++ b/editor/plugins/text_editor.cpp
@@ -30,6 +30,8 @@
#include "text_editor.h"
+#include "editor_node.h"
+
void TextEditor::add_syntax_highlighter(SyntaxHighlighter *p_highlighter) {
highlighters[p_highlighter->get_name()] = p_highlighter;
highlighter_menu->add_radio_check_item(p_highlighter->get_name());
@@ -158,10 +160,7 @@ String TextEditor::get_name() {
Ref<Texture> TextEditor::get_icon() {
- if (get_parent_control() && get_parent_control()->has_icon(text_file->get_class(), "EditorIcons")) {
- return get_parent_control()->get_icon(text_file->get_class(), "EditorIcons");
- }
- return Ref<Texture>();
+ return EditorNode::get_singleton()->get_object_icon(text_file.operator->(), "");
}
RES TextEditor::get_edited_resource() const {
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index aba89a87ee..fa6dce1771 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -655,16 +655,9 @@ bool ProjectExportDialog::_fill_tree(EditorFileSystemDirectory *p_dir, TreeItem
file->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
file->set_text(0, p_dir->get_file(i));
- Ref<Texture> tex;
- if (has_icon(type, editor_icons)) {
- tex = get_icon(type, editor_icons);
- } else {
- tex = get_icon("Object", editor_icons);
- }
-
String path = p_dir->get_file_path(i);
- file->set_icon(0, tex);
+ file->set_icon(0, EditorNode::get_singleton()->get_class_icon(type));
file->set_editable(0, true);
file->set_checked(0, current->has_export_file(path));
file->set_metadata(0, path);
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 1baf606e7b..7a68646f40 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -1840,9 +1840,9 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
input_editor->set_column_title(0, TTR("Action"));
input_editor->set_column_title(1, TTR("Deadzone"));
input_editor->set_column_expand(1, false);
- input_editor->set_column_min_width(1, 80);
+ input_editor->set_column_min_width(1, 80 * EDSCALE);
input_editor->set_column_expand(2, false);
- input_editor->set_column_min_width(2, 50);
+ input_editor->set_column_min_width(2, 50 * EDSCALE);
input_editor->connect("item_edited", this, "_action_edited");
input_editor->connect("item_activated", this, "_action_activated");
input_editor->connect("cell_selected", this, "_action_selected");
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 1c2eedfc9c..508db2e03f 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -34,6 +34,7 @@
#include "core/io/image_loader.h"
#include "core/io/marshalls.h"
#include "core/io/resource_loader.h"
+#include "core/math/expression.h"
#include "core/os/input.h"
#include "core/os/keyboard.h"
#include "core/pair.h"
@@ -1531,21 +1532,24 @@ void CustomPropertyEditor::_modified(String p_string) {
updating = true;
switch (type) {
case Variant::INT: {
-
- if (evaluator)
- v = evaluator->eval(value_editor[0]->get_text());
- else
+ String text = value_editor[0]->get_text();
+ Ref<Expression> expr;
+ expr.instance();
+ Error err = expr->parse(text);
+ if (err != OK) {
v = value_editor[0]->get_text().to_int();
+ return;
+ } else {
+ v = expr->execute(Array(), NULL, false);
+ }
emit_signal("variant_changed");
} break;
case Variant::REAL: {
if (hint != PROPERTY_HINT_EXP_EASING) {
- if (evaluator)
- v = evaluator->eval(value_editor[0]->get_text());
- else
- v = value_editor[0]->get_text().to_double();
+ String text = value_editor[0]->get_text();
+ v = _parse_real_expression(text);
emit_signal("variant_changed");
}
@@ -1558,13 +1562,8 @@ void CustomPropertyEditor::_modified(String p_string) {
case Variant::VECTOR2: {
Vector2 vec;
- if (evaluator) {
- vec.x = evaluator->eval(value_editor[0]->get_text());
- vec.y = evaluator->eval(value_editor[1]->get_text());
- } else {
- vec.x = value_editor[0]->get_text().to_double();
- vec.y = value_editor[1]->get_text().to_double();
- }
+ vec.x = _parse_real_expression(value_editor[0]->get_text());
+ vec.y = _parse_real_expression(value_editor[1]->get_text());
v = vec;
_emit_changed_whole_or_field();
@@ -1572,17 +1571,11 @@ void CustomPropertyEditor::_modified(String p_string) {
case Variant::RECT2: {
Rect2 r2;
- if (evaluator) {
- r2.position.x = evaluator->eval(value_editor[0]->get_text());
- r2.position.y = evaluator->eval(value_editor[1]->get_text());
- r2.size.x = evaluator->eval(value_editor[2]->get_text());
- r2.size.y = evaluator->eval(value_editor[3]->get_text());
- } else {
- r2.position.x = value_editor[0]->get_text().to_double();
- r2.position.y = value_editor[1]->get_text().to_double();
- r2.size.x = value_editor[2]->get_text().to_double();
- r2.size.y = value_editor[3]->get_text().to_double();
- }
+
+ r2.position.x = _parse_real_expression(value_editor[0]->get_text());
+ r2.position.y = _parse_real_expression(value_editor[1]->get_text());
+ r2.size.x = _parse_real_expression(value_editor[2]->get_text());
+ r2.size.y = _parse_real_expression(value_editor[3]->get_text());
v = r2;
_emit_changed_whole_or_field();
@@ -1591,15 +1584,9 @@ void CustomPropertyEditor::_modified(String p_string) {
case Variant::VECTOR3: {
Vector3 vec;
- if (evaluator) {
- vec.x = evaluator->eval(value_editor[0]->get_text());
- vec.y = evaluator->eval(value_editor[1]->get_text());
- vec.z = evaluator->eval(value_editor[2]->get_text());
- } else {
- vec.x = value_editor[0]->get_text().to_double();
- vec.y = value_editor[1]->get_text().to_double();
- vec.z = value_editor[2]->get_text().to_double();
- }
+ vec.x = _parse_real_expression(value_editor[0]->get_text());
+ vec.y = _parse_real_expression(value_editor[1]->get_text());
+ vec.z = _parse_real_expression(value_editor[2]->get_text());
v = vec;
_emit_changed_whole_or_field();
@@ -1607,17 +1594,10 @@ void CustomPropertyEditor::_modified(String p_string) {
case Variant::PLANE: {
Plane pl;
- if (evaluator) {
- pl.normal.x = evaluator->eval(value_editor[0]->get_text());
- pl.normal.y = evaluator->eval(value_editor[1]->get_text());
- pl.normal.z = evaluator->eval(value_editor[2]->get_text());
- pl.d = evaluator->eval(value_editor[3]->get_text());
- } else {
- pl.normal.x = value_editor[0]->get_text().to_double();
- pl.normal.y = value_editor[1]->get_text().to_double();
- pl.normal.z = value_editor[2]->get_text().to_double();
- pl.d = value_editor[3]->get_text().to_double();
- }
+ pl.normal.x = _parse_real_expression(value_editor[0]->get_text());
+ pl.normal.y = _parse_real_expression(value_editor[1]->get_text());
+ pl.normal.z = _parse_real_expression(value_editor[2]->get_text());
+ pl.d = _parse_real_expression(value_editor[3]->get_text());
v = pl;
_emit_changed_whole_or_field();
@@ -1625,17 +1605,10 @@ void CustomPropertyEditor::_modified(String p_string) {
case Variant::QUAT: {
Quat q;
- if (evaluator) {
- q.x = evaluator->eval(value_editor[0]->get_text());
- q.y = evaluator->eval(value_editor[1]->get_text());
- q.z = evaluator->eval(value_editor[2]->get_text());
- q.w = evaluator->eval(value_editor[3]->get_text());
- } else {
- q.x = value_editor[0]->get_text().to_double();
- q.y = value_editor[1]->get_text().to_double();
- q.z = value_editor[2]->get_text().to_double();
- q.w = value_editor[3]->get_text().to_double();
- }
+ q.x = _parse_real_expression(value_editor[0]->get_text());
+ q.y = _parse_real_expression(value_editor[1]->get_text());
+ q.z = _parse_real_expression(value_editor[2]->get_text());
+ q.w = _parse_real_expression(value_editor[3]->get_text());
v = q;
_emit_changed_whole_or_field();
@@ -1645,21 +1618,12 @@ void CustomPropertyEditor::_modified(String p_string) {
Vector3 pos;
Vector3 size;
- if (evaluator) {
- pos.x = evaluator->eval(value_editor[0]->get_text());
- pos.y = evaluator->eval(value_editor[1]->get_text());
- pos.z = evaluator->eval(value_editor[2]->get_text());
- size.x = evaluator->eval(value_editor[3]->get_text());
- size.y = evaluator->eval(value_editor[4]->get_text());
- size.z = evaluator->eval(value_editor[5]->get_text());
- } else {
- pos.x = value_editor[0]->get_text().to_double();
- pos.y = value_editor[1]->get_text().to_double();
- pos.z = value_editor[2]->get_text().to_double();
- size.x = value_editor[3]->get_text().to_double();
- size.y = value_editor[4]->get_text().to_double();
- size.z = value_editor[5]->get_text().to_double();
- }
+ pos.x = _parse_real_expression(value_editor[0]->get_text());
+ pos.y = _parse_real_expression(value_editor[1]->get_text());
+ pos.z = _parse_real_expression(value_editor[2]->get_text());
+ size.x = _parse_real_expression(value_editor[3]->get_text());
+ size.y = _parse_real_expression(value_editor[4]->get_text());
+ size.z = _parse_real_expression(value_editor[5]->get_text());
v = AABB(pos, size);
_emit_changed_whole_or_field();
@@ -1668,11 +1632,7 @@ void CustomPropertyEditor::_modified(String p_string) {
Transform2D m;
for (int i = 0; i < 6; i++) {
- if (evaluator) {
- m.elements[i / 2][i % 2] = evaluator->eval(value_editor[i]->get_text());
- } else {
- m.elements[i / 2][i % 2] = value_editor[i]->get_text().to_double();
- }
+ m.elements[i / 2][i % 2] = _parse_real_expression(value_editor[i]->get_text());
}
v = m;
@@ -1683,12 +1643,7 @@ void CustomPropertyEditor::_modified(String p_string) {
Basis m;
for (int i = 0; i < 9; i++) {
-
- if (evaluator) {
- m.elements[i / 3][i % 3] = evaluator->eval(value_editor[i]->get_text());
- } else {
- m.elements[i / 3][i % 3] = value_editor[i]->get_text().to_double();
- }
+ m.elements[i / 3][i % 3] = _parse_real_expression(value_editor[i]->get_text());
}
v = m;
@@ -1699,25 +1654,14 @@ void CustomPropertyEditor::_modified(String p_string) {
Basis basis;
for (int i = 0; i < 9; i++) {
-
- if (evaluator) {
- basis.elements[i / 3][i % 3] = evaluator->eval(value_editor[(i / 3) * 4 + i % 3]->get_text());
- } else {
- basis.elements[i / 3][i % 3] = value_editor[(i / 3) * 4 + i % 3]->get_text().to_double();
- }
+ basis.elements[i / 3][i % 3] = _parse_real_expression(value_editor[(i / 3) * 4 + i % 3]->get_text());
}
Vector3 origin;
- if (evaluator) {
- origin.x = evaluator->eval(value_editor[3]->get_text());
- origin.y = evaluator->eval(value_editor[7]->get_text());
- origin.z = evaluator->eval(value_editor[11]->get_text());
- } else {
- origin.x = value_editor[3]->get_text().to_double();
- origin.y = value_editor[7]->get_text().to_double();
- origin.z = value_editor[11]->get_text().to_double();
- }
+ origin.x = _parse_real_expression(value_editor[3]->get_text());
+ origin.y = _parse_real_expression(value_editor[7]->get_text());
+ origin.z = _parse_real_expression(value_editor[11]->get_text());
v = Transform(basis, origin);
_emit_changed_whole_or_field();
@@ -1759,6 +1703,19 @@ void CustomPropertyEditor::_modified(String p_string) {
updating = false;
}
+real_t CustomPropertyEditor::_parse_real_expression(String text) {
+ Ref<Expression> expr;
+ expr.instance();
+ Error err = expr->parse(text);
+ real_t out;
+ if (err != OK) {
+ out = value_editor[0]->get_text().to_double();
+ } else {
+ out = expr->execute(Array(), NULL, false);
+ }
+ return out;
+}
+
void CustomPropertyEditor::_emit_changed_whole_or_field() {
if (!Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
diff --git a/editor/property_editor.h b/editor/property_editor.h
index 7d7ab912ea..ee3a56d857 100644
--- a/editor/property_editor.h
+++ b/editor/property_editor.h
@@ -135,6 +135,9 @@ class CustomPropertyEditor : public Popup {
void _text_edit_changed();
void _file_selected(String p_file);
void _modified(String p_string);
+
+ real_t _parse_real_expression(String text);
+
void _range_modified(double p_value);
void _focus_enter();
void _focus_exit();
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index c9eba33f35..9042bdc7c1 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -31,6 +31,7 @@
#include "property_selector.h"
#include "core/os/keyboard.h"
+#include "editor/editor_node.h"
#include "editor_scale.h"
void PropertySelector::_text_changed(const String &p_newtext) {
@@ -161,10 +162,8 @@ void PropertySelector::_update_search() {
Ref<Texture> icon;
if (E->get().name == "Script Variables") {
icon = get_icon("Script", "EditorIcons");
- } else if (has_icon(E->get().name, "EditorIcons")) {
- icon = get_icon(E->get().name, "EditorIcons");
} else {
- icon = get_icon("Object", "EditorIcons");
+ icon = EditorNode::get_singleton()->get_class_icon(E->get().name);
}
category->set_icon(0, icon);
continue;
@@ -241,10 +240,8 @@ void PropertySelector::_update_search() {
if (E->get().name == "*Script Methods") {
icon = get_icon("Script", "EditorIcons");
script_methods = true;
- } else if (has_icon(rep, "EditorIcons")) {
- icon = get_icon(rep, "EditorIcons");
} else {
- icon = get_icon("Object", "EditorIcons");
+ icon = EditorNode::get_singleton()->get_class_icon(rep);
}
category->set_icon(0, icon);
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 9461f39aeb..af6b998b28 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -399,11 +399,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
const RefPtr empty;
editor_data->get_undo_redo().add_do_method(E->get(), "set_script", empty);
editor_data->get_undo_redo().add_undo_method(E->get(), "set_script", existing);
-
- if (E->get()->has_meta("_editor_icon")) {
- editor_data->get_undo_redo().add_do_method(E->get(), "set_meta", "_editor_icon", get_icon(E->get()->get_class(), "EditorIcons"));
- editor_data->get_undo_redo().add_undo_method(E->get(), "set_meta", "_editor_icon", E->get()->get_meta("_editor_icon"));
- }
}
}
@@ -1501,19 +1496,6 @@ void SceneTreeDock::_script_created(Ref<Script> p_script) {
Ref<Script> existing = E->get()->get_script();
editor_data->get_undo_redo().add_do_method(E->get(), "set_script", p_script.get_ref_ptr());
editor_data->get_undo_redo().add_undo_method(E->get(), "set_script", existing);
-
- String icon_path;
- String name = p_script->get_language()->get_global_class_name(p_script->get_path(), NULL, &icon_path);
- if (ScriptServer::is_global_class(name)) {
- RES icon = ResourceLoader::load(icon_path);
- editor_data->get_undo_redo().add_do_method(E->get(), "set_meta", "_editor_icon", icon);
- String existing_name = existing.is_valid() ? existing->get_language()->get_global_class_name(existing->get_path()) : String();
- if (existing.is_null() || !ScriptServer::is_global_class(existing_name)) {
- editor_data->get_undo_redo().add_undo_method(E->get(), "set_meta", "_editor_icon", get_icon(E->get()->get_class(), "EditorIcons"));
- } else {
- editor_data->get_undo_redo().add_undo_method(E->get(), "set_meta", "_editor_icon", editor_data->script_class_get_icon_path(existing_name));
- }
- }
}
editor_data->get_undo_redo().commit_action();
@@ -2029,12 +2011,7 @@ void SceneTreeDock::_add_children_to_popup(Object *p_obj, int p_depth) {
if (!obj)
continue;
- Ref<Texture> icon;
-
- if (has_icon(obj->get_class(), "EditorIcons"))
- icon = get_icon(obj->get_class(), "EditorIcons");
- else
- icon = get_icon("Object", "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(obj);
if (menu->get_item_count() == 0) {
menu->add_submenu_item(TTR("Sub-Resources"), "Sub-Resources");
@@ -2264,7 +2241,7 @@ void SceneTreeDock::_update_create_root_dialog() {
String name = l.get_slicec(' ', 0);
if (ScriptServer::is_global_class(name))
name = ScriptServer::get_global_class_base(name);
- button->set_icon(get_icon(name, "EditorIcons"));
+ button->set_icon(EditorNode::get_singleton()->get_class_icon(name));
button->connect("pressed", this, "_favorite_root_selected", make_binds(l));
}
}
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index a45773003a..07670bb420 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -186,11 +186,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
item->set_collapsed(true);
}
- Ref<Texture> icon;
- if (p_node->has_meta("_editor_icon"))
- icon = p_node->get_meta("_editor_icon");
- else
- icon = get_icon((has_icon(p_node->get_class(), "EditorIcons") ? p_node->get_class() : String("Object")), "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(p_node, "Node");
item->set_icon(0, icon);
item->set_metadata(0, p_node->get_path());
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index b451092709..a28a111025 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -428,8 +428,9 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
ObjectID id = ObjectID(p_data[i + 3]);
it->set_text(0, p_data[i + 1]);
- if (has_icon(p_data[i + 2], "EditorIcons"))
- it->set_icon(0, get_icon(p_data[i + 2], "EditorIcons"));
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(p_data[i + 2], "");
+ if (icon.is_valid())
+ it->set_icon(0, icon);
it->set_metadata(0, id);
if (id == inspected_object_id) {
diff --git a/main/main.cpp b/main/main.cpp
index 34aca032da..90d4db2948 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1096,30 +1096,24 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
ERR_PRINTS("Non-existing or invalid boot splash at: " + boot_logo_path + ". Loading default splash.");
}
+ Color boot_bg_color = GLOBAL_DEF("application/boot_splash/bg_color", boot_splash_bg_color);
if (boot_logo.is_valid()) {
OS::get_singleton()->_msec_splash = OS::get_singleton()->get_ticks_msec();
- Color boot_bg = GLOBAL_DEF("application/boot_splash/bg_color", clear);
- VisualServer::get_singleton()->set_boot_image(boot_logo, boot_bg, boot_logo_scale);
-#ifndef TOOLS_ENABLED
-//no tools, so free the boot logo (no longer needed)
-//ProjectSettings::get_singleton()->set("application/boot_logo",Image());
-#endif
+ VisualServer::get_singleton()->set_boot_image(boot_logo, boot_bg_color, boot_logo_scale);
} else {
#ifndef NO_DEFAULT_BOOT_LOGO
-
MAIN_PRINT("Main: Create bootsplash");
#if defined(TOOLS_ENABLED) && !defined(NO_EDITOR_SPLASH)
-
Ref<Image> splash = (editor || project_manager) ? memnew(Image(boot_splash_editor_png)) : memnew(Image(boot_splash_png));
#else
Ref<Image> splash = memnew(Image(boot_splash_png));
#endif
MAIN_PRINT("Main: ClearColor");
- VisualServer::get_singleton()->set_default_clear_color(boot_splash_bg_color);
+ VisualServer::get_singleton()->set_default_clear_color(boot_bg_color);
MAIN_PRINT("Main: Image");
- VisualServer::get_singleton()->set_boot_image(splash, boot_splash_bg_color, false);
+ VisualServer::get_singleton()->set_boot_image(splash, boot_bg_color, false);
#endif
}
diff --git a/methods.py b/methods.py
index 1bc10954ba..00c477635e 100644
--- a/methods.py
+++ b/methods.py
@@ -578,6 +578,9 @@ def generate_vs_project(env, num_jobs):
release_targets = ['bin\\godot.windows.opt.32.exe'] + ['bin\\godot.windows.opt.64.exe']
release_debug_targets = ['bin\\godot.windows.opt.tools.32.exe'] + ['bin\\godot.windows.opt.tools.64.exe']
targets = debug_targets + release_targets + release_debug_targets
+ if not env.get('MSVS'):
+ env['MSVS']['PROJECTSUFFIX'] = '.vcxproj'
+ env['MSVS']['SOLUTIONSUFFIX'] = '.sln'
env.MSVSProject(
target=['#godot' + env['MSVSPROJECTSUFFIX']],
incs=env.vs_incs,
diff --git a/modules/gdnative/gdnative/variant.cpp b/modules/gdnative/gdnative/variant.cpp
index 423f3312e1..fd6babfc3a 100644
--- a/modules/gdnative/gdnative/variant.cpp
+++ b/modules/gdnative/gdnative/variant.cpp
@@ -489,6 +489,24 @@ void GDAPI godot_variant_destroy(godot_variant *p_self) {
self->~Variant();
}
+// GDNative core 1.1
+
+godot_string GDAPI godot_variant_get_operator_name(godot_variant_operator p_op) {
+ Variant::Operator op = (Variant::Operator)p_op;
+ godot_string raw_dest;
+ String *dest = (String *)&raw_dest;
+ memnew_placement(dest, String(Variant::get_operator_name(op))); // operator = is overloaded by String
+ return raw_dest;
+}
+
+void GDAPI godot_variant_evaluate(godot_variant_operator p_op, const godot_variant *p_a, const godot_variant *p_b, godot_variant *r_ret, godot_bool *r_valid) {
+ Variant::Operator op = (Variant::Operator)p_op;
+ const Variant *a = (const Variant *)p_a;
+ const Variant *b = (const Variant *)p_b;
+ Variant *ret = (Variant *)r_ret;
+ Variant::evaluate(op, a, b, *ret, *r_valid);
+}
+
#ifdef __cplusplus
}
#endif
diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json
index dce3d7e96b..16a34a9a33 100644
--- a/modules/gdnative/gdnative_api.json
+++ b/modules/gdnative/gdnative_api.json
@@ -94,6 +94,24 @@
["godot_transform *", "r_dest"],
["const godot_quat *", "p_quat"]
]
+ },
+ {
+ "name": "godot_variant_get_operator_name",
+ "return_type": "godot_string",
+ "arguments": [
+ ["godot_variant_operator", "p_op"]
+ ]
+ },
+ {
+ "name": "godot_variant_evaluate",
+ "return_type": "void",
+ "arguments": [
+ ["godot_variant_operator", "p_op"],
+ ["const godot_variant *", "p_a"],
+ ["const godot_variant *", "p_b"],
+ ["godot_variant *", "r_ret"],
+ ["godot_bool *", "r_valid"]
+ ]
}
]
},
diff --git a/modules/gdnative/include/gdnative/variant.h b/modules/gdnative/include/gdnative/variant.h
index 6779dc4092..5e71aa9f11 100644
--- a/modules/gdnative/include/gdnative/variant.h
+++ b/modules/gdnative/include/gdnative/variant.h
@@ -100,6 +100,45 @@ typedef struct godot_variant_call_error {
godot_variant_type expected;
} godot_variant_call_error;
+typedef enum godot_variant_operator {
+ // comparison
+ GODOT_VARIANT_OP_EQUAL,
+ GODOT_VARIANT_OP_NOT_EQUAL,
+ GODOT_VARIANT_OP_LESS,
+ GODOT_VARIANT_OP_LESS_EQUAL,
+ GODOT_VARIANT_OP_GREATER,
+ GODOT_VARIANT_OP_GREATER_EQUAL,
+
+ // mathematic
+ GODOT_VARIANT_OP_ADD,
+ GODOT_VARIANT_OP_SUBTRACT,
+ GODOT_VARIANT_OP_MULTIPLY,
+ GODOT_VARIANT_OP_DIVIDE,
+ GODOT_VARIANT_OP_NEGATE,
+ GODOT_VARIANT_OP_POSITIVE,
+ GODOT_VARIANT_OP_MODULE,
+ GODOT_VARIANT_OP_STRING_CONCAT,
+
+ // bitwise
+ GODOT_VARIANT_OP_SHIFT_LEFT,
+ GODOT_VARIANT_OP_SHIFT_RIGHT,
+ GODOT_VARIANT_OP_BIT_AND,
+ GODOT_VARIANT_OP_BIT_OR,
+ GODOT_VARIANT_OP_BIT_XOR,
+ GODOT_VARIANT_OP_BIT_NEGATE,
+
+ // logic
+ GODOT_VARIANT_OP_AND,
+ GODOT_VARIANT_OP_OR,
+ GODOT_VARIANT_OP_XOR,
+ GODOT_VARIANT_OP_NOT,
+
+ // containment
+ GODOT_VARIANT_OP_IN,
+
+ GODOT_VARIANT_OP_MAX,
+} godot_variant_operator;
+
// reduce extern "C" nesting for VS2013
#ifdef __cplusplus
}
@@ -204,6 +243,11 @@ godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self);
void GDAPI godot_variant_destroy(godot_variant *p_self);
+// GDNative core 1.1
+
+godot_string GDAPI godot_variant_get_operator_name(godot_variant_operator p_op);
+void GDAPI godot_variant_evaluate(godot_variant_operator p_op, const godot_variant *p_a, const godot_variant *p_b, godot_variant *r_ret, godot_bool *r_valid);
+
#ifdef __cplusplus
}
#endif
diff --git a/modules/gdnative/include/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h
index d6a729be47..ba044117e2 100644
--- a/modules/gdnative/include/nativescript/godot_nativescript.h
+++ b/modules/gdnative/include/nativescript/godot_nativescript.h
@@ -40,12 +40,13 @@ extern "C" {
typedef enum {
GODOT_METHOD_RPC_MODE_DISABLED,
GODOT_METHOD_RPC_MODE_REMOTE,
- GODOT_METHOD_RPC_MODE_SYNC,
GODOT_METHOD_RPC_MODE_MASTER,
- GODOT_METHOD_RPC_MODE_SLAVE,
+ GODOT_METHOD_RPC_MODE_PUPPET,
+ GODOT_METHOD_RPC_MODE_SLAVE = GODOT_METHOD_RPC_MODE_PUPPET,
GODOT_METHOD_RPC_MODE_REMOTESYNC,
+ GODOT_METHOD_RPC_MODE_SYNC = GODOT_METHOD_RPC_MODE_REMOTESYNC,
GODOT_METHOD_RPC_MODE_MASTERSYNC,
- GODOT_METHOD_RPC_MODE_SLAVESYNC,
+ GODOT_METHOD_RPC_MODE_PUPPETSYNC,
} godot_method_rpc_mode;
typedef enum {
diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp
index ea968fb0b1..641e4021d8 100644
--- a/modules/gdnative/nativescript/nativescript.cpp
+++ b/modules/gdnative/nativescript/nativescript.cpp
@@ -810,18 +810,16 @@ MultiplayerAPI::RPCMode NativeScriptInstance::get_rpc_mode(const StringName &p_m
return MultiplayerAPI::RPC_MODE_DISABLED;
case GODOT_METHOD_RPC_MODE_REMOTE:
return MultiplayerAPI::RPC_MODE_REMOTE;
- case GODOT_METHOD_RPC_MODE_SYNC:
- return MultiplayerAPI::RPC_MODE_SYNC;
case GODOT_METHOD_RPC_MODE_MASTER:
return MultiplayerAPI::RPC_MODE_MASTER;
- case GODOT_METHOD_RPC_MODE_SLAVE:
- return MultiplayerAPI::RPC_MODE_SLAVE;
+ case GODOT_METHOD_RPC_MODE_PUPPET:
+ return MultiplayerAPI::RPC_MODE_PUPPET;
case GODOT_METHOD_RPC_MODE_REMOTESYNC:
return MultiplayerAPI::RPC_MODE_REMOTESYNC;
case GODOT_METHOD_RPC_MODE_MASTERSYNC:
return MultiplayerAPI::RPC_MODE_MASTERSYNC;
- case GODOT_METHOD_RPC_MODE_SLAVESYNC:
- return MultiplayerAPI::RPC_MODE_SLAVESYNC;
+ case GODOT_METHOD_RPC_MODE_PUPPETSYNC:
+ return MultiplayerAPI::RPC_MODE_PUPPETSYNC;
default:
return MultiplayerAPI::RPC_MODE_DISABLED;
}
@@ -846,12 +844,16 @@ MultiplayerAPI::RPCMode NativeScriptInstance::get_rset_mode(const StringName &p_
return MultiplayerAPI::RPC_MODE_DISABLED;
case GODOT_METHOD_RPC_MODE_REMOTE:
return MultiplayerAPI::RPC_MODE_REMOTE;
- case GODOT_METHOD_RPC_MODE_SYNC:
- return MultiplayerAPI::RPC_MODE_SYNC;
case GODOT_METHOD_RPC_MODE_MASTER:
return MultiplayerAPI::RPC_MODE_MASTER;
- case GODOT_METHOD_RPC_MODE_SLAVE:
- return MultiplayerAPI::RPC_MODE_SLAVE;
+ case GODOT_METHOD_RPC_MODE_PUPPET:
+ return MultiplayerAPI::RPC_MODE_PUPPET;
+ case GODOT_METHOD_RPC_MODE_REMOTESYNC:
+ return MultiplayerAPI::RPC_MODE_REMOTESYNC;
+ case GODOT_METHOD_RPC_MODE_MASTERSYNC:
+ return MultiplayerAPI::RPC_MODE_MASTERSYNC;
+ case GODOT_METHOD_RPC_MODE_PUPPETSYNC:
+ return MultiplayerAPI::RPC_MODE_PUPPETSYNC;
default:
return MultiplayerAPI::RPC_MODE_DISABLED;
}
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 4d5d8cedde..d12c1f555c 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -1779,10 +1779,11 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const {
"remote",
"sync",
"master",
+ "puppet",
"slave",
"remotesync",
"mastersync",
- "slavesync",
+ "puppetsync",
0
};
@@ -1979,6 +1980,10 @@ String GDScriptWarning::get_message() const {
CHECK_SYMBOLS(4);
return "The argument '" + symbols[0] + "' of the function '" + symbols[1] + "' requires a the subtype '" + symbols[2] + "' but the supertype '" + symbols[3] + "' was provided";
} break;
+ case DEPRECATED_KEYWORD: {
+ CHECK_SYMBOLS(2);
+ return "The '" + symbols[0] + "' keyword is deprecated and will be removed in a future release, please replace its uses by '" + symbols[1] + "'.";
+ } break;
}
ERR_EXPLAIN("Invalid GDScript warning code: " + get_name_from_code(code));
ERR_FAIL_V(String());
@@ -2018,6 +2023,7 @@ String GDScriptWarning::get_name_from_code(Code p_code) {
"UNSAFE_METHOD_ACCESS",
"UNSAFE_CAST",
"UNSAFE_CALL_ARGUMENT",
+ "DEPRECATED_KEYWORD",
NULL
};
diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h
index 739d18569f..d795500265 100644
--- a/modules/gdscript/gdscript.h
+++ b/modules/gdscript/gdscript.h
@@ -289,6 +289,7 @@ struct GDScriptWarning {
UNSAFE_METHOD_ACCESS, // Function not found in the detected type (but can be in subtypes)
UNSAFE_CAST, // Cast used in an unknown type
UNSAFE_CALL_ARGUMENT, // Function call argument is of a supertype of the require argument
+ DEPRECATED_KEYWORD, // The keyword is deprecated and should be replaced
WARNING_MAX,
} code;
Vector<String> symbols;
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index affb73a048..32a7668760 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -2109,8 +2109,8 @@ static void _find_identifiers(const GDScriptCompletionContext &p_context, bool p
"and", "in", "not", "or", "false", "PI", "TAU", "INF", "NAN", "self", "true", "as", "assert",
"breakpoint", "class", "extends", "is", "func", "preload", "setget", "signal", "tool", "yield",
"const", "enum", "export", "onready", "static", "var", "break", "continue", "if", "elif",
- "else", "for", "pass", "return", "match", "while", "remote", "sync", "master", "slave",
- "remotesync", "mastersync", "slavesync",
+ "else", "for", "pass", "return", "match", "while", "remote", "sync", "master", "puppet", "slave",
+ "remotesync", "mastersync", "puppetsync",
0
};
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 7243690f94..89e102a858 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -4382,10 +4382,10 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
tokenizer->advance();
}
- if (tokenizer->get_token() != GDScriptTokenizer::TK_PR_VAR && tokenizer->get_token() != GDScriptTokenizer::TK_PR_ONREADY && tokenizer->get_token() != GDScriptTokenizer::TK_PR_REMOTE && tokenizer->get_token() != GDScriptTokenizer::TK_PR_MASTER && tokenizer->get_token() != GDScriptTokenizer::TK_PR_SLAVE && tokenizer->get_token() != GDScriptTokenizer::TK_PR_SYNC && tokenizer->get_token() != GDScriptTokenizer::TK_PR_REMOTESYNC && tokenizer->get_token() != GDScriptTokenizer::TK_PR_MASTERSYNC && tokenizer->get_token() != GDScriptTokenizer::TK_PR_SLAVESYNC) {
+ if (tokenizer->get_token() != GDScriptTokenizer::TK_PR_VAR && tokenizer->get_token() != GDScriptTokenizer::TK_PR_ONREADY && tokenizer->get_token() != GDScriptTokenizer::TK_PR_REMOTE && tokenizer->get_token() != GDScriptTokenizer::TK_PR_MASTER && tokenizer->get_token() != GDScriptTokenizer::TK_PR_PUPPET && tokenizer->get_token() != GDScriptTokenizer::TK_PR_SYNC && tokenizer->get_token() != GDScriptTokenizer::TK_PR_REMOTESYNC && tokenizer->get_token() != GDScriptTokenizer::TK_PR_MASTERSYNC && tokenizer->get_token() != GDScriptTokenizer::TK_PR_PUPPETSYNC && tokenizer->get_token() != GDScriptTokenizer::TK_PR_SLAVE) {
current_export = PropertyInfo();
- _set_error("Expected 'var', 'onready', 'remote', 'master', 'slave', 'sync', 'remotesync', 'mastersync', 'slavesync'.");
+ _set_error("Expected 'var', 'onready', 'remote', 'master', 'puppet', 'sync', 'remotesync', 'mastersync', 'puppetsync'.");
return;
}
@@ -4442,7 +4442,9 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
rpc_mode = MultiplayerAPI::RPC_MODE_MASTER;
continue;
} break;
- case GDScriptTokenizer::TK_PR_SLAVE: {
+ case GDScriptTokenizer::TK_PR_SLAVE:
+ _add_warning(GDScriptWarning::DEPRECATED_KEYWORD, tokenizer->get_token_line(), "slave", "puppet");
+ case GDScriptTokenizer::TK_PR_PUPPET: {
//may be fallthrough from export, ignore if so
tokenizer->advance();
@@ -4459,7 +4461,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
}
}
- rpc_mode = MultiplayerAPI::RPC_MODE_SLAVE;
+ rpc_mode = MultiplayerAPI::RPC_MODE_PUPPET;
continue;
} break;
case GDScriptTokenizer::TK_PR_REMOTESYNC:
@@ -4475,7 +4477,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
return;
}
- rpc_mode = MultiplayerAPI::RPC_MODE_SYNC;
+ rpc_mode = MultiplayerAPI::RPC_MODE_REMOTESYNC;
continue;
} break;
case GDScriptTokenizer::TK_PR_MASTERSYNC: {
@@ -4493,7 +4495,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
rpc_mode = MultiplayerAPI::RPC_MODE_MASTERSYNC;
continue;
} break;
- case GDScriptTokenizer::TK_PR_SLAVESYNC: {
+ case GDScriptTokenizer::TK_PR_PUPPETSYNC: {
//may be fallthrough from export, ignore if so
tokenizer->advance();
@@ -4505,7 +4507,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
return;
}
- rpc_mode = MultiplayerAPI::RPC_MODE_SLAVESYNC;
+ rpc_mode = MultiplayerAPI::RPC_MODE_PUPPETSYNC;
continue;
} break;
case GDScriptTokenizer::TK_PR_VAR: {
diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp
index 941f5dbecc..77e1b7290e 100644
--- a/modules/gdscript/gdscript_tokenizer.cpp
+++ b/modules/gdscript/gdscript_tokenizer.cpp
@@ -112,10 +112,11 @@ const char *GDScriptTokenizer::token_names[TK_MAX] = {
"rpc",
"sync",
"master",
+ "puppet",
"slave",
"remotesync",
"mastersync",
- "slavesync",
+ "puppetsync",
"'['",
"']'",
"'{'",
@@ -210,10 +211,11 @@ static const _kws _keyword_list[] = {
{ GDScriptTokenizer::TK_PR_REMOTE, "remote" },
{ GDScriptTokenizer::TK_PR_MASTER, "master" },
{ GDScriptTokenizer::TK_PR_SLAVE, "slave" },
+ { GDScriptTokenizer::TK_PR_PUPPET, "puppet" },
{ GDScriptTokenizer::TK_PR_SYNC, "sync" },
{ GDScriptTokenizer::TK_PR_REMOTESYNC, "remotesync" },
{ GDScriptTokenizer::TK_PR_MASTERSYNC, "mastersync" },
- { GDScriptTokenizer::TK_PR_SLAVESYNC, "slavesync" },
+ { GDScriptTokenizer::TK_PR_PUPPETSYNC, "puppetsync" },
{ GDScriptTokenizer::TK_PR_CONST, "const" },
{ GDScriptTokenizer::TK_PR_ENUM, "enum" },
//controlflow
@@ -258,11 +260,11 @@ bool GDScriptTokenizer::is_token_literal(int p_offset, bool variable_safe) const
case TK_PR_SIGNAL:
case TK_PR_REMOTE:
case TK_PR_MASTER:
- case TK_PR_SLAVE:
+ case TK_PR_PUPPET:
case TK_PR_SYNC:
case TK_PR_REMOTESYNC:
case TK_PR_MASTERSYNC:
- case TK_PR_SLAVESYNC:
+ case TK_PR_PUPPETSYNC:
return true;
// Literal for non-variables only:
diff --git a/modules/gdscript/gdscript_tokenizer.h b/modules/gdscript/gdscript_tokenizer.h
index 01b1ac5bf2..cc894fb101 100644
--- a/modules/gdscript/gdscript_tokenizer.h
+++ b/modules/gdscript/gdscript_tokenizer.h
@@ -119,9 +119,10 @@ public:
TK_PR_SYNC,
TK_PR_MASTER,
TK_PR_SLAVE,
+ TK_PR_PUPPET,
TK_PR_REMOTESYNC,
TK_PR_MASTERSYNC,
- TK_PR_SLAVESYNC,
+ TK_PR_PUPPETSYNC,
TK_BRACKET_OPEN,
TK_BRACKET_CLOSE,
TK_CURLY_BRACKET_OPEN,
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index b9209fce92..c013c232d4 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -1541,18 +1541,20 @@ MultiplayerAPI::RPCMode CSharpInstance::_member_get_rpc_mode(GDMonoClassMember *
if (p_member->has_attribute(CACHED_CLASS(RemoteAttribute)))
return MultiplayerAPI::RPC_MODE_REMOTE;
- if (p_member->has_attribute(CACHED_CLASS(SyncAttribute)))
- return MultiplayerAPI::RPC_MODE_SYNC;
if (p_member->has_attribute(CACHED_CLASS(MasterAttribute)))
return MultiplayerAPI::RPC_MODE_MASTER;
+ if (p_member->has_attribute(CACHED_CLASS(PuppetAttribute)))
+ return MultiplayerAPI::RPC_MODE_PUPPET;
if (p_member->has_attribute(CACHED_CLASS(SlaveAttribute)))
- return MultiplayerAPI::RPC_MODE_SLAVE;
+ return MultiplayerAPI::RPC_MODE_PUPPET;
if (p_member->has_attribute(CACHED_CLASS(RemoteSyncAttribute)))
return MultiplayerAPI::RPC_MODE_REMOTESYNC;
+ if (p_member->has_attribute(CACHED_CLASS(SyncAttribute)))
+ return MultiplayerAPI::RPC_MODE_REMOTESYNC;
if (p_member->has_attribute(CACHED_CLASS(MasterSyncAttribute)))
return MultiplayerAPI::RPC_MODE_MASTERSYNC;
- if (p_member->has_attribute(CACHED_CLASS(SlaveSyncAttribute)))
- return MultiplayerAPI::RPC_MODE_SLAVESYNC;
+ if (p_member->has_attribute(CACHED_CLASS(PuppetSyncAttribute)))
+ return MultiplayerAPI::RPC_MODE_PUPPETSYNC;
return MultiplayerAPI::RPC_MODE_DISABLED;
}
diff --git a/modules/mono/glue/Managed/Files/Attributes/RPCAttributes.cs b/modules/mono/glue/Managed/Files/Attributes/RPCAttributes.cs
index 6bf9560bfa..2398e10135 100644
--- a/modules/mono/glue/Managed/Files/Attributes/RPCAttributes.cs
+++ b/modules/mono/glue/Managed/Files/Attributes/RPCAttributes.cs
@@ -12,6 +12,9 @@ namespace Godot
public class MasterAttribute : Attribute {}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Field)]
+ public class PuppetAttribute : Attribute {}
+
+ [AttributeUsage(AttributeTargets.Method | AttributeTargets.Field)]
public class SlaveAttribute : Attribute {}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Field)]
@@ -21,5 +24,5 @@ namespace Godot
public class MasterSyncAttribute : Attribute {}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Field)]
- public class SlaveSyncAttribute : Attribute {}
+ public class PuppetSyncAttribute : Attribute {}
}
diff --git a/modules/mono/mono_gd/gd_mono_utils.cpp b/modules/mono/mono_gd/gd_mono_utils.cpp
index 8fbaca0992..b97a24b09c 100644
--- a/modules/mono/mono_gd/gd_mono_utils.cpp
+++ b/modules/mono/mono_gd/gd_mono_utils.cpp
@@ -126,10 +126,11 @@ void MonoCache::clear_members() {
class_RemoteAttribute = NULL;
class_SyncAttribute = NULL;
class_MasterAttribute = NULL;
+ class_PuppetAttribute = NULL;
class_SlaveAttribute = NULL;
class_RemoteSyncAttribute = NULL;
class_MasterSyncAttribute = NULL;
- class_SlaveSyncAttribute = NULL;
+ class_PuppetSyncAttribute = NULL;
class_GodotMethodAttribute = NULL;
field_GodotMethodAttribute_methodName = NULL;
@@ -225,10 +226,11 @@ void update_godot_api_cache() {
CACHE_CLASS_AND_CHECK(RemoteAttribute, GODOT_API_CLASS(RemoteAttribute));
CACHE_CLASS_AND_CHECK(SyncAttribute, GODOT_API_CLASS(SyncAttribute));
CACHE_CLASS_AND_CHECK(MasterAttribute, GODOT_API_CLASS(MasterAttribute));
+ CACHE_CLASS_AND_CHECK(PuppetAttribute, GODOT_API_CLASS(PuppetAttribute));
CACHE_CLASS_AND_CHECK(SlaveAttribute, GODOT_API_CLASS(SlaveAttribute));
CACHE_CLASS_AND_CHECK(RemoteSyncAttribute, GODOT_API_CLASS(RemoteSyncAttribute));
CACHE_CLASS_AND_CHECK(MasterSyncAttribute, GODOT_API_CLASS(MasterSyncAttribute));
- CACHE_CLASS_AND_CHECK(SlaveSyncAttribute, GODOT_API_CLASS(SlaveSyncAttribute));
+ CACHE_CLASS_AND_CHECK(PuppetSyncAttribute, GODOT_API_CLASS(PuppetSyncAttribute));
CACHE_CLASS_AND_CHECK(GodotMethodAttribute, GODOT_API_CLASS(GodotMethodAttribute));
CACHE_FIELD_AND_CHECK(GodotMethodAttribute, methodName, CACHED_CLASS(GodotMethodAttribute)->get_field("methodName"));
diff --git a/modules/mono/mono_gd/gd_mono_utils.h b/modules/mono/mono_gd/gd_mono_utils.h
index 96ff3e8116..ec3a57eb46 100644
--- a/modules/mono/mono_gd/gd_mono_utils.h
+++ b/modules/mono/mono_gd/gd_mono_utils.h
@@ -131,8 +131,9 @@ struct MonoCache {
GDMonoClass *class_SyncAttribute;
GDMonoClass *class_RemoteSyncAttribute;
GDMonoClass *class_MasterSyncAttribute;
- GDMonoClass *class_SlaveSyncAttribute;
+ GDMonoClass *class_PuppetSyncAttribute;
GDMonoClass *class_MasterAttribute;
+ GDMonoClass *class_PuppetAttribute;
GDMonoClass *class_SlaveAttribute;
GDMonoClass *class_GodotMethodAttribute;
GDMonoField *field_GodotMethodAttribute_methodName;
diff --git a/modules/opensimplex/SCsub b/modules/opensimplex/SCsub
new file mode 100644
index 0000000000..be9c8b091f
--- /dev/null
+++ b/modules/opensimplex/SCsub
@@ -0,0 +1,4 @@
+#!/usr/bin/env python
+
+Import('env')
+env.add_source_files(env.modules_sources, ["register_types.cpp", "simplex_noise.cpp", "noise_texture.cpp", "#thirdparty/misc/open-simplex-noise.c"])
diff --git a/modules/opensimplex/config.py b/modules/opensimplex/config.py
new file mode 100644
index 0000000000..c91c9e5c80
--- /dev/null
+++ b/modules/opensimplex/config.py
@@ -0,0 +1,14 @@
+def can_build(env, platform):
+ return True
+
+def configure(env):
+ pass
+
+def get_doc_classes():
+ return [
+ "NoiseTexture",
+ "SimplexNoise"
+ ]
+
+def get_doc_path():
+ return "doc_classes"
diff --git a/modules/opensimplex/doc_classes/NoiseTexture.xml b/modules/opensimplex/doc_classes/NoiseTexture.xml
new file mode 100644
index 0000000000..c7dc373f59
--- /dev/null
+++ b/modules/opensimplex/doc_classes/NoiseTexture.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="NoiseTexture" inherits="Texture" category="Core" version="3.1">
+ <brief_description>
+ [SimplexNoise] filled texture.
+ </brief_description>
+ <description>
+ Uses a [SimplexNoise] to fill the texture data. You can specify the texture size but keep in mind that larger textures will take longer to generate and seamless noise only works with square sized textures.
+ NoiseTexture can also generate normalmap textures.
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ <method name="set_height">
+ <return type="void">
+ </return>
+ <argument index="0" name="height" type="int">
+ </argument>
+ <description>
+ Set texture height.
+ </description>
+ </method>
+ <method name="set_width">
+ <return type="void">
+ </return>
+ <argument index="0" name="width" type="int">
+ </argument>
+ <description>
+ Set texture width.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="as_normalmap" type="bool" setter="set_as_normalmap" getter="is_normalmap">
+ If true, the resulting texture contains a normal map created from the original noise interpreted as a bump map.
+ </member>
+ <member name="noise" type="SimplexNoise" setter="set_noise" getter="get_noise">
+ The [SimplexNoise] instance used to generate the noise.
+ </member>
+ <member name="seamless" type="bool" setter="set_seamless" getter="get_seamless">
+ Whether the texture can be tiled without visible seams or not. Seamless textures take longer to generate.
+ </member>
+ <member name="size" type="Vector2" setter="set_size" getter="get_size">
+ Size of the generated texture.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/modules/opensimplex/doc_classes/SimplexNoise.xml b/modules/opensimplex/doc_classes/SimplexNoise.xml
new file mode 100644
index 0000000000..a5a01d88a7
--- /dev/null
+++ b/modules/opensimplex/doc_classes/SimplexNoise.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="SimplexNoise" inherits="Resource" category="Core" version="3.1">
+ <brief_description>
+ Noise generator based on Open Simplex.
+ </brief_description>
+ <description>
+ This resource allows you to configure and sample a fractal noise space.
+
+ Here is a brief usage example that configures a SimplexNoise and gets samples at various positions and dimensions:
+ [codeblock]
+ var noise = SimplexNoise.new()
+
+ # Configure
+ noise.seed = randi()
+ noise.octaves = 4
+ noise.period = 20.0
+ noise.persistance = 0.8
+
+ #Sample
+ print("Values:")
+ print(noise.get_noise_2d(1.0,1.0))
+ print(noise.get_noise_3d(0.5,3.0,15.0))
+ print(noise.get_noise_3d(0.5,1.9,4.7,0.0))
+ [/codeblock]
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ <method name="get_image">
+ <return type="Image">
+ </return>
+ <argument index="0" name="width" type="int">
+ </argument>
+ <argument index="1" name="height" type="int">
+ </argument>
+ <description>
+ Generate a noise image with the requested [code]width[/code] and [code]height[/code], based on the current noise parameters.
+ </description>
+ </method>
+ <method name="get_noise_2d">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="y" type="float">
+ </argument>
+ <description>
+ 2D noise value [-1,1] at position [code]x[/code],[code]y[/code].
+ </description>
+ </method>
+ <method name="get_noise_2dv">
+ <return type="float">
+ </return>
+ <argument index="0" name="pos" type="Vector2">
+ </argument>
+ <description>
+ 2D noise value [-1,1] at position [code]pos.x[/code],[code]pos.y[/code].
+ </description>
+ </method>
+ <method name="get_noise_3d">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="y" type="float">
+ </argument>
+ <argument index="2" name="z" type="float">
+ </argument>
+ <description>
+ 3D noise value [-1,1] at position [code]x[/code],[code]y[/code],[code]z[/code].
+ </description>
+ </method>
+ <method name="get_noise_3dv">
+ <return type="float">
+ </return>
+ <argument index="0" name="pos" type="Vector3">
+ </argument>
+ <description>
+ 3D noise value [-1,1] at position [code]pos.x[/code],[code]pos.y[/code],[code]pos.z[/code].
+ </description>
+ </method>
+ <method name="get_noise_4d">
+ <return type="float">
+ </return>
+ <argument index="0" name="x" type="float">
+ </argument>
+ <argument index="1" name="y" type="float">
+ </argument>
+ <argument index="2" name="z" type="float">
+ </argument>
+ <argument index="3" name="w" type="float">
+ </argument>
+ <description>
+ 4D noise value [-1,1] at position [code]x[/code],[code]y[/code],[code]z[/code],[code]w[/code].
+ </description>
+ </method>
+ <method name="get_seamless_image">
+ <return type="Image">
+ </return>
+ <argument index="0" name="size" type="int">
+ </argument>
+ <description>
+ Generate a tileable noise image, based on the current noise parameters.
+ Generated seamless images are always square ([code]size[/code]x[code]size[/code]).
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="lacunarity" type="float" setter="set_lacunarity" getter="get_lacunarity">
+ Difference in period between [member octaves].
+ </member>
+ <member name="octaves" type="int" setter="set_octaves" getter="get_octaves">
+ Number of Simplex Noise layers that are sampled to get the fractal noise.
+ </member>
+ <member name="period" type="float" setter="set_period" getter="get_period">
+ Period of the base octave.
+ A lower period results in a higher frequancy noise (more value changes across the same distance).
+ </member>
+ <member name="persistance" type="float" setter="set_persistance" getter="get_persistance">
+ Contribuiton factor of the different octaves.
+ A [code]persistance[/code] value of 1 means all the octaves have the same contribution, a value of 0.5 means each octave contributes half as much as the previous one.
+ </member>
+ <member name="seed" type="int" setter="set_seed" getter="get_seed">
+ Seed used to generate random values, different seeds will generate different noise maps.
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/modules/opensimplex/noise_texture.cpp b/modules/opensimplex/noise_texture.cpp
new file mode 100644
index 0000000000..b82b0b453f
--- /dev/null
+++ b/modules/opensimplex/noise_texture.cpp
@@ -0,0 +1,244 @@
+/*************************************************************************/
+/* noise_texture.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 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 "noise_texture.h"
+
+#include "core/core_string_names.h"
+
+NoiseTexture::NoiseTexture() {
+ update_queued = false;
+ noise_thread = NULL;
+ regen_queued = false;
+ first_time = true;
+
+ size = Vector2i(512, 512);
+ seamless = false;
+ as_normalmap = false;
+ flags = FLAGS_DEFAULT;
+
+ noise = Ref<SimplexNoise>();
+
+ texture = VS::get_singleton()->texture_create();
+
+ _queue_update();
+}
+
+NoiseTexture::~NoiseTexture() {
+ VS::get_singleton()->free(texture);
+}
+
+void NoiseTexture::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("set_width", "width"), &NoiseTexture::set_width);
+ ClassDB::bind_method(D_METHOD("set_height", "height"), &NoiseTexture::set_height);
+ ClassDB::bind_method(D_METHOD("set_size", "size"), &NoiseTexture::set_size);
+
+ ClassDB::bind_method(D_METHOD("set_noise", "noise"), &NoiseTexture::set_noise);
+ ClassDB::bind_method(D_METHOD("get_noise"), &NoiseTexture::get_noise);
+
+ ClassDB::bind_method(D_METHOD("set_seamless", "seamless"), &NoiseTexture::set_seamless);
+ ClassDB::bind_method(D_METHOD("get_seamless"), &NoiseTexture::get_seamless);
+
+ ClassDB::bind_method(D_METHOD("set_as_normalmap", "as_normalmap"), &NoiseTexture::set_as_normalmap);
+ ClassDB::bind_method(D_METHOD("is_normalmap"), &NoiseTexture::is_normalmap);
+
+ ClassDB::bind_method(D_METHOD("_update_texture"), &NoiseTexture::_update_texture);
+ ClassDB::bind_method(D_METHOD("_generate_texture"), &NoiseTexture::_generate_texture);
+ ClassDB::bind_method(D_METHOD("_thread_done", "image"), &NoiseTexture::_thread_done);
+
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "size"), "set_size", "get_size");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "seamless"), "set_seamless", "get_seamless");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "as_normalmap"), "set_as_normalmap", "is_normalmap");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "noise", PROPERTY_HINT_RESOURCE_TYPE, "SimplexNoise"), "set_noise", "get_noise");
+}
+
+void NoiseTexture::_set_texture_data(const Ref<Image> &p_image) {
+ data = p_image;
+ if (data.is_valid()) {
+ VS::get_singleton()->texture_allocate(texture, size.x, size.y, 0, Image::FORMAT_RGBA8, VS::TEXTURE_TYPE_2D, flags);
+ VS::get_singleton()->texture_set_data(texture, p_image);
+ }
+ emit_changed();
+}
+
+void NoiseTexture::_thread_done(const Ref<Image> &p_image) {
+
+ _set_texture_data(p_image);
+ Thread::wait_to_finish(noise_thread);
+ memdelete(noise_thread);
+ noise_thread = NULL;
+ if (regen_queued) {
+ noise_thread = Thread::create(_thread_function, this);
+ regen_queued = false;
+ }
+}
+
+void NoiseTexture::_thread_function(void *p_ud) {
+ NoiseTexture *tex = (NoiseTexture *)p_ud;
+ tex->call_deferred("_thread_done", tex->_generate_texture());
+}
+
+void NoiseTexture::_queue_update() {
+
+ if (update_queued)
+ return;
+
+ update_queued = true;
+ call_deferred("_update_texture");
+}
+
+Ref<Image> NoiseTexture::_generate_texture() {
+
+ update_queued = false;
+
+ if (noise.is_null()) return Ref<Image>();
+
+ Ref<Image> image;
+
+ if (seamless) {
+ image = noise->get_seamless_image(size.x);
+ } else {
+ image = noise->get_image(size.x, size.y);
+ }
+
+ if (as_normalmap) {
+ image->bumpmap_to_normalmap();
+ }
+
+ return image;
+}
+
+void NoiseTexture::_update_texture() {
+ bool use_thread = true;
+ if (first_time) {
+ use_thread = false;
+ first_time = false;
+ }
+#ifdef NO_THREADS
+ use_thread = false;
+#endif
+ if (use_thread) {
+
+ if (!noise_thread) {
+ noise_thread = Thread::create(_thread_function, this);
+ regen_queued = false;
+ } else {
+ regen_queued = true;
+ }
+
+ } else {
+ Ref<Image> image = _generate_texture();
+ _set_texture_data(image);
+ }
+}
+
+void NoiseTexture::set_noise(Ref<SimplexNoise> p_noise) {
+ if (p_noise == noise)
+ return;
+ if (noise.is_valid()) {
+ noise->disconnect(CoreStringNames::get_singleton()->changed, this, "_update_texture");
+ }
+ noise = p_noise;
+ if (noise.is_valid()) {
+ noise->connect(CoreStringNames::get_singleton()->changed, this, "_update_texture");
+ }
+ _queue_update();
+}
+
+Ref<SimplexNoise> NoiseTexture::get_noise() {
+ return noise;
+}
+
+void NoiseTexture::set_width(int p_width) {
+ if (p_width == size.x) return;
+ size.x = p_width;
+ _queue_update();
+}
+
+void NoiseTexture::set_height(int p_height) {
+ if (p_height == size.y) return;
+ size.y = p_height;
+ _queue_update();
+}
+
+void NoiseTexture::set_seamless(bool p_seamless) {
+ if (p_seamless == seamless) return;
+ seamless = p_seamless;
+ _queue_update();
+}
+
+bool NoiseTexture::get_seamless() {
+ return seamless;
+}
+
+void NoiseTexture::set_as_normalmap(bool p_as_normalmap) {
+ if (p_as_normalmap == as_normalmap) return;
+ as_normalmap = p_as_normalmap;
+ _queue_update();
+}
+
+bool NoiseTexture::is_normalmap() {
+ return as_normalmap;
+}
+
+void NoiseTexture::set_size(Vector2 p_size) {
+ if (p_size == size) return;
+ size = p_size;
+ _queue_update();
+}
+
+Vector2 NoiseTexture::get_size() {
+
+ return size;
+}
+
+int NoiseTexture::get_width() const {
+
+ return size.x;
+}
+
+int NoiseTexture::get_height() const {
+
+ return size.y;
+}
+
+void NoiseTexture::set_flags(uint32_t p_flags) {
+ flags = p_flags;
+ VS::get_singleton()->texture_set_flags(texture, flags);
+}
+
+uint32_t NoiseTexture::get_flags() const {
+ return flags;
+}
+
+Ref<Image> NoiseTexture::get_data() const {
+
+ return data;
+}
diff --git a/modules/opensimplex/noise_texture.h b/modules/opensimplex/noise_texture.h
new file mode 100644
index 0000000000..108e471fc1
--- /dev/null
+++ b/modules/opensimplex/noise_texture.h
@@ -0,0 +1,104 @@
+/*************************************************************************/
+/* noise_texture.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 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 NOISE_TEXTURE_H
+#define NOISE_TEXTURE_H
+
+#include "simplex_noise.h"
+
+#include "core/image.h"
+#include "core/reference.h"
+#include "editor/editor_node.h"
+#include "editor/editor_plugin.h"
+#include "editor/property_editor.h"
+
+class NoiseTexture : public Texture {
+ GDCLASS(NoiseTexture, Texture)
+
+private:
+ Ref<Image> data;
+
+ Thread *noise_thread;
+
+ bool first_time;
+ bool update_queued;
+ bool regen_queued;
+
+ RID texture;
+ uint32_t flags;
+
+ Ref<SimplexNoise> noise;
+ Vector2i size;
+ bool seamless;
+ bool as_normalmap;
+
+ void _thread_done(const Ref<Image> &p_image);
+ static void _thread_function(void *p_ud);
+
+ void _queue_update();
+ Ref<Image> _generate_texture();
+ void _update_texture();
+ void _set_texture_data(const Ref<Image> &p_image);
+
+protected:
+ static void _bind_methods();
+
+public:
+ void set_noise(Ref<SimplexNoise> p_noise);
+ Ref<SimplexNoise> get_noise();
+
+ void set_width(int p_width);
+ void set_height(int p_hieght);
+
+ void set_seamless(bool p_seamless);
+ bool get_seamless();
+
+ void set_as_normalmap(bool p_seamless);
+ bool is_normalmap();
+
+ void set_size(Vector2 p_size);
+ Vector2 get_size();
+
+ int get_width() const;
+ int get_height() const;
+
+ virtual void set_flags(uint32_t p_flags);
+ virtual uint32_t get_flags() const;
+
+ virtual RID get_rid() const { return texture; }
+ virtual bool has_alpha() const { return false; }
+
+ virtual Ref<Image> get_data() const;
+
+ NoiseTexture();
+ virtual ~NoiseTexture();
+};
+
+#endif // NOISE_TEXTURE_H
diff --git a/modules/opensimplex/register_types.cpp b/modules/opensimplex/register_types.cpp
new file mode 100644
index 0000000000..9e4af99651
--- /dev/null
+++ b/modules/opensimplex/register_types.cpp
@@ -0,0 +1,42 @@
+/*************************************************************************/
+/* register_types.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 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 "noise_texture.h"
+#include "simplex_noise.h"
+
+void register_opensimplex_types() {
+
+ ClassDB::register_class<SimplexNoise>();
+ ClassDB::register_class<NoiseTexture>();
+}
+
+void unregister_opensimplex_types() {
+}
diff --git a/modules/opensimplex/register_types.h b/modules/opensimplex/register_types.h
new file mode 100644
index 0000000000..5e71a30ea6
--- /dev/null
+++ b/modules/opensimplex/register_types.h
@@ -0,0 +1,32 @@
+/*************************************************************************/
+/* register_types.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 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_opensimplex_types();
+void unregister_opensimplex_types();
diff --git a/modules/opensimplex/simplex_noise.cpp b/modules/opensimplex/simplex_noise.cpp
new file mode 100644
index 0000000000..6d66c7110e
--- /dev/null
+++ b/modules/opensimplex/simplex_noise.cpp
@@ -0,0 +1,257 @@
+/*************************************************************************/
+/* simplex_noise.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 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 "simplex_noise.h"
+
+#include "core/core_string_names.h"
+
+SimplexNoise::SimplexNoise() {
+
+ seed = 0;
+ persistance = 0.5;
+ octaves = 3;
+ period = 64;
+ lacunarity = 2.0;
+
+ _init_seeds();
+}
+
+SimplexNoise::~SimplexNoise() {
+}
+
+void SimplexNoise::_init_seeds() {
+ for (int i = 0; i < 6; ++i) {
+ open_simplex_noise(seed + i * 2, &(contexts[i]));
+ }
+}
+
+void SimplexNoise::set_seed(int p_seed) {
+
+ if (seed == p_seed)
+ return;
+
+ seed = p_seed;
+
+ _init_seeds();
+
+ emit_changed();
+}
+
+int SimplexNoise::get_seed() {
+
+ return seed;
+}
+
+void SimplexNoise::set_octaves(int p_octaves) {
+ if (p_octaves == octaves) return;
+ octaves = CLAMP(p_octaves, 1, 6);
+ emit_changed();
+}
+
+void SimplexNoise::set_period(float p_period) {
+ if (p_period == period) return;
+ period = p_period;
+ emit_changed();
+}
+
+void SimplexNoise::set_persistance(float p_persistance) {
+ if (p_persistance == persistance) return;
+ persistance = p_persistance;
+ emit_changed();
+}
+
+void SimplexNoise::set_lacunarity(float p_lacunarity) {
+ if (p_lacunarity == lacunarity) return;
+ lacunarity = p_lacunarity;
+ emit_changed();
+}
+
+Ref<Image> SimplexNoise::get_image(int p_width, int p_height) {
+
+ PoolVector<uint8_t> data;
+ data.resize(p_width * p_height * 4);
+
+ PoolVector<uint8_t>::Write wd8 = data.write();
+
+ for (int i = 0; i < p_height; i++) {
+ for (int j = 0; j < p_width; j++) {
+ float v = get_noise_2d(i, j);
+ v = v * 0.5 + 0.5; // Normalize [0..1]
+ uint8_t value = uint8_t(CLAMP(v * 255.0, 0, 255));
+ wd8[(i * p_width + j) * 4 + 0] = value;
+ wd8[(i * p_width + j) * 4 + 1] = value;
+ wd8[(i * p_width + j) * 4 + 2] = value;
+ wd8[(i * p_width + j) * 4 + 3] = 255;
+ }
+ }
+
+ Ref<Image> image = memnew(Image(p_width, p_height, false, Image::FORMAT_RGBA8, data));
+ return image;
+}
+
+Ref<Image> SimplexNoise::get_seamless_image(int p_size) {
+
+ PoolVector<uint8_t> data;
+ data.resize(p_size * p_size * 4);
+
+ PoolVector<uint8_t>::Write wd8 = data.write();
+
+ for (int i = 0; i < p_size; i++) {
+ for (int j = 0; j < p_size; j++) {
+
+ float ii = (float)i / (float)p_size;
+ float jj = (float)j / (float)p_size;
+
+ ii *= 2.0 * Math_PI;
+ jj *= 2.0 * Math_PI;
+
+ float radius = p_size / (2.0 * Math_PI);
+
+ float x = radius * Math::sin(jj);
+ float y = radius * Math::cos(jj);
+ float z = radius * Math::sin(ii);
+ float w = radius * Math::cos(ii);
+ float v = get_noise_4d(x, y, z, w);
+
+ v = v * 0.5 + 0.5; // Normalize [0..1]
+ uint8_t value = uint8_t(CLAMP(v * 255.0, 0, 255));
+ wd8[(i * p_size + j) * 4 + 0] = value;
+ wd8[(i * p_size + j) * 4 + 1] = value;
+ wd8[(i * p_size + j) * 4 + 2] = value;
+ wd8[(i * p_size + j) * 4 + 3] = 255;
+ }
+ }
+
+ Ref<Image> image = memnew(Image(p_size, p_size, false, Image::FORMAT_RGBA8, data));
+ return image;
+}
+
+void SimplexNoise::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("get_seed"), &SimplexNoise::get_seed);
+ ClassDB::bind_method(D_METHOD("set_seed", "seed"), &SimplexNoise::set_seed);
+
+ ClassDB::bind_method(D_METHOD("set_octaves", "octave_count"), &SimplexNoise::set_octaves);
+ ClassDB::bind_method(D_METHOD("get_octaves"), &SimplexNoise::get_octaves);
+
+ ClassDB::bind_method(D_METHOD("set_period", "period"), &SimplexNoise::set_period);
+ ClassDB::bind_method(D_METHOD("get_period"), &SimplexNoise::get_period);
+
+ ClassDB::bind_method(D_METHOD("set_persistance", "persistance"), &SimplexNoise::set_persistance);
+ ClassDB::bind_method(D_METHOD("get_persistance"), &SimplexNoise::get_persistance);
+
+ ClassDB::bind_method(D_METHOD("set_lacunarity", "lacunarity"), &SimplexNoise::set_lacunarity);
+ ClassDB::bind_method(D_METHOD("get_lacunarity"), &SimplexNoise::get_lacunarity);
+
+ ClassDB::bind_method(D_METHOD("get_image", "width", "height"), &SimplexNoise::get_image);
+ ClassDB::bind_method(D_METHOD("get_seamless_image", "size"), &SimplexNoise::get_seamless_image);
+
+ ClassDB::bind_method(D_METHOD("get_noise_2d", "x", "y"), &SimplexNoise::get_noise_2d);
+ ClassDB::bind_method(D_METHOD("get_noise_3d", "x", "y", "z"), &SimplexNoise::get_noise_3d);
+ ClassDB::bind_method(D_METHOD("get_noise_4d", "x", "y", "z", "w"), &SimplexNoise::get_noise_4d);
+
+ ClassDB::bind_method(D_METHOD("get_noise_2dv", "pos"), &SimplexNoise::get_noise_2dv);
+ ClassDB::bind_method(D_METHOD("get_noise_3dv", "pos"), &SimplexNoise::get_noise_3dv);
+
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "seed"), "set_seed", "get_seed");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "octaves", PROPERTY_HINT_RANGE, "1,6,1"), "set_octaves", "get_octaves");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "period", PROPERTY_HINT_RANGE, "0.1,256.0,0.1"), "set_period", "get_period");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "persistance", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_persistance", "get_persistance");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "lacunarity", PROPERTY_HINT_RANGE, "0.1,4.0,0.01"), "set_lacunarity", "get_lacunarity");
+}
+
+float SimplexNoise::get_noise_2d(float x, float y) {
+
+ x /= period;
+ y /= period;
+
+ float amp = 1.0;
+ float max = 1.0;
+ float sum = _get_octave_noise_2d(0, x, y);
+
+ unsigned int i = 0;
+ while (++i < octaves) {
+ x *= lacunarity;
+ y *= lacunarity;
+ amp *= persistance;
+ max += amp;
+ sum += _get_octave_noise_2d(i, x, y) * amp;
+ }
+
+ return sum / max;
+}
+
+float SimplexNoise::get_noise_3d(float x, float y, float z) {
+
+ x /= period;
+ y /= period;
+ z /= period;
+
+ float amp = 1.0;
+ float max = 1.0;
+ float sum = _get_octave_noise_3d(0, x, y, z);
+
+ unsigned int i = 0;
+ while (++i < octaves) {
+ x *= lacunarity;
+ y *= lacunarity;
+ z *= lacunarity;
+ amp *= persistance;
+ max += amp;
+ sum += _get_octave_noise_3d(i, x, y, z) * amp;
+ }
+
+ return sum / max;
+}
+
+float SimplexNoise::get_noise_4d(float x, float y, float z, float w) {
+
+ x /= period;
+ y /= period;
+ z /= period;
+ w /= period;
+
+ float amp = 1.0;
+ float max = 1.0;
+ float sum = _get_octave_noise_4d(0, x, y, z, w);
+
+ unsigned int i = 0;
+ while (++i < octaves) {
+ x *= lacunarity;
+ y *= lacunarity;
+ z *= lacunarity;
+ w *= lacunarity;
+ amp *= persistance;
+ max += amp;
+ sum += _get_octave_noise_4d(i, x, y, z, w) * amp;
+ }
+
+ return sum / max;
+}
diff --git a/modules/opensimplex/simplex_noise.h b/modules/opensimplex/simplex_noise.h
new file mode 100644
index 0000000000..59390c6172
--- /dev/null
+++ b/modules/opensimplex/simplex_noise.h
@@ -0,0 +1,93 @@
+/*************************************************************************/
+/* simplex_noise.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 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 SIMPLEX_NOISE_H
+#define SIMPLEX_NOISE_H
+
+#include "core/image.h"
+#include "core/reference.h"
+#include "scene/resources/texture.h"
+
+#include "thirdparty/misc/open-simplex-noise.h"
+
+class SimplexNoise : public Resource {
+ GDCLASS(SimplexNoise, Resource)
+ OBJ_SAVE_TYPE(SimplexNoise);
+
+ osn_context contexts[6];
+
+ int seed;
+ float persistance; // Controls details, value in [0,1]. Higher increases grain, lower increases smoothness.
+ int octaves; // Number of noise layers
+ float period; // Distance above which we start to see similarities. The higher, the longer "hills" will be on a terrain.
+ float lacunarity; // Controls period change across octaves. 2 is usually a good value to address all detail levels.
+
+public:
+ SimplexNoise();
+ ~SimplexNoise();
+
+ void _init_seeds();
+
+ void set_seed(int seed);
+ int get_seed();
+
+ void set_octaves(int p_octaves);
+ int get_octaves() const { return octaves; }
+
+ void set_period(float p_period);
+ float get_period() const { return period; }
+
+ void set_persistance(float p_persistance);
+ float get_persistance() const { return persistance; }
+
+ void set_lacunarity(float p_lacunarity);
+ float get_lacunarity() const { return lacunarity; }
+
+ Ref<Image> get_image(int p_width, int p_height);
+ Ref<Image> get_seamless_image(int p_size);
+
+ float get_noise_2d(float x, float y);
+ float get_noise_3d(float x, float y, float z);
+ float get_noise_4d(float x, float y, float z, float w);
+
+ _FORCE_INLINE_ float _get_octave_noise_2d(int octave, float x, float y) { return open_simplex_noise2(&(contexts[octave]), x, y); }
+ _FORCE_INLINE_ float _get_octave_noise_3d(int octave, float x, float y, float z) { return open_simplex_noise3(&(contexts[octave]), x, y, z); }
+ _FORCE_INLINE_ float _get_octave_noise_4d(int octave, float x, float y, float z, float w) { return open_simplex_noise4(&(contexts[octave]), x, y, z, w); }
+
+ // Convenience
+
+ _FORCE_INLINE_ float get_noise_2dv(Vector2 v) { return get_noise_2d(v.x, v.y); }
+ _FORCE_INLINE_ float get_noise_3dv(Vector3 v) { return get_noise_3d(v.x, v.y, v.z); }
+
+protected:
+ static void _bind_methods();
+};
+
+#endif // OPENSIMPLEX_NOISE_H
diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp
index 99f242e974..5c880f48d1 100644
--- a/modules/visual_script/visual_script_nodes.cpp
+++ b/modules/visual_script/visual_script_nodes.cpp
@@ -167,7 +167,7 @@ void VisualScriptFunction::_get_property_list(List<PropertyInfo> *p_list) const
p_list->push_back(PropertyInfo(Variant::INT, "stack/size", PROPERTY_HINT_RANGE, "1,100000"));
}
p_list->push_back(PropertyInfo(Variant::BOOL, "stack/stackless"));
- p_list->push_back(PropertyInfo(Variant::INT, "rpc/mode", PROPERTY_HINT_ENUM, "Disabled,Remote,Sync,Master,Slave"));
+ p_list->push_back(PropertyInfo(Variant::INT, "rpc/mode", PROPERTY_HINT_ENUM, "Disabled,Remote,Master,Puppet,Remote Sync,Master Sync,Puppet Sync"));
}
int VisualScriptFunction::get_output_sequence_port_count() const {
diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp
index 39997d14c4..9942d5baa6 100644
--- a/modules/visual_script/visual_script_property_selector.cpp
+++ b/modules/visual_script/visual_script_property_selector.cpp
@@ -31,6 +31,7 @@
#include "visual_script_property_selector.h"
#include "core/os/keyboard.h"
+#include "editor/editor_node.h"
#include "editor_scale.h"
#include "modules/visual_script/visual_script.h"
#include "modules/visual_script/visual_script_builtin_funcs.h"
@@ -176,10 +177,8 @@ void VisualScriptPropertySelector::_update_search() {
Ref<Texture> icon;
if (E->get().name == "Script Variables") {
icon = get_icon("Script", "EditorIcons");
- } else if (has_icon(E->get().name, "EditorIcons")) {
- icon = get_icon(E->get().name, "EditorIcons");
} else {
- icon = get_icon("Object", "EditorIcons");
+ icon = EditorNode::get_singleton()->get_class_icon(E->get().name);
}
category->set_icon(0, icon);
continue;
@@ -289,10 +288,8 @@ void VisualScriptPropertySelector::_update_search() {
if (E->get().name == "*Script Methods") {
icon = get_icon("Script", "EditorIcons");
script_methods = true;
- } else if (has_icon(rep, "EditorIcons")) {
- icon = get_icon(rep, "EditorIcons");
} else {
- icon = get_icon("Object", "EditorIcons");
+ icon = EditorNode::get_singleton()->get_class_icon(rep);
}
category->set_icon(0, icon);
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index 36c0dfc18a..774ee49af2 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -431,7 +431,7 @@ void Sprite3D::_draw() {
};
- Vector2 src_tsize = Vector2(texture->get_width(), texture->get_height());
+ Vector2 src_tsize = tsize;
// Properly setup UVs for impostor textures (AtlasTexture).
Ref<AtlasTexture> atlas_tex = texture;
@@ -441,10 +441,10 @@ void Sprite3D::_draw() {
}
Vector2 uvs[4] = {
- final_src_rect.position / tsize,
- (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / tsize,
- (final_src_rect.position + final_src_rect.size) / tsize,
- (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / tsize,
+ final_src_rect.position / src_tsize,
+ (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / src_tsize,
+ (final_src_rect.position + final_src_rect.size) / src_tsize,
+ (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / src_tsize,
};
if (is_flipped_h()) {
@@ -731,7 +731,7 @@ void AnimatedSprite3D::_draw() {
};
- Vector2 src_tsize = Vector2(texture->get_width(), texture->get_height());
+ Vector2 src_tsize = tsize;
// Properly setup UVs for impostor textures (AtlasTexture).
Ref<AtlasTexture> atlas_tex = texture;
@@ -741,10 +741,10 @@ void AnimatedSprite3D::_draw() {
}
Vector2 uvs[4] = {
- final_src_rect.position / tsize,
- (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / tsize,
- (final_src_rect.position + final_src_rect.size) / tsize,
- (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / tsize,
+ final_src_rect.position / src_tsize,
+ (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / src_tsize,
+ (final_src_rect.position + final_src_rect.size) / src_tsize,
+ (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / src_tsize,
};
if (is_flipped_h()) {
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 1e281471a6..fa5019a6f7 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -29,12 +29,13 @@
/*************************************************************************/
#include "rich_text_label.h"
+
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "scene/scene_string_names.h"
#ifdef TOOLS_ENABLED
-#include "editor/editor_node.h"
+#include "editor/editor_scale.h"
#endif
RichTextLabel::Item *RichTextLabel::_get_next_item(Item *p_item, bool p_free) {
@@ -2295,7 +2296,7 @@ RichTextLabel::RichTextLabel() {
vscroll = memnew(VScrollBar);
add_child(vscroll);
- vscroll->set_drag_slave(String(".."));
+ vscroll->set_drag_node(String(".."));
vscroll->set_step(1);
vscroll->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 0);
vscroll->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, 0);
diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp
index df27fb0e6b..07380f45cc 100644
--- a/scene/gui/scroll_bar.cpp
+++ b/scene/gui/scroll_bar.cpp
@@ -300,24 +300,24 @@ void ScrollBar::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
- if (has_node(drag_slave_path)) {
- Node *n = get_node(drag_slave_path);
- drag_slave = Object::cast_to<Control>(n);
+ if (has_node(drag_node_path)) {
+ Node *n = get_node(drag_node_path);
+ drag_node = Object::cast_to<Control>(n);
}
- if (drag_slave) {
- drag_slave->connect("gui_input", this, "_drag_slave_input");
- drag_slave->connect("tree_exiting", this, "_drag_slave_exit", varray(), CONNECT_ONESHOT);
+ if (drag_node) {
+ drag_node->connect("gui_input", this, "_drag_node_input");
+ drag_node->connect("tree_exiting", this, "_drag_node_exit", varray(), CONNECT_ONESHOT);
}
}
if (p_what == NOTIFICATION_EXIT_TREE) {
- if (drag_slave) {
- drag_slave->disconnect("gui_input", this, "_drag_slave_input");
- drag_slave->disconnect("tree_exiting", this, "_drag_slave_exit");
+ if (drag_node) {
+ drag_node->disconnect("gui_input", this, "_drag_node_input");
+ drag_node->disconnect("tree_exiting", this, "_drag_node_exit");
}
- drag_slave = NULL;
+ drag_node = NULL;
}
if (p_what == NOTIFICATION_INTERNAL_PHYSICS_PROCESS) {
@@ -337,12 +337,13 @@ void ScrollBar::_notification(int p_what) {
scrolling = false;
set_physics_process_internal(false);
}
- } else if (drag_slave_touching) {
- if (drag_slave_touching_deaccel) {
+ } else if (drag_node_touching) {
+
+ if (drag_node_touching_deaccel) {
Vector2 pos = Vector2(orientation == HORIZONTAL ? get_value() : 0, orientation == VERTICAL ? get_value() : 0);
- pos += drag_slave_speed * get_physics_process_delta_time();
+ pos += drag_node_speed * get_physics_process_delta_time();
bool turnoff = false;
@@ -360,15 +361,15 @@ void ScrollBar::_notification(int p_what) {
set_value(pos.x);
- float sgn_x = drag_slave_speed.x < 0 ? -1 : 1;
- float val_x = Math::abs(drag_slave_speed.x);
+ float sgn_x = drag_node_speed.x < 0 ? -1 : 1;
+ float val_x = Math::abs(drag_node_speed.x);
val_x -= 1000 * get_physics_process_delta_time();
if (val_x < 0) {
turnoff = true;
}
- drag_slave_speed.x = sgn_x * val_x;
+ drag_node_speed.x = sgn_x * val_x;
} else {
@@ -384,29 +385,29 @@ void ScrollBar::_notification(int p_what) {
set_value(pos.y);
- float sgn_y = drag_slave_speed.y < 0 ? -1 : 1;
- float val_y = Math::abs(drag_slave_speed.y);
+ float sgn_y = drag_node_speed.y < 0 ? -1 : 1;
+ float val_y = Math::abs(drag_node_speed.y);
val_y -= 1000 * get_physics_process_delta_time();
if (val_y < 0) {
turnoff = true;
}
- drag_slave_speed.y = sgn_y * val_y;
+ drag_node_speed.y = sgn_y * val_y;
}
if (turnoff) {
set_physics_process_internal(false);
- drag_slave_touching = false;
- drag_slave_touching_deaccel = false;
+ drag_node_touching = false;
+ drag_node_touching_deaccel = false;
}
} else {
if (time_since_motion == 0 || time_since_motion > 0.1) {
- Vector2 diff = drag_slave_accum - last_drag_slave_accum;
- last_drag_slave_accum = drag_slave_accum;
- drag_slave_speed = diff / get_physics_process_delta_time();
+ Vector2 diff = drag_node_accum - last_drag_node_accum;
+ last_drag_node_accum = drag_node_accum;
+ drag_node_speed = diff / get_physics_process_delta_time();
}
time_since_motion += get_physics_process_delta_time();
@@ -544,15 +545,15 @@ float ScrollBar::get_custom_step() const {
return custom_step;
}
-void ScrollBar::_drag_slave_exit() {
+void ScrollBar::_drag_node_exit() {
- if (drag_slave) {
- drag_slave->disconnect("gui_input", this, "_drag_slave_input");
+ if (drag_node) {
+ drag_node->disconnect("gui_input", this, "_drag_node_input");
}
- drag_slave = NULL;
+ drag_node = NULL;
}
-void ScrollBar::_drag_slave_input(const Ref<InputEvent> &p_input) {
+void ScrollBar::_drag_node_input(const Ref<InputEvent> &p_input) {
Ref<InputEventMouseButton> mb = p_input;
@@ -563,43 +564,30 @@ void ScrollBar::_drag_slave_input(const Ref<InputEvent> &p_input) {
if (mb->is_pressed()) {
- if (drag_slave_touching) {
- set_physics_process_internal(false);
- drag_slave_touching_deaccel = false;
- drag_slave_touching = false;
- drag_slave_speed = Vector2();
- drag_slave_accum = Vector2();
- last_drag_slave_accum = Vector2();
- drag_slave_from = Vector2();
- }
+ drag_node_speed = Vector2();
+ drag_node_accum = Vector2();
+ last_drag_node_accum = Vector2();
+ drag_node_from = Vector2(orientation == HORIZONTAL ? get_value() : 0, orientation == VERTICAL ? get_value() : 0);
- if (true) {
- drag_slave_speed = Vector2();
- drag_slave_accum = Vector2();
- last_drag_slave_accum = Vector2();
- //drag_slave_from=Vector2(h_scroll->get_val(),v_scroll->get_val());
- drag_slave_from = Vector2(orientation == HORIZONTAL ? get_value() : 0, orientation == VERTICAL ? get_value() : 0);
+ drag_node_touching = OS::get_singleton()->has_touchscreen_ui_hint();
+ drag_node_touching_deaccel = false;
+ time_since_motion = 0;
- drag_slave_touching = OS::get_singleton()->has_touchscreen_ui_hint();
- drag_slave_touching_deaccel = false;
+ if (drag_node_touching) {
+ set_physics_process_internal(true);
time_since_motion = 0;
- if (drag_slave_touching) {
- set_physics_process_internal(true);
- time_since_motion = 0;
- }
}
} else {
- if (drag_slave_touching) {
+ if (drag_node_touching) {
- if (drag_slave_speed == Vector2()) {
- drag_slave_touching_deaccel = false;
- drag_slave_touching = false;
+ if (drag_node_speed == Vector2()) {
+ drag_node_touching_deaccel = false;
+ drag_node_touching = false;
set_physics_process_internal(false);
} else {
-
- drag_slave_touching_deaccel = true;
+ drag_node_touching_deaccel = true;
}
}
}
@@ -609,60 +597,54 @@ void ScrollBar::_drag_slave_input(const Ref<InputEvent> &p_input) {
if (mm.is_valid()) {
- if (drag_slave_touching && !drag_slave_touching_deaccel) {
+ if (drag_node_touching && !drag_node_touching_deaccel) {
Vector2 motion = Vector2(mm->get_relative().x, mm->get_relative().y);
- drag_slave_accum -= motion;
- Vector2 diff = drag_slave_from + drag_slave_accum;
+ drag_node_accum -= motion;
+ Vector2 diff = drag_node_from + drag_node_accum;
if (orientation == HORIZONTAL)
set_value(diff.x);
- /*
- else
- drag_slave_accum.x=0;
- */
+
if (orientation == VERTICAL)
set_value(diff.y);
- /*
- else
- drag_slave_accum.y=0;
- */
+
time_since_motion = 0;
}
}
}
-void ScrollBar::set_drag_slave(const NodePath &p_path) {
+void ScrollBar::set_drag_node(const NodePath &p_path) {
if (is_inside_tree()) {
- if (drag_slave) {
- drag_slave->disconnect("gui_input", this, "_drag_slave_input");
- drag_slave->disconnect("tree_exiting", this, "_drag_slave_exit");
+ if (drag_node) {
+ drag_node->disconnect("gui_input", this, "_drag_node_input");
+ drag_node->disconnect("tree_exiting", this, "_drag_node_exit");
}
}
- drag_slave = NULL;
- drag_slave_path = p_path;
+ drag_node = NULL;
+ drag_node_path = p_path;
if (is_inside_tree()) {
if (has_node(p_path)) {
Node *n = get_node(p_path);
- drag_slave = Object::cast_to<Control>(n);
+ drag_node = Object::cast_to<Control>(n);
}
- if (drag_slave) {
- drag_slave->connect("gui_input", this, "_drag_slave_input");
- drag_slave->connect("tree_exiting", this, "_drag_slave_exit", varray(), CONNECT_ONESHOT);
+ if (drag_node) {
+ drag_node->connect("gui_input", this, "_drag_node_input");
+ drag_node->connect("tree_exiting", this, "_drag_node_exit", varray(), CONNECT_ONESHOT);
}
}
}
-NodePath ScrollBar::get_drag_slave() const {
+NodePath ScrollBar::get_drag_node() const {
- return drag_slave_path;
+ return drag_node_path;
}
void ScrollBar::set_smooth_scroll_enabled(bool p_enable) {
@@ -678,8 +660,8 @@ void ScrollBar::_bind_methods() {
ClassDB::bind_method(D_METHOD("_gui_input"), &ScrollBar::_gui_input);
ClassDB::bind_method(D_METHOD("set_custom_step", "step"), &ScrollBar::set_custom_step);
ClassDB::bind_method(D_METHOD("get_custom_step"), &ScrollBar::get_custom_step);
- ClassDB::bind_method(D_METHOD("_drag_slave_input"), &ScrollBar::_drag_slave_input);
- ClassDB::bind_method(D_METHOD("_drag_slave_exit"), &ScrollBar::_drag_slave_exit);
+ ClassDB::bind_method(D_METHOD("_drag_node_input"), &ScrollBar::_drag_node_input);
+ ClassDB::bind_method(D_METHOD("_drag_node_exit"), &ScrollBar::_drag_node_exit);
ADD_SIGNAL(MethodInfo("scrolling"));
@@ -691,13 +673,13 @@ ScrollBar::ScrollBar(Orientation p_orientation) {
orientation = p_orientation;
highlight = HIGHLIGHT_NONE;
custom_step = -1;
- drag_slave = NULL;
+ drag_node = NULL;
drag.active = false;
- drag_slave_speed = Vector2();
- drag_slave_touching = false;
- drag_slave_touching_deaccel = false;
+ drag_node_speed = Vector2();
+ drag_node_touching = false;
+ drag_node_touching_deaccel = false;
scrolling = false;
target_scroll = 0;
diff --git a/scene/gui/scroll_bar.h b/scene/gui/scroll_bar.h
index 15e037f8bb..cde4120cdb 100644
--- a/scene/gui/scroll_bar.h
+++ b/scene/gui/scroll_bar.h
@@ -36,6 +36,7 @@
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
+
class ScrollBar : public Range {
GDCLASS(ScrollBar, Range);
@@ -71,25 +72,25 @@ class ScrollBar : public Range {
static void set_can_focus_by_default(bool p_can_focus);
- Node *drag_slave;
- NodePath drag_slave_path;
+ Node *drag_node;
+ NodePath drag_node_path;
- Vector2 drag_slave_speed;
- Vector2 drag_slave_accum;
- Vector2 drag_slave_from;
- Vector2 last_drag_slave_accum;
- float last_drag_slave_time;
+ Vector2 drag_node_speed;
+ Vector2 drag_node_accum;
+ Vector2 drag_node_from;
+ Vector2 last_drag_node_accum;
+ float last_drag_node_time;
float time_since_motion;
- bool drag_slave_touching;
- bool drag_slave_touching_deaccel;
+ bool drag_node_touching;
+ bool drag_node_touching_deaccel;
bool click_handled;
bool scrolling;
double target_scroll;
bool smooth_scroll_enabled;
- void _drag_slave_exit();
- void _drag_slave_input(const Ref<InputEvent> &p_input);
+ void _drag_node_exit();
+ void _drag_node_input(const Ref<InputEvent> &p_input);
void _gui_input(Ref<InputEvent> p_event);
@@ -102,8 +103,8 @@ public:
void set_custom_step(float p_custom_step);
float get_custom_step() const;
- void set_drag_slave(const NodePath &p_path);
- NodePath get_drag_slave() const;
+ void set_drag_node(const NodePath &p_path);
+ NodePath get_drag_node() const;
void set_smooth_scroll_enabled(bool p_enable);
bool is_smooth_scroll_enabled() const;
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index dfd9dfa52e..487ca2b009 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -2789,6 +2789,8 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("gui_get_drag_data"), &Viewport::gui_get_drag_data);
ClassDB::bind_method(D_METHOD("gui_is_dragging"), &Viewport::gui_is_dragging);
+ ClassDB::bind_method(D_METHOD("get_modal_stack_top"), &Viewport::get_modal_stack_top);
+
ClassDB::bind_method(D_METHOD("set_disable_input", "disable"), &Viewport::set_disable_input);
ClassDB::bind_method(D_METHOD("is_input_disabled"), &Viewport::is_input_disabled);
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 4727526b68..2cf802a2da 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -145,6 +145,31 @@ void ShaderMaterial::_get_property_list(List<PropertyInfo> *p_list) const {
}
}
+bool ShaderMaterial::property_can_revert(const String &p_name) {
+ if (shader.is_valid()) {
+
+ StringName pr = shader->remap_param(p_name);
+ if (pr) {
+ Variant default_value = VisualServer::get_singleton()->material_get_param_default(_get_material(), pr);
+ Variant current_value;
+ _get(p_name, current_value);
+ return default_value.get_type() != Variant::NIL && default_value != current_value;
+ }
+ }
+ return false;
+}
+
+Variant ShaderMaterial::property_get_revert(const String &p_name) {
+ Variant r_ret;
+ if (shader.is_valid()) {
+ StringName pr = shader->remap_param(p_name);
+ if (pr) {
+ r_ret = VisualServer::get_singleton()->material_get_param_default(_get_material(), pr);
+ }
+ }
+ return r_ret;
+}
+
void ShaderMaterial::set_shader(const Ref<Shader> &p_shader) {
if (shader.is_valid()) {
@@ -190,6 +215,8 @@ void ShaderMaterial::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_shader_param", "param", "value"), &ShaderMaterial::set_shader_param);
ClassDB::bind_method(D_METHOD("get_shader_param", "param"), &ShaderMaterial::get_shader_param);
ClassDB::bind_method(D_METHOD("_shader_changed"), &ShaderMaterial::_shader_changed);
+ ClassDB::bind_method(D_METHOD("property_can_revert", "name"), &ShaderMaterial::property_can_revert);
+ ClassDB::bind_method(D_METHOD("property_get_revert", "name"), &ShaderMaterial::property_get_revert);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shader", PROPERTY_HINT_RESOURCE_TYPE, "Shader"), "set_shader", "get_shader");
}
diff --git a/scene/resources/material.h b/scene/resources/material.h
index 078649e7b0..4a2a813341 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -85,6 +85,8 @@ protected:
bool _set(const StringName &p_name, const Variant &p_value);
bool _get(const StringName &p_name, Variant &r_ret) const;
void _get_property_list(List<PropertyInfo> *p_list) const;
+ bool property_can_revert(const String &p_name);
+ Variant property_get_revert(const String &p_name);
static void _bind_methods();
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 9875c7b130..16b4ed31df 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -30,11 +30,11 @@
#include "texture.h"
-#include "bit_mask.h"
#include "core/core_string_names.h"
#include "core/io/image_loader.h"
#include "core/method_bind_ext.gen.inc"
#include "core/os/os.h"
+#include "scene/resources/bit_mask.h"
Size2 Texture::get_size() const {
@@ -1633,16 +1633,17 @@ void GradientTexture::_queue_update() {
if (update_pending)
return;
+ update_pending = true;
call_deferred("_update");
}
void GradientTexture::_update() {
+ update_pending = false;
+
if (gradient.is_null())
return;
- update_pending = false;
-
PoolVector<uint8_t> data;
data.resize(width * 4);
{
@@ -1945,8 +1946,8 @@ void AnimatedTexture::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "fps", PROPERTY_HINT_RANGE, "0,1024,0.1"), "set_fps", "get_fps");
for (int i = 0; i < MAX_FRAMES; i++) {
- ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "frame_" + itos(i) + "/texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_frame_texture", "get_frame_texture", i);
- ADD_PROPERTYI(PropertyInfo(Variant::REAL, "frame_" + itos(i) + "/delay_sec", PROPERTY_HINT_RANGE, "0.0,16.0,0.01"), "set_frame_delay", "get_frame_delay", i);
+ ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "frame_" + itos(i) + "/texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "set_frame_texture", "get_frame_texture", i);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "frame_" + itos(i) + "/delay_sec", PROPERTY_HINT_RANGE, "0.0,16.0,0.01", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "set_frame_delay", "get_frame_delay", i);
}
}
diff --git a/scene/resources/texture.h b/scene/resources/texture.h
index 4865f7b507..cb759c63da 100644
--- a/scene/resources/texture.h
+++ b/scene/resources/texture.h
@@ -37,9 +37,10 @@
#include "core/os/rw_lock.h"
#include "core/os/thread_safe.h"
#include "core/resource.h"
-#include "curve.h"
#include "scene/resources/color_ramp.h"
+#include "scene/resources/curve.h"
#include "servers/visual_server.h"
+
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index c26f02f087..6eeaf12dfc 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -249,6 +249,7 @@ public:
virtual void material_set_param(RID p_material, const StringName &p_param, const Variant &p_value) = 0;
virtual Variant material_get_param(RID p_material, const StringName &p_param) const = 0;
+ virtual Variant material_get_param_default(RID p_material, const StringName &p_param) const = 0;
virtual void material_set_line_width(RID p_material, float p_width) = 0;
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index 8a8b8af267..35236b23f1 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -2273,6 +2273,90 @@ bool ShaderLanguage::is_sampler_type(DataType p_type) {
p_type == TYPE_SAMPLERCUBE;
}
+Variant ShaderLanguage::constant_value_to_variant(const Vector<ShaderLanguage::ConstantNode::Value> &p_value, DataType p_type) {
+ if (p_value.size() > 0) {
+ Variant value;
+ switch (p_type) {
+ case ShaderLanguage::TYPE_BOOL:
+ value = Variant(p_value[0].boolean);
+ break;
+ case ShaderLanguage::TYPE_BVEC2:
+ case ShaderLanguage::TYPE_BVEC3:
+ case ShaderLanguage::TYPE_BVEC4:
+ case ShaderLanguage::TYPE_INT:
+ value = Variant(p_value[0].sint);
+ break;
+ case ShaderLanguage::TYPE_IVEC2:
+ value = Variant(Vector2(p_value[0].sint, p_value[1].sint));
+ break;
+ case ShaderLanguage::TYPE_IVEC3:
+ value = Variant(Vector3(p_value[0].sint, p_value[1].sint, p_value[2].sint));
+ break;
+ case ShaderLanguage::TYPE_IVEC4:
+ value = Variant(Plane(p_value[0].sint, p_value[1].sint, p_value[2].sint, p_value[3].sint));
+ break;
+ case ShaderLanguage::TYPE_UINT:
+ value = Variant(p_value[0].uint);
+ break;
+ case ShaderLanguage::TYPE_UVEC2:
+ value = Variant(Vector2(p_value[0].uint, p_value[1].uint));
+ break;
+ case ShaderLanguage::TYPE_UVEC3:
+ value = Variant(Vector3(p_value[0].uint, p_value[1].uint, p_value[2].uint));
+ break;
+ case ShaderLanguage::TYPE_UVEC4:
+ value = Variant(Plane(p_value[0].uint, p_value[1].uint, p_value[2].uint, p_value[3].uint));
+ break;
+ case ShaderLanguage::TYPE_FLOAT:
+ value = Variant(p_value[0].real);
+ break;
+ case ShaderLanguage::TYPE_VEC2:
+ value = Variant(Vector2(p_value[0].real, p_value[1].real));
+ break;
+ case ShaderLanguage::TYPE_VEC3:
+ value = Variant(Vector3(p_value[0].real, p_value[1].real, p_value[2].real));
+ break;
+ case ShaderLanguage::TYPE_VEC4:
+ value = Variant(Plane(p_value[0].real, p_value[1].real, p_value[2].real, p_value[3].real));
+ break;
+ case ShaderLanguage::TYPE_MAT2:
+ value = Variant(Transform2D(p_value[0].real, p_value[2].real, p_value[1].real, p_value[3].real, 0.0, 0.0));
+ break;
+ case ShaderLanguage::TYPE_MAT3: {
+ Basis p;
+ p[0][0] = p_value[0].real;
+ p[0][1] = p_value[1].real;
+ p[0][2] = p_value[2].real;
+ p[1][0] = p_value[3].real;
+ p[1][1] = p_value[4].real;
+ p[1][2] = p_value[5].real;
+ p[2][0] = p_value[6].real;
+ p[2][1] = p_value[7].real;
+ p[2][2] = p_value[8].real;
+ value = Variant(p);
+ break;
+ }
+ case ShaderLanguage::TYPE_MAT4: {
+ Basis p;
+ p[0][0] = p_value[0].real;
+ p[0][1] = p_value[1].real;
+ p[0][2] = p_value[2].real;
+ p[1][0] = p_value[4].real;
+ p[1][1] = p_value[5].real;
+ p[1][2] = p_value[6].real;
+ p[2][0] = p_value[8].real;
+ p[2][1] = p_value[9].real;
+ p[2][2] = p_value[10].real;
+ Transform t = Transform(p, Vector3(p_value[3].real, p_value[7].real, p_value[11].real));
+ value = Variant(t);
+ break;
+ }
+ }
+ return value;
+ }
+ return Variant();
+}
+
void ShaderLanguage::get_keyword_list(List<String> *r_keywords) {
Set<String> kws;
diff --git a/servers/visual/shader_language.h b/servers/visual/shader_language.h
index e8ae099302..08c4d06992 100644
--- a/servers/visual/shader_language.h
+++ b/servers/visual/shader_language.h
@@ -548,6 +548,7 @@ public:
static int get_cardinality(DataType p_type);
static bool is_scalar_type(DataType p_type);
static bool is_sampler_type(DataType p_type);
+ static Variant constant_value_to_variant(const Vector<ShaderLanguage::ConstantNode::Value> &p_value, DataType p_type);
static void get_keyword_list(List<String> *r_keywords);
static void get_builtin_funcs(List<String> *r_keywords);
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index f25973c4e2..b54e150656 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -203,6 +203,7 @@ public:
BIND3(material_set_param, RID, const StringName &, const Variant &)
BIND2RC(Variant, material_get_param, RID, const StringName &)
+ BIND2RC(Variant, material_get_param_default, RID, const StringName &)
BIND2(material_set_render_priority, RID, int)
BIND2(material_set_line_width, RID, float)
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
index 85205e5132..b8f86d7123 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -137,6 +137,7 @@ public:
FUNC3(material_set_param, RID, const StringName &, const Variant &)
FUNC2RC(Variant, material_get_param, RID, const StringName &)
+ FUNC2RC(Variant, material_get_param_default, RID, const StringName &)
FUNC2(material_set_render_priority, RID, int)
FUNC2(material_set_line_width, RID, float)
diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp
index d4e96bb173..7240266133 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -1695,6 +1695,7 @@ void VisualServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("material_get_shader", "shader_material"), &VisualServer::material_get_shader);
ClassDB::bind_method(D_METHOD("material_set_param", "material", "parameter", "value"), &VisualServer::material_set_param);
ClassDB::bind_method(D_METHOD("material_get_param", "material", "parameter"), &VisualServer::material_get_param);
+ ClassDB::bind_method(D_METHOD("material_get_param_default", "material", "parameter"), &VisualServer::material_get_param_default);
ClassDB::bind_method(D_METHOD("material_set_render_priority", "material", "priority"), &VisualServer::material_set_render_priority);
ClassDB::bind_method(D_METHOD("material_set_line_width", "material", "width"), &VisualServer::material_set_line_width);
ClassDB::bind_method(D_METHOD("material_set_next_pass", "material", "next_material"), &VisualServer::material_set_next_pass);
diff --git a/servers/visual_server.h b/servers/visual_server.h
index 7c21d138e0..6a1f2c3550 100644
--- a/servers/visual_server.h
+++ b/servers/visual_server.h
@@ -209,6 +209,7 @@ public:
virtual void material_set_param(RID p_material, const StringName &p_param, const Variant &p_value) = 0;
virtual Variant material_get_param(RID p_material, const StringName &p_param) const = 0;
+ virtual Variant material_get_param_default(RID p_material, const StringName &p_param) const = 0;
virtual void material_set_render_priority(RID p_material, int priority) = 0;
diff --git a/thirdparty/README.md b/thirdparty/README.md
index 55f6a71179..71053de016 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -356,6 +356,11 @@ Collection of single-file libraries used in Godot components.
* Upstream: https://github.com/ivanfratric/polypartition (`src/polypartition.cpp`)
* Version: TBD, class was renamed
* License: MIT
+- `open-simplex-noise.{c,h}`
+ * Upstream: https://github.com/smcameron/open-simplex-noise-in-c
+ * Version: git (0d555e7, 2015)
+ * License: Unlicense
+
### modules
diff --git a/thirdparty/misc/open-simplex-noise-LICENSE b/thirdparty/misc/open-simplex-noise-LICENSE
new file mode 100644
index 0000000000..a84c395662
--- /dev/null
+++ b/thirdparty/misc/open-simplex-noise-LICENSE
@@ -0,0 +1,25 @@
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+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 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.
+
+For more information, please refer to <http://unlicense.org>
+
diff --git a/thirdparty/misc/open-simplex-noise-no-allocate.patch b/thirdparty/misc/open-simplex-noise-no-allocate.patch
new file mode 100644
index 0000000000..fc3abe7d00
--- /dev/null
+++ b/thirdparty/misc/open-simplex-noise-no-allocate.patch
@@ -0,0 +1,133 @@
+diff -u orig/open-simplex-noise.c misc/open-simplex-noise.c
+--- orig/open-simplex-noise.c 2018-09-14 11:11:40.049810000 +0200
++++ misc/open-simplex-noise.c 2018-09-14 11:09:39.726457000 +0200
+@@ -13,6 +13,11 @@
+ * of any particular randomization library, so results
+ * will be the same when ported to other languages.
+ */
++
++// -- GODOT start --
++// Modified to work without allocating memory, also removed some unused function.
++// -- GODOT end --
++
+ #include <math.h>
+ #include <stdlib.h>
+ #include <stdint.h>
+@@ -34,11 +39,12 @@
+
+ #define DEFAULT_SEED (0LL)
+
+-struct osn_context {
++// -- GODOT start --
++/*struct osn_context {
+ int16_t *perm;
+ int16_t *permGradIndex3D;
+-};
+-
++};*/
++// -- GODOT end --
+ #define ARRAYSIZE(x) (sizeof((x)) / sizeof((x)[0]))
+
+ /*
+@@ -126,7 +132,9 @@
+ int xi = (int) x;
+ return x < xi ? xi - 1 : xi;
+ }
+-
++
++// -- GODOT start --
++/*
+ static int allocate_perm(struct osn_context *ctx, int nperm, int ngrad)
+ {
+ if (ctx->perm)
+@@ -154,18 +162,21 @@
+ memcpy(ctx->perm, p, sizeof(*ctx->perm) * nelements);
+
+ for (i = 0; i < 256; i++) {
+- /* Since 3D has 24 gradients, simple bitmask won't work, so precompute modulo array. */
++ // Since 3D has 24 gradients, simple bitmask won't work, so precompute modulo array.
+ ctx->permGradIndex3D[i] = (int16_t)((ctx->perm[i] % (ARRAYSIZE(gradients3D) / 3)) * 3);
+ }
+ return 0;
+ }
++*/
++// -- GODOT end --
+
+ /*
+ * Initializes using a permutation array generated from a 64-bit seed.
+ * Generates a proper permutation (i.e. doesn't merely perform N successive pair
+ * swaps on a base array). Uses a simple 64-bit LCG.
+ */
+-int open_simplex_noise(int64_t seed, struct osn_context **ctx)
++// -- GODOT start --
++int open_simplex_noise(int64_t seed, struct osn_context *ctx)
+ {
+ int rc;
+ int16_t source[256];
+@@ -174,20 +185,9 @@
+ int16_t *permGradIndex3D;
+ int r;
+
+- *ctx = (struct osn_context *) malloc(sizeof(**ctx));
+- if (!(*ctx))
+- return -ENOMEM;
+- (*ctx)->perm = NULL;
+- (*ctx)->permGradIndex3D = NULL;
+-
+- rc = allocate_perm(*ctx, 256, 256);
+- if (rc) {
+- free(*ctx);
+- return rc;
+- }
+-
+- perm = (*ctx)->perm;
+- permGradIndex3D = (*ctx)->permGradIndex3D;
++ perm = ctx->perm;
++ permGradIndex3D = ctx->permGradIndex3D;
++// -- GODOT end --
+
+ for (i = 0; i < 256; i++)
+ source[i] = (int16_t) i;
+@@ -206,6 +206,8 @@
+ return 0;
+ }
+
++// -- GODOT start --
++/*
+ void open_simplex_noise_free(struct osn_context *ctx)
+ {
+ if (!ctx)
+@@ -220,6 +222,8 @@
+ }
+ free(ctx);
+ }
++*/
++// -- GODOT end --
+
+ /* 2D OpenSimplex (Simplectic) Noise. */
+ double open_simplex_noise2(struct osn_context *ctx, double x, double y)
+diff -u orig/open-simplex-noise.h misc/open-simplex-noise.h
+--- orig/open-simplex-noise.h 2018-09-14 11:11:19.659807000 +0200
++++ misc/open-simplex-noise.h 2018-09-14 11:10:05.006460000 +0200
+@@ -35,11 +35,18 @@
+ extern "C" {
+ #endif
+
+-struct osn_context;
++// -- GODOT start --
++// Modified to work without allocating memory, also removed some unused function.
+
+-int open_simplex_noise(int64_t seed, struct osn_context **ctx);
++struct osn_context {
++ int16_t perm[256];
++ int16_t permGradIndex3D[256];
++};
++
++int open_simplex_noise(int64_t seed, struct osn_context *ctx);
++//int open_simplex_noise_init_perm(struct osn_context *ctx, int16_t p[], int nelements);
++// -- GODOT end --
+ void open_simplex_noise_free(struct osn_context *ctx);
+-int open_simplex_noise_init_perm(struct osn_context *ctx, int16_t p[], int nelements);
+ double open_simplex_noise2(struct osn_context *ctx, double x, double y);
+ double open_simplex_noise3(struct osn_context *ctx, double x, double y, double z);
+ double open_simplex_noise4(struct osn_context *ctx, double x, double y, double z, double w);
diff --git a/thirdparty/misc/open-simplex-noise.c b/thirdparty/misc/open-simplex-noise.c
new file mode 100644
index 0000000000..42f2fbb5be
--- /dev/null
+++ b/thirdparty/misc/open-simplex-noise.c
@@ -0,0 +1,2254 @@
+/*
+ * OpenSimplex (Simplectic) Noise in C.
+ * Ported by Stephen M. Cameron from Kurt Spencer's java implementation
+ *
+ * v1.1 (October 5, 2014)
+ * - Added 2D and 4D implementations.
+ * - Proper gradient sets for all dimensions, from a
+ * dimensionally-generalizable scheme with an actual
+ * rhyme and reason behind it.
+ * - Removed default permutation array in favor of
+ * default seed.
+ * - Changed seed-based constructor to be independent
+ * of any particular randomization library, so results
+ * will be the same when ported to other languages.
+ */
+
+// -- GODOT start --
+// Modified to work without allocating memory, also removed some unused function.
+// -- GODOT end --
+
+#include <math.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <errno.h>
+
+#include "open-simplex-noise.h"
+
+#define STRETCH_CONSTANT_2D (-0.211324865405187) /* (1 / sqrt(2 + 1) - 1 ) / 2; */
+#define SQUISH_CONSTANT_2D (0.366025403784439) /* (sqrt(2 + 1) -1) / 2; */
+#define STRETCH_CONSTANT_3D (-1.0 / 6.0) /* (1 / sqrt(3 + 1) - 1) / 3; */
+#define SQUISH_CONSTANT_3D (1.0 / 3.0) /* (sqrt(3+1)-1)/3; */
+#define STRETCH_CONSTANT_4D (-0.138196601125011) /* (1 / sqrt(4 + 1) - 1) / 4; */
+#define SQUISH_CONSTANT_4D (0.309016994374947) /* (sqrt(4 + 1) - 1) / 4; */
+
+#define NORM_CONSTANT_2D (47.0)
+#define NORM_CONSTANT_3D (103.0)
+#define NORM_CONSTANT_4D (30.0)
+
+#define DEFAULT_SEED (0LL)
+
+// -- GODOT start --
+/*struct osn_context {
+ int16_t *perm;
+ int16_t *permGradIndex3D;
+};*/
+// -- GODOT end --
+#define ARRAYSIZE(x) (sizeof((x)) / sizeof((x)[0]))
+
+/*
+ * Gradients for 2D. They approximate the directions to the
+ * vertices of an octagon from the center.
+ */
+static const int8_t gradients2D[] = {
+ 5, 2, 2, 5,
+ -5, 2, -2, 5,
+ 5, -2, 2, -5,
+ -5, -2, -2, -5,
+};
+
+/*
+ * Gradients for 3D. They approximate the directions to the
+ * vertices of a rhombicuboctahedron from the center, skewed so
+ * that the triangular and square facets can be inscribed inside
+ * circles of the same radius.
+ */
+static const signed char gradients3D[] = {
+ -11, 4, 4, -4, 11, 4, -4, 4, 11,
+ 11, 4, 4, 4, 11, 4, 4, 4, 11,
+ -11, -4, 4, -4, -11, 4, -4, -4, 11,
+ 11, -4, 4, 4, -11, 4, 4, -4, 11,
+ -11, 4, -4, -4, 11, -4, -4, 4, -11,
+ 11, 4, -4, 4, 11, -4, 4, 4, -11,
+ -11, -4, -4, -4, -11, -4, -4, -4, -11,
+ 11, -4, -4, 4, -11, -4, 4, -4, -11,
+};
+
+/*
+ * Gradients for 4D. They approximate the directions to the
+ * vertices of a disprismatotesseractihexadecachoron from the center,
+ * skewed so that the tetrahedral and cubic facets can be inscribed inside
+ * spheres of the same radius.
+ */
+static const signed char gradients4D[] = {
+ 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3,
+ -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3,
+ 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3,
+ -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3,
+ 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3,
+ -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3,
+ 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3,
+ -3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3,
+ 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3,
+ -3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3,
+ 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3,
+ -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3,
+ 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3,
+ -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3,
+ 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3,
+ -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3,
+};
+
+static double extrapolate2(struct osn_context *ctx, int xsb, int ysb, double dx, double dy)
+{
+ int16_t *perm = ctx->perm;
+ int index = perm[(perm[xsb & 0xFF] + ysb) & 0xFF] & 0x0E;
+ return gradients2D[index] * dx
+ + gradients2D[index + 1] * dy;
+}
+
+static double extrapolate3(struct osn_context *ctx, int xsb, int ysb, int zsb, double dx, double dy, double dz)
+{
+ int16_t *perm = ctx->perm;
+ int16_t *permGradIndex3D = ctx->permGradIndex3D;
+ int index = permGradIndex3D[(perm[(perm[xsb & 0xFF] + ysb) & 0xFF] + zsb) & 0xFF];
+ return gradients3D[index] * dx
+ + gradients3D[index + 1] * dy
+ + gradients3D[index + 2] * dz;
+}
+
+static double extrapolate4(struct osn_context *ctx, int xsb, int ysb, int zsb, int wsb, double dx, double dy, double dz, double dw)
+{
+ int16_t *perm = ctx->perm;
+ int index = perm[(perm[(perm[(perm[xsb & 0xFF] + ysb) & 0xFF] + zsb) & 0xFF] + wsb) & 0xFF] & 0xFC;
+ return gradients4D[index] * dx
+ + gradients4D[index + 1] * dy
+ + gradients4D[index + 2] * dz
+ + gradients4D[index + 3] * dw;
+}
+
+static INLINE int fastFloor(double x) {
+ int xi = (int) x;
+ return x < xi ? xi - 1 : xi;
+}
+
+// -- GODOT start --
+/*
+static int allocate_perm(struct osn_context *ctx, int nperm, int ngrad)
+{
+ if (ctx->perm)
+ free(ctx->perm);
+ if (ctx->permGradIndex3D)
+ free(ctx->permGradIndex3D);
+ ctx->perm = (int16_t *) malloc(sizeof(*ctx->perm) * nperm);
+ if (!ctx->perm)
+ return -ENOMEM;
+ ctx->permGradIndex3D = (int16_t *) malloc(sizeof(*ctx->permGradIndex3D) * ngrad);
+ if (!ctx->permGradIndex3D) {
+ free(ctx->perm);
+ return -ENOMEM;
+ }
+ return 0;
+}
+
+int open_simplex_noise_init_perm(struct osn_context *ctx, int16_t p[], int nelements)
+{
+ int i, rc;
+
+ rc = allocate_perm(ctx, nelements, 256);
+ if (rc)
+ return rc;
+ memcpy(ctx->perm, p, sizeof(*ctx->perm) * nelements);
+
+ for (i = 0; i < 256; i++) {
+ // Since 3D has 24 gradients, simple bitmask won't work, so precompute modulo array.
+ ctx->permGradIndex3D[i] = (int16_t)((ctx->perm[i] % (ARRAYSIZE(gradients3D) / 3)) * 3);
+ }
+ return 0;
+}
+*/
+// -- GODOT end --
+
+/*
+ * Initializes using a permutation array generated from a 64-bit seed.
+ * Generates a proper permutation (i.e. doesn't merely perform N successive pair
+ * swaps on a base array). Uses a simple 64-bit LCG.
+ */
+// -- GODOT start --
+int open_simplex_noise(int64_t seed, struct osn_context *ctx)
+{
+ int rc;
+ int16_t source[256];
+ int i;
+ int16_t *perm;
+ int16_t *permGradIndex3D;
+ int r;
+
+ perm = ctx->perm;
+ permGradIndex3D = ctx->permGradIndex3D;
+// -- GODOT end --
+
+ for (i = 0; i < 256; i++)
+ source[i] = (int16_t) i;
+ seed = seed * 6364136223846793005LL + 1442695040888963407LL;
+ seed = seed * 6364136223846793005LL + 1442695040888963407LL;
+ seed = seed * 6364136223846793005LL + 1442695040888963407LL;
+ for (i = 255; i >= 0; i--) {
+ seed = seed * 6364136223846793005LL + 1442695040888963407LL;
+ r = (int)((seed + 31) % (i + 1));
+ if (r < 0)
+ r += (i + 1);
+ perm[i] = source[r];
+ permGradIndex3D[i] = (short)((perm[i] % (ARRAYSIZE(gradients3D) / 3)) * 3);
+ source[r] = source[i];
+ }
+ return 0;
+}
+
+// -- GODOT start --
+/*
+void open_simplex_noise_free(struct osn_context *ctx)
+{
+ if (!ctx)
+ return;
+ if (ctx->perm) {
+ free(ctx->perm);
+ ctx->perm = NULL;
+ }
+ if (ctx->permGradIndex3D) {
+ free(ctx->permGradIndex3D);
+ ctx->permGradIndex3D = NULL;
+ }
+ free(ctx);
+}
+*/
+// -- GODOT end --
+
+/* 2D OpenSimplex (Simplectic) Noise. */
+double open_simplex_noise2(struct osn_context *ctx, double x, double y)
+{
+
+ /* Place input coordinates onto grid. */
+ double stretchOffset = (x + y) * STRETCH_CONSTANT_2D;
+ double xs = x + stretchOffset;
+ double ys = y + stretchOffset;
+
+ /* Floor to get grid coordinates of rhombus (stretched square) super-cell origin. */
+ int xsb = fastFloor(xs);
+ int ysb = fastFloor(ys);
+
+ /* Skew out to get actual coordinates of rhombus origin. We'll need these later. */
+ double squishOffset = (xsb + ysb) * SQUISH_CONSTANT_2D;
+ double xb = xsb + squishOffset;
+ double yb = ysb + squishOffset;
+
+ /* Compute grid coordinates relative to rhombus origin. */
+ double xins = xs - xsb;
+ double yins = ys - ysb;
+
+ /* Sum those together to get a value that determines which region we're in. */
+ double inSum = xins + yins;
+
+ /* Positions relative to origin point. */
+ double dx0 = x - xb;
+ double dy0 = y - yb;
+
+ /* We'll be defining these inside the next block and using them afterwards. */
+ double dx_ext, dy_ext;
+ int xsv_ext, ysv_ext;
+
+ double dx1;
+ double dy1;
+ double attn1;
+ double dx2;
+ double dy2;
+ double attn2;
+ double zins;
+ double attn0;
+ double attn_ext;
+
+ double value = 0;
+
+ /* Contribution (1,0) */
+ dx1 = dx0 - 1 - SQUISH_CONSTANT_2D;
+ dy1 = dy0 - 0 - SQUISH_CONSTANT_2D;
+ attn1 = 2 - dx1 * dx1 - dy1 * dy1;
+ if (attn1 > 0) {
+ attn1 *= attn1;
+ value += attn1 * attn1 * extrapolate2(ctx, xsb + 1, ysb + 0, dx1, dy1);
+ }
+
+ /* Contribution (0,1) */
+ dx2 = dx0 - 0 - SQUISH_CONSTANT_2D;
+ dy2 = dy0 - 1 - SQUISH_CONSTANT_2D;
+ attn2 = 2 - dx2 * dx2 - dy2 * dy2;
+ if (attn2 > 0) {
+ attn2 *= attn2;
+ value += attn2 * attn2 * extrapolate2(ctx, xsb + 0, ysb + 1, dx2, dy2);
+ }
+
+ if (inSum <= 1) { /* We're inside the triangle (2-Simplex) at (0,0) */
+ zins = 1 - inSum;
+ if (zins > xins || zins > yins) { /* (0,0) is one of the closest two triangular vertices */
+ if (xins > yins) {
+ xsv_ext = xsb + 1;
+ ysv_ext = ysb - 1;
+ dx_ext = dx0 - 1;
+ dy_ext = dy0 + 1;
+ } else {
+ xsv_ext = xsb - 1;
+ ysv_ext = ysb + 1;
+ dx_ext = dx0 + 1;
+ dy_ext = dy0 - 1;
+ }
+ } else { /* (1,0) and (0,1) are the closest two vertices. */
+ xsv_ext = xsb + 1;
+ ysv_ext = ysb + 1;
+ dx_ext = dx0 - 1 - 2 * SQUISH_CONSTANT_2D;
+ dy_ext = dy0 - 1 - 2 * SQUISH_CONSTANT_2D;
+ }
+ } else { /* We're inside the triangle (2-Simplex) at (1,1) */
+ zins = 2 - inSum;
+ if (zins < xins || zins < yins) { /* (0,0) is one of the closest two triangular vertices */
+ if (xins > yins) {
+ xsv_ext = xsb + 2;
+ ysv_ext = ysb + 0;
+ dx_ext = dx0 - 2 - 2 * SQUISH_CONSTANT_2D;
+ dy_ext = dy0 + 0 - 2 * SQUISH_CONSTANT_2D;
+ } else {
+ xsv_ext = xsb + 0;
+ ysv_ext = ysb + 2;
+ dx_ext = dx0 + 0 - 2 * SQUISH_CONSTANT_2D;
+ dy_ext = dy0 - 2 - 2 * SQUISH_CONSTANT_2D;
+ }
+ } else { /* (1,0) and (0,1) are the closest two vertices. */
+ dx_ext = dx0;
+ dy_ext = dy0;
+ xsv_ext = xsb;
+ ysv_ext = ysb;
+ }
+ xsb += 1;
+ ysb += 1;
+ dx0 = dx0 - 1 - 2 * SQUISH_CONSTANT_2D;
+ dy0 = dy0 - 1 - 2 * SQUISH_CONSTANT_2D;
+ }
+
+ /* Contribution (0,0) or (1,1) */
+ attn0 = 2 - dx0 * dx0 - dy0 * dy0;
+ if (attn0 > 0) {
+ attn0 *= attn0;
+ value += attn0 * attn0 * extrapolate2(ctx, xsb, ysb, dx0, dy0);
+ }
+
+ /* Extra Vertex */
+ attn_ext = 2 - dx_ext * dx_ext - dy_ext * dy_ext;
+ if (attn_ext > 0) {
+ attn_ext *= attn_ext;
+ value += attn_ext * attn_ext * extrapolate2(ctx, xsv_ext, ysv_ext, dx_ext, dy_ext);
+ }
+
+ return value / NORM_CONSTANT_2D;
+}
+
+/*
+ * 3D OpenSimplex (Simplectic) Noise
+ */
+double open_simplex_noise3(struct osn_context *ctx, double x, double y, double z)
+{
+
+ /* Place input coordinates on simplectic honeycomb. */
+ double stretchOffset = (x + y + z) * STRETCH_CONSTANT_3D;
+ double xs = x + stretchOffset;
+ double ys = y + stretchOffset;
+ double zs = z + stretchOffset;
+
+ /* Floor to get simplectic honeycomb coordinates of rhombohedron (stretched cube) super-cell origin. */
+ int xsb = fastFloor(xs);
+ int ysb = fastFloor(ys);
+ int zsb = fastFloor(zs);
+
+ /* Skew out to get actual coordinates of rhombohedron origin. We'll need these later. */
+ double squishOffset = (xsb + ysb + zsb) * SQUISH_CONSTANT_3D;
+ double xb = xsb + squishOffset;
+ double yb = ysb + squishOffset;
+ double zb = zsb + squishOffset;
+
+ /* Compute simplectic honeycomb coordinates relative to rhombohedral origin. */
+ double xins = xs - xsb;
+ double yins = ys - ysb;
+ double zins = zs - zsb;
+
+ /* Sum those together to get a value that determines which region we're in. */
+ double inSum = xins + yins + zins;
+
+ /* Positions relative to origin point. */
+ double dx0 = x - xb;
+ double dy0 = y - yb;
+ double dz0 = z - zb;
+
+ /* We'll be defining these inside the next block and using them afterwards. */
+ double dx_ext0, dy_ext0, dz_ext0;
+ double dx_ext1, dy_ext1, dz_ext1;
+ int xsv_ext0, ysv_ext0, zsv_ext0;
+ int xsv_ext1, ysv_ext1, zsv_ext1;
+
+ double wins;
+ int8_t c, c1, c2;
+ int8_t aPoint, bPoint;
+ double aScore, bScore;
+ int aIsFurtherSide;
+ int bIsFurtherSide;
+ double p1, p2, p3;
+ double score;
+ double attn0, attn1, attn2, attn3, attn4, attn5, attn6;
+ double dx1, dy1, dz1;
+ double dx2, dy2, dz2;
+ double dx3, dy3, dz3;
+ double dx4, dy4, dz4;
+ double dx5, dy5, dz5;
+ double dx6, dy6, dz6;
+ double attn_ext0, attn_ext1;
+
+ double value = 0;
+ if (inSum <= 1) { /* We're inside the tetrahedron (3-Simplex) at (0,0,0) */
+
+ /* Determine which two of (0,0,1), (0,1,0), (1,0,0) are closest. */
+ aPoint = 0x01;
+ aScore = xins;
+ bPoint = 0x02;
+ bScore = yins;
+ if (aScore >= bScore && zins > bScore) {
+ bScore = zins;
+ bPoint = 0x04;
+ } else if (aScore < bScore && zins > aScore) {
+ aScore = zins;
+ aPoint = 0x04;
+ }
+
+ /* Now we determine the two lattice points not part of the tetrahedron that may contribute.
+ This depends on the closest two tetrahedral vertices, including (0,0,0) */
+ wins = 1 - inSum;
+ if (wins > aScore || wins > bScore) { /* (0,0,0) is one of the closest two tetrahedral vertices. */
+ c = (bScore > aScore ? bPoint : aPoint); /* Our other closest vertex is the closest out of a and b. */
+
+ if ((c & 0x01) == 0) {
+ xsv_ext0 = xsb - 1;
+ xsv_ext1 = xsb;
+ dx_ext0 = dx0 + 1;
+ dx_ext1 = dx0;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsb + 1;
+ dx_ext0 = dx_ext1 = dx0 - 1;
+ }
+
+ if ((c & 0x02) == 0) {
+ ysv_ext0 = ysv_ext1 = ysb;
+ dy_ext0 = dy_ext1 = dy0;
+ if ((c & 0x01) == 0) {
+ ysv_ext1 -= 1;
+ dy_ext1 += 1;
+ } else {
+ ysv_ext0 -= 1;
+ dy_ext0 += 1;
+ }
+ } else {
+ ysv_ext0 = ysv_ext1 = ysb + 1;
+ dy_ext0 = dy_ext1 = dy0 - 1;
+ }
+
+ if ((c & 0x04) == 0) {
+ zsv_ext0 = zsb;
+ zsv_ext1 = zsb - 1;
+ dz_ext0 = dz0;
+ dz_ext1 = dz0 + 1;
+ } else {
+ zsv_ext0 = zsv_ext1 = zsb + 1;
+ dz_ext0 = dz_ext1 = dz0 - 1;
+ }
+ } else { /* (0,0,0) is not one of the closest two tetrahedral vertices. */
+ c = (int8_t)(aPoint | bPoint); /* Our two extra vertices are determined by the closest two. */
+
+ if ((c & 0x01) == 0) {
+ xsv_ext0 = xsb;
+ xsv_ext1 = xsb - 1;
+ dx_ext0 = dx0 - 2 * SQUISH_CONSTANT_3D;
+ dx_ext1 = dx0 + 1 - SQUISH_CONSTANT_3D;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsb + 1;
+ dx_ext0 = dx0 - 1 - 2 * SQUISH_CONSTANT_3D;
+ dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_3D;
+ }
+
+ if ((c & 0x02) == 0) {
+ ysv_ext0 = ysb;
+ ysv_ext1 = ysb - 1;
+ dy_ext0 = dy0 - 2 * SQUISH_CONSTANT_3D;
+ dy_ext1 = dy0 + 1 - SQUISH_CONSTANT_3D;
+ } else {
+ ysv_ext0 = ysv_ext1 = ysb + 1;
+ dy_ext0 = dy0 - 1 - 2 * SQUISH_CONSTANT_3D;
+ dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_3D;
+ }
+
+ if ((c & 0x04) == 0) {
+ zsv_ext0 = zsb;
+ zsv_ext1 = zsb - 1;
+ dz_ext0 = dz0 - 2 * SQUISH_CONSTANT_3D;
+ dz_ext1 = dz0 + 1 - SQUISH_CONSTANT_3D;
+ } else {
+ zsv_ext0 = zsv_ext1 = zsb + 1;
+ dz_ext0 = dz0 - 1 - 2 * SQUISH_CONSTANT_3D;
+ dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_3D;
+ }
+ }
+
+ /* Contribution (0,0,0) */
+ attn0 = 2 - dx0 * dx0 - dy0 * dy0 - dz0 * dz0;
+ if (attn0 > 0) {
+ attn0 *= attn0;
+ value += attn0 * attn0 * extrapolate3(ctx, xsb + 0, ysb + 0, zsb + 0, dx0, dy0, dz0);
+ }
+
+ /* Contribution (1,0,0) */
+ dx1 = dx0 - 1 - SQUISH_CONSTANT_3D;
+ dy1 = dy0 - 0 - SQUISH_CONSTANT_3D;
+ dz1 = dz0 - 0 - SQUISH_CONSTANT_3D;
+ attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1;
+ if (attn1 > 0) {
+ attn1 *= attn1;
+ value += attn1 * attn1 * extrapolate3(ctx, xsb + 1, ysb + 0, zsb + 0, dx1, dy1, dz1);
+ }
+
+ /* Contribution (0,1,0) */
+ dx2 = dx0 - 0 - SQUISH_CONSTANT_3D;
+ dy2 = dy0 - 1 - SQUISH_CONSTANT_3D;
+ dz2 = dz1;
+ attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2;
+ if (attn2 > 0) {
+ attn2 *= attn2;
+ value += attn2 * attn2 * extrapolate3(ctx, xsb + 0, ysb + 1, zsb + 0, dx2, dy2, dz2);
+ }
+
+ /* Contribution (0,0,1) */
+ dx3 = dx2;
+ dy3 = dy1;
+ dz3 = dz0 - 1 - SQUISH_CONSTANT_3D;
+ attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3;
+ if (attn3 > 0) {
+ attn3 *= attn3;
+ value += attn3 * attn3 * extrapolate3(ctx, xsb + 0, ysb + 0, zsb + 1, dx3, dy3, dz3);
+ }
+ } else if (inSum >= 2) { /* We're inside the tetrahedron (3-Simplex) at (1,1,1) */
+
+ /* Determine which two tetrahedral vertices are the closest, out of (1,1,0), (1,0,1), (0,1,1) but not (1,1,1). */
+ aPoint = 0x06;
+ aScore = xins;
+ bPoint = 0x05;
+ bScore = yins;
+ if (aScore <= bScore && zins < bScore) {
+ bScore = zins;
+ bPoint = 0x03;
+ } else if (aScore > bScore && zins < aScore) {
+ aScore = zins;
+ aPoint = 0x03;
+ }
+
+ /* Now we determine the two lattice points not part of the tetrahedron that may contribute.
+ This depends on the closest two tetrahedral vertices, including (1,1,1) */
+ wins = 3 - inSum;
+ if (wins < aScore || wins < bScore) { /* (1,1,1) is one of the closest two tetrahedral vertices. */
+ c = (bScore < aScore ? bPoint : aPoint); /* Our other closest vertex is the closest out of a and b. */
+
+ if ((c & 0x01) != 0) {
+ xsv_ext0 = xsb + 2;
+ xsv_ext1 = xsb + 1;
+ dx_ext0 = dx0 - 2 - 3 * SQUISH_CONSTANT_3D;
+ dx_ext1 = dx0 - 1 - 3 * SQUISH_CONSTANT_3D;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsb;
+ dx_ext0 = dx_ext1 = dx0 - 3 * SQUISH_CONSTANT_3D;
+ }
+
+ if ((c & 0x02) != 0) {
+ ysv_ext0 = ysv_ext1 = ysb + 1;
+ dy_ext0 = dy_ext1 = dy0 - 1 - 3 * SQUISH_CONSTANT_3D;
+ if ((c & 0x01) != 0) {
+ ysv_ext1 += 1;
+ dy_ext1 -= 1;
+ } else {
+ ysv_ext0 += 1;
+ dy_ext0 -= 1;
+ }
+ } else {
+ ysv_ext0 = ysv_ext1 = ysb;
+ dy_ext0 = dy_ext1 = dy0 - 3 * SQUISH_CONSTANT_3D;
+ }
+
+ if ((c & 0x04) != 0) {
+ zsv_ext0 = zsb + 1;
+ zsv_ext1 = zsb + 2;
+ dz_ext0 = dz0 - 1 - 3 * SQUISH_CONSTANT_3D;
+ dz_ext1 = dz0 - 2 - 3 * SQUISH_CONSTANT_3D;
+ } else {
+ zsv_ext0 = zsv_ext1 = zsb;
+ dz_ext0 = dz_ext1 = dz0 - 3 * SQUISH_CONSTANT_3D;
+ }
+ } else { /* (1,1,1) is not one of the closest two tetrahedral vertices. */
+ c = (int8_t)(aPoint & bPoint); /* Our two extra vertices are determined by the closest two. */
+
+ if ((c & 0x01) != 0) {
+ xsv_ext0 = xsb + 1;
+ xsv_ext1 = xsb + 2;
+ dx_ext0 = dx0 - 1 - SQUISH_CONSTANT_3D;
+ dx_ext1 = dx0 - 2 - 2 * SQUISH_CONSTANT_3D;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsb;
+ dx_ext0 = dx0 - SQUISH_CONSTANT_3D;
+ dx_ext1 = dx0 - 2 * SQUISH_CONSTANT_3D;
+ }
+
+ if ((c & 0x02) != 0) {
+ ysv_ext0 = ysb + 1;
+ ysv_ext1 = ysb + 2;
+ dy_ext0 = dy0 - 1 - SQUISH_CONSTANT_3D;
+ dy_ext1 = dy0 - 2 - 2 * SQUISH_CONSTANT_3D;
+ } else {
+ ysv_ext0 = ysv_ext1 = ysb;
+ dy_ext0 = dy0 - SQUISH_CONSTANT_3D;
+ dy_ext1 = dy0 - 2 * SQUISH_CONSTANT_3D;
+ }
+
+ if ((c & 0x04) != 0) {
+ zsv_ext0 = zsb + 1;
+ zsv_ext1 = zsb + 2;
+ dz_ext0 = dz0 - 1 - SQUISH_CONSTANT_3D;
+ dz_ext1 = dz0 - 2 - 2 * SQUISH_CONSTANT_3D;
+ } else {
+ zsv_ext0 = zsv_ext1 = zsb;
+ dz_ext0 = dz0 - SQUISH_CONSTANT_3D;
+ dz_ext1 = dz0 - 2 * SQUISH_CONSTANT_3D;
+ }
+ }
+
+ /* Contribution (1,1,0) */
+ dx3 = dx0 - 1 - 2 * SQUISH_CONSTANT_3D;
+ dy3 = dy0 - 1 - 2 * SQUISH_CONSTANT_3D;
+ dz3 = dz0 - 0 - 2 * SQUISH_CONSTANT_3D;
+ attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3;
+ if (attn3 > 0) {
+ attn3 *= attn3;
+ value += attn3 * attn3 * extrapolate3(ctx, xsb + 1, ysb + 1, zsb + 0, dx3, dy3, dz3);
+ }
+
+ /* Contribution (1,0,1) */
+ dx2 = dx3;
+ dy2 = dy0 - 0 - 2 * SQUISH_CONSTANT_3D;
+ dz2 = dz0 - 1 - 2 * SQUISH_CONSTANT_3D;
+ attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2;
+ if (attn2 > 0) {
+ attn2 *= attn2;
+ value += attn2 * attn2 * extrapolate3(ctx, xsb + 1, ysb + 0, zsb + 1, dx2, dy2, dz2);
+ }
+
+ /* Contribution (0,1,1) */
+ dx1 = dx0 - 0 - 2 * SQUISH_CONSTANT_3D;
+ dy1 = dy3;
+ dz1 = dz2;
+ attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1;
+ if (attn1 > 0) {
+ attn1 *= attn1;
+ value += attn1 * attn1 * extrapolate3(ctx, xsb + 0, ysb + 1, zsb + 1, dx1, dy1, dz1);
+ }
+
+ /* Contribution (1,1,1) */
+ dx0 = dx0 - 1 - 3 * SQUISH_CONSTANT_3D;
+ dy0 = dy0 - 1 - 3 * SQUISH_CONSTANT_3D;
+ dz0 = dz0 - 1 - 3 * SQUISH_CONSTANT_3D;
+ attn0 = 2 - dx0 * dx0 - dy0 * dy0 - dz0 * dz0;
+ if (attn0 > 0) {
+ attn0 *= attn0;
+ value += attn0 * attn0 * extrapolate3(ctx, xsb + 1, ysb + 1, zsb + 1, dx0, dy0, dz0);
+ }
+ } else { /* We're inside the octahedron (Rectified 3-Simplex) in between.
+ Decide between point (0,0,1) and (1,1,0) as closest */
+ p1 = xins + yins;
+ if (p1 > 1) {
+ aScore = p1 - 1;
+ aPoint = 0x03;
+ aIsFurtherSide = 1;
+ } else {
+ aScore = 1 - p1;
+ aPoint = 0x04;
+ aIsFurtherSide = 0;
+ }
+
+ /* Decide between point (0,1,0) and (1,0,1) as closest */
+ p2 = xins + zins;
+ if (p2 > 1) {
+ bScore = p2 - 1;
+ bPoint = 0x05;
+ bIsFurtherSide = 1;
+ } else {
+ bScore = 1 - p2;
+ bPoint = 0x02;
+ bIsFurtherSide = 0;
+ }
+
+ /* The closest out of the two (1,0,0) and (0,1,1) will replace the furthest out of the two decided above, if closer. */
+ p3 = yins + zins;
+ if (p3 > 1) {
+ score = p3 - 1;
+ if (aScore <= bScore && aScore < score) {
+ aScore = score;
+ aPoint = 0x06;
+ aIsFurtherSide = 1;
+ } else if (aScore > bScore && bScore < score) {
+ bScore = score;
+ bPoint = 0x06;
+ bIsFurtherSide = 1;
+ }
+ } else {
+ score = 1 - p3;
+ if (aScore <= bScore && aScore < score) {
+ aScore = score;
+ aPoint = 0x01;
+ aIsFurtherSide = 0;
+ } else if (aScore > bScore && bScore < score) {
+ bScore = score;
+ bPoint = 0x01;
+ bIsFurtherSide = 0;
+ }
+ }
+
+ /* Where each of the two closest points are determines how the extra two vertices are calculated. */
+ if (aIsFurtherSide == bIsFurtherSide) {
+ if (aIsFurtherSide) { /* Both closest points on (1,1,1) side */
+
+ /* One of the two extra points is (1,1,1) */
+ dx_ext0 = dx0 - 1 - 3 * SQUISH_CONSTANT_3D;
+ dy_ext0 = dy0 - 1 - 3 * SQUISH_CONSTANT_3D;
+ dz_ext0 = dz0 - 1 - 3 * SQUISH_CONSTANT_3D;
+ xsv_ext0 = xsb + 1;
+ ysv_ext0 = ysb + 1;
+ zsv_ext0 = zsb + 1;
+
+ /* Other extra point is based on the shared axis. */
+ c = (int8_t)(aPoint & bPoint);
+ if ((c & 0x01) != 0) {
+ dx_ext1 = dx0 - 2 - 2 * SQUISH_CONSTANT_3D;
+ dy_ext1 = dy0 - 2 * SQUISH_CONSTANT_3D;
+ dz_ext1 = dz0 - 2 * SQUISH_CONSTANT_3D;
+ xsv_ext1 = xsb + 2;
+ ysv_ext1 = ysb;
+ zsv_ext1 = zsb;
+ } else if ((c & 0x02) != 0) {
+ dx_ext1 = dx0 - 2 * SQUISH_CONSTANT_3D;
+ dy_ext1 = dy0 - 2 - 2 * SQUISH_CONSTANT_3D;
+ dz_ext1 = dz0 - 2 * SQUISH_CONSTANT_3D;
+ xsv_ext1 = xsb;
+ ysv_ext1 = ysb + 2;
+ zsv_ext1 = zsb;
+ } else {
+ dx_ext1 = dx0 - 2 * SQUISH_CONSTANT_3D;
+ dy_ext1 = dy0 - 2 * SQUISH_CONSTANT_3D;
+ dz_ext1 = dz0 - 2 - 2 * SQUISH_CONSTANT_3D;
+ xsv_ext1 = xsb;
+ ysv_ext1 = ysb;
+ zsv_ext1 = zsb + 2;
+ }
+ } else { /* Both closest points on (0,0,0) side */
+
+ /* One of the two extra points is (0,0,0) */
+ dx_ext0 = dx0;
+ dy_ext0 = dy0;
+ dz_ext0 = dz0;
+ xsv_ext0 = xsb;
+ ysv_ext0 = ysb;
+ zsv_ext0 = zsb;
+
+ /* Other extra point is based on the omitted axis. */
+ c = (int8_t)(aPoint | bPoint);
+ if ((c & 0x01) == 0) {
+ dx_ext1 = dx0 + 1 - SQUISH_CONSTANT_3D;
+ dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_3D;
+ dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_3D;
+ xsv_ext1 = xsb - 1;
+ ysv_ext1 = ysb + 1;
+ zsv_ext1 = zsb + 1;
+ } else if ((c & 0x02) == 0) {
+ dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_3D;
+ dy_ext1 = dy0 + 1 - SQUISH_CONSTANT_3D;
+ dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_3D;
+ xsv_ext1 = xsb + 1;
+ ysv_ext1 = ysb - 1;
+ zsv_ext1 = zsb + 1;
+ } else {
+ dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_3D;
+ dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_3D;
+ dz_ext1 = dz0 + 1 - SQUISH_CONSTANT_3D;
+ xsv_ext1 = xsb + 1;
+ ysv_ext1 = ysb + 1;
+ zsv_ext1 = zsb - 1;
+ }
+ }
+ } else { /* One point on (0,0,0) side, one point on (1,1,1) side */
+ if (aIsFurtherSide) {
+ c1 = aPoint;
+ c2 = bPoint;
+ } else {
+ c1 = bPoint;
+ c2 = aPoint;
+ }
+
+ /* One contribution is a permutation of (1,1,-1) */
+ if ((c1 & 0x01) == 0) {
+ dx_ext0 = dx0 + 1 - SQUISH_CONSTANT_3D;
+ dy_ext0 = dy0 - 1 - SQUISH_CONSTANT_3D;
+ dz_ext0 = dz0 - 1 - SQUISH_CONSTANT_3D;
+ xsv_ext0 = xsb - 1;
+ ysv_ext0 = ysb + 1;
+ zsv_ext0 = zsb + 1;
+ } else if ((c1 & 0x02) == 0) {
+ dx_ext0 = dx0 - 1 - SQUISH_CONSTANT_3D;
+ dy_ext0 = dy0 + 1 - SQUISH_CONSTANT_3D;
+ dz_ext0 = dz0 - 1 - SQUISH_CONSTANT_3D;
+ xsv_ext0 = xsb + 1;
+ ysv_ext0 = ysb - 1;
+ zsv_ext0 = zsb + 1;
+ } else {
+ dx_ext0 = dx0 - 1 - SQUISH_CONSTANT_3D;
+ dy_ext0 = dy0 - 1 - SQUISH_CONSTANT_3D;
+ dz_ext0 = dz0 + 1 - SQUISH_CONSTANT_3D;
+ xsv_ext0 = xsb + 1;
+ ysv_ext0 = ysb + 1;
+ zsv_ext0 = zsb - 1;
+ }
+
+ /* One contribution is a permutation of (0,0,2) */
+ dx_ext1 = dx0 - 2 * SQUISH_CONSTANT_3D;
+ dy_ext1 = dy0 - 2 * SQUISH_CONSTANT_3D;
+ dz_ext1 = dz0 - 2 * SQUISH_CONSTANT_3D;
+ xsv_ext1 = xsb;
+ ysv_ext1 = ysb;
+ zsv_ext1 = zsb;
+ if ((c2 & 0x01) != 0) {
+ dx_ext1 -= 2;
+ xsv_ext1 += 2;
+ } else if ((c2 & 0x02) != 0) {
+ dy_ext1 -= 2;
+ ysv_ext1 += 2;
+ } else {
+ dz_ext1 -= 2;
+ zsv_ext1 += 2;
+ }
+ }
+
+ /* Contribution (1,0,0) */
+ dx1 = dx0 - 1 - SQUISH_CONSTANT_3D;
+ dy1 = dy0 - 0 - SQUISH_CONSTANT_3D;
+ dz1 = dz0 - 0 - SQUISH_CONSTANT_3D;
+ attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1;
+ if (attn1 > 0) {
+ attn1 *= attn1;
+ value += attn1 * attn1 * extrapolate3(ctx, xsb + 1, ysb + 0, zsb + 0, dx1, dy1, dz1);
+ }
+
+ /* Contribution (0,1,0) */
+ dx2 = dx0 - 0 - SQUISH_CONSTANT_3D;
+ dy2 = dy0 - 1 - SQUISH_CONSTANT_3D;
+ dz2 = dz1;
+ attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2;
+ if (attn2 > 0) {
+ attn2 *= attn2;
+ value += attn2 * attn2 * extrapolate3(ctx, xsb + 0, ysb + 1, zsb + 0, dx2, dy2, dz2);
+ }
+
+ /* Contribution (0,0,1) */
+ dx3 = dx2;
+ dy3 = dy1;
+ dz3 = dz0 - 1 - SQUISH_CONSTANT_3D;
+ attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3;
+ if (attn3 > 0) {
+ attn3 *= attn3;
+ value += attn3 * attn3 * extrapolate3(ctx, xsb + 0, ysb + 0, zsb + 1, dx3, dy3, dz3);
+ }
+
+ /* Contribution (1,1,0) */
+ dx4 = dx0 - 1 - 2 * SQUISH_CONSTANT_3D;
+ dy4 = dy0 - 1 - 2 * SQUISH_CONSTANT_3D;
+ dz4 = dz0 - 0 - 2 * SQUISH_CONSTANT_3D;
+ attn4 = 2 - dx4 * dx4 - dy4 * dy4 - dz4 * dz4;
+ if (attn4 > 0) {
+ attn4 *= attn4;
+ value += attn4 * attn4 * extrapolate3(ctx, xsb + 1, ysb + 1, zsb + 0, dx4, dy4, dz4);
+ }
+
+ /* Contribution (1,0,1) */
+ dx5 = dx4;
+ dy5 = dy0 - 0 - 2 * SQUISH_CONSTANT_3D;
+ dz5 = dz0 - 1 - 2 * SQUISH_CONSTANT_3D;
+ attn5 = 2 - dx5 * dx5 - dy5 * dy5 - dz5 * dz5;
+ if (attn5 > 0) {
+ attn5 *= attn5;
+ value += attn5 * attn5 * extrapolate3(ctx, xsb + 1, ysb + 0, zsb + 1, dx5, dy5, dz5);
+ }
+
+ /* Contribution (0,1,1) */
+ dx6 = dx0 - 0 - 2 * SQUISH_CONSTANT_3D;
+ dy6 = dy4;
+ dz6 = dz5;
+ attn6 = 2 - dx6 * dx6 - dy6 * dy6 - dz6 * dz6;
+ if (attn6 > 0) {
+ attn6 *= attn6;
+ value += attn6 * attn6 * extrapolate3(ctx, xsb + 0, ysb + 1, zsb + 1, dx6, dy6, dz6);
+ }
+ }
+
+ /* First extra vertex */
+ attn_ext0 = 2 - dx_ext0 * dx_ext0 - dy_ext0 * dy_ext0 - dz_ext0 * dz_ext0;
+ if (attn_ext0 > 0)
+ {
+ attn_ext0 *= attn_ext0;
+ value += attn_ext0 * attn_ext0 * extrapolate3(ctx, xsv_ext0, ysv_ext0, zsv_ext0, dx_ext0, dy_ext0, dz_ext0);
+ }
+
+ /* Second extra vertex */
+ attn_ext1 = 2 - dx_ext1 * dx_ext1 - dy_ext1 * dy_ext1 - dz_ext1 * dz_ext1;
+ if (attn_ext1 > 0)
+ {
+ attn_ext1 *= attn_ext1;
+ value += attn_ext1 * attn_ext1 * extrapolate3(ctx, xsv_ext1, ysv_ext1, zsv_ext1, dx_ext1, dy_ext1, dz_ext1);
+ }
+
+ return value / NORM_CONSTANT_3D;
+}
+
+/*
+ * 4D OpenSimplex (Simplectic) Noise.
+ */
+double open_simplex_noise4(struct osn_context *ctx, double x, double y, double z, double w)
+{
+ double uins;
+ double dx1, dy1, dz1, dw1;
+ double dx2, dy2, dz2, dw2;
+ double dx3, dy3, dz3, dw3;
+ double dx4, dy4, dz4, dw4;
+ double dx5, dy5, dz5, dw5;
+ double dx6, dy6, dz6, dw6;
+ double dx7, dy7, dz7, dw7;
+ double dx8, dy8, dz8, dw8;
+ double dx9, dy9, dz9, dw9;
+ double dx10, dy10, dz10, dw10;
+ double attn0, attn1, attn2, attn3, attn4;
+ double attn5, attn6, attn7, attn8, attn9, attn10;
+ double attn_ext0, attn_ext1, attn_ext2;
+ int8_t c, c1, c2;
+ int8_t aPoint, bPoint;
+ double aScore, bScore;
+ int aIsBiggerSide;
+ int bIsBiggerSide;
+ double p1, p2, p3, p4;
+ double score;
+
+ /* Place input coordinates on simplectic honeycomb. */
+ double stretchOffset = (x + y + z + w) * STRETCH_CONSTANT_4D;
+ double xs = x + stretchOffset;
+ double ys = y + stretchOffset;
+ double zs = z + stretchOffset;
+ double ws = w + stretchOffset;
+
+ /* Floor to get simplectic honeycomb coordinates of rhombo-hypercube super-cell origin. */
+ int xsb = fastFloor(xs);
+ int ysb = fastFloor(ys);
+ int zsb = fastFloor(zs);
+ int wsb = fastFloor(ws);
+
+ /* Skew out to get actual coordinates of stretched rhombo-hypercube origin. We'll need these later. */
+ double squishOffset = (xsb + ysb + zsb + wsb) * SQUISH_CONSTANT_4D;
+ double xb = xsb + squishOffset;
+ double yb = ysb + squishOffset;
+ double zb = zsb + squishOffset;
+ double wb = wsb + squishOffset;
+
+ /* Compute simplectic honeycomb coordinates relative to rhombo-hypercube origin. */
+ double xins = xs - xsb;
+ double yins = ys - ysb;
+ double zins = zs - zsb;
+ double wins = ws - wsb;
+
+ /* Sum those together to get a value that determines which region we're in. */
+ double inSum = xins + yins + zins + wins;
+
+ /* Positions relative to origin point. */
+ double dx0 = x - xb;
+ double dy0 = y - yb;
+ double dz0 = z - zb;
+ double dw0 = w - wb;
+
+ /* We'll be defining these inside the next block and using them afterwards. */
+ double dx_ext0, dy_ext0, dz_ext0, dw_ext0;
+ double dx_ext1, dy_ext1, dz_ext1, dw_ext1;
+ double dx_ext2, dy_ext2, dz_ext2, dw_ext2;
+ int xsv_ext0, ysv_ext0, zsv_ext0, wsv_ext0;
+ int xsv_ext1, ysv_ext1, zsv_ext1, wsv_ext1;
+ int xsv_ext2, ysv_ext2, zsv_ext2, wsv_ext2;
+
+ double value = 0;
+ if (inSum <= 1) { /* We're inside the pentachoron (4-Simplex) at (0,0,0,0) */
+
+ /* Determine which two of (0,0,0,1), (0,0,1,0), (0,1,0,0), (1,0,0,0) are closest. */
+ aPoint = 0x01;
+ aScore = xins;
+ bPoint = 0x02;
+ bScore = yins;
+ if (aScore >= bScore && zins > bScore) {
+ bScore = zins;
+ bPoint = 0x04;
+ } else if (aScore < bScore && zins > aScore) {
+ aScore = zins;
+ aPoint = 0x04;
+ }
+ if (aScore >= bScore && wins > bScore) {
+ bScore = wins;
+ bPoint = 0x08;
+ } else if (aScore < bScore && wins > aScore) {
+ aScore = wins;
+ aPoint = 0x08;
+ }
+
+ /* Now we determine the three lattice points not part of the pentachoron that may contribute.
+ This depends on the closest two pentachoron vertices, including (0,0,0,0) */
+ uins = 1 - inSum;
+ if (uins > aScore || uins > bScore) { /* (0,0,0,0) is one of the closest two pentachoron vertices. */
+ c = (bScore > aScore ? bPoint : aPoint); /* Our other closest vertex is the closest out of a and b. */
+ if ((c & 0x01) == 0) {
+ xsv_ext0 = xsb - 1;
+ xsv_ext1 = xsv_ext2 = xsb;
+ dx_ext0 = dx0 + 1;
+ dx_ext1 = dx_ext2 = dx0;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsv_ext2 = xsb + 1;
+ dx_ext0 = dx_ext1 = dx_ext2 = dx0 - 1;
+ }
+
+ if ((c & 0x02) == 0) {
+ ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb;
+ dy_ext0 = dy_ext1 = dy_ext2 = dy0;
+ if ((c & 0x01) == 0x01) {
+ ysv_ext0 -= 1;
+ dy_ext0 += 1;
+ } else {
+ ysv_ext1 -= 1;
+ dy_ext1 += 1;
+ }
+ } else {
+ ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb + 1;
+ dy_ext0 = dy_ext1 = dy_ext2 = dy0 - 1;
+ }
+
+ if ((c & 0x04) == 0) {
+ zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb;
+ dz_ext0 = dz_ext1 = dz_ext2 = dz0;
+ if ((c & 0x03) != 0) {
+ if ((c & 0x03) == 0x03) {
+ zsv_ext0 -= 1;
+ dz_ext0 += 1;
+ } else {
+ zsv_ext1 -= 1;
+ dz_ext1 += 1;
+ }
+ } else {
+ zsv_ext2 -= 1;
+ dz_ext2 += 1;
+ }
+ } else {
+ zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb + 1;
+ dz_ext0 = dz_ext1 = dz_ext2 = dz0 - 1;
+ }
+
+ if ((c & 0x08) == 0) {
+ wsv_ext0 = wsv_ext1 = wsb;
+ wsv_ext2 = wsb - 1;
+ dw_ext0 = dw_ext1 = dw0;
+ dw_ext2 = dw0 + 1;
+ } else {
+ wsv_ext0 = wsv_ext1 = wsv_ext2 = wsb + 1;
+ dw_ext0 = dw_ext1 = dw_ext2 = dw0 - 1;
+ }
+ } else { /* (0,0,0,0) is not one of the closest two pentachoron vertices. */
+ c = (int8_t)(aPoint | bPoint); /* Our three extra vertices are determined by the closest two. */
+
+ if ((c & 0x01) == 0) {
+ xsv_ext0 = xsv_ext2 = xsb;
+ xsv_ext1 = xsb - 1;
+ dx_ext0 = dx0 - 2 * SQUISH_CONSTANT_4D;
+ dx_ext1 = dx0 + 1 - SQUISH_CONSTANT_4D;
+ dx_ext2 = dx0 - SQUISH_CONSTANT_4D;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsv_ext2 = xsb + 1;
+ dx_ext0 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dx_ext1 = dx_ext2 = dx0 - 1 - SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x02) == 0) {
+ ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb;
+ dy_ext0 = dy0 - 2 * SQUISH_CONSTANT_4D;
+ dy_ext1 = dy_ext2 = dy0 - SQUISH_CONSTANT_4D;
+ if ((c & 0x01) == 0x01) {
+ ysv_ext1 -= 1;
+ dy_ext1 += 1;
+ } else {
+ ysv_ext2 -= 1;
+ dy_ext2 += 1;
+ }
+ } else {
+ ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb + 1;
+ dy_ext0 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dy_ext1 = dy_ext2 = dy0 - 1 - SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x04) == 0) {
+ zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb;
+ dz_ext0 = dz0 - 2 * SQUISH_CONSTANT_4D;
+ dz_ext1 = dz_ext2 = dz0 - SQUISH_CONSTANT_4D;
+ if ((c & 0x03) == 0x03) {
+ zsv_ext1 -= 1;
+ dz_ext1 += 1;
+ } else {
+ zsv_ext2 -= 1;
+ dz_ext2 += 1;
+ }
+ } else {
+ zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb + 1;
+ dz_ext0 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dz_ext1 = dz_ext2 = dz0 - 1 - SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x08) == 0) {
+ wsv_ext0 = wsv_ext1 = wsb;
+ wsv_ext2 = wsb - 1;
+ dw_ext0 = dw0 - 2 * SQUISH_CONSTANT_4D;
+ dw_ext1 = dw0 - SQUISH_CONSTANT_4D;
+ dw_ext2 = dw0 + 1 - SQUISH_CONSTANT_4D;
+ } else {
+ wsv_ext0 = wsv_ext1 = wsv_ext2 = wsb + 1;
+ dw_ext0 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dw_ext1 = dw_ext2 = dw0 - 1 - SQUISH_CONSTANT_4D;
+ }
+ }
+
+ /* Contribution (0,0,0,0) */
+ attn0 = 2 - dx0 * dx0 - dy0 * dy0 - dz0 * dz0 - dw0 * dw0;
+ if (attn0 > 0) {
+ attn0 *= attn0;
+ value += attn0 * attn0 * extrapolate4(ctx, xsb + 0, ysb + 0, zsb + 0, wsb + 0, dx0, dy0, dz0, dw0);
+ }
+
+ /* Contribution (1,0,0,0) */
+ dx1 = dx0 - 1 - SQUISH_CONSTANT_4D;
+ dy1 = dy0 - 0 - SQUISH_CONSTANT_4D;
+ dz1 = dz0 - 0 - SQUISH_CONSTANT_4D;
+ dw1 = dw0 - 0 - SQUISH_CONSTANT_4D;
+ attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1 - dw1 * dw1;
+ if (attn1 > 0) {
+ attn1 *= attn1;
+ value += attn1 * attn1 * extrapolate4(ctx, xsb + 1, ysb + 0, zsb + 0, wsb + 0, dx1, dy1, dz1, dw1);
+ }
+
+ /* Contribution (0,1,0,0) */
+ dx2 = dx0 - 0 - SQUISH_CONSTANT_4D;
+ dy2 = dy0 - 1 - SQUISH_CONSTANT_4D;
+ dz2 = dz1;
+ dw2 = dw1;
+ attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2 - dw2 * dw2;
+ if (attn2 > 0) {
+ attn2 *= attn2;
+ value += attn2 * attn2 * extrapolate4(ctx, xsb + 0, ysb + 1, zsb + 0, wsb + 0, dx2, dy2, dz2, dw2);
+ }
+
+ /* Contribution (0,0,1,0) */
+ dx3 = dx2;
+ dy3 = dy1;
+ dz3 = dz0 - 1 - SQUISH_CONSTANT_4D;
+ dw3 = dw1;
+ attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3 - dw3 * dw3;
+ if (attn3 > 0) {
+ attn3 *= attn3;
+ value += attn3 * attn3 * extrapolate4(ctx, xsb + 0, ysb + 0, zsb + 1, wsb + 0, dx3, dy3, dz3, dw3);
+ }
+
+ /* Contribution (0,0,0,1) */
+ dx4 = dx2;
+ dy4 = dy1;
+ dz4 = dz1;
+ dw4 = dw0 - 1 - SQUISH_CONSTANT_4D;
+ attn4 = 2 - dx4 * dx4 - dy4 * dy4 - dz4 * dz4 - dw4 * dw4;
+ if (attn4 > 0) {
+ attn4 *= attn4;
+ value += attn4 * attn4 * extrapolate4(ctx, xsb + 0, ysb + 0, zsb + 0, wsb + 1, dx4, dy4, dz4, dw4);
+ }
+ } else if (inSum >= 3) { /* We're inside the pentachoron (4-Simplex) at (1,1,1,1)
+ Determine which two of (1,1,1,0), (1,1,0,1), (1,0,1,1), (0,1,1,1) are closest. */
+ aPoint = 0x0E;
+ aScore = xins;
+ bPoint = 0x0D;
+ bScore = yins;
+ if (aScore <= bScore && zins < bScore) {
+ bScore = zins;
+ bPoint = 0x0B;
+ } else if (aScore > bScore && zins < aScore) {
+ aScore = zins;
+ aPoint = 0x0B;
+ }
+ if (aScore <= bScore && wins < bScore) {
+ bScore = wins;
+ bPoint = 0x07;
+ } else if (aScore > bScore && wins < aScore) {
+ aScore = wins;
+ aPoint = 0x07;
+ }
+
+ /* Now we determine the three lattice points not part of the pentachoron that may contribute.
+ This depends on the closest two pentachoron vertices, including (0,0,0,0) */
+ uins = 4 - inSum;
+ if (uins < aScore || uins < bScore) { /* (1,1,1,1) is one of the closest two pentachoron vertices. */
+ c = (bScore < aScore ? bPoint : aPoint); /* Our other closest vertex is the closest out of a and b. */
+
+ if ((c & 0x01) != 0) {
+ xsv_ext0 = xsb + 2;
+ xsv_ext1 = xsv_ext2 = xsb + 1;
+ dx_ext0 = dx0 - 2 - 4 * SQUISH_CONSTANT_4D;
+ dx_ext1 = dx_ext2 = dx0 - 1 - 4 * SQUISH_CONSTANT_4D;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsv_ext2 = xsb;
+ dx_ext0 = dx_ext1 = dx_ext2 = dx0 - 4 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x02) != 0) {
+ ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb + 1;
+ dy_ext0 = dy_ext1 = dy_ext2 = dy0 - 1 - 4 * SQUISH_CONSTANT_4D;
+ if ((c & 0x01) != 0) {
+ ysv_ext1 += 1;
+ dy_ext1 -= 1;
+ } else {
+ ysv_ext0 += 1;
+ dy_ext0 -= 1;
+ }
+ } else {
+ ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb;
+ dy_ext0 = dy_ext1 = dy_ext2 = dy0 - 4 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x04) != 0) {
+ zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb + 1;
+ dz_ext0 = dz_ext1 = dz_ext2 = dz0 - 1 - 4 * SQUISH_CONSTANT_4D;
+ if ((c & 0x03) != 0x03) {
+ if ((c & 0x03) == 0) {
+ zsv_ext0 += 1;
+ dz_ext0 -= 1;
+ } else {
+ zsv_ext1 += 1;
+ dz_ext1 -= 1;
+ }
+ } else {
+ zsv_ext2 += 1;
+ dz_ext2 -= 1;
+ }
+ } else {
+ zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb;
+ dz_ext0 = dz_ext1 = dz_ext2 = dz0 - 4 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x08) != 0) {
+ wsv_ext0 = wsv_ext1 = wsb + 1;
+ wsv_ext2 = wsb + 2;
+ dw_ext0 = dw_ext1 = dw0 - 1 - 4 * SQUISH_CONSTANT_4D;
+ dw_ext2 = dw0 - 2 - 4 * SQUISH_CONSTANT_4D;
+ } else {
+ wsv_ext0 = wsv_ext1 = wsv_ext2 = wsb;
+ dw_ext0 = dw_ext1 = dw_ext2 = dw0 - 4 * SQUISH_CONSTANT_4D;
+ }
+ } else { /* (1,1,1,1) is not one of the closest two pentachoron vertices. */
+ c = (int8_t)(aPoint & bPoint); /* Our three extra vertices are determined by the closest two. */
+
+ if ((c & 0x01) != 0) {
+ xsv_ext0 = xsv_ext2 = xsb + 1;
+ xsv_ext1 = xsb + 2;
+ dx_ext0 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dx_ext1 = dx0 - 2 - 3 * SQUISH_CONSTANT_4D;
+ dx_ext2 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsv_ext2 = xsb;
+ dx_ext0 = dx0 - 2 * SQUISH_CONSTANT_4D;
+ dx_ext1 = dx_ext2 = dx0 - 3 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x02) != 0) {
+ ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb + 1;
+ dy_ext0 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dy_ext1 = dy_ext2 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ if ((c & 0x01) != 0) {
+ ysv_ext2 += 1;
+ dy_ext2 -= 1;
+ } else {
+ ysv_ext1 += 1;
+ dy_ext1 -= 1;
+ }
+ } else {
+ ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb;
+ dy_ext0 = dy0 - 2 * SQUISH_CONSTANT_4D;
+ dy_ext1 = dy_ext2 = dy0 - 3 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x04) != 0) {
+ zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb + 1;
+ dz_ext0 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dz_ext1 = dz_ext2 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ if ((c & 0x03) != 0) {
+ zsv_ext2 += 1;
+ dz_ext2 -= 1;
+ } else {
+ zsv_ext1 += 1;
+ dz_ext1 -= 1;
+ }
+ } else {
+ zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb;
+ dz_ext0 = dz0 - 2 * SQUISH_CONSTANT_4D;
+ dz_ext1 = dz_ext2 = dz0 - 3 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x08) != 0) {
+ wsv_ext0 = wsv_ext1 = wsb + 1;
+ wsv_ext2 = wsb + 2;
+ dw_ext0 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dw_ext1 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dw_ext2 = dw0 - 2 - 3 * SQUISH_CONSTANT_4D;
+ } else {
+ wsv_ext0 = wsv_ext1 = wsv_ext2 = wsb;
+ dw_ext0 = dw0 - 2 * SQUISH_CONSTANT_4D;
+ dw_ext1 = dw_ext2 = dw0 - 3 * SQUISH_CONSTANT_4D;
+ }
+ }
+
+ /* Contribution (1,1,1,0) */
+ dx4 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dy4 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dz4 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dw4 = dw0 - 3 * SQUISH_CONSTANT_4D;
+ attn4 = 2 - dx4 * dx4 - dy4 * dy4 - dz4 * dz4 - dw4 * dw4;
+ if (attn4 > 0) {
+ attn4 *= attn4;
+ value += attn4 * attn4 * extrapolate4(ctx, xsb + 1, ysb + 1, zsb + 1, wsb + 0, dx4, dy4, dz4, dw4);
+ }
+
+ /* Contribution (1,1,0,1) */
+ dx3 = dx4;
+ dy3 = dy4;
+ dz3 = dz0 - 3 * SQUISH_CONSTANT_4D;
+ dw3 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3 - dw3 * dw3;
+ if (attn3 > 0) {
+ attn3 *= attn3;
+ value += attn3 * attn3 * extrapolate4(ctx, xsb + 1, ysb + 1, zsb + 0, wsb + 1, dx3, dy3, dz3, dw3);
+ }
+
+ /* Contribution (1,0,1,1) */
+ dx2 = dx4;
+ dy2 = dy0 - 3 * SQUISH_CONSTANT_4D;
+ dz2 = dz4;
+ dw2 = dw3;
+ attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2 - dw2 * dw2;
+ if (attn2 > 0) {
+ attn2 *= attn2;
+ value += attn2 * attn2 * extrapolate4(ctx, xsb + 1, ysb + 0, zsb + 1, wsb + 1, dx2, dy2, dz2, dw2);
+ }
+
+ /* Contribution (0,1,1,1) */
+ dx1 = dx0 - 3 * SQUISH_CONSTANT_4D;
+ dz1 = dz4;
+ dy1 = dy4;
+ dw1 = dw3;
+ attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1 - dw1 * dw1;
+ if (attn1 > 0) {
+ attn1 *= attn1;
+ value += attn1 * attn1 * extrapolate4(ctx, xsb + 0, ysb + 1, zsb + 1, wsb + 1, dx1, dy1, dz1, dw1);
+ }
+
+ /* Contribution (1,1,1,1) */
+ dx0 = dx0 - 1 - 4 * SQUISH_CONSTANT_4D;
+ dy0 = dy0 - 1 - 4 * SQUISH_CONSTANT_4D;
+ dz0 = dz0 - 1 - 4 * SQUISH_CONSTANT_4D;
+ dw0 = dw0 - 1 - 4 * SQUISH_CONSTANT_4D;
+ attn0 = 2 - dx0 * dx0 - dy0 * dy0 - dz0 * dz0 - dw0 * dw0;
+ if (attn0 > 0) {
+ attn0 *= attn0;
+ value += attn0 * attn0 * extrapolate4(ctx, xsb + 1, ysb + 1, zsb + 1, wsb + 1, dx0, dy0, dz0, dw0);
+ }
+ } else if (inSum <= 2) { /* We're inside the first dispentachoron (Rectified 4-Simplex) */
+ aIsBiggerSide = 1;
+ bIsBiggerSide = 1;
+
+ /* Decide between (1,1,0,0) and (0,0,1,1) */
+ if (xins + yins > zins + wins) {
+ aScore = xins + yins;
+ aPoint = 0x03;
+ } else {
+ aScore = zins + wins;
+ aPoint = 0x0C;
+ }
+
+ /* Decide between (1,0,1,0) and (0,1,0,1) */
+ if (xins + zins > yins + wins) {
+ bScore = xins + zins;
+ bPoint = 0x05;
+ } else {
+ bScore = yins + wins;
+ bPoint = 0x0A;
+ }
+
+ /* Closer between (1,0,0,1) and (0,1,1,0) will replace the further of a and b, if closer. */
+ if (xins + wins > yins + zins) {
+ score = xins + wins;
+ if (aScore >= bScore && score > bScore) {
+ bScore = score;
+ bPoint = 0x09;
+ } else if (aScore < bScore && score > aScore) {
+ aScore = score;
+ aPoint = 0x09;
+ }
+ } else {
+ score = yins + zins;
+ if (aScore >= bScore && score > bScore) {
+ bScore = score;
+ bPoint = 0x06;
+ } else if (aScore < bScore && score > aScore) {
+ aScore = score;
+ aPoint = 0x06;
+ }
+ }
+
+ /* Decide if (1,0,0,0) is closer. */
+ p1 = 2 - inSum + xins;
+ if (aScore >= bScore && p1 > bScore) {
+ bScore = p1;
+ bPoint = 0x01;
+ bIsBiggerSide = 0;
+ } else if (aScore < bScore && p1 > aScore) {
+ aScore = p1;
+ aPoint = 0x01;
+ aIsBiggerSide = 0;
+ }
+
+ /* Decide if (0,1,0,0) is closer. */
+ p2 = 2 - inSum + yins;
+ if (aScore >= bScore && p2 > bScore) {
+ bScore = p2;
+ bPoint = 0x02;
+ bIsBiggerSide = 0;
+ } else if (aScore < bScore && p2 > aScore) {
+ aScore = p2;
+ aPoint = 0x02;
+ aIsBiggerSide = 0;
+ }
+
+ /* Decide if (0,0,1,0) is closer. */
+ p3 = 2 - inSum + zins;
+ if (aScore >= bScore && p3 > bScore) {
+ bScore = p3;
+ bPoint = 0x04;
+ bIsBiggerSide = 0;
+ } else if (aScore < bScore && p3 > aScore) {
+ aScore = p3;
+ aPoint = 0x04;
+ aIsBiggerSide = 0;
+ }
+
+ /* Decide if (0,0,0,1) is closer. */
+ p4 = 2 - inSum + wins;
+ if (aScore >= bScore && p4 > bScore) {
+ bScore = p4;
+ bPoint = 0x08;
+ bIsBiggerSide = 0;
+ } else if (aScore < bScore && p4 > aScore) {
+ aScore = p4;
+ aPoint = 0x08;
+ aIsBiggerSide = 0;
+ }
+
+ /* Where each of the two closest points are determines how the extra three vertices are calculated. */
+ if (aIsBiggerSide == bIsBiggerSide) {
+ if (aIsBiggerSide) { /* Both closest points on the bigger side */
+ c1 = (int8_t)(aPoint | bPoint);
+ c2 = (int8_t)(aPoint & bPoint);
+ if ((c1 & 0x01) == 0) {
+ xsv_ext0 = xsb;
+ xsv_ext1 = xsb - 1;
+ dx_ext0 = dx0 - 3 * SQUISH_CONSTANT_4D;
+ dx_ext1 = dx0 + 1 - 2 * SQUISH_CONSTANT_4D;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsb + 1;
+ dx_ext0 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dx_ext1 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c1 & 0x02) == 0) {
+ ysv_ext0 = ysb;
+ ysv_ext1 = ysb - 1;
+ dy_ext0 = dy0 - 3 * SQUISH_CONSTANT_4D;
+ dy_ext1 = dy0 + 1 - 2 * SQUISH_CONSTANT_4D;
+ } else {
+ ysv_ext0 = ysv_ext1 = ysb + 1;
+ dy_ext0 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dy_ext1 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c1 & 0x04) == 0) {
+ zsv_ext0 = zsb;
+ zsv_ext1 = zsb - 1;
+ dz_ext0 = dz0 - 3 * SQUISH_CONSTANT_4D;
+ dz_ext1 = dz0 + 1 - 2 * SQUISH_CONSTANT_4D;
+ } else {
+ zsv_ext0 = zsv_ext1 = zsb + 1;
+ dz_ext0 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dz_ext1 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c1 & 0x08) == 0) {
+ wsv_ext0 = wsb;
+ wsv_ext1 = wsb - 1;
+ dw_ext0 = dw0 - 3 * SQUISH_CONSTANT_4D;
+ dw_ext1 = dw0 + 1 - 2 * SQUISH_CONSTANT_4D;
+ } else {
+ wsv_ext0 = wsv_ext1 = wsb + 1;
+ dw_ext0 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dw_ext1 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ }
+
+ /* One combination is a permutation of (0,0,0,2) based on c2 */
+ xsv_ext2 = xsb;
+ ysv_ext2 = ysb;
+ zsv_ext2 = zsb;
+ wsv_ext2 = wsb;
+ dx_ext2 = dx0 - 2 * SQUISH_CONSTANT_4D;
+ dy_ext2 = dy0 - 2 * SQUISH_CONSTANT_4D;
+ dz_ext2 = dz0 - 2 * SQUISH_CONSTANT_4D;
+ dw_ext2 = dw0 - 2 * SQUISH_CONSTANT_4D;
+ if ((c2 & 0x01) != 0) {
+ xsv_ext2 += 2;
+ dx_ext2 -= 2;
+ } else if ((c2 & 0x02) != 0) {
+ ysv_ext2 += 2;
+ dy_ext2 -= 2;
+ } else if ((c2 & 0x04) != 0) {
+ zsv_ext2 += 2;
+ dz_ext2 -= 2;
+ } else {
+ wsv_ext2 += 2;
+ dw_ext2 -= 2;
+ }
+
+ } else { /* Both closest points on the smaller side */
+ /* One of the two extra points is (0,0,0,0) */
+ xsv_ext2 = xsb;
+ ysv_ext2 = ysb;
+ zsv_ext2 = zsb;
+ wsv_ext2 = wsb;
+ dx_ext2 = dx0;
+ dy_ext2 = dy0;
+ dz_ext2 = dz0;
+ dw_ext2 = dw0;
+
+ /* Other two points are based on the omitted axes. */
+ c = (int8_t)(aPoint | bPoint);
+
+ if ((c & 0x01) == 0) {
+ xsv_ext0 = xsb - 1;
+ xsv_ext1 = xsb;
+ dx_ext0 = dx0 + 1 - SQUISH_CONSTANT_4D;
+ dx_ext1 = dx0 - SQUISH_CONSTANT_4D;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsb + 1;
+ dx_ext0 = dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x02) == 0) {
+ ysv_ext0 = ysv_ext1 = ysb;
+ dy_ext0 = dy_ext1 = dy0 - SQUISH_CONSTANT_4D;
+ if ((c & 0x01) == 0x01)
+ {
+ ysv_ext0 -= 1;
+ dy_ext0 += 1;
+ } else {
+ ysv_ext1 -= 1;
+ dy_ext1 += 1;
+ }
+ } else {
+ ysv_ext0 = ysv_ext1 = ysb + 1;
+ dy_ext0 = dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x04) == 0) {
+ zsv_ext0 = zsv_ext1 = zsb;
+ dz_ext0 = dz_ext1 = dz0 - SQUISH_CONSTANT_4D;
+ if ((c & 0x03) == 0x03)
+ {
+ zsv_ext0 -= 1;
+ dz_ext0 += 1;
+ } else {
+ zsv_ext1 -= 1;
+ dz_ext1 += 1;
+ }
+ } else {
+ zsv_ext0 = zsv_ext1 = zsb + 1;
+ dz_ext0 = dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x08) == 0)
+ {
+ wsv_ext0 = wsb;
+ wsv_ext1 = wsb - 1;
+ dw_ext0 = dw0 - SQUISH_CONSTANT_4D;
+ dw_ext1 = dw0 + 1 - SQUISH_CONSTANT_4D;
+ } else {
+ wsv_ext0 = wsv_ext1 = wsb + 1;
+ dw_ext0 = dw_ext1 = dw0 - 1 - SQUISH_CONSTANT_4D;
+ }
+
+ }
+ } else { /* One point on each "side" */
+ if (aIsBiggerSide) {
+ c1 = aPoint;
+ c2 = bPoint;
+ } else {
+ c1 = bPoint;
+ c2 = aPoint;
+ }
+
+ /* Two contributions are the bigger-sided point with each 0 replaced with -1. */
+ if ((c1 & 0x01) == 0) {
+ xsv_ext0 = xsb - 1;
+ xsv_ext1 = xsb;
+ dx_ext0 = dx0 + 1 - SQUISH_CONSTANT_4D;
+ dx_ext1 = dx0 - SQUISH_CONSTANT_4D;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsb + 1;
+ dx_ext0 = dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_4D;
+ }
+
+ if ((c1 & 0x02) == 0) {
+ ysv_ext0 = ysv_ext1 = ysb;
+ dy_ext0 = dy_ext1 = dy0 - SQUISH_CONSTANT_4D;
+ if ((c1 & 0x01) == 0x01) {
+ ysv_ext0 -= 1;
+ dy_ext0 += 1;
+ } else {
+ ysv_ext1 -= 1;
+ dy_ext1 += 1;
+ }
+ } else {
+ ysv_ext0 = ysv_ext1 = ysb + 1;
+ dy_ext0 = dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_4D;
+ }
+
+ if ((c1 & 0x04) == 0) {
+ zsv_ext0 = zsv_ext1 = zsb;
+ dz_ext0 = dz_ext1 = dz0 - SQUISH_CONSTANT_4D;
+ if ((c1 & 0x03) == 0x03) {
+ zsv_ext0 -= 1;
+ dz_ext0 += 1;
+ } else {
+ zsv_ext1 -= 1;
+ dz_ext1 += 1;
+ }
+ } else {
+ zsv_ext0 = zsv_ext1 = zsb + 1;
+ dz_ext0 = dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_4D;
+ }
+
+ if ((c1 & 0x08) == 0) {
+ wsv_ext0 = wsb;
+ wsv_ext1 = wsb - 1;
+ dw_ext0 = dw0 - SQUISH_CONSTANT_4D;
+ dw_ext1 = dw0 + 1 - SQUISH_CONSTANT_4D;
+ } else {
+ wsv_ext0 = wsv_ext1 = wsb + 1;
+ dw_ext0 = dw_ext1 = dw0 - 1 - SQUISH_CONSTANT_4D;
+ }
+
+ /* One contribution is a permutation of (0,0,0,2) based on the smaller-sided point */
+ xsv_ext2 = xsb;
+ ysv_ext2 = ysb;
+ zsv_ext2 = zsb;
+ wsv_ext2 = wsb;
+ dx_ext2 = dx0 - 2 * SQUISH_CONSTANT_4D;
+ dy_ext2 = dy0 - 2 * SQUISH_CONSTANT_4D;
+ dz_ext2 = dz0 - 2 * SQUISH_CONSTANT_4D;
+ dw_ext2 = dw0 - 2 * SQUISH_CONSTANT_4D;
+ if ((c2 & 0x01) != 0) {
+ xsv_ext2 += 2;
+ dx_ext2 -= 2;
+ } else if ((c2 & 0x02) != 0) {
+ ysv_ext2 += 2;
+ dy_ext2 -= 2;
+ } else if ((c2 & 0x04) != 0) {
+ zsv_ext2 += 2;
+ dz_ext2 -= 2;
+ } else {
+ wsv_ext2 += 2;
+ dw_ext2 -= 2;
+ }
+ }
+
+ /* Contribution (1,0,0,0) */
+ dx1 = dx0 - 1 - SQUISH_CONSTANT_4D;
+ dy1 = dy0 - 0 - SQUISH_CONSTANT_4D;
+ dz1 = dz0 - 0 - SQUISH_CONSTANT_4D;
+ dw1 = dw0 - 0 - SQUISH_CONSTANT_4D;
+ attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1 - dw1 * dw1;
+ if (attn1 > 0) {
+ attn1 *= attn1;
+ value += attn1 * attn1 * extrapolate4(ctx, xsb + 1, ysb + 0, zsb + 0, wsb + 0, dx1, dy1, dz1, dw1);
+ }
+
+ /* Contribution (0,1,0,0) */
+ dx2 = dx0 - 0 - SQUISH_CONSTANT_4D;
+ dy2 = dy0 - 1 - SQUISH_CONSTANT_4D;
+ dz2 = dz1;
+ dw2 = dw1;
+ attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2 - dw2 * dw2;
+ if (attn2 > 0) {
+ attn2 *= attn2;
+ value += attn2 * attn2 * extrapolate4(ctx, xsb + 0, ysb + 1, zsb + 0, wsb + 0, dx2, dy2, dz2, dw2);
+ }
+
+ /* Contribution (0,0,1,0) */
+ dx3 = dx2;
+ dy3 = dy1;
+ dz3 = dz0 - 1 - SQUISH_CONSTANT_4D;
+ dw3 = dw1;
+ attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3 - dw3 * dw3;
+ if (attn3 > 0) {
+ attn3 *= attn3;
+ value += attn3 * attn3 * extrapolate4(ctx, xsb + 0, ysb + 0, zsb + 1, wsb + 0, dx3, dy3, dz3, dw3);
+ }
+
+ /* Contribution (0,0,0,1) */
+ dx4 = dx2;
+ dy4 = dy1;
+ dz4 = dz1;
+ dw4 = dw0 - 1 - SQUISH_CONSTANT_4D;
+ attn4 = 2 - dx4 * dx4 - dy4 * dy4 - dz4 * dz4 - dw4 * dw4;
+ if (attn4 > 0) {
+ attn4 *= attn4;
+ value += attn4 * attn4 * extrapolate4(ctx, xsb + 0, ysb + 0, zsb + 0, wsb + 1, dx4, dy4, dz4, dw4);
+ }
+
+ /* Contribution (1,1,0,0) */
+ dx5 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dy5 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dz5 = dz0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dw5 = dw0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ attn5 = 2 - dx5 * dx5 - dy5 * dy5 - dz5 * dz5 - dw5 * dw5;
+ if (attn5 > 0) {
+ attn5 *= attn5;
+ value += attn5 * attn5 * extrapolate4(ctx, xsb + 1, ysb + 1, zsb + 0, wsb + 0, dx5, dy5, dz5, dw5);
+ }
+
+ /* Contribution (1,0,1,0) */
+ dx6 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dy6 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dz6 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dw6 = dw0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ attn6 = 2 - dx6 * dx6 - dy6 * dy6 - dz6 * dz6 - dw6 * dw6;
+ if (attn6 > 0) {
+ attn6 *= attn6;
+ value += attn6 * attn6 * extrapolate4(ctx, xsb + 1, ysb + 0, zsb + 1, wsb + 0, dx6, dy6, dz6, dw6);
+ }
+
+ /* Contribution (1,0,0,1) */
+ dx7 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dy7 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dz7 = dz0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dw7 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ attn7 = 2 - dx7 * dx7 - dy7 * dy7 - dz7 * dz7 - dw7 * dw7;
+ if (attn7 > 0) {
+ attn7 *= attn7;
+ value += attn7 * attn7 * extrapolate4(ctx, xsb + 1, ysb + 0, zsb + 0, wsb + 1, dx7, dy7, dz7, dw7);
+ }
+
+ /* Contribution (0,1,1,0) */
+ dx8 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dy8 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dz8 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dw8 = dw0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ attn8 = 2 - dx8 * dx8 - dy8 * dy8 - dz8 * dz8 - dw8 * dw8;
+ if (attn8 > 0) {
+ attn8 *= attn8;
+ value += attn8 * attn8 * extrapolate4(ctx, xsb + 0, ysb + 1, zsb + 1, wsb + 0, dx8, dy8, dz8, dw8);
+ }
+
+ /* Contribution (0,1,0,1) */
+ dx9 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dy9 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dz9 = dz0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dw9 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ attn9 = 2 - dx9 * dx9 - dy9 * dy9 - dz9 * dz9 - dw9 * dw9;
+ if (attn9 > 0) {
+ attn9 *= attn9;
+ value += attn9 * attn9 * extrapolate4(ctx, xsb + 0, ysb + 1, zsb + 0, wsb + 1, dx9, dy9, dz9, dw9);
+ }
+
+ /* Contribution (0,0,1,1) */
+ dx10 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dy10 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dz10 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dw10 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ attn10 = 2 - dx10 * dx10 - dy10 * dy10 - dz10 * dz10 - dw10 * dw10;
+ if (attn10 > 0) {
+ attn10 *= attn10;
+ value += attn10 * attn10 * extrapolate4(ctx, xsb + 0, ysb + 0, zsb + 1, wsb + 1, dx10, dy10, dz10, dw10);
+ }
+ } else { /* We're inside the second dispentachoron (Rectified 4-Simplex) */
+ aIsBiggerSide = 1;
+ bIsBiggerSide = 1;
+
+ /* Decide between (0,0,1,1) and (1,1,0,0) */
+ if (xins + yins < zins + wins) {
+ aScore = xins + yins;
+ aPoint = 0x0C;
+ } else {
+ aScore = zins + wins;
+ aPoint = 0x03;
+ }
+
+ /* Decide between (0,1,0,1) and (1,0,1,0) */
+ if (xins + zins < yins + wins) {
+ bScore = xins + zins;
+ bPoint = 0x0A;
+ } else {
+ bScore = yins + wins;
+ bPoint = 0x05;
+ }
+
+ /* Closer between (0,1,1,0) and (1,0,0,1) will replace the further of a and b, if closer. */
+ if (xins + wins < yins + zins) {
+ score = xins + wins;
+ if (aScore <= bScore && score < bScore) {
+ bScore = score;
+ bPoint = 0x06;
+ } else if (aScore > bScore && score < aScore) {
+ aScore = score;
+ aPoint = 0x06;
+ }
+ } else {
+ score = yins + zins;
+ if (aScore <= bScore && score < bScore) {
+ bScore = score;
+ bPoint = 0x09;
+ } else if (aScore > bScore && score < aScore) {
+ aScore = score;
+ aPoint = 0x09;
+ }
+ }
+
+ /* Decide if (0,1,1,1) is closer. */
+ p1 = 3 - inSum + xins;
+ if (aScore <= bScore && p1 < bScore) {
+ bScore = p1;
+ bPoint = 0x0E;
+ bIsBiggerSide = 0;
+ } else if (aScore > bScore && p1 < aScore) {
+ aScore = p1;
+ aPoint = 0x0E;
+ aIsBiggerSide = 0;
+ }
+
+ /* Decide if (1,0,1,1) is closer. */
+ p2 = 3 - inSum + yins;
+ if (aScore <= bScore && p2 < bScore) {
+ bScore = p2;
+ bPoint = 0x0D;
+ bIsBiggerSide = 0;
+ } else if (aScore > bScore && p2 < aScore) {
+ aScore = p2;
+ aPoint = 0x0D;
+ aIsBiggerSide = 0;
+ }
+
+ /* Decide if (1,1,0,1) is closer. */
+ p3 = 3 - inSum + zins;
+ if (aScore <= bScore && p3 < bScore) {
+ bScore = p3;
+ bPoint = 0x0B;
+ bIsBiggerSide = 0;
+ } else if (aScore > bScore && p3 < aScore) {
+ aScore = p3;
+ aPoint = 0x0B;
+ aIsBiggerSide = 0;
+ }
+
+ /* Decide if (1,1,1,0) is closer. */
+ p4 = 3 - inSum + wins;
+ if (aScore <= bScore && p4 < bScore) {
+ bScore = p4;
+ bPoint = 0x07;
+ bIsBiggerSide = 0;
+ } else if (aScore > bScore && p4 < aScore) {
+ aScore = p4;
+ aPoint = 0x07;
+ aIsBiggerSide = 0;
+ }
+
+ /* Where each of the two closest points are determines how the extra three vertices are calculated. */
+ if (aIsBiggerSide == bIsBiggerSide) {
+ if (aIsBiggerSide) { /* Both closest points on the bigger side */
+ c1 = (int8_t)(aPoint & bPoint);
+ c2 = (int8_t)(aPoint | bPoint);
+
+ /* Two contributions are permutations of (0,0,0,1) and (0,0,0,2) based on c1 */
+ xsv_ext0 = xsv_ext1 = xsb;
+ ysv_ext0 = ysv_ext1 = ysb;
+ zsv_ext0 = zsv_ext1 = zsb;
+ wsv_ext0 = wsv_ext1 = wsb;
+ dx_ext0 = dx0 - SQUISH_CONSTANT_4D;
+ dy_ext0 = dy0 - SQUISH_CONSTANT_4D;
+ dz_ext0 = dz0 - SQUISH_CONSTANT_4D;
+ dw_ext0 = dw0 - SQUISH_CONSTANT_4D;
+ dx_ext1 = dx0 - 2 * SQUISH_CONSTANT_4D;
+ dy_ext1 = dy0 - 2 * SQUISH_CONSTANT_4D;
+ dz_ext1 = dz0 - 2 * SQUISH_CONSTANT_4D;
+ dw_ext1 = dw0 - 2 * SQUISH_CONSTANT_4D;
+ if ((c1 & 0x01) != 0) {
+ xsv_ext0 += 1;
+ dx_ext0 -= 1;
+ xsv_ext1 += 2;
+ dx_ext1 -= 2;
+ } else if ((c1 & 0x02) != 0) {
+ ysv_ext0 += 1;
+ dy_ext0 -= 1;
+ ysv_ext1 += 2;
+ dy_ext1 -= 2;
+ } else if ((c1 & 0x04) != 0) {
+ zsv_ext0 += 1;
+ dz_ext0 -= 1;
+ zsv_ext1 += 2;
+ dz_ext1 -= 2;
+ } else {
+ wsv_ext0 += 1;
+ dw_ext0 -= 1;
+ wsv_ext1 += 2;
+ dw_ext1 -= 2;
+ }
+
+ /* One contribution is a permutation of (1,1,1,-1) based on c2 */
+ xsv_ext2 = xsb + 1;
+ ysv_ext2 = ysb + 1;
+ zsv_ext2 = zsb + 1;
+ wsv_ext2 = wsb + 1;
+ dx_ext2 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dy_ext2 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dz_ext2 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dw_ext2 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ if ((c2 & 0x01) == 0) {
+ xsv_ext2 -= 2;
+ dx_ext2 += 2;
+ } else if ((c2 & 0x02) == 0) {
+ ysv_ext2 -= 2;
+ dy_ext2 += 2;
+ } else if ((c2 & 0x04) == 0) {
+ zsv_ext2 -= 2;
+ dz_ext2 += 2;
+ } else {
+ wsv_ext2 -= 2;
+ dw_ext2 += 2;
+ }
+ } else { /* Both closest points on the smaller side */
+ /* One of the two extra points is (1,1,1,1) */
+ xsv_ext2 = xsb + 1;
+ ysv_ext2 = ysb + 1;
+ zsv_ext2 = zsb + 1;
+ wsv_ext2 = wsb + 1;
+ dx_ext2 = dx0 - 1 - 4 * SQUISH_CONSTANT_4D;
+ dy_ext2 = dy0 - 1 - 4 * SQUISH_CONSTANT_4D;
+ dz_ext2 = dz0 - 1 - 4 * SQUISH_CONSTANT_4D;
+ dw_ext2 = dw0 - 1 - 4 * SQUISH_CONSTANT_4D;
+
+ /* Other two points are based on the shared axes. */
+ c = (int8_t)(aPoint & bPoint);
+
+ if ((c & 0x01) != 0) {
+ xsv_ext0 = xsb + 2;
+ xsv_ext1 = xsb + 1;
+ dx_ext0 = dx0 - 2 - 3 * SQUISH_CONSTANT_4D;
+ dx_ext1 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsb;
+ dx_ext0 = dx_ext1 = dx0 - 3 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x02) != 0) {
+ ysv_ext0 = ysv_ext1 = ysb + 1;
+ dy_ext0 = dy_ext1 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ if ((c & 0x01) == 0)
+ {
+ ysv_ext0 += 1;
+ dy_ext0 -= 1;
+ } else {
+ ysv_ext1 += 1;
+ dy_ext1 -= 1;
+ }
+ } else {
+ ysv_ext0 = ysv_ext1 = ysb;
+ dy_ext0 = dy_ext1 = dy0 - 3 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x04) != 0) {
+ zsv_ext0 = zsv_ext1 = zsb + 1;
+ dz_ext0 = dz_ext1 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ if ((c & 0x03) == 0)
+ {
+ zsv_ext0 += 1;
+ dz_ext0 -= 1;
+ } else {
+ zsv_ext1 += 1;
+ dz_ext1 -= 1;
+ }
+ } else {
+ zsv_ext0 = zsv_ext1 = zsb;
+ dz_ext0 = dz_ext1 = dz0 - 3 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c & 0x08) != 0)
+ {
+ wsv_ext0 = wsb + 1;
+ wsv_ext1 = wsb + 2;
+ dw_ext0 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dw_ext1 = dw0 - 2 - 3 * SQUISH_CONSTANT_4D;
+ } else {
+ wsv_ext0 = wsv_ext1 = wsb;
+ dw_ext0 = dw_ext1 = dw0 - 3 * SQUISH_CONSTANT_4D;
+ }
+ }
+ } else { /* One point on each "side" */
+ if (aIsBiggerSide) {
+ c1 = aPoint;
+ c2 = bPoint;
+ } else {
+ c1 = bPoint;
+ c2 = aPoint;
+ }
+
+ /* Two contributions are the bigger-sided point with each 1 replaced with 2. */
+ if ((c1 & 0x01) != 0) {
+ xsv_ext0 = xsb + 2;
+ xsv_ext1 = xsb + 1;
+ dx_ext0 = dx0 - 2 - 3 * SQUISH_CONSTANT_4D;
+ dx_ext1 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ } else {
+ xsv_ext0 = xsv_ext1 = xsb;
+ dx_ext0 = dx_ext1 = dx0 - 3 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c1 & 0x02) != 0) {
+ ysv_ext0 = ysv_ext1 = ysb + 1;
+ dy_ext0 = dy_ext1 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ if ((c1 & 0x01) == 0) {
+ ysv_ext0 += 1;
+ dy_ext0 -= 1;
+ } else {
+ ysv_ext1 += 1;
+ dy_ext1 -= 1;
+ }
+ } else {
+ ysv_ext0 = ysv_ext1 = ysb;
+ dy_ext0 = dy_ext1 = dy0 - 3 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c1 & 0x04) != 0) {
+ zsv_ext0 = zsv_ext1 = zsb + 1;
+ dz_ext0 = dz_ext1 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ if ((c1 & 0x03) == 0) {
+ zsv_ext0 += 1;
+ dz_ext0 -= 1;
+ } else {
+ zsv_ext1 += 1;
+ dz_ext1 -= 1;
+ }
+ } else {
+ zsv_ext0 = zsv_ext1 = zsb;
+ dz_ext0 = dz_ext1 = dz0 - 3 * SQUISH_CONSTANT_4D;
+ }
+
+ if ((c1 & 0x08) != 0) {
+ wsv_ext0 = wsb + 1;
+ wsv_ext1 = wsb + 2;
+ dw_ext0 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dw_ext1 = dw0 - 2 - 3 * SQUISH_CONSTANT_4D;
+ } else {
+ wsv_ext0 = wsv_ext1 = wsb;
+ dw_ext0 = dw_ext1 = dw0 - 3 * SQUISH_CONSTANT_4D;
+ }
+
+ /* One contribution is a permutation of (1,1,1,-1) based on the smaller-sided point */
+ xsv_ext2 = xsb + 1;
+ ysv_ext2 = ysb + 1;
+ zsv_ext2 = zsb + 1;
+ wsv_ext2 = wsb + 1;
+ dx_ext2 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dy_ext2 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dz_ext2 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dw_ext2 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ if ((c2 & 0x01) == 0) {
+ xsv_ext2 -= 2;
+ dx_ext2 += 2;
+ } else if ((c2 & 0x02) == 0) {
+ ysv_ext2 -= 2;
+ dy_ext2 += 2;
+ } else if ((c2 & 0x04) == 0) {
+ zsv_ext2 -= 2;
+ dz_ext2 += 2;
+ } else {
+ wsv_ext2 -= 2;
+ dw_ext2 += 2;
+ }
+ }
+
+ /* Contribution (1,1,1,0) */
+ dx4 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dy4 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dz4 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ dw4 = dw0 - 3 * SQUISH_CONSTANT_4D;
+ attn4 = 2 - dx4 * dx4 - dy4 * dy4 - dz4 * dz4 - dw4 * dw4;
+ if (attn4 > 0) {
+ attn4 *= attn4;
+ value += attn4 * attn4 * extrapolate4(ctx, xsb + 1, ysb + 1, zsb + 1, wsb + 0, dx4, dy4, dz4, dw4);
+ }
+
+ /* Contribution (1,1,0,1) */
+ dx3 = dx4;
+ dy3 = dy4;
+ dz3 = dz0 - 3 * SQUISH_CONSTANT_4D;
+ dw3 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D;
+ attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3 - dw3 * dw3;
+ if (attn3 > 0) {
+ attn3 *= attn3;
+ value += attn3 * attn3 * extrapolate4(ctx, xsb + 1, ysb + 1, zsb + 0, wsb + 1, dx3, dy3, dz3, dw3);
+ }
+
+ /* Contribution (1,0,1,1) */
+ dx2 = dx4;
+ dy2 = dy0 - 3 * SQUISH_CONSTANT_4D;
+ dz2 = dz4;
+ dw2 = dw3;
+ attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2 - dw2 * dw2;
+ if (attn2 > 0) {
+ attn2 *= attn2;
+ value += attn2 * attn2 * extrapolate4(ctx, xsb + 1, ysb + 0, zsb + 1, wsb + 1, dx2, dy2, dz2, dw2);
+ }
+
+ /* Contribution (0,1,1,1) */
+ dx1 = dx0 - 3 * SQUISH_CONSTANT_4D;
+ dz1 = dz4;
+ dy1 = dy4;
+ dw1 = dw3;
+ attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1 - dw1 * dw1;
+ if (attn1 > 0) {
+ attn1 *= attn1;
+ value += attn1 * attn1 * extrapolate4(ctx, xsb + 0, ysb + 1, zsb + 1, wsb + 1, dx1, dy1, dz1, dw1);
+ }
+
+ /* Contribution (1,1,0,0) */
+ dx5 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dy5 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dz5 = dz0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dw5 = dw0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ attn5 = 2 - dx5 * dx5 - dy5 * dy5 - dz5 * dz5 - dw5 * dw5;
+ if (attn5 > 0) {
+ attn5 *= attn5;
+ value += attn5 * attn5 * extrapolate4(ctx, xsb + 1, ysb + 1, zsb + 0, wsb + 0, dx5, dy5, dz5, dw5);
+ }
+
+ /* Contribution (1,0,1,0) */
+ dx6 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dy6 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dz6 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dw6 = dw0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ attn6 = 2 - dx6 * dx6 - dy6 * dy6 - dz6 * dz6 - dw6 * dw6;
+ if (attn6 > 0) {
+ attn6 *= attn6;
+ value += attn6 * attn6 * extrapolate4(ctx, xsb + 1, ysb + 0, zsb + 1, wsb + 0, dx6, dy6, dz6, dw6);
+ }
+
+ /* Contribution (1,0,0,1) */
+ dx7 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dy7 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dz7 = dz0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dw7 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ attn7 = 2 - dx7 * dx7 - dy7 * dy7 - dz7 * dz7 - dw7 * dw7;
+ if (attn7 > 0) {
+ attn7 *= attn7;
+ value += attn7 * attn7 * extrapolate4(ctx, xsb + 1, ysb + 0, zsb + 0, wsb + 1, dx7, dy7, dz7, dw7);
+ }
+
+ /* Contribution (0,1,1,0) */
+ dx8 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dy8 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dz8 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dw8 = dw0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ attn8 = 2 - dx8 * dx8 - dy8 * dy8 - dz8 * dz8 - dw8 * dw8;
+ if (attn8 > 0) {
+ attn8 *= attn8;
+ value += attn8 * attn8 * extrapolate4(ctx, xsb + 0, ysb + 1, zsb + 1, wsb + 0, dx8, dy8, dz8, dw8);
+ }
+
+ /* Contribution (0,1,0,1) */
+ dx9 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dy9 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dz9 = dz0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dw9 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ attn9 = 2 - dx9 * dx9 - dy9 * dy9 - dz9 * dz9 - dw9 * dw9;
+ if (attn9 > 0) {
+ attn9 *= attn9;
+ value += attn9 * attn9 * extrapolate4(ctx, xsb + 0, ysb + 1, zsb + 0, wsb + 1, dx9, dy9, dz9, dw9);
+ }
+
+ /* Contribution (0,0,1,1) */
+ dx10 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dy10 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D;
+ dz10 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ dw10 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D;
+ attn10 = 2 - dx10 * dx10 - dy10 * dy10 - dz10 * dz10 - dw10 * dw10;
+ if (attn10 > 0) {
+ attn10 *= attn10;
+ value += attn10 * attn10 * extrapolate4(ctx, xsb + 0, ysb + 0, zsb + 1, wsb + 1, dx10, dy10, dz10, dw10);
+ }
+ }
+
+ /* First extra vertex */
+ attn_ext0 = 2 - dx_ext0 * dx_ext0 - dy_ext0 * dy_ext0 - dz_ext0 * dz_ext0 - dw_ext0 * dw_ext0;
+ if (attn_ext0 > 0)
+ {
+ attn_ext0 *= attn_ext0;
+ value += attn_ext0 * attn_ext0 * extrapolate4(ctx, xsv_ext0, ysv_ext0, zsv_ext0, wsv_ext0, dx_ext0, dy_ext0, dz_ext0, dw_ext0);
+ }
+
+ /* Second extra vertex */
+ attn_ext1 = 2 - dx_ext1 * dx_ext1 - dy_ext1 * dy_ext1 - dz_ext1 * dz_ext1 - dw_ext1 * dw_ext1;
+ if (attn_ext1 > 0)
+ {
+ attn_ext1 *= attn_ext1;
+ value += attn_ext1 * attn_ext1 * extrapolate4(ctx, xsv_ext1, ysv_ext1, zsv_ext1, wsv_ext1, dx_ext1, dy_ext1, dz_ext1, dw_ext1);
+ }
+
+ /* Third extra vertex */
+ attn_ext2 = 2 - dx_ext2 * dx_ext2 - dy_ext2 * dy_ext2 - dz_ext2 * dz_ext2 - dw_ext2 * dw_ext2;
+ if (attn_ext2 > 0)
+ {
+ attn_ext2 *= attn_ext2;
+ value += attn_ext2 * attn_ext2 * extrapolate4(ctx, xsv_ext2, ysv_ext2, zsv_ext2, wsv_ext2, dx_ext2, dy_ext2, dz_ext2, dw_ext2);
+ }
+
+ return value / NORM_CONSTANT_4D;
+}
+
diff --git a/thirdparty/misc/open-simplex-noise.h b/thirdparty/misc/open-simplex-noise.h
new file mode 100644
index 0000000000..89e0df8218
--- /dev/null
+++ b/thirdparty/misc/open-simplex-noise.h
@@ -0,0 +1,58 @@
+#ifndef OPEN_SIMPLEX_NOISE_H__
+#define OPEN_SIMPLEX_NOISE_H__
+
+/*
+ * OpenSimplex (Simplectic) Noise in C.
+ * Ported to C from Kurt Spencer's java implementation by Stephen M. Cameron
+ *
+ * v1.1 (October 6, 2014)
+ * - Ported to C
+ *
+ * v1.1 (October 5, 2014)
+ * - Added 2D and 4D implementations.
+ * - Proper gradient sets for all dimensions, from a
+ * dimensionally-generalizable scheme with an actual
+ * rhyme and reason behind it.
+ * - Removed default permutation array in favor of
+ * default seed.
+ * - Changed seed-based constructor to be independent
+ * of any particular randomization library, so results
+ * will be the same when ported to other languages.
+ */
+
+#if ((__GNUC_STDC_INLINE__) || (__STDC_VERSION__ >= 199901L))
+ #include <stdint.h>
+ #define INLINE inline
+#elif (defined (_MSC_VER) || defined (__GNUC_GNU_INLINE__))
+ #include <stdint.h>
+ #define INLINE __inline
+#else
+ /* ANSI C doesn't have inline or stdint.h. */
+ #define INLINE
+#endif
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+// -- GODOT start --
+// Modified to work without allocating memory, also removed some unused function.
+
+struct osn_context {
+ int16_t perm[256];
+ int16_t permGradIndex3D[256];
+};
+
+int open_simplex_noise(int64_t seed, struct osn_context *ctx);
+//int open_simplex_noise_init_perm(struct osn_context *ctx, int16_t p[], int nelements);
+// -- GODOT end --
+void open_simplex_noise_free(struct osn_context *ctx);
+double open_simplex_noise2(struct osn_context *ctx, double x, double y);
+double open_simplex_noise3(struct osn_context *ctx, double x, double y, double z);
+double open_simplex_noise4(struct osn_context *ctx, double x, double y, double z, double w);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif