diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/io/http_client.cpp | 2 | ||||
-rw-r--r-- | core/script_debugger_remote.cpp | 14 | ||||
-rw-r--r-- | core/script_debugger_remote.h | 2 | ||||
-rw-r--r-- | core/script_language.cpp | 2 | ||||
-rw-r--r-- | core/script_language.h | 7 | ||||
-rw-r--r-- | core/variant_op.cpp | 10 |
6 files changed, 28 insertions, 9 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 11f9536243..3520680118 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -639,7 +639,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_raw","method","url","headers","body"),&HTTPClient::request_raw,DEFVAL(String())); + ObjectTypeDB::bind_method(_MD("request_raw","method","url","headers","body"),&HTTPClient::request_raw); 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/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 011b1f78a0..99d1e22c07 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -291,6 +291,8 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) { _set_object_property(cmd[1],cmd[2],cmd[3]); + } else if (command=="reload_scripts") { + reload_all_scripts=true; } else if (command=="breakpoint") { bool set = cmd[3]; @@ -698,7 +700,8 @@ void ScriptDebuggerRemote::_poll_events() { profiling=false; _send_profiling_data(false); print_line("PROFILING END!"); - + } else if (command=="reload_scripts") { + reload_all_scripts=true; } else if (command=="breakpoint") { bool set = cmd[3]; @@ -863,6 +866,14 @@ void ScriptDebuggerRemote::idle_poll() { } } + if (reload_all_scripts) { + + for(int i=0;i<ScriptServer::get_language_count();i++) { + ScriptServer::get_language(i)->reload_all_scripts(); + } + reload_all_scripts=false; + } + _poll_events(); } @@ -1012,6 +1023,7 @@ ScriptDebuggerRemote::ScriptDebuggerRemote() { profile_info_ptrs.resize(profile_info.size()); profiling=false; max_frame_functions=16; + reload_all_scripts=false; } diff --git a/core/script_debugger_remote.h b/core/script_debugger_remote.h index 8fdab47013..c6a00e189f 100644 --- a/core/script_debugger_remote.h +++ b/core/script_debugger_remote.h @@ -60,6 +60,7 @@ class ScriptDebuggerRemote : public ScriptDebugger { bool profiling; int max_frame_functions; bool skip_profile_frame; + bool reload_all_scripts; Ref<StreamPeerTCP> tcp_client; @@ -168,6 +169,7 @@ public: virtual void profiling_end(); virtual void profiling_set_frame_times(float p_frame_time,float p_idle_time,float p_fixed_time,float p_fixed_frame_time); + ScriptDebuggerRemote(); ~ScriptDebuggerRemote(); }; diff --git a/core/script_language.cpp b/core/script_language.cpp index 1503418269..b3116a0297 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -51,7 +51,7 @@ void Script::_bind_methods() { ObjectTypeDB::bind_method(_MD("has_source_code"),&Script::has_source_code); ObjectTypeDB::bind_method(_MD("get_source_code"),&Script::get_source_code); ObjectTypeDB::bind_method(_MD("set_source_code","source"),&Script::set_source_code); - ObjectTypeDB::bind_method(_MD("reload"),&Script::reload); + ObjectTypeDB::bind_method(_MD("reload","keep_state"),&Script::reload,DEFVAL(false)); } diff --git a/core/script_language.h b/core/script_language.h index bd76107acf..d8b4c61b6c 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -87,7 +87,7 @@ public: virtual bool has_source_code() const=0; virtual String get_source_code() const=0; virtual void set_source_code(const String& p_code)=0; - virtual Error reload()=0; + virtual Error reload(bool p_keep_state=false)=0; virtual bool is_tool() const=0; @@ -127,6 +127,8 @@ public: virtual Ref<Script> get_script() const=0; + virtual bool is_placeholder() const { return false; } + virtual ScriptLanguage *get_language()=0; virtual ~ScriptInstance(); }; @@ -189,6 +191,7 @@ public: virtual Vector<StackInfo> debug_get_current_stack_info() { return Vector<StackInfo>(); } + virtual void reload_all_scripts()=0; /* LOADER FUNCTIONS */ virtual void get_recognized_extensions(List<String> *p_extensions) const=0; @@ -248,6 +251,8 @@ public: void update(const List<PropertyInfo> &p_properties,const Map<StringName,Variant>& p_values); //likely changed in editor + virtual bool is_placeholder() const { return true; } + PlaceHolderScriptInstance(ScriptLanguage *p_language, Ref<Script> p_script,Object *p_owner); ~PlaceHolderScriptInstance(); diff --git a/core/variant_op.cpp b/core/variant_op.cpp index a9cc37168d..6065094da7 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -1354,7 +1354,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) return; } else if (*str=="r8" ) { valid=true; - v->g=float(p_value)/255.0; + v->r=float(p_value)/255.0; return; } else if (*str=="g8" ) { valid=true; @@ -2213,16 +2213,16 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { return v->get_v(); } else if (*str=="r8") { valid=true; - return v->r*255.0; + return (int)Math::round(v->r*255.0); } else if (*str=="g8" ) { valid=true; - return v->g*255.0; + return (int)Math::round(v->g*255.0); } else if (*str=="b8" ) { valid=true; - return v->b*255.0; + return (int)Math::round(v->b*255.0); } else if (*str=="a8" ) { valid=true; - return v->a*255.0; + return (int)Math::round(v->a*255.0); } } else if (p_index.get_type()==Variant::INT) { |