summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/openssl/stream_peer_openssl.cpp7
-rw-r--r--modules/gdscript/gd_function.cpp25
-rw-r--r--modules/gdscript/gd_function.h3
-rw-r--r--modules/gdscript/gd_parser.cpp9
-rw-r--r--modules/gdscript/gd_script.h2
-rw-r--r--scene/3d/skeleton.cpp16
-rw-r--r--scene/audio/stream_player.cpp10
-rw-r--r--scene/audio/stream_player.h2
-rw-r--r--scene/gui/text_edit.cpp1
-rw-r--r--scene/main/viewport.cpp8
-rw-r--r--tools/doc/doc_data.cpp6
-rw-r--r--tools/editor/asset_library_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/animation_player_editor_plugin.cpp1
-rw-r--r--tools/editor/plugins/sprite_frames_editor_plugin.cpp63
14 files changed, 139 insertions, 16 deletions
diff --git a/drivers/openssl/stream_peer_openssl.cpp b/drivers/openssl/stream_peer_openssl.cpp
index 67f58b6028..9349df3793 100644
--- a/drivers/openssl/stream_peer_openssl.cpp
+++ b/drivers/openssl/stream_peer_openssl.cpp
@@ -309,6 +309,9 @@ Error StreamPeerOpenSSL::connect(Ref<StreamPeer> p_base, bool p_validate_certs,
validate_certs=p_validate_certs;
validate_hostname=p_for_hostname!="";
+
+
+
if (p_validate_certs) {
@@ -380,6 +383,10 @@ Error StreamPeerOpenSSL::connect(Ref<StreamPeer> p_base, bool p_validate_certs,
bio->ptr = this;
SSL_set_bio( ssl, bio, bio );
+ if (p_for_hostname!=String()) {
+ SSL_set_tlsext_host_name(ssl,p_for_hostname.utf8().get_data());
+ }
+
use_blocking=true; // let handshake use blocking
// Set the SSL to automatically retry on failure.
SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp
index 6e52686de4..de86eb2ab9 100644
--- a/modules/gdscript/gd_function.cpp
+++ b/modules/gdscript/gd_function.cpp
@@ -846,6 +846,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
gdfs->state._class=_class;
gdfs->state.ip=ip+ipofs;
gdfs->state.line=line;
+ gdfs->state.instance_id=(p_instance && p_instance->get_owner())?p_instance->get_owner()->get_instance_ID():0;
+ gdfs->state.script_id=_class->get_instance_ID();
//gdfs->state.result_pos=ip+ipofs-1;
gdfs->state.defarg=defarg;
gdfs->state.instance=p_instance;
@@ -1352,6 +1354,18 @@ GDFunction::~GDFunction() {
Variant GDFunctionState::_signal_callback(const Variant** p_args, int p_argcount, Variant::CallError& r_error) {
+#ifdef DEBUG_ENABLED
+ if (state.instance_id && !ObjectDB::get_instance(state.instance_id)) {
+ ERR_EXPLAIN("Resumed after yield, but class instance is gone");
+ ERR_FAIL_V(Variant());
+ }
+
+ if (state.script_id && !ObjectDB::get_instance(state.script_id)) {
+ ERR_EXPLAIN("Resumed after yield, but script is gone");
+ ERR_FAIL_V(Variant());
+ }
+#endif
+
Variant arg;
r_error.error=Variant::CallError::CALL_OK;
@@ -1398,6 +1412,17 @@ bool GDFunctionState::is_valid() const {
Variant GDFunctionState::resume(const Variant& p_arg) {
ERR_FAIL_COND_V(!function,Variant());
+#ifdef DEBUG_ENABLED
+ if (state.instance_id && !ObjectDB::get_instance(state.instance_id)) {
+ ERR_EXPLAIN("Resumed after yield, but class instance is gone");
+ ERR_FAIL_V(Variant());
+ }
+
+ if (state.script_id && !ObjectDB::get_instance(state.script_id)) {
+ ERR_EXPLAIN("Resumed after yield, but script is gone");
+ ERR_FAIL_V(Variant());
+ }
+#endif
state.result=p_arg;
Variant::CallError err;
diff --git a/modules/gdscript/gd_function.h b/modules/gdscript/gd_function.h
index 942db170c8..e09c6509dd 100644
--- a/modules/gdscript/gd_function.h
+++ b/modules/gdscript/gd_function.h
@@ -136,6 +136,9 @@ public:
struct CallState {
+ ObjectID instance_id; //by debug only
+ ObjectID script_id;
+
GDInstance *instance;
Vector<uint8_t> stack;
int stack_size;
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index e83bd3d21e..6c6560efa6 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -31,6 +31,7 @@
#include "io/resource_loader.h"
#include "os/file_access.h"
#include "script_language.h"
+#include "gd_script.h"
template<class T>
T* GDParser::alloc_node() {
@@ -494,6 +495,14 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
}
}
+ if (GDScriptLanguage::get_singleton()->get_global_map().has(identifier)) {
+ //check from constants
+ ConstantNode *constant = alloc_node<ConstantNode>();
+ constant->value = GDScriptLanguage::get_singleton()->get_global_array()[ GDScriptLanguage::get_singleton()->get_global_map()[identifier] ];
+ expr=constant;
+ bfn = true;
+ }
+
if ( !bfn ) {
IdentifierNode *id = alloc_node<IdentifierNode>();
id->name = identifier;
diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h
index 166e29ad70..723761c3a9 100644
--- a/modules/gdscript/gd_script.h
+++ b/modules/gdscript/gd_script.h
@@ -202,6 +202,8 @@ friend class GDCompiler;
public:
+ _FORCE_INLINE_ Object* get_owner() { return owner; }
+
virtual bool set(const StringName& p_name, const Variant& p_value);
virtual bool get(const StringName& p_name, Variant &r_ret) const;
virtual void get_property_list(List<PropertyInfo> *p_properties) const;
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index d0b739e17f..c996a8123c 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -64,15 +64,17 @@ bool Skeleton::_set(const StringName& p_path, const Variant& p_value) {
else if (what=="bound_childs") {
Array children=p_value;
- bones[which].nodes_bound.clear();
+ if (is_inside_tree()) {
+ bones[which].nodes_bound.clear();
- for (int i=0;i<children.size();i++) {
+ for (int i=0;i<children.size();i++) {
- NodePath path=children[i];
- ERR_CONTINUE( path.operator String()=="" );
- Node *node = get_node(path);
- ERR_CONTINUE(!node);
- bind_child_node_to_bone(which,node);
+ NodePath path=children[i];
+ ERR_CONTINUE( path.operator String()=="" );
+ Node *node = get_node(path);
+ ERR_CONTINUE(!node);
+ bind_child_node_to_bone(which,node);
+ }
}
} else {
return false;
diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp
index 050e945c8f..99ecace1ed 100644
--- a/scene/audio/stream_player.cpp
+++ b/scene/audio/stream_player.cpp
@@ -77,7 +77,7 @@ void StreamPlayer::sp_update() {
if (to_mix==0) {
if (!stop_request) {
stop_request=true;
- call_deferred("stop");
+ call_deferred("_do_stop");
}
return;
}
@@ -91,7 +91,10 @@ void StreamPlayer::sp_update() {
}
}
-
+void StreamPlayer::_do_stop() {
+ stop();
+ emit_signal("finished");
+}
void StreamPlayer::_notification(int p_what) {
@@ -181,7 +184,7 @@ void StreamPlayer::stop() {
stop_request=false;
playback->stop();
resampler.flush();
- emit_signal("finished");
+
//set_idle_process(false);
}
@@ -381,6 +384,7 @@ void StreamPlayer::_bind_methods() {
ObjectTypeDB::bind_method(_MD("_set_play","play"),&StreamPlayer::_set_play);
ObjectTypeDB::bind_method(_MD("_get_play"),&StreamPlayer::_get_play);
+ ObjectTypeDB::bind_method(_MD("_do_stop"),&StreamPlayer::_do_stop);
ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream/stream", PROPERTY_HINT_RESOURCE_TYPE,"AudioStream"), _SCS("set_stream"), _SCS("get_stream") );
ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/play"), _SCS("_set_play"), _SCS("_get_play") );
diff --git a/scene/audio/stream_player.h b/scene/audio/stream_player.h
index 475139c2a4..4facc3c816 100644
--- a/scene/audio/stream_player.h
+++ b/scene/audio/stream_player.h
@@ -71,6 +71,8 @@ class StreamPlayer : public Node {
AudioRBResampler resampler;
+ void _do_stop();
+
bool _play;
void _set_play(bool p_play);
bool _get_play() const;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index ca8284cb13..3adf129ce5 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4546,6 +4546,7 @@ TextEdit::TextEdit() {
scroll_past_end_of_file_enabled=false;
auto_brace_completion_enabled=false;
brace_matching_enabled=false;
+ highlight_all_occurrences=false;
auto_indent=false;
insert_mode = false;
window_has_focus=true;
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index ff8f0d05f1..68f5a252e5 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1331,11 +1331,11 @@ Matrix32 Viewport::_get_input_pre_xform() const {
Matrix32 pre_xf;
if (render_target) {
- ERR_FAIL_COND_V(to_screen_rect.size.x==0,pre_xf);
- ERR_FAIL_COND_V(to_screen_rect.size.y==0,pre_xf);
+ if (to_screen_rect!=Rect2()) {
- pre_xf.elements[2]=-to_screen_rect.pos;
- pre_xf.scale(rect.size/to_screen_rect.size);
+ pre_xf.elements[2]=-to_screen_rect.pos;
+ pre_xf.scale(rect.size/to_screen_rect.size);
+ }
} else {
pre_xf.elements[2]=-rect.pos;
diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp
index e3689cf13d..470dd078ae 100644
--- a/tools/doc/doc_data.cpp
+++ b/tools/doc/doc_data.cpp
@@ -455,6 +455,12 @@ void DocData::generate(bool p_basic_types) {
}
+ {
+ //so it can be documented that it does not exist
+ class_list["Variant"]=ClassDoc();
+ class_list["Variant"].name="Variant";
+ }
+
if (!p_basic_types)
return;
diff --git a/tools/editor/asset_library_editor_plugin.cpp b/tools/editor/asset_library_editor_plugin.cpp
index a2448921d7..ee535310bc 100644
--- a/tools/editor/asset_library_editor_plugin.cpp
+++ b/tools/editor/asset_library_editor_plugin.cpp
@@ -1366,7 +1366,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
repository = memnew( OptionButton );
repository->add_item("Godot");
- repository->set_item_metadata(0, "http://godotengine.org/asset-library/api");
+ repository->set_item_metadata(0, "https://godotengine.org/asset-library/api");
repository->add_item("Localhost"); // TODO: Maybe remove?
repository->set_item_metadata(1, "http://127.0.0.1/asset-library/api");
repository->connect("item_selected",this,"_repository_changed");
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp
index 10c7bf79a3..203564e612 100644
--- a/tools/editor/plugins/animation_player_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_player_editor_plugin.cpp
@@ -1404,6 +1404,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) {
hb->add_child(animation);
animation->set_h_size_flags(SIZE_EXPAND_FILL);
animation->set_tooltip(TTR("Display list of animations in player."));
+ animation->set_clip_text(true);
autoplay = memnew( ToolButton );
hb->add_child(autoplay);
diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
index 4f59287994..e29a0c8d52 100644
--- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -31,7 +31,7 @@
#include "io/resource_loader.h"
#include "globals.h"
#include "tools/editor/editor_settings.h"
-
+#include "scene/3d/sprite_3d.h"
@@ -355,6 +355,35 @@ void SpriteFramesEditor::_animation_select() {
}
+
+static void _find_anim_sprites(Node* p_node,List<Node*> *r_nodes,Ref<SpriteFrames> p_sfames) {
+
+ Node *edited = EditorNode::get_singleton()->get_edited_scene();
+ if (!edited)
+ return;
+ if (p_node!=edited && p_node->get_owner()!=edited)
+ return;
+
+ {
+ AnimatedSprite *as = p_node->cast_to<AnimatedSprite>();
+ if (as && as->get_sprite_frames()==p_sfames) {
+ r_nodes->push_back(p_node);
+ }
+ }
+
+ {
+ AnimatedSprite3D *as = p_node->cast_to<AnimatedSprite3D>();
+ if (as && as->get_sprite_frames()==p_sfames) {
+ r_nodes->push_back(p_node);
+ }
+ }
+
+ for(int i=0;i<p_node->get_child_count();i++) {
+ _find_anim_sprites(p_node->get_child(i),r_nodes,p_sfames);
+ }
+
+}
+
void SpriteFramesEditor::_animation_name_edited(){
if (updating)
@@ -381,9 +410,24 @@ void SpriteFramesEditor::_animation_name_edited(){
name=new_name+" "+itos(counter);
}
+ List<Node*> nodes;
+ _find_anim_sprites(EditorNode::get_singleton()->get_edited_scene(),&nodes,Ref<SpriteFrames>(frames));
+
undo_redo->create_action(TTR("Rename Animation"));
undo_redo->add_do_method(frames,"rename_animation",edited_anim,name);
undo_redo->add_undo_method(frames,"rename_animation",name,edited_anim);
+
+ for(List<Node*>::Element *E=nodes.front();E;E=E->next()) {
+
+ String current = E->get()->call("get_animation");
+ if (current!=edited_anim)
+ continue;
+
+ undo_redo->add_do_method(E->get(),"set_animation",name);
+ undo_redo->add_undo_method(E->get(),"set_animation",edited_anim);
+
+ }
+
undo_redo->add_do_method(this,"_update_library");
undo_redo->add_undo_method(this,"_update_library");
@@ -406,12 +450,28 @@ void SpriteFramesEditor::_animation_add(){
name=new_name+" "+itos(counter);
}
+ List<Node*> nodes;
+ _find_anim_sprites(EditorNode::get_singleton()->get_edited_scene(),&nodes,Ref<SpriteFrames>(frames));
+
+
undo_redo->create_action(TTR("Add Animation"));
undo_redo->add_do_method(frames,"add_animation",name);
undo_redo->add_undo_method(frames,"remove_animation",name);
undo_redo->add_do_method(this,"_update_library");
undo_redo->add_undo_method(this,"_update_library");
+
+ for(List<Node*>::Element *E=nodes.front();E;E=E->next()) {
+
+ String current = E->get()->call("get_animation");
+ if (frames->has_animation(current))
+ continue;
+
+ undo_redo->add_do_method(E->get(),"set_animation",name);
+ undo_redo->add_undo_method(E->get(),"set_animation",current);
+
+ }
+
edited_anim=new_name;
undo_redo->commit_action();
@@ -426,6 +486,7 @@ void SpriteFramesEditor::_animation_remove(){
if (!frames->has_animation(edited_anim))
return;
+
undo_redo->create_action(TTR("Remove Animation"));
undo_redo->add_do_method(frames,"remove_animation",edited_anim);
undo_redo->add_undo_method(frames,"add_animation",edited_anim);