summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--core/io/http_client.cpp7
-rw-r--r--core/io/http_client.h1
-rw-r--r--core/os/file_access.cpp4
-rw-r--r--core/variant_call.cpp2
-rw-r--r--doc/base/classes.xml192
-rw-r--r--drivers/nrex/nrex.cpp14
-rw-r--r--scene/3d/bone_attachment.cpp1
-rw-r--r--scene/animation/animation_player.cpp3
-rw-r--r--scene/audio/stream_player.cpp2
-rw-r--r--scene/main/node.cpp10
-rw-r--r--scene/main/node.h2
-rw-r--r--scene/scene_string_names.cpp1
-rw-r--r--scene/scene_string_names.h1
-rw-r--r--tools/editor/editor_node.cpp1
-rw-r--r--tools/editor/scene_tree_dock.cpp1
16 files changed, 237 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml
index 11dcdf447c..f2f087fc98 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -71,4 +71,4 @@ before_script:
- if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$GODOT_TARGET" = "android" ]; then brew update; brew install android-sdk android-ndk; export ANDROID_HOME=/usr/local/opt/android-sdk; export ANDROID_NDK_ROOT=/usr/local/opt/android-ndk; fi
script:
- - scons platform=$GODOT_TARGET CXX=$CXX
+ - scons platform=$GODOT_TARGET CXX=$CXX openssl=builtin
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index e0c01c9422..8c58e0ba5e 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -81,6 +81,12 @@ void HTTPClient::set_connection(const Ref<StreamPeer>& p_connection){
}
+Ref<StreamPeer> HTTPClient::get_connection() const {
+
+ return connection;
+}
+
+
Error HTTPClient::request( Method p_method, const String& p_url, const Vector<String>& p_headers,const String& p_body) {
ERR_FAIL_INDEX_V(p_method,METHOD_MAX,ERR_INVALID_PARAMETER);
@@ -578,6 +584,7 @@ void HTTPClient::_bind_methods() {
ObjectTypeDB::bind_method(_MD("connect:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect,DEFVAL(false),DEFVAL(true));
ObjectTypeDB::bind_method(_MD("set_connection","connection:StreamPeer"),&HTTPClient::set_connection);
+ ObjectTypeDB::bind_method(_MD("get_connection:StreamPeer"),&HTTPClient::get_connection);
ObjectTypeDB::bind_method(_MD("request","method","url","headers","body"),&HTTPClient::request,DEFVAL(String()));
ObjectTypeDB::bind_method(_MD("send_body_text","body"),&HTTPClient::send_body_text);
ObjectTypeDB::bind_method(_MD("send_body_data","body"),&HTTPClient::send_body_data);
diff --git a/core/io/http_client.h b/core/io/http_client.h
index e795646c70..defde08524 100644
--- a/core/io/http_client.h
+++ b/core/io/http_client.h
@@ -168,6 +168,7 @@ public:
Error connect(const String &p_host,int p_port,bool p_ssl=false,bool p_verify_host=true);
void set_connection(const Ref<StreamPeer>& p_connection);
+ Ref<StreamPeer> get_connection() const;
Error request( Method p_method, const String& p_url, const Vector<String>& p_headers,const String& p_body=String());
Error send_body_text(const String& p_body);
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp
index 0846ef3eb0..a3ee9395de 100644
--- a/core/os/file_access.cpp
+++ b/core/os/file_access.cpp
@@ -284,7 +284,7 @@ Vector<String> FileAccess::get_csv_line(String delim) const {
String l;
int qc=0;
do {
- l+=get_line();
+ l+=get_line()+"\n";
qc=0;
for(int i=0;i<l.length();i++) {
@@ -295,6 +295,8 @@ Vector<String> FileAccess::get_csv_line(String delim) const {
} while (qc%2);
+ l=l.substr(0, l.length()-1);
+
Vector<String> strings;
bool in_quote=false;
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index a4963f0d1f..f3bf8f9e47 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -246,6 +246,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
VCALL_LOCALMEM1R(String,match);
VCALL_LOCALMEM1R(String,matchn);
VCALL_LOCALMEM1R(String,begins_with);
+ VCALL_LOCALMEM1R(String,ends_with);
VCALL_LOCALMEM2R(String,replace);
VCALL_LOCALMEM2R(String,replacen);
VCALL_LOCALMEM2R(String,insert);
@@ -1261,6 +1262,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
ADDFUNC1(STRING,BOOL,String,match,STRING,"expr",varray());
ADDFUNC1(STRING,BOOL,String,matchn,STRING,"expr",varray());
ADDFUNC1(STRING,BOOL,String,begins_with,STRING,"text",varray());
+ ADDFUNC1(STRING,BOOL,String,ends_with,STRING,"text",varray());
ADDFUNC2(STRING,STRING,String,replace,STRING,"what",STRING,"forwhat",varray());
ADDFUNC2(STRING,STRING,String,replacen,STRING,"what",STRING,"forwhat",varray());
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index 23b699ecb0..b77a1c29a8 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -3561,6 +3561,62 @@
<description>
</description>
</method>
+ <method name="set_collision_mask">
+ <argument index="0" name="collision_mask" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_collision_mask" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_layer_mask">
+ <argument index="0" name="layer_mask" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_layer_mask" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_collision_mask_bit">
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <argument index="1" name="value" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_collision_mask_bit" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_layer_mask_bit">
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <argument index="1" name="value" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_layer_mask_bit" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_monitorable">
<argument index="0" name="enable" type="bool">
</argument>
@@ -9683,6 +9739,14 @@ This approximation makes straight segments between each point, then subdivides t
Return true if the dictionary has a given key.
</description>
</method>
+ <method name="has_all">
+ <return type="bool">
+ </return>
+ <argument index="0" name="values" type="Array">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="hash">
<return type="int">
</return>
@@ -25065,6 +25129,50 @@ This method controls whether the position between two cached points is interpola
<description>
</description>
</method>
+ <method name="set_collision_mask">
+ <argument index="0" name="mask" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_collision_mask" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_collision_mask_bit">
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <argument index="1" name="value" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_collision_mask_bit" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_layer_mask_bit">
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <argument index="1" name="value" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_layer_mask_bit" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="bit" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="add_collision_exception_with">
<argument index="0" name="body" type="PhysicsBody">
</argument>
@@ -25681,6 +25789,22 @@ This method controls whether the position between two cached points is interpola
<description>
</description>
</method>
+ <method name="area_set_layer_mask">
+ <argument index="0" name="area" type="RID">
+ </argument>
+ <argument index="1" name="mask" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="area_set_collision_mask">
+ <argument index="0" name="area" type="RID">
+ </argument>
+ <argument index="1" name="mask" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="area_set_param">
<argument index="0" name="area" type="RID">
</argument>
@@ -25799,6 +25923,42 @@ This method controls whether the position between two cached points is interpola
<description>
</description>
</method>
+ <method name="body_set_layer_mask">
+ <argument index="0" name="body" type="RID">
+ </argument>
+ <argument index="1" name="mask" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="body_get_layer_mask" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="body" type="RID">
+ </argument>
+ <argument index="1" name="arg1" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="body_set_collision_mask">
+ <argument index="0" name="body" type="RID">
+ </argument>
+ <argument index="1" name="mask" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="body_get_collision_mask" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="body" type="RID">
+ </argument>
+ <argument index="1" name="arg1" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="body_add_shape">
<argument index="0" name="body" type="RID">
</argument>
@@ -28265,6 +28425,30 @@ This method controls whether the position between two cached points is interpola
<description>
</description>
</method>
+ <method name="set_layer_mask">
+ <argument index="0" name="mask" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_layer_mask" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_type_mask">
+ <argument index="0" name="mask" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_type_mask" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
</constants>
@@ -35079,6 +35263,14 @@ This method controls whether the position between two cached points is interpola
Return true if the string is empty.
</description>
</method>
+ <method name="ends_with">
+ <return type="bool">
+ </return>
+ <argument index="0" name="text" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="extension">
<return type="String">
</return>
diff --git a/drivers/nrex/nrex.cpp b/drivers/nrex/nrex.cpp
index ac19c71408..69e04285e3 100644
--- a/drivers/nrex/nrex.cpp
+++ b/drivers/nrex/nrex.cpp
@@ -68,9 +68,9 @@ class nrex_array
{
}
- nrex_array(unsigned int size)
- : _data(NREX_NEW_ARRAY(T, size))
- , _reserved(size)
+ nrex_array(unsigned int reserved)
+ : _data(NREX_NEW_ARRAY(T, reserved ? reserved : 1))
+ , _reserved(reserved ? reserved : 1)
, _size(0)
{
}
@@ -87,6 +87,12 @@ class nrex_array
void reserve(unsigned int size)
{
+ if (size < _size) {
+ size = _size;
+ }
+ if (size == 0) {
+ size = 1;
+ }
T* old = _data;
_data = NREX_NEW_ARRAY(T, size);
_reserved = size;
@@ -207,8 +213,8 @@ struct nrex_search
: str(str)
, captures(captures)
, end(0)
+ , lookahead_pos(lookahead)
{
- lookahead_pos.reserve(lookahead);
}
};
diff --git a/scene/3d/bone_attachment.cpp b/scene/3d/bone_attachment.cpp
index 1628ccc15e..56b61d40e2 100644
--- a/scene/3d/bone_attachment.cpp
+++ b/scene/3d/bone_attachment.cpp
@@ -80,6 +80,7 @@ void BoneAttachment::_check_bind() {
int idx = sk->find_bone(bone_name);
if (idx!=-1) {
sk->bind_child_node_to_bone(idx,this);;
+ set_transform(sk->get_bone_global_pose(idx));
bound=true;
}
}
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 32958112e5..25f49a8a8b 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -1012,6 +1012,8 @@ void AnimationPlayer::play(const StringName& p_name, float p_custom_blend, float
queued.clear();
_set_process(true); // always process when starting an animation
playing = true;
+
+ emit_signal(SceneStringNames::get_singleton()->animation_started, c.assigned);
if (is_inside_tree() && get_tree()->is_editor_hint())
return; // no next in this case
@@ -1347,6 +1349,7 @@ void AnimationPlayer::_bind_methods() {
ADD_SIGNAL( MethodInfo("finished") );
ADD_SIGNAL( MethodInfo("animation_changed", PropertyInfo(Variant::STRING,"old_name"), PropertyInfo(Variant::STRING,"new_name")) );
+ ADD_SIGNAL( MethodInfo("animation_started", PropertyInfo(Variant::STRING,"name")) );
BIND_CONSTANT( ANIMATION_PROCESS_FIXED );
BIND_CONSTANT( ANIMATION_PROCESS_IDLE );
diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp
index b6b1ee85f3..050e945c8f 100644
--- a/scene/audio/stream_player.cpp
+++ b/scene/audio/stream_player.cpp
@@ -388,7 +388,7 @@ void StreamPlayer::_bind_methods() {
ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") );
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") );
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") );
- ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") );
+ ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") );
ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") );
ADD_SIGNAL(MethodInfo("finished"));
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index b90edb38b2..f4c41256db 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -1374,6 +1374,16 @@ bool Node::is_editable_instance(Node *p_node) const {
return data.editable_instances.has(p);
}
+void Node::set_editable_instances(const HashMap<NodePath,int>& p_editable_instances) {
+
+ data.editable_instances=p_editable_instances;
+}
+
+HashMap<NodePath,int> Node::get_editable_instances() const {
+
+ return data.editable_instances;
+}
+
#if 0
diff --git a/scene/main/node.h b/scene/main/node.h
index 5c6147d644..560a2e588a 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -239,6 +239,8 @@ public:
void set_editable_instance(Node* p_node,bool p_editable);
bool is_editable_instance(Node* p_node) const;
+ void set_editable_instances(const HashMap<NodePath,int>& p_editable_instances);
+ HashMap<NodePath,int> get_editable_instances() const;
/* NOTIFICATIONS */
diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp
index f47b61001c..28834c732d 100644
--- a/scene/scene_string_names.cpp
+++ b/scene/scene_string_names.cpp
@@ -52,6 +52,7 @@ SceneStringNames::SceneStringNames() {
finished=StaticCString::create("finished");
animation_changed=StaticCString::create("animation_changed");
+ animation_started=StaticCString::create("animation_started");
mouse_enter=StaticCString::create("mouse_enter");
mouse_exit=StaticCString::create("mouse_exit");
diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h
index fc45351c33..f85a858423 100644
--- a/scene/scene_string_names.h
+++ b/scene/scene_string_names.h
@@ -79,6 +79,7 @@ public:
StringName finished;
StringName animation_changed;
+ StringName animation_started;
StringName body_enter_shape;
StringName body_enter;
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index aa47e97622..316485f42a 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -2672,6 +2672,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
break;
}
+ _menu_option_confirm(RUN_STOP,true);
get_tree()->quit();
String exec = OS::get_singleton()->get_executable_path();
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index 6b2961ea72..c6115ba87a 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -1317,6 +1317,7 @@ void SceneTreeDock::_create() {
if (n==edited_scene) {
edited_scene=newnode;
editor->set_edited_scene(newnode);
+ newnode->set_editable_instances(n->get_editable_instances());
}
//small hack to make collisionshapes and other kind of nodes to work