diff options
68 files changed, 825 insertions, 248 deletions
diff --git a/SConstruct b/SConstruct index d168820f66..0652414088 100644 --- a/SConstruct +++ b/SConstruct @@ -16,7 +16,6 @@ platform_list = [] # list of platforms platform_opts = {} # options for each platform platform_flags = {} # flags for each platform - active_platforms=[] active_platform_ids=[] platform_exporters=[] @@ -60,7 +59,7 @@ platform_arg = ARGUMENTS.get("platform", False) if (os.name=="posix"): pass elif (os.name=="nt"): - if (os.getenv("VSINSTALLDIR")==None or platform_arg=="android"): + if (not methods.msvc_is_detected() or platform_arg=="android"): custom_tools=['mingw'] env_base=Environment(tools=custom_tools); @@ -138,7 +137,8 @@ opts.Add('etc1','etc1 Texture compression support (yes/no)','yes') opts.Add('builtin_zlib','Use built-in zlib (yes/no)','yes') opts.Add('openssl','Use OpenSSL (yes/no/builtin)','no') opts.Add('musepack','Musepack Audio (yes/no)','yes') -opts.Add("CXX", "Compiler"); +opts.Add("CXX", "C++ Compiler") +opts.Add("CC", "C Compiler") opts.Add("CCFLAGS", "Custom flags for the C++ compiler"); opts.Add("CFLAGS", "Custom flags for the C compiler"); opts.Add("LINKFLAGS", "Custom flags for the linker"); diff --git a/core/array.cpp b/core/array.cpp index 23792f90fc..683a43e3d0 100644 --- a/core/array.cpp +++ b/core/array.cpp @@ -276,16 +276,26 @@ void Array::push_front(const Variant& p_value) { _p->array.insert(0,p_value); } -void Array::pop_back(){ +Variant Array::pop_back(){ - if (!_p->array.empty()) - _p->array.resize( _p->array.size() -1 ); + if (!_p->array.empty()) { + int n = _p->array.size() - 1; + Variant ret = _p->array.get(n); + _p->array.resize(n); + return ret; + } + return Variant(); } -void Array::pop_front(){ - if (!_p->array.empty()) +Variant Array::pop_front(){ + + if (!_p->array.empty()) { + Variant ret = _p->array.get(0); _p->array.remove(0); + return ret; + } + return Variant(); } diff --git a/core/array.h b/core/array.h index dfc902525c..eb79b0cf33 100644 --- a/core/array.h +++ b/core/array.h @@ -80,8 +80,8 @@ public: void erase(const Variant& p_value); void push_front(const Variant& p_value); - void pop_back(); - void pop_front(); + Variant pop_back(); + Variant pop_front(); Array(const Array& p_from); Array(bool p_shared=false); diff --git a/core/input_map.cpp b/core/input_map.cpp index 3a0f9596f5..09cb7ce426 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -232,64 +232,6 @@ bool InputMap::event_is_action(const InputEvent& p_event, const StringName& p_ac return _find_event(E->get().inputs,p_event)!=NULL; } -bool InputMap::event_is_joy_motion_action_pressed(const InputEvent& p_event) const { - - ERR_FAIL_COND_V(p_event.type!=InputEvent::JOYSTICK_MOTION,false); - bool pressed=false; - - //this could be optimized by having a separate list of joymotions? - - for (Map<StringName, Action>::Element *A=input_map.front();A;A=A->next()) { - - for (List<InputEvent>::Element *E=A->get().inputs.front();E;E=E->next()) { - - const InputEvent& e=E->get(); - if(e.type!=p_event.type) - continue; - if (e.type!=InputEvent::KEY && e.device!=p_event.device) - continue; - - switch(p_event.type) { - - case InputEvent::KEY: { - - if (e.key.scancode==p_event.key.scancode && e.key.mod == p_event.key.mod) - return e.key.pressed; - - } break; - case InputEvent::JOYSTICK_BUTTON: { - - if (e.joy_button.button_index==p_event.joy_button.button_index) { - return e.joy_button.pressed; - } - - } break; - case InputEvent::MOUSE_BUTTON: { - - if (e.mouse_button.button_index==p_event.mouse_button.button_index) { - return e.mouse_button.pressed; - } - - } break; - case InputEvent::JOYSTICK_MOTION: { - - if (e.joy_motion.axis==p_event.joy_motion.axis) { - if ( - (e.joy_motion.axis_value * p_event.joy_motion.axis_value >0) && //same axis - ABS(e.joy_motion.axis_value)>0.5 && ABS(p_event.joy_motion.axis_value)>0.5 ) - pressed=true; - } - - } break; - } - - } - } - - return pressed; - -} - const Map<StringName, InputMap::Action>& InputMap::get_action_map() const { return input_map; } diff --git a/core/input_map.h b/core/input_map.h index a224765d8c..21c479588d 100644 --- a/core/input_map.h +++ b/core/input_map.h @@ -72,7 +72,6 @@ public: const List<InputEvent> *get_action_list(const StringName& p_action); bool event_is_action(const InputEvent& p_event, const StringName& p_action) const; - bool event_is_joy_motion_action_pressed(const InputEvent& p_event) const; const Map<StringName, Action>& get_action_map() const; void load_from_globals(); diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp index 0e2060008c..2cc11aa738 100644 --- a/core/math/math_2d.cpp +++ b/core/math/math_2d.cpp @@ -475,18 +475,18 @@ Matrix32::Matrix32(real_t p_rot, const Vector2& p_pos) { elements[2]=p_pos; } -Vector2 Matrix32::get_scale() const { +Size2 Matrix32::get_scale() const { - return Vector2( elements[0].length(), elements[1].length() ); + return Size2( elements[0].length(), elements[1].length() ); } -void Matrix32::scale(const Vector2& p_scale) { +void Matrix32::scale(const Size2& p_scale) { elements[0]*=p_scale; elements[1]*=p_scale; elements[2]*=p_scale; } -void Matrix32::scale_basis(const Vector2& p_scale) { +void Matrix32::scale_basis(const Size2& p_scale) { elements[0]*=p_scale; elements[1]*=p_scale; @@ -501,7 +501,6 @@ void Matrix32::translate( const Vector2& p_translation ) { elements[2]+=basis_xform(p_translation); } - void Matrix32::orthonormalize() { // Gram-Schmidt Process @@ -550,11 +549,6 @@ void Matrix32::operator*=(const Matrix32& p_transform) { elements[2] = xform(p_transform.elements[2]); float x0,x1,y0,y1; -/* - x0 = p_transform.tdotx(elements[0]); - x1 = p_transform.tdoty(elements[0]); - y0 = p_transform.tdotx(elements[1]); - y1 = p_transform.tdoty(elements[1]);*/ x0 = tdotx(p_transform.elements[0]); x1 = tdoty(p_transform.elements[0]); @@ -576,7 +570,7 @@ Matrix32 Matrix32::operator*(const Matrix32& p_transform) const { } -Matrix32 Matrix32::scaled(const Vector2& p_scale) const { +Matrix32 Matrix32::scaled(const Size2& p_scale) const { Matrix32 copy=*this; copy.scale(p_scale); @@ -584,7 +578,7 @@ Matrix32 Matrix32::scaled(const Vector2& p_scale) const { } -Matrix32 Matrix32::basis_scaled(const Vector2& p_scale) const { +Matrix32 Matrix32::basis_scaled(const Size2& p_scale) const { Matrix32 copy=*this; copy.scale_basis(p_scale); @@ -629,8 +623,8 @@ Matrix32 Matrix32::interpolate_with(const Matrix32& p_transform, float p_c) cons real_t r1 = get_rotation(); real_t r2 = p_transform.get_rotation(); - Vector2 s1 = get_scale(); - Vector2 s2 = p_transform.get_scale(); + Size2 s1 = get_scale(); + Size2 s2 = p_transform.get_scale(); //slerp rotation Vector2 v1(Math::cos(r1), Math::sin(r1)); diff --git a/core/math/math_2d.h b/core/math/math_2d.h index 90aae9fe50..38c1ac9656 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -553,10 +553,8 @@ struct Rect2i { struct Matrix32 { - Vector2 elements[3]; - _FORCE_INLINE_ float tdotx(const Vector2& v) const { return elements[0][0] * v.x + elements[1][0] * v.y; } _FORCE_INLINE_ float tdoty(const Vector2& v) const { return elements[0][1] * v.x + elements[1][1] * v.y; } @@ -577,26 +575,25 @@ struct Matrix32 { _FORCE_INLINE_ void set_rotation_and_scale(real_t p_phi,const Size2& p_scale); void rotate(real_t p_phi); - void scale(const Vector2& p_scale); - void scale_basis(const Vector2& p_scale); + void scale(const Size2& p_scale); + void scale_basis(const Size2& p_scale); void translate( real_t p_tx, real_t p_ty); void translate( const Vector2& p_translation ); float basis_determinant() const; - Vector2 get_scale() const; + Size2 get_scale() const; _FORCE_INLINE_ const Vector2& get_origin() const { return elements[2]; } _FORCE_INLINE_ void set_origin(const Vector2& p_origin) { elements[2]=p_origin; } - Matrix32 scaled(const Vector2& p_scale) const; - Matrix32 basis_scaled(const Vector2& p_scale) const; + Matrix32 scaled(const Size2& p_scale) const; + Matrix32 basis_scaled(const Size2& p_scale) const; Matrix32 translated(const Vector2& p_offset) const; Matrix32 rotated(float p_phi) const; Matrix32 untranslated() const; - void orthonormalize(); Matrix32 orthonormalized() const; @@ -615,7 +612,6 @@ struct Matrix32 { _FORCE_INLINE_ Rect2 xform(const Rect2& p_vec) const; _FORCE_INLINE_ Rect2 xform_inv(const Rect2& p_vec) const; - operator String() const; Matrix32(real_t xx, real_t xy, real_t yx, real_t yy, real_t ox, real_t oy) { @@ -630,7 +626,6 @@ struct Matrix32 { Matrix32(real_t p_rot, const Vector2& p_pos); Matrix32() { elements[0][0]=1.0; elements[1][1]=1.0; } - }; bool Rect2::intersects_transformed(const Matrix32& p_xform, const Rect2& p_rect) const { diff --git a/core/os/input.cpp b/core/os/input.cpp index 401ab7ffe2..4ab57a84ea 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -64,6 +64,10 @@ void Input::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_connected_joysticks"),&Input::get_connected_joysticks); ObjectTypeDB::bind_method(_MD("get_joy_vibration_strength", "device"), &Input::get_joy_vibration_strength); ObjectTypeDB::bind_method(_MD("get_joy_vibration_duration", "device"), &Input::get_joy_vibration_duration); + ObjectTypeDB::bind_method(_MD("get_joy_button_string", "button_index"), &Input::get_joy_button_string); + ObjectTypeDB::bind_method(_MD("get_joy_button_index_from_string", "button"), &Input::get_joy_button_index_from_string); + ObjectTypeDB::bind_method(_MD("get_joy_axis_string", "axis_index"), &Input::get_joy_axis_string); + ObjectTypeDB::bind_method(_MD("get_joy_axis_index_from_string", "axis"), &Input::get_joy_axis_index_from_string); ObjectTypeDB::bind_method(_MD("start_joy_vibration", "device", "weak_magnitude", "strong_magnitude", "duration"), &Input::start_joy_vibration, DEFVAL(0)); ObjectTypeDB::bind_method(_MD("stop_joy_vibration", "device"), &Input::stop_joy_vibration); ObjectTypeDB::bind_method(_MD("get_accelerometer"),&Input::get_accelerometer); @@ -90,7 +94,7 @@ void Input::get_argument_options(const StringName& p_function,int p_idx,List<Str #ifdef TOOLS_ENABLED String pf=p_function; - if (p_idx==0 && (pf=="is_action_pressed" || pf=="action_press" || pf=="action_release")) { + if (p_idx==0 && (pf=="is_action_pressed" || pf=="action_press" || pf=="action_release" || pf=="is_action_just_pressed" || pf=="is_action_just_released")) { List<PropertyInfo> pinfo; Globals::get_singleton()->get_property_list(&pinfo); diff --git a/core/os/input.h b/core/os/input.h index 665fb4ad99..d8f3be09df 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -96,6 +96,11 @@ public: virtual void set_custom_mouse_cursor(const RES& p_cursor,const Vector2& p_hotspot=Vector2())=0; virtual void set_mouse_in_window(bool p_in_window)=0; + virtual String get_joy_button_string(int p_button)=0; + virtual String get_joy_axis_string(int p_axis)=0; + virtual int get_joy_button_index_from_string(String p_button)=0; + virtual int get_joy_axis_index_from_string(String p_axis)=0; + Input(); }; diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 9d920724e1..9982767be1 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -204,7 +204,7 @@ bool InputEvent::is_pressed() const { case MOUSE_BUTTON: return mouse_button.pressed; case JOYSTICK_BUTTON: return joy_button.pressed; case SCREEN_TOUCH: return screen_touch.pressed; - case JOYSTICK_MOTION: return InputMap::get_singleton()->event_is_joy_motion_action_pressed(*this); + case JOYSTICK_MOTION: return ABS(joy_motion.axis_value) > 0.5; case ACTION: return action.pressed; default: {} } diff --git a/core/os/os.h b/core/os/os.h index 8e9293b3c8..c2b46a5420 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -372,6 +372,7 @@ public: virtual void set_screen_orientation(ScreenOrientation p_orientation); ScreenOrientation get_screen_orientation() const; + virtual void enable_for_stealing_focus(ProcessID pid) {} virtual void move_window_to_foreground() {} virtual void debug_break(); diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 1ac0907967..6d685d3c43 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -134,6 +134,8 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) { ERR_FAIL(); } + OS::get_singleton()->enable_for_stealing_focus(Globals::get_singleton()->get("editor_pid")); + packet_peer_stream->put_var("debug_enter"); packet_peer_stream->put_var(2); packet_peer_stream->put_var(p_can_continue); @@ -273,6 +275,7 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) { set_depth(-1); set_lines_left(-1); + OS::get_singleton()->move_window_to_foreground(); break; } else if (command=="break") { ERR_PRINT("Got break when already broke!"); diff --git a/core/ustring.cpp b/core/ustring.cpp index 0d887210c3..f7dcba6b14 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3173,7 +3173,7 @@ bool String::is_valid_identifier() const { //kind of poor should be rewritten properly -String String::world_wrap(int p_chars_per_line) const { +String String::word_wrap(int p_chars_per_line) const { int from=0; int last_space=0; diff --git a/core/ustring.h b/core/ustring.h index bb57b11d88..09d13a9e64 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -218,7 +218,7 @@ public: String c_escape() const; String c_unescape() const; String json_escape() const; - String world_wrap(int p_chars_per_line) const; + String word_wrap(int p_chars_per_line) const; String percent_encode() const; String percent_decode() const; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 8473fdcd19..a84eed4d88 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -346,6 +346,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM0R(Vector2,angle); // VCALL_LOCALMEM1R(Vector2,cross); VCALL_LOCALMEM0R(Vector2,abs); + VCALL_LOCALMEM1R(Vector2,clamped); VCALL_LOCALMEM0R(Rect2,get_area); VCALL_LOCALMEM1R(Rect2,intersects); @@ -464,8 +465,8 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM0R(Array,hash); VCALL_LOCALMEM1(Array,push_back); VCALL_LOCALMEM1(Array,push_front); - VCALL_LOCALMEM0(Array,pop_back); - VCALL_LOCALMEM0(Array,pop_front); + VCALL_LOCALMEM0R(Array,pop_back); + VCALL_LOCALMEM0R(Array,pop_front); VCALL_LOCALMEM1(Array,append); VCALL_LOCALMEM1(Array,resize); VCALL_LOCALMEM2(Array,insert); @@ -1457,6 +1458,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC1(VECTOR2,VECTOR2,Vector2,reflect,VECTOR2,"vec",varray()); //ADDFUNC1(VECTOR2,REAL,Vector2,cross,VECTOR2,"with",varray()); ADDFUNC0(VECTOR2,VECTOR2,Vector2,abs,varray()); + ADDFUNC1(VECTOR2,VECTOR2,Vector2,clamped,REAL,"length",varray()); ADDFUNC0(RECT2,REAL,Rect2,get_area,varray()); ADDFUNC1(RECT2,BOOL,Rect2,intersects,RECT2,"b",varray()); diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 6865bb1378..deed5c5cda 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -2153,6 +2153,120 @@ <constants> </constants> </class> +<class name="AStar" inherits="Reference" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="add_point"> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="pos" type="Vector3"> + </argument> + <argument index="2" name="weight_scale" type="float" default="1"> + </argument> + <description> + </description> + </method> + <method name="are_points_connected" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="to_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="clear"> + <description> + </description> + </method> + <method name="connect_points"> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="to_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="disconnect_points"> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="to_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_available_point_id" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_closest_point" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="to_pos" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="get_closest_pos_in_segment" qualifiers="const"> + <return type="Vector3"> + </return> + <argument index="0" name="to_pos" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="get_id_path"> + <return type="IntArray"> + </return> + <argument index="0" name="from_id" type="int"> + </argument> + <argument index="1" name="to_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_point_path"> + <return type="Vector3Array"> + </return> + <argument index="0" name="from_id" type="int"> + </argument> + <argument index="1" name="to_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_point_pos" qualifiers="const"> + <return type="Vector3"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_point_weight_scale" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <description> + </description> + </method> + <method name="remove_point"> + <argument index="0" name="id" type="int"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> <class name="AcceptDialog" inherits="WindowDialog" category="Core"> <brief_description> Base dialog for user notification. @@ -4024,7 +4138,7 @@ </argument> <argument index="2" name="area_shape" type="int"> </argument> - <argument index="3" name="area_shape" type="int"> + <argument index="3" name="self_shape" type="int"> </argument> <description> This signal triggers only once when an area enters this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering. @@ -4044,7 +4158,7 @@ </argument> <argument index="2" name="area_shape" type="int"> </argument> - <argument index="3" name="area_shape" type="int"> + <argument index="3" name="self_shape" type="int"> </argument> <description> This signal triggers only once when an area exits this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering. @@ -4366,7 +4480,7 @@ </argument> <argument index="2" name="area_shape" type="int"> </argument> - <argument index="3" name="area_shape" type="int"> + <argument index="3" name="self_shape" type="int"> </argument> <description> This signal triggers only once when an area enters this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering. @@ -4386,7 +4500,7 @@ </argument> <argument index="2" name="area_shape" type="int"> </argument> - <argument index="3" name="area_shape" type="int"> + <argument index="3" name="self_shape" type="int"> </argument> <description> This signal triggers only once when an area exits this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering. @@ -6755,6 +6869,12 @@ <description> </description> </method> + <method name="get_custom_viewport" qualifiers="const"> + <return type="Viewport"> + </return> + <description> + </description> + </method> <method name="get_drag_margin" qualifiers="const"> <return type="float"> </return> @@ -6858,6 +6978,12 @@ <description> </description> </method> + <method name="set_custom_viewport"> + <argument index="0" name="viewport" type="Viewport"> + </argument> + <description> + </description> + </method> <method name="set_drag_margin"> <argument index="0" name="margin" type="int"> </argument> @@ -7560,6 +7686,12 @@ Canvas Item layer. [CanvasItem] nodes that are direct or indirect children of a [CanvasLayer] will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a [CanvasLayer] with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below). </description> <methods> + <method name="get_custom_viewport" qualifiers="const"> + <return type="Viewport"> + </return> + <description> + </description> + </method> <method name="get_layer" qualifiers="const"> <return type="int"> </return> @@ -7602,13 +7734,6 @@ Return the base transform for this layer. </description> </method> - <method name="get_viewport" qualifiers="const"> - <return type="RID"> - </return> - <description> - Return the viewport RID for this layer. - </description> - </method> <method name="get_world_2d" qualifiers="const"> <return type="World2D"> </return> @@ -7616,6 +7741,12 @@ Return the [World2D] used by this layer. </description> </method> + <method name="set_custom_viewport"> + <argument index="0" name="viewport" type="Viewport"> + </argument> + <description> + </description> + </method> <method name="set_layer"> <argument index="0" name="layer" type="int"> </argument> @@ -8678,6 +8809,28 @@ <constants> </constants> </class> +<class name="ColorFrame" inherits="Control" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_frame_color" qualifiers="const"> + <return type="Color"> + </return> + <description> + </description> + </method> + <method name="set_frame_color"> + <argument index="0" name="color" type="Color"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> <class name="ColorPicker" inherits="BoxContainer" category="Core"> <brief_description> Color picker control. @@ -11697,6 +11850,13 @@ Get the general settings for the editor (the same window that appears in the Settings menu). </description> </method> + <method name="get_editor_viewport"> + <return type="Control"> + </return> + <description> + Get the main editor control. Use this as a parent for main screens. + </description> + </method> <method name="get_name" qualifiers="virtual"> <return type="String"> </return> @@ -11762,6 +11922,10 @@ Return true if this is a main screen editor plugin (it goes in the main screen selector together with 2D, 3D, Script). </description> </method> + <method name="hide_bottom_panel"> + <description> + </description> + </method> <method name="inspect_object"> <argument index="0" name="object" type="Object"> </argument> @@ -11771,6 +11935,12 @@ Inspect an object in the inspector. </description> </method> + <method name="make_bottom_panel_item_visible"> + <argument index="0" name="item" type="Control"> + </argument> + <description> + </description> + </method> <method name="make_visible" qualifiers="virtual"> <argument index="0" name="visible" type="bool"> </argument> @@ -12069,7 +12239,7 @@ <return type="Array"> </return> <description> - Get the list of selected nodes, optimized for transform operations (ie, moving them, rotating, etc). This list avoids situations where a node is selected and also chid/grandchild. + Get the list of selected nodes, optimized for transform operations (ie, moving them, rotating, etc). This list avoids situations where a node is selected and also chid/grandchild. </description> </method> <method name="remove_node"> @@ -16480,6 +16650,38 @@ Returns the current value of the joystick axis at given index (see JOY_* constants in [@Global Scope]) </description> </method> + <method name="get_joy_axis_index_from_string"> + <return type="int"> + </return> + <argument index="0" name="axis" type="String"> + </argument> + <description> + </description> + </method> + <method name="get_joy_axis_string"> + <return type="String"> + </return> + <argument index="0" name="axis_index" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_joy_button_index_from_string"> + <return type="int"> + </return> + <argument index="0" name="button" type="String"> + </argument> + <description> + </description> + </method> + <method name="get_joy_button_string"> + <return type="String"> + </return> + <argument index="0" name="button_index" type="int"> + </argument> + <description> + </description> + </method> <method name="get_joy_guid" qualifiers="const"> <return type="String"> </return> @@ -40903,6 +41105,16 @@ <description> </description> </signal> + <signal name="symbol_lookup"> + <argument index="0" name="symbol" type="String"> + </argument> + <argument index="1" name="row" type="int"> + </argument> + <argument index="2" name="column" type="int"> + </argument> + <description> + </description> + </signal> <signal name="text_changed"> <description> Emitted when the text changes. @@ -42913,18 +43125,33 @@ </class> <class name="Tree" inherits="Control" category="Core"> <brief_description> + Control to show a tree of items. </brief_description> <description> + This shows a tree of items that can be selected, expanded and collapsed. The tree can have multiple columns with custom controls like text editing, buttons and popups. It can be useful for structural displaying and interactions. + Trees are built via code, using [TreeItem] objects to create the structure. They have a single root but multiple root can be simulated if a dummy hidden root is added. + [codeblock] + func _ready(): + var tree = Tree.new() + var root = tree.create_item() + tree.set_hide_root(true) + var child1 = tree.create_item(root) + var child2 = tree.create_item(root) + var subchild1 = tree.create_item(child1) + subchild1.set_text(0, "Subchild1") + [/codeblock] </description> <methods> <method name="are_column_titles_visible" qualifiers="const"> <return type="bool"> </return> <description> + Get whether the column titles are being shown. </description> </method> <method name="clear"> <description> + Clear the tree. This erases all of the items. </description> </method> <method name="create_item"> @@ -42933,16 +43160,19 @@ <argument index="0" name="parent" type="TreeItem" default="NULL"> </argument> <description> + Create an item in the tree and add it as the last child of [code]parent[/code]. If parent is not given, it will be added as the last child of the root, or it'll the be the root itself if the tree is empty. </description> </method> <method name="ensure_cursor_is_visible"> <description> + Make the current selected item visible. This will scroll the tree to make sure the selected item is in sight. </description> </method> <method name="get_allow_rmb_select" qualifiers="const"> <return type="bool"> </return> <description> + Get whether a right click can select items. </description> </method> <method name="get_column_at_pos" qualifiers="const"> @@ -42951,6 +43181,7 @@ <argument index="0" name="pos" type="Vector2"> </argument> <description> + Get the column index under the given point. </description> </method> <method name="get_column_title" qualifiers="const"> @@ -42959,6 +43190,7 @@ <argument index="0" name="column" type="int"> </argument> <description> + Get the title of the given column. </description> </method> <method name="get_column_width" qualifiers="const"> @@ -42967,36 +43199,42 @@ <argument index="0" name="column" type="int"> </argument> <description> + Get the width of the given column in pixels. </description> </method> <method name="get_columns" qualifiers="const"> <return type="int"> </return> <description> + Get the amount of columns. </description> </method> <method name="get_custom_popup_rect" qualifiers="const"> <return type="Rect2"> </return> <description> + Get the rectangle for custom popups. Helper to create custom cell controls that display a popup. See [method TreeItem.set_cell_mode]. </description> </method> <method name="get_drop_mode_flags" qualifiers="const"> <return type="int"> </return> <description> + Get the flags of the current drop mode. </description> </method> <method name="get_edited" qualifiers="const"> <return type="TreeItem"> </return> <description> + Get the current edited item. This is only available for custom cell mode. </description> </method> <method name="get_edited_column" qualifiers="const"> <return type="int"> </return> <description> + Get the column of the cell for the current edited icon. This is only available for custom cell mode. </description> </method> <method name="get_item_area_rect" qualifiers="const"> @@ -43007,6 +43245,7 @@ <argument index="1" name="column" type="int" default="-1"> </argument> <description> + Get the rectangle area of the the specified item. If column is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. </description> </method> <method name="get_item_at_pos" qualifiers="const"> @@ -43015,6 +43254,7 @@ <argument index="0" name="pos" type="Vector2"> </argument> <description> + Get the tree item at the specified position (relative to the tree origin position). </description> </method> <method name="get_next_selected"> @@ -43023,42 +43263,49 @@ <argument index="0" name="from" type="TreeItem"> </argument> <description> + Get the next selected item after the given one. </description> </method> <method name="get_pressed_button" qualifiers="const"> <return type="int"> </return> <description> + Get the index of the last pressed button. </description> </method> <method name="get_root"> <return type="TreeItem"> </return> <description> + Get the root item of the tree. </description> </method> <method name="get_scroll" qualifiers="const"> <return type="Vector2"> </return> <description> + Get the current scrolling position. </description> </method> <method name="get_selected" qualifiers="const"> <return type="TreeItem"> </return> <description> + Get the currently selected item. </description> </method> <method name="get_selected_column" qualifiers="const"> <return type="int"> </return> <description> + Get the column number of the current selection. </description> </method> <method name="get_single_select_cell_editing_only_when_already_selected" qualifiers="const"> <return type="bool"> </return> <description> + Get whether the editing of a cell should only happen when it is already selected. </description> </method> <method name="is_delayed_text_editor_enabled" qualifiers="const"> @@ -43071,12 +43318,14 @@ <return type="bool"> </return> <description> + Get whether the folding arrow is hidden. </description> </method> <method name="set_allow_rmb_select"> <argument index="0" name="allow" type="bool"> </argument> <description> + Set whether or not a right mouse button click can select items. </description> </method> <method name="set_column_expand"> @@ -43085,6 +43334,7 @@ <argument index="1" name="expand" type="bool"> </argument> <description> + Set whether a column will have the "Expand" flag of [Control]. </description> </method> <method name="set_column_min_width"> @@ -43093,6 +43343,7 @@ <argument index="1" name="min_width" type="int"> </argument> <description> + Set the minimum width of a column. </description> </method> <method name="set_column_title"> @@ -43101,18 +43352,21 @@ <argument index="1" name="title" type="String"> </argument> <description> + Set the title of a column. </description> </method> <method name="set_column_titles_visible"> <argument index="0" name="visible" type="bool"> </argument> <description> + Set whether the column titles visibility. </description> </method> <method name="set_columns"> <argument index="0" name="amount" type="int"> </argument> <description> + Set the amount of columns. </description> </method> <method name="set_delayed_text_editor"> @@ -43125,30 +43379,35 @@ <argument index="0" name="flags" type="int"> </argument> <description> + Set the drop mode as an OR combination of flags. See [code]DROP_MODE_*[/code] constants. </description> </method> <method name="set_hide_folding"> <argument index="0" name="hide" type="bool"> </argument> <description> + Set whether the folding arrow should be hidden. </description> </method> <method name="set_hide_root"> <argument index="0" name="enable" type="bool"> </argument> <description> + Set whether the root of the tree should be hidden. </description> </method> <method name="set_select_mode"> <argument index="0" name="mode" type="int"> </argument> <description> + Set the selection mode. Use one of the [code]SELECT_*[/code] constants. </description> </method> <method name="set_single_select_cell_editing_only_when_already_selected"> <argument index="0" name="enable" type="bool"> </argument> <description> + Set whether the editing of a cell should only happen when it is already selected. </description> </method> </methods> @@ -43161,32 +43420,38 @@ <argument index="2" name="id" type="int"> </argument> <description> + Emitted when a button on the tree was pressed (see [method TreeItem.add_button]). </description> </signal> <signal name="cell_selected"> <description> + Emitted when a cell is selected. </description> </signal> <signal name="custom_popup_edited"> <argument index="0" name="arrow_clicked" type="bool"> </argument> <description> + Emitted when a cell with the [code]CELL_MODE_CUSTOM[/code] is clicked to be edited. </description> </signal> <signal name="empty_tree_rmb_selected"> <argument index="0" name="pos" type="Vector2"> </argument> <description> + Emitted when the right mouse button is pressed if RMB selection is active and the tree is empty. </description> </signal> <signal name="item_activated"> <description> + Emitted when an item is activated (double-clicked). </description> </signal> <signal name="item_collapsed"> <argument index="0" name="item" type="Object"> </argument> <description> + Emitted when an item is collapsed by a click on the folding arrow. </description> </signal> <signal name="item_double_clicked"> @@ -43195,16 +43460,19 @@ </signal> <signal name="item_edited"> <description> + Emitted when an item is editted. </description> </signal> <signal name="item_rmb_selected"> <argument index="0" name="pos" type="Vector2"> </argument> <description> + Emitted when an item is selected with right mouse button. </description> </signal> <signal name="item_selected"> <description> + Emitted when an item is selected with right mouse button. </description> </signal> <signal name="multi_selected"> @@ -44478,6 +44746,14 @@ do_property]. Returns the angle in radians between the line connecting the two points and the x coordinate. </description> </method> + <method name="clamped"> + <return type="Vector2"> + </return> + <argument index="0" name="length" type="float"> + </argument> + <description> + </description> + </method> <method name="cubic_interpolate"> <return type="Vector2"> </return> @@ -45231,136 +45507,160 @@ do_property]. </class> <class name="VideoPlayer" inherits="Control" category="Core"> <brief_description> + Control to play video files. </brief_description> <description> + This control has the ability to play video streams. The only format accepted is the OGV Theora, so any other format must be converted before using in a project. </description> <methods> <method name="get_audio_track" qualifiers="const"> <return type="int"> </return> <description> + Get the selected audio track (for multitrack videos). </description> </method> <method name="get_buffering_msec" qualifiers="const"> <return type="int"> </return> <description> + Get the amount of miliseconds to store in buffer while playing. </description> </method> <method name="get_stream" qualifiers="const"> <return type="VideoStream"> </return> <description> + Get the video stream. </description> </method> <method name="get_stream_name" qualifiers="const"> <return type="String"> </return> <description> + Get the name of the video stream. </description> </method> <method name="get_stream_pos" qualifiers="const"> <return type="float"> </return> <description> + Get the current position of the stream, in seconds. </description> </method> <method name="get_video_texture"> <return type="Texture"> </return> <description> + Get the current frame of the video as a [Texture]. </description> </method> <method name="get_volume" qualifiers="const"> <return type="float"> </return> <description> + Get the volume of the audio track as a linear value. </description> </method> <method name="get_volume_db" qualifiers="const"> <return type="float"> </return> <description> + Get the volume of the audio track in decibels. </description> </method> <method name="has_autoplay" qualifiers="const"> <return type="bool"> </return> <description> + Get whether or not the video is set as autoplay. </description> </method> <method name="has_expand" qualifiers="const"> <return type="bool"> </return> <description> + Get whether or not the expand property is set. </description> </method> <method name="is_paused" qualifiers="const"> <return type="bool"> </return> <description> + Get whether or not the video is paused. </description> </method> <method name="is_playing" qualifiers="const"> <return type="bool"> </return> <description> + Get whether or not the video is playing. </description> </method> <method name="play"> <description> + Start the video playback. </description> </method> <method name="set_audio_track"> <argument index="0" name="track" type="int"> </argument> <description> + Set the audio track (for multitrack videos). </description> </method> <method name="set_autoplay"> <argument index="0" name="enabled" type="bool"> </argument> <description> + Set whether this node should start playing automatically. </description> </method> <method name="set_buffering_msec"> <argument index="0" name="msec" type="int"> </argument> <description> + Set the amount of miliseconds to buffer during playback. </description> </method> <method name="set_expand"> <argument index="0" name="enable" type="bool"> </argument> <description> + Set the expand property. If enabled, the video will grow or shrink to fit the player size, otherwise it will play at the stream resolution. </description> </method> <method name="set_paused"> <argument index="0" name="paused" type="bool"> </argument> <description> + Set whether the video should pause the playback. </description> </method> <method name="set_stream"> <argument index="0" name="stream" type="VideoStream"> </argument> <description> + Set the video stream for this player. </description> </method> <method name="set_volume"> <argument index="0" name="volume" type="float"> </argument> <description> + Set the audio volume as a linear value. </description> </method> <method name="set_volume_db"> <argument index="0" name="db" type="float"> </argument> <description> + Set the audio volume in decibels. </description> </method> <method name="stop"> <description> + Stop the video playback. </description> </method> </methods> @@ -45540,6 +45840,12 @@ do_property]. Return the 3D world of the viewport. </description> </method> + <method name="get_world_2d" qualifiers="const"> + <return type="World2D"> + </return> + <description> + </description> + </method> <method name="gui_get_drag_data" qualifiers="const"> <return type="Variant"> </return> @@ -45763,6 +46069,12 @@ do_property]. Change the 3D world of the viewport. </description> </method> + <method name="set_world_2d"> + <argument index="0" name="world_2d" type="World2D"> + </argument> + <description> + </description> + </method> <method name="unhandled_input"> <argument index="0" name="local_event" type="InputEvent"> </argument> @@ -46083,12 +46395,24 @@ do_property]. <description> </description> <methods> + <method name="get_aabb" qualifiers="const"> + <return type="AABB"> + </return> + <description> + </description> + </method> <method name="get_layer_mask" qualifiers="const"> <return type="int"> </return> <description> </description> </method> + <method name="get_transformed_aabb" qualifiers="const"> + <return type="AABB"> + </return> + <description> + </description> + </method> <method name="set_base"> <argument index="0" name="base" type="RID"> </argument> @@ -49760,14 +50084,17 @@ do_property]. </class> <class name="XMLParser" inherits="Reference" category="Core"> <brief_description> + Low-level class for creating parsers for XML files. </brief_description> <description> + This class can serve as base to make custom XML parsers. Since XML is a very flexible standard, this interface is low level so it can be applied to any possible schema. </description> <methods> <method name="get_attribute_count" qualifiers="const"> <return type="int"> </return> <description> + Get the amount of attributes in the current element. </description> </method> <method name="get_attribute_name" qualifiers="const"> @@ -49776,6 +50103,7 @@ do_property]. <argument index="0" name="idx" type="int"> </argument> <description> + Get the name of the attribute specified by the index in [code]idx[/code] argument. </description> </method> <method name="get_attribute_value" qualifiers="const"> @@ -49784,12 +50112,14 @@ do_property]. <argument index="0" name="idx" type="int"> </argument> <description> + Get the value of the attribute specified by the index in [code]idx[/code] argument. </description> </method> <method name="get_current_line" qualifiers="const"> <return type="int"> </return> <description> + Get the current line in the parsed file (currently not implemented). </description> </method> <method name="get_named_attribute_value" qualifiers="const"> @@ -49798,6 +50128,7 @@ do_property]. <argument index="0" name="name" type="String"> </argument> <description> + Get the value of a certain attribute of the current element by name. This will raise an error if the element has no such attribute. </description> </method> <method name="get_named_attribute_value_safe" qualifiers="const"> @@ -49806,30 +50137,35 @@ do_property]. <argument index="0" name="name" type="String"> </argument> <description> + Get the value of a certain attribute of the current element by name. This will return an empty [String] if the attribute is not found. </description> </method> <method name="get_node_data" qualifiers="const"> <return type="String"> </return> <description> + Get the contents of a text node. This will raise an error in any other type of node. </description> </method> <method name="get_node_name" qualifiers="const"> <return type="String"> </return> <description> + Get the name of the current element node. This will raise an error if the current node type is not [code]NODE_ELEMENT[/code] nor [code]NODE_ELEMENT_END[/code] </description> </method> <method name="get_node_offset" qualifiers="const"> <return type="int"> </return> <description> + Get the byte offset of the current node since the beginning of the file or buffer. </description> </method> <method name="get_node_type"> <return type="int"> </return> <description> + Get the type of the current node. Compare with [code]NODE_*[/code] constants. </description> </method> <method name="has_attribute" qualifiers="const"> @@ -49838,12 +50174,14 @@ do_property]. <argument index="0" name="name" type="String"> </argument> <description> + Check whether or not the current element has a certain attribute. </description> </method> <method name="is_empty" qualifiers="const"> <return type="bool"> </return> <description> + Check whether the current element is empty (this only works for completely empty tags, e.g. <element \>). </description> </method> <method name="open"> @@ -49852,6 +50190,7 @@ do_property]. <argument index="0" name="file" type="String"> </argument> <description> + Open a XML file for parsing. This returns an error code. </description> </method> <method name="open_buffer"> @@ -49860,12 +50199,14 @@ do_property]. <argument index="0" name="buffer" type="RawArray"> </argument> <description> + Open a XML raw buffer for parsing. This returns an error code. </description> </method> <method name="read"> <return type="int"> </return> <description> + Read the next node of the file. This returns an error code. </description> </method> <method name="seek"> @@ -49874,27 +50215,36 @@ do_property]. <argument index="0" name="pos" type="int"> </argument> <description> + Move the buffer cursor to a certain offset (since the beginning) and read the next node there. This returns an error code. </description> </method> <method name="skip_section"> <description> + Skips the current section. If the node contains other elements, they will be ignored and the cursor will go to the closing of the current element. </description> </method> </methods> <constants> <constant name="NODE_NONE" value="0"> + There's no node (no file or buffer opened) </constant> <constant name="NODE_ELEMENT" value="1"> + Element (tag) </constant> <constant name="NODE_ELEMENT_END" value="2"> + End of element </constant> <constant name="NODE_TEXT" value="3"> + Text node </constant> <constant name="NODE_COMMENT" value="4"> + Comment node </constant> <constant name="NODE_CDATA" value="5"> + CDATA content </constant> <constant name="NODE_UNKNOWN" value="6"> + Unknown node </constant> </constants> </class> diff --git a/drivers/builtin_openssl2/SCsub b/drivers/builtin_openssl2/SCsub index a28bc2922c..0c035cc4a5 100644 --- a/drivers/builtin_openssl2/SCsub +++ b/drivers/builtin_openssl2/SCsub @@ -656,7 +656,8 @@ if "platform" in env and env["platform"] == "winrt": # Workaround for compilation error with GCC/Clang when -Werror is too greedy (GH-4517) import os -if not (os.name=="nt" and os.getenv("VSINSTALLDIR")!=None): # not Windows and not MSVC +import methods +if not (os.name=="nt" and methods.msvc_is_detected() ): # not Windows and not MSVC env_drivers.Append(CFLAGS=["-Wno-error=implicit-function-declaration"]) env_drivers.add_source_files(env.drivers_sources,openssl_sources) diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 8350fb0674..aeb3d9e039 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -1998,7 +1998,6 @@ void RasterizerGLES2::mesh_add_surface(RID p_mesh,VS::PrimitiveType p_primitive, if (use_VBO) { elem_size=VS::ARRAY_WEIGHTS_SIZE*sizeof(GLushort); - elem_count=VS::ARRAY_WEIGHTS_SIZE; valid_local=false; bind=true; normalize=true; @@ -2007,7 +2006,6 @@ void RasterizerGLES2::mesh_add_surface(RID p_mesh,VS::PrimitiveType p_primitive, } else { elem_size=VS::ARRAY_WEIGHTS_SIZE*sizeof(GLfloat); - elem_count=VS::ARRAY_WEIGHTS_SIZE; valid_local=false; bind=false; datatype=GL_FLOAT; @@ -2019,7 +2017,6 @@ void RasterizerGLES2::mesh_add_surface(RID p_mesh,VS::PrimitiveType p_primitive, if (use_VBO) { elem_size=VS::ARRAY_WEIGHTS_SIZE*sizeof(GLubyte); - elem_count=VS::ARRAY_WEIGHTS_SIZE; valid_local=false; bind=true; datatype=GL_UNSIGNED_BYTE; @@ -2027,7 +2024,6 @@ void RasterizerGLES2::mesh_add_surface(RID p_mesh,VS::PrimitiveType p_primitive, } else { elem_size=VS::ARRAY_WEIGHTS_SIZE*sizeof(GLushort); - elem_count=VS::ARRAY_WEIGHTS_SIZE; valid_local=false; bind=false; datatype=GL_UNSIGNED_SHORT; @@ -4666,7 +4662,7 @@ void RasterizerGLES2::_update_shader( Shader* p_shader) const { enablers.push_back("#define USE_LIGHT_SHADER_CODE\n"); } if (light_flags.uses_shadow_color) { - enablers.push_back("#define USE_LIGHT_SHADOW_COLOR\n"); + enablers.push_back("#define USE_OUTPUT_SHADOW_COLOR\n"); } if (light_flags.uses_time || fragment_flags.uses_time || vertex_flags.uses_time) { enablers.push_back("#define USE_TIME\n"); @@ -4709,7 +4705,7 @@ void RasterizerGLES2::_update_shader( Shader* p_shader) const { enablers.push_back("#define USE_TEXPIXEL_SIZE\n"); } if (light_flags.uses_shadow_color) { - enablers.push_back("#define USE_LIGHT_SHADOW_COLOR\n"); + enablers.push_back("#define USE_OUTPUT_SHADOW_COLOR\n"); } if (vertex_flags.uses_worldvec) { @@ -7022,6 +7018,10 @@ void RasterizerGLES2::_process_glow_bloom() { void RasterizerGLES2::_process_hdr() { + if (framebuffer.luminance.empty()) { + return; + } + glBindFramebuffer(GL_FRAMEBUFFER, framebuffer.luminance[0].fbo); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, framebuffer.color ); diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 3be0fdab17..d4636ed444 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -904,6 +904,7 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() { mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_VEC"]="light_vec"; mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_HEIGHT"]="light_height"; mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_COLOR"]="light"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_SHADOW"]="light_shadow_color"; mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_UV"]="light_uv"; mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT"]="light_out"; mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["SHADOW"]="shadow_color"; diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index 285abd30ff..5f4767940d 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -244,7 +244,7 @@ FRAGMENT_SHADER_CODE vec2 light_uv = light_uv_interp.xy; vec4 light = texture2D(light_texture,light_uv) * light_color; -#if defined(USE_LIGHT_SHADOW_COLOR) +#if defined(USE_OUTPUT_SHADOW_COLOR) vec4 shadow_color=vec4(0.0,0.0,0.0,0.0); #endif @@ -380,7 +380,7 @@ LIGHT_SHADER_CODE #endif -#if defined(USE_LIGHT_SHADOW_COLOR) +#if defined(USE_OUTPUT_SHADOW_COLOR) color=mix(shadow_color,color,shadow_attenuation); #else //color*=shadow_attenuation; diff --git a/drivers/gles2/shaders/material.glsl b/drivers/gles2/shaders/material.glsl index fd778f3442..477a451f2f 100644 --- a/drivers/gles2/shaders/material.glsl +++ b/drivers/gles2/shaders/material.glsl @@ -1185,7 +1185,7 @@ FRAGMENT_SHADER_CODE vec3 mdiffuse = diffuse.rgb; vec3 light; -#if defined(USE_LIGHT_SHADOW_COLOR) +#if defined(USE_OUTPUT_SHADOW_COLOR) vec3 shadow_color=vec3(0.0,0.0,0.0); #endif @@ -1209,7 +1209,7 @@ LIGHT_SHADER_CODE #endif diffuse.rgb = const_light_mult * ambient_light *diffuse.rgb + light * attenuation * shadow_attenuation; -#if defined(USE_LIGHT_SHADOW_COLOR) +#if defined(USE_OUTPUT_SHADOW_COLOR) diffuse.rgb += light * shadow_color * attenuation * (1.0 - shadow_attenuation); #endif diff --git a/drivers/vorbis/SCsub b/drivers/vorbis/SCsub index 87805cc2d8..4afafcc4ba 100644 --- a/drivers/vorbis/SCsub +++ b/drivers/vorbis/SCsub @@ -5,7 +5,7 @@ sources = [ ] sources_lib = [ - "vorbis/analysis.c", + #"vorbis/analysis.c", #"vorbis/barkmel.c", "vorbis/bitrate.c", "vorbis/block.c", @@ -27,7 +27,7 @@ sources_lib = [ "vorbis/smallft.c", "vorbis/synthesis.c", #"vorbis/tone.c", - "vorbis/vorbisenc.c", + #"vorbis/vorbisenc.c", "vorbis/vorbisfile.c", "vorbis/window.c", ] diff --git a/main/input_default.cpp b/main/input_default.cpp index 089772edc5..92f4a6fb72 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -849,6 +849,13 @@ uint32_t InputDefault::joy_axis(uint32_t p_last_id, int p_device, int p_axis, co return p_last_id; } + if (ABS(joy.last_axis[p_axis]) > 0.5 && joy.last_axis[p_axis] * p_value.value < 0) { + //changed direction quickly, insert fake event to release pending inputmap actions + JoyAxis jx; + jx.min = p_value.min; + jx.value = p_value.value < 0 ? 0.1 : -0.1; + p_last_id = joy_axis(p_last_id, p_device, p_axis, jx); + } joy.last_axis[p_axis] = p_value.value; float val = p_value.min == 0 ? -1.0f + 2.0f * p_value.value : p_value.value; @@ -1152,3 +1159,61 @@ Array InputDefault::get_connected_joysticks() { } return ret; } + +static const char* _buttons[] = { + "Face Button Bottom", + "Face Button Right", + "Face Button Left", + "Face Button Top", + "L", + "R", + "L2", + "R2", + "L3", + "R3", + "Select", + "Start", + "DPAD Up", + "DPAD Down", + "DPAD Left", + "DPAD Right" +}; + +static const char* _axes[] = { + "Left Stick X", + "Left Stick Y", + "Right Stick X", + "Right Stick Y", + "", + "", + "L2", + "R2" +}; + +String InputDefault::get_joy_button_string(int p_button) { + ERR_FAIL_INDEX_V(p_button, JOY_BUTTON_MAX, ""); + return _buttons[p_button]; +} + +int InputDefault::get_joy_button_index_from_string(String p_button) { + for (int i = 0; i < JOY_BUTTON_MAX; i++) { + if (p_button == _buttons[i]) { + return i; + } + } + ERR_FAIL_V(-1); +} + +String InputDefault::get_joy_axis_string(int p_axis) { + ERR_FAIL_INDEX_V(p_axis, JOY_AXIS_MAX, ""); + return _axes[p_axis]; +} + +int InputDefault::get_joy_axis_index_from_string(String p_axis) { + for (int i = 0; i < JOY_AXIS_MAX; i++) { + if (p_axis == _axes[i]) { + return i; + } + } + ERR_FAIL_V(-1); +} diff --git a/main/input_default.h b/main/input_default.h index fbf7837b3b..2db6d28abf 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -235,6 +235,11 @@ public: virtual bool is_joy_known(int p_device); virtual String get_joy_guid(int p_device) const; + virtual String get_joy_button_string(int p_button); + virtual String get_joy_axis_string(int p_axis); + virtual int get_joy_axis_index_from_string(String p_axis); + virtual int get_joy_button_index_from_string(String p_button); + bool is_joy_mapped(int p_device); String get_joy_guid_remapped(int p_device) const; void set_fallback_mapping(String p_guid); diff --git a/main/main.cpp b/main/main.cpp index d2ba38b094..a1f62c7628 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -560,6 +560,16 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas goto error; } + } else if (I->get()=="-epid") { + if (I->next()) { + + int editor_pid=I->next()->get().to_int(); + Globals::get_singleton()->set("editor_pid",editor_pid); + N=I->next()->next(); + } else { + goto error; + + } } else { //test for game path diff --git a/methods.py b/methods.py index c28ed55dda..c4951c69bd 100755 --- a/methods.py +++ b/methods.py @@ -1516,6 +1516,12 @@ def detect_visual_c_compiler_version(tools_env): return vc_chosen_compiler_str +def msvc_is_detected() : + # looks for VisualStudio env variable + # or for Visual C++ Build Tools (which is a standalone MSVC) + return os.getenv("VSINSTALLDIR") or os.getenv("VS100COMNTOOLS") or os.getenv("VS110COMNTOOLS") or os.getenv("VS120COMNTOOLS") or os.getenv("VS140COMNTOOLS"); + + def precious_program(env, program, sources, **args): program = env.ProgramOriginal(program, sources, **args) env.Precious(program) diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp index 18a4347edf..4134ed037f 100644 --- a/modules/enet/networked_multiplayer_enet.cpp +++ b/modules/enet/networked_multiplayer_enet.cpp @@ -359,7 +359,7 @@ Error NetworkedMultiplayerENet::get_packet(const uint8_t **r_buffer,int &r_buffe incoming_packets.pop_front(); *r_buffer=(const uint8_t*)(¤t_packet.packet->data[12]); - r_buffer_size=current_packet.packet->dataLength; + r_buffer_size=current_packet.packet->dataLength-12; return OK; } diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 8f3edfcaa7..4735a91f43 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -913,15 +913,13 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool } - ret.resize(ret.size()+stable_extra.size()); - while(ret.size()%4) - ret.push_back(0); - for(int i=0;i<stable_extra.size();i++) { - - chars[i]=stable_extra[i]; + ret.push_back(stable_extra[i]); } + while(ret.size()%4) + ret.push_back(0); + uint32_t new_stable_end=ret.size(); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 4e395a6f9f..862709fc7d 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -132,15 +132,10 @@ void OS_Android::initialize(const VideoMode& p_desired,int p_video_driver,int p_ AudioDriverManagerSW::add_driver(&audio_driver_android); - if (true) { - RasterizerGLES2 *rasterizer_gles22=memnew( RasterizerGLES2(false,use_reload_hooks,false,use_reload_hooks ) ); - if (gl_extensions) - rasterizer_gles22->set_extensions(gl_extensions); - rasterizer = rasterizer_gles22; - } else { - //rasterizer = memnew( RasterizerGLES1(use_reload_hooks, use_reload_hooks) ); - - } + RasterizerGLES2 *rasterizer_gles22=memnew( RasterizerGLES2(false,use_reload_hooks,false,use_reload_hooks ) ); + if (gl_extensions) + rasterizer_gles22->set_extensions(gl_extensions); + rasterizer = rasterizer_gles22; rasterizer->set_force_16_bits_fbo(use_16bits_fbo); diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 0548b84cfa..12ea5a93ee 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -1,10 +1,11 @@ # -# tested on | Windows native | Linux cross-compilation -# ------------------------+-------------------+--------------------------- -# MSVS C++ 2010 Express | WORKS | n/a -# Mingw-w64 | WORKS | WORKS -# Mingw-w32 | WORKS | WORKS -# MinGW | WORKS | untested +# tested on | Windows native | Linux cross-compilation +# ----------------------------+-------------------+--------------------------- +# MSVS C++ 2010 Express | WORKS | n/a +# Visual C++ Build Tools 2015 | WORKS | n/a +# Mingw-w64 | WORKS | WORKS +# Mingw-w32 | WORKS | WORKS +# MinGW | WORKS | untested # ##### # Notes about MSVS C++ : @@ -12,6 +13,12 @@ # - MSVC2010-Express compiles to 32bits only. # ##### +# Note about Visual C++ Build Tools : +# +# - Visual C++ Build Tools is the standalone MSVC compiler : +# http://landinghub.visualstudio.com/visual-cpp-build-tools +# +##### # Notes about Mingw-w64 and Mingw-w32 under Windows : # # - both can be installed using the official installer : @@ -78,7 +85,7 @@ ##### # TODO : -# +# # - finish to cleanup this script to remove all the remains of previous hacks and workarounds # - make it work with the Windows7 SDK that is supposed to enable 64bits compilation for MSVC2010-Express # - confirm it works well with other Visual Studio versions. @@ -102,7 +109,7 @@ def can_build(): if (os.name=="nt"): #building natively on windows! - if (os.getenv("VSINSTALLDIR")): + if ( methods.msvc_is_detected() ): return True else: print("\nMSVC not detected, attempting Mingw.") @@ -197,7 +204,7 @@ def configure(env): env.Append(CPPPATH=['#platform/windows']) env['is_mingw']=False - if (os.name=="nt" and os.getenv("VSINSTALLDIR")!=None): + if (os.name=="nt" and methods.msvc_is_detected() ): #build using visual studio env['ENV']['TMP'] = os.environ['TMP'] env.Append(CPPPATH=['#platform/windows/include']) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index cebafdabce..35d90a8308 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1312,10 +1312,13 @@ void OS_Windows::finalize_core() { void OS_Windows::vprint(const char* p_format, va_list p_list, bool p_stderr) { - char buf[16384+1]; - int len = vsnprintf(buf,16384,p_format,p_list); + const unsigned int BUFFER_SIZE = 16384; + char buf[BUFFER_SIZE+1]; // +1 for the terminating character + int len = vsnprintf(buf,BUFFER_SIZE,p_format,p_list); if (len<=0) return; + if(len >= BUFFER_SIZE) + len = BUFFER_SIZE; // Output is too big, will be truncated buf[len]=0; @@ -2154,10 +2157,15 @@ String OS_Windows::get_stdin_string(bool p_block) { } +void OS_Windows::enable_for_stealing_focus(ProcessID pid) { + + AllowSetForegroundWindow(pid); + +} + void OS_Windows::move_window_to_foreground() { SetForegroundWindow(hWnd); - BringWindowToTop(hWnd); } diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index e3e037e57b..70ef694957 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -269,6 +269,7 @@ public: virtual String get_locale() const; virtual LatinKeyboardVariant get_latin_keyboard_variant() const; + virtual void enable_for_stealing_focus(ProcessID pid); virtual void move_window_to_foreground(); virtual String get_data_dir() const; virtual String get_system_dir(SystemDir p_dir) const; diff --git a/platform/winrt/SCsub b/platform/winrt/SCsub index ef7a653d53..fde0c11f3b 100644 --- a/platform/winrt/SCsub +++ b/platform/winrt/SCsub @@ -13,7 +13,10 @@ files = [ 'os_winrt.cpp', ] -cmd = env.AlwaysBuild(env.ANGLE('libANGLE.lib', None)) +if "build_angle" in env and env["build_angle"]: + cmd = env.AlwaysBuild(env.ANGLE('libANGLE.lib', None)) prog = env.Program('#bin/godot', files) -env.Depends(prog, [cmd]) + +if "build_angle" in env and env["build_angle"]: + env.Depends(prog, [cmd]) diff --git a/platform/winrt/detect.py b/platform/winrt/detect.py index 6ba4cf5cbc..7f220736d7 100644 --- a/platform/winrt/detect.py +++ b/platform/winrt/detect.py @@ -17,11 +17,6 @@ def can_build(): if (os.getenv("VSINSTALLDIR")): if (os.getenv("ANGLE_SRC_PATH") == None): - print("You need to define ANGLE_SRC_PATH to the path of ANGLE source root.") - return False - - if not os.path.isfile(str(os.getenv("ANGLE_SRC_PATH")) + "/winrt/10/src/angle.sln"): - print ("Couldn't find the ANGLE solution. Is ANGLE_SRC_PATH configured to the right path?") return False return True @@ -56,6 +51,9 @@ def configure(env): jobs = str(env.GetOption("num_jobs")) angle_build_cmd = "msbuild.exe " + angle_root + "/winrt/10/src/angle.sln /nologo /v:m /m:" + jobs + " /p:Configuration=Release /p:Platform=" + if os.path.isfile(str(os.getenv("ANGLE_SRC_PATH")) + "/winrt/10/src/angle.sln"): + env["build_angle"] = True + if os.getenv('Platform') == "ARM": print "Compiled program architecture will be an ARM executable. (forcing bits=32)." diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 356de7b2bc..ba232f6d4e 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -155,7 +155,7 @@ def configure(env): if os.system("pkg-config --exists alsa")==0: print("Enabling ALSA") env.Append(CPPFLAGS=["-DALSA_ENABLED"]) - env.Append(LIBS=['asound']) + env.ParseConfig('pkg-config alsa --cflags --libs') else: print("ALSA libraries not found, disabling driver") diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 9a2d610e78..5f1ab5b4aa 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1176,6 +1176,19 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { event.key.mod.shift=true; } + //don't set mod state if modifier keys are released by themselves + //else event.is_action() will not work correctly here + if (!event.key.pressed) { + if (event.key.scancode == KEY_SHIFT) + event.key.mod.shift = false; + else if (event.key.scancode == KEY_CONTROL) + event.key.mod.control = false; + else if (event.key.scancode == KEY_ALT) + event.key.mod.alt = false; + else if (event.key.scancode == KEY_META) + event.key.mod.meta = false; + } + //printf("key: %x\n",event.key.scancode); input->parse_input_event( event); } diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 71728966fd..e8954b7e98 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -650,8 +650,8 @@ void Area2D::_bind_methods() { ADD_SIGNAL( MethodInfo("body_enter",PropertyInfo(Variant::OBJECT,"body",PROPERTY_HINT_RESOURCE_TYPE,"PhysicsBody2D"))); ADD_SIGNAL( MethodInfo("body_exit",PropertyInfo(Variant::OBJECT,"body",PROPERTY_HINT_RESOURCE_TYPE,"PhysicsBody2D"))); - ADD_SIGNAL( MethodInfo("area_enter_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"area_shape"))); - ADD_SIGNAL( MethodInfo("area_exit_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"area_shape"))); + ADD_SIGNAL( MethodInfo("area_enter_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"self_shape"))); + ADD_SIGNAL( MethodInfo("area_exit_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"self_shape"))); ADD_SIGNAL( MethodInfo("area_enter",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"))); ADD_SIGNAL( MethodInfo("area_exit",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area2D"))); diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index df43e8e373..b3f925cb14 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -253,7 +253,7 @@ void Node2D::global_translate(const Vector2& p_amount) { set_global_pos( get_global_pos() + p_amount ); } -void Node2D::scale(const Vector2& p_amount) { +void Node2D::scale(const Size2& p_amount) { set_scale( get_scale() * p_amount ); } diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h index aa8d0ef33c..b31ee08af6 100644 --- a/scene/2d/node_2d.h +++ b/scene/2d/node_2d.h @@ -79,7 +79,7 @@ public: void move_y(float p_delta,bool p_scaled=false); void translate(const Vector2& p_amount); void global_translate(const Vector2& p_amount); - void scale(const Vector2& p_amount); + void scale(const Size2& p_amount); Point2 get_pos() const; float get_rot() const; @@ -110,8 +110,6 @@ public: Matrix32 get_relative_transform_to_parent(const Node *p_parent) const; - - Matrix32 get_transform() const; Node2D(); diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index cfb87fb998..12893524d1 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -288,12 +288,12 @@ float Polygon2D::_get_texture_rotationd() const{ } -void Polygon2D::set_texture_scale(const Vector2& p_scale){ +void Polygon2D::set_texture_scale(const Size2& p_scale){ tex_scale=p_scale; update(); } -Vector2 Polygon2D::get_texture_scale() const{ +Size2 Polygon2D::get_texture_scale() const{ return tex_scale; } diff --git a/scene/2d/polygon_2d.h b/scene/2d/polygon_2d.h index 04e8aeb6fd..cecb9081f7 100644 --- a/scene/2d/polygon_2d.h +++ b/scene/2d/polygon_2d.h @@ -40,7 +40,7 @@ class Polygon2D : public Node2D { DVector<Color> vertex_colors; Color color; Ref<Texture> texture; - Vector2 tex_scale; + Size2 tex_scale; Vector2 tex_ofs; bool tex_tile; float tex_rot; @@ -81,8 +81,8 @@ public: void set_texture_rotation(float p_rot); float get_texture_rotation() const; - void set_texture_scale(const Vector2& p_scale); - Vector2 get_texture_scale() const; + void set_texture_scale(const Size2& p_scale); + Size2 get_texture_scale() const; void set_invert(bool p_rot); bool get_invert() const; diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index a8a4122016..c1d0d1a97c 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -640,8 +640,8 @@ void Area::_bind_methods() { ADD_SIGNAL( MethodInfo("body_enter",PropertyInfo(Variant::OBJECT,"body"))); ADD_SIGNAL( MethodInfo("body_exit",PropertyInfo(Variant::OBJECT,"body"))); - ADD_SIGNAL( MethodInfo("area_enter_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"area_shape"))); - ADD_SIGNAL( MethodInfo("area_exit_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"area_shape"))); + ADD_SIGNAL( MethodInfo("area_enter_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"self_shape"))); + ADD_SIGNAL( MethodInfo("area_exit_shape",PropertyInfo(Variant::INT,"area_id"),PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"),PropertyInfo(Variant::INT,"area_shape"),PropertyInfo(Variant::INT,"self_shape"))); ADD_SIGNAL( MethodInfo("area_enter",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"))); ADD_SIGNAL( MethodInfo("area_exit",PropertyInfo(Variant::OBJECT,"area",PROPERTY_HINT_RESOURCE_TYPE,"Area"))); diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp index c9319904bd..99c7fd047f 100644 --- a/scene/3d/immediate_geometry.cpp +++ b/scene/3d/immediate_geometry.cpp @@ -72,6 +72,7 @@ void ImmediateGeometry::add_vertex(const Vector3& p_vertex){ if (empty) { aabb.pos=p_vertex; aabb.size=Vector3(); + empty=false; } else { aabb.expand_to(p_vertex); } diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index b15226cce3..b4f7a4e5b4 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -128,6 +128,8 @@ void VisualInstance::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_layer_mask","mask"), &VisualInstance::set_layer_mask); ObjectTypeDB::bind_method(_MD("get_layer_mask"), &VisualInstance::get_layer_mask); + ObjectTypeDB::bind_method(_MD("get_transformed_aabb"), &VisualInstance::get_transformed_aabb); + ADD_PROPERTY( PropertyInfo( Variant::INT, "layers",PROPERTY_HINT_ALL_FLAGS), _SCS("set_layer_mask"), _SCS("get_layer_mask")); @@ -376,6 +378,8 @@ void GeometryInstance::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_extra_cull_margin","margin"), &GeometryInstance::set_extra_cull_margin); ObjectTypeDB::bind_method(_MD("get_extra_cull_margin"), &GeometryInstance::get_extra_cull_margin); + ObjectTypeDB::bind_method(_MD("get_aabb"),&GeometryInstance::get_aabb); + ObjectTypeDB::bind_method(_MD("_baked_light_changed"), &GeometryInstance::_baked_light_changed); ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "geometry/visible"), _SCS("set_flag"), _SCS("get_flag"),FLAG_VISIBLE); diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 89cd509fbd..f69ad8fa7e 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -959,7 +959,23 @@ void ItemList::_notification(int p_what) { shape_changed=false; } + //ensure_selected_visible needs to be checked before we draw the list. + if (ensure_selected_visible && current>=0 && current <=items.size()) { + Rect2 r = items[current].rect_cache; + int from = scroll_bar->get_val(); + int to = from + scroll_bar->get_page(); + + if (r.pos.y < from) { + scroll_bar->set_val(r.pos.y); + } else if (r.pos.y+r.size.y > to) { + scroll_bar->set_val(r.pos.y+r.size.y - (to-from)); + } + + + } + + ensure_selected_visible=false; Vector2 base_ofs = bg->get_offset(); base_ofs.y-=int(scroll_bar->get_val()); @@ -1147,25 +1163,6 @@ void ItemList::_notification(int p_what) { for(int i=0;i<separators.size();i++) { draw_line(Vector2(bg->get_margin(MARGIN_LEFT),base_ofs.y+separators[i]),Vector2(size.width-bg->get_margin(MARGIN_LEFT),base_ofs.y+separators[i]),guide_color); } - - - if (ensure_selected_visible && current>=0 && current <=items.size()) { - - Rect2 r = items[current].rect_cache; - int from = scroll_bar->get_val(); - int to = from + scroll_bar->get_page(); - - if (r.pos.y < from) { - scroll_bar->set_val(r.pos.y); - } else if (r.pos.y+r.size.y > to) { - scroll_bar->set_val(r.pos.y+r.size.y - (to-from)); - } - - - } - - ensure_selected_visible=false; - } } diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 90a8af9238..f7d74b2b49 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -639,6 +639,7 @@ void LineEdit::_notification(int p_what) { if(text.empty()) font_color.a *= placeholder_alpha; + int caret_height = font->get_height() > y_area ? y_area : font->get_height(); while(true) { //end of string, break! @@ -657,14 +658,14 @@ void LineEdit::_notification(int p_what) { bool selected=selection.enabled && char_ofs>=selection.begin && char_ofs<selection.end; if (selected) - VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(char_width, y_area)), selection_color); + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(char_width, caret_height)), selection_color); font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, selected ? font_color_selected : font_color); if (char_ofs==cursor_pos && draw_caret) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2( - Point2( x_ofs , y_ofs ), Size2( 1, y_area ) ), cursor_color ); + Point2( x_ofs , y_ofs ), Size2( 1, caret_height ) ), cursor_color ); } x_ofs+=char_width; @@ -673,7 +674,7 @@ void LineEdit::_notification(int p_what) { if (char_ofs==cursor_pos && draw_caret) {//may be at the end VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2( - Point2( x_ofs , y_ofs ), Size2( 1, y_area ) ), cursor_color ); + Point2( x_ofs , y_ofs ), Size2( 1, caret_height ) ), cursor_color ); } } break; case NOTIFICATION_FOCUS_ENTER: { @@ -1191,24 +1192,28 @@ void LineEdit::menu_option(int p_option) { switch(p_option) { case MENU_CUT: { - cut_text(); + if (editable) { + cut_text(); + } } break; case MENU_COPY: { copy_text(); } break; case MENU_PASTE: { - - paste_text(); + if (editable) { + paste_text(); + } } break; case MENU_CLEAR: { - clear(); + if (editable) { + clear(); + } } break; case MENU_SELECT_ALL: { select_all(); } break; case MENU_UNDO: { - undo(); } break; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 9db0a66395..8a9ed98a5f 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2542,7 +2542,9 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { } break; case KEY_X: { - + if (readonly) { + break; + } if (!k.mod.command || k.mod.shift || k.mod.alt) { scancode_handled=false; break; @@ -2574,7 +2576,9 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { undo(); } break; case KEY_V: { - + if (readonly) { + break; + } if (!k.mod.command || k.mod.shift || k.mod.alt) { scancode_handled=false; break; @@ -4527,18 +4531,22 @@ void TextEdit::menu_option(int p_option) { switch( p_option ) { case MENU_CUT: { - - cut(); + if (!readonly) { + cut(); + } } break; case MENU_COPY: { copy(); } break; case MENU_PASTE: { - - paste(); + if (!readonly) { + paste(); + } } break; case MENU_CLEAR: { - clear(); + if (!readonly) { + clear(); + } } break; case MENU_SELECT_ALL: { select_all(); diff --git a/scene/main/canvas_layer.h b/scene/main/canvas_layer.h index 6aad90a09d..a1311390be 100644 --- a/scene/main/canvas_layer.h +++ b/scene/main/canvas_layer.h @@ -40,7 +40,7 @@ class CanvasLayer : public Node { bool locrotscale_dirty; Vector2 ofs; - Vector2 scale; + Size2 scale; real_t rot; int layer; Matrix32 transform; @@ -81,8 +81,8 @@ public: void set_rotationd(real_t p_degrees); real_t get_rotationd() const; - void set_scale(const Vector2& p_scale); - Vector2 get_scale() const; + void set_scale(const Size2& p_scale); + Size2 get_scale() const; Ref<World2D> get_world_2d() const; diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index 40ae26ba5d..02faa9425d 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -1483,6 +1483,8 @@ const ShaderGraph::InOutParamInfo ShaderGraph::inout_param_info[]={ {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightColor","LIGHT_COLOR.rgb","",SLOT_TYPE_VEC,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightAlpha","LIGHT_COLOR.a","",SLOT_TYPE_SCALAR,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightHeight","LIGHT_HEIGHT","",SLOT_TYPE_SCALAR,SLOT_IN}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"ShadowColor","LIGHT_SHADOW.rgb","",SLOT_TYPE_VEC,SLOT_IN}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"ShadowAlpha","LIGHT_SHADOW.a","",SLOT_TYPE_SCALAR,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"TexPixelSize","vec3(TEXTURE_PIXEL_SIZE,0)","",SLOT_TYPE_VEC,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"Var1","VAR1.rgb","",SLOT_TYPE_VEC,SLOT_IN}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"Var2","VAR2.rgb","",SLOT_TYPE_VEC,SLOT_IN}, @@ -1490,6 +1492,8 @@ const ShaderGraph::InOutParamInfo ShaderGraph::inout_param_info[]={ //canvas item light out {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightColor","LIGHT.rgb","",SLOT_TYPE_VEC,SLOT_OUT}, {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"LightAlpha","LIGHT.a","",SLOT_TYPE_SCALAR,SLOT_OUT}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"ShadowColor","SHADOW.rgb","",SLOT_TYPE_VEC,SLOT_OUT}, + {MODE_CANVAS_ITEM,SHADER_TYPE_LIGHT,"ShadowAlpha","SHADOW.a","",SLOT_TYPE_SCALAR,SLOT_OUT}, //end {MODE_MATERIAL,SHADER_TYPE_FRAGMENT,NULL,NULL,NULL,SLOT_TYPE_SCALAR,SLOT_OUT}, diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index 9291aa6c17..77245c687d 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -136,7 +136,7 @@ bool LineShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p_en return true; } -real_t LineShape2DSW::get_moment_of_inertia(float p_mass, const Vector2 &p_scale) const { +real_t LineShape2DSW::get_moment_of_inertia(float p_mass, const Size2 &p_scale) const { return 0; } @@ -191,7 +191,7 @@ bool RayShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p_end } -real_t RayShape2DSW::get_moment_of_inertia(float p_mass, const Vector2 &p_scale) const { +real_t RayShape2DSW::get_moment_of_inertia(float p_mass, const Size2 &p_scale) const { return 0; //rays are mass-less } @@ -252,7 +252,7 @@ bool SegmentShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p return true; } -real_t SegmentShape2DSW::get_moment_of_inertia(float p_mass, const Vector2 &p_scale) const { +real_t SegmentShape2DSW::get_moment_of_inertia(float p_mass, const Size2 &p_scale) const { Vector2 s[2]={a*p_scale,b*p_scale}; @@ -336,7 +336,7 @@ bool CircleShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p_ return true; } -real_t CircleShape2DSW::get_moment_of_inertia(float p_mass, const Vector2 &p_scale) const { +real_t CircleShape2DSW::get_moment_of_inertia(float p_mass, const Size2 &p_scale) const { return (radius*radius)*(p_scale.x*0.5+p_scale.y*0.5); @@ -407,7 +407,7 @@ bool RectangleShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& return get_aabb().intersects_segment(p_begin,p_end,&r_point,&r_normal); } -real_t RectangleShape2DSW::get_moment_of_inertia(float p_mass,const Vector2& p_scale) const { +real_t RectangleShape2DSW::get_moment_of_inertia(float p_mass,const Size2& p_scale) const { Vector2 he2=half_extents*2*p_scale; return p_mass*he2.dot(he2)/12.0f; @@ -540,7 +540,7 @@ bool CapsuleShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p return collided; //todo } -real_t CapsuleShape2DSW::get_moment_of_inertia(float p_mass, const Vector2 &p_scale) const { +real_t CapsuleShape2DSW::get_moment_of_inertia(float p_mass, const Size2 &p_scale) const { Vector2 he2=Vector2(radius*2,height+radius*2)*p_scale; return p_mass*he2.dot(he2)/12.0f; @@ -670,7 +670,7 @@ bool ConvexPolygonShape2DSW::intersect_segment(const Vector2& p_begin,const Vect return inters; //todo } -real_t ConvexPolygonShape2DSW::get_moment_of_inertia(float p_mass,const Vector2& p_scale) const { +real_t ConvexPolygonShape2DSW::get_moment_of_inertia(float p_mass,const Size2& p_scale) const { Rect2 aabb; aabb.pos=points[0].pos*p_scale; diff --git a/servers/physics_2d/shape_2d_sw.h b/servers/physics_2d/shape_2d_sw.h index 4164896696..b90c36bc04 100644 --- a/servers/physics_2d/shape_2d_sw.h +++ b/servers/physics_2d/shape_2d_sw.h @@ -86,7 +86,7 @@ public: virtual void get_supports(const Vector2& p_normal,Vector2 *r_supports,int & r_amount) const=0; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const=0; - virtual real_t get_moment_of_inertia(float p_mass,const Vector2& p_scale) const=0; + virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const=0; virtual void set_data(const Variant& p_data)=0; virtual Variant get_data() const=0; @@ -175,7 +175,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Vector2& p_scale) const; + virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -218,7 +218,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Vector2& p_scale) const; + virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -266,7 +266,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Vector2& p_scale) const; + virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -304,7 +304,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Vector2& p_scale) const; + virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -344,7 +344,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Vector2& p_scale) const; + virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -432,7 +432,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Vector2& p_scale) const; + virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -495,7 +495,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Vector2& p_scale) const; + virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const; virtual void set_data(const Variant& p_data); virtual Variant get_data() const; @@ -584,7 +584,7 @@ public: virtual bool contains_point(const Vector2& p_point) const; virtual bool intersect_segment(const Vector2& p_begin,const Vector2& p_end,Vector2 &r_point, Vector2 &r_normal) const; - virtual real_t get_moment_of_inertia(float p_mass,const Vector2& p_scale) const { return 0; } + virtual real_t get_moment_of_inertia(float p_mass,const Size2& p_scale) const { return 0; } virtual void set_data(const Variant& p_data); virtual Variant get_data() const; diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 09b3ada509..fdf3cb622d 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -1180,6 +1180,7 @@ const ShaderLanguage::BuiltinsDef ShaderLanguage::ci_light_builtins_defs[]={ { "LIGHT_HEIGHT", TYPE_FLOAT}, { "LIGHT_COLOR", TYPE_VEC4}, { "LIGHT_UV", TYPE_VEC2}, + { "LIGHT_SHADOW", TYPE_VEC4}, { "LIGHT", TYPE_VEC4}, { "SHADOW", TYPE_VEC4}, { "POINT_COORD", TYPE_VEC2}, diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 3b1e90a907..fe97fe2881 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -3016,7 +3016,11 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor) { for(int i=0;i<singleton->main_editor_buttons.size();i++) { - if (p_editor->get_name()==singleton->main_editor_buttons[i]->get_name()) { + if (p_editor->get_name()==singleton->main_editor_buttons[i]->get_text()) { + + if (singleton->main_editor_buttons[i]->is_pressed()) { + singleton->_editor_select(EDITOR_SCRIPT); + } memdelete( singleton->main_editor_buttons[i] ); singleton->main_editor_buttons.remove(i); @@ -6254,9 +6258,9 @@ EditorNode::EditorNode() { overridden_default_layout=-1; default_layout.instance(); - default_layout->set_value(docks_section, "dock_3", TTR("Scene")); - default_layout->set_value(docks_section, "dock_4", TTR("FileSystem")); - default_layout->set_value(docks_section, "dock_5", TTR("Inspector")); + default_layout->set_value(docks_section, "dock_3", TTR("FileSystem")); + default_layout->set_value(docks_section, "dock_5", TTR("Scene")); + default_layout->set_value(docks_section, "dock_6", TTR("Inspector")+","+TTR("Node")); for(int i=0;i<DOCK_SLOT_MAX/2;i++) default_layout->set_value(docks_section, "dock_hsplit_"+itos(i+1), 0); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 2fae5daced..0393cd19a9 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -700,6 +700,7 @@ public: void notify_child_process_exited(); + OS::ProcessID get_child_process_id() const { return editor_run.get_pid(); } void stop_child_process(); Ref<Theme> get_editor_theme() const { return theme; } diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp index 55f0e52c88..4b82d5e59c 100644 --- a/tools/editor/editor_plugin.cpp +++ b/tools/editor/editor_plugin.cpp @@ -71,6 +71,11 @@ void EditorPlugin::remove_control_from_bottom_panel(Control *p_control) { } +Control * EditorPlugin::get_editor_viewport() { + + return EditorNode::get_singleton()->get_viewport(); +} + void EditorPlugin::add_control_to_container(CustomControlContainer p_location,Control *p_control) { switch(p_location) { @@ -315,6 +320,16 @@ Control *EditorPlugin::get_base_control() { return EditorNode::get_singleton()->get_gui_base(); } +void EditorPlugin::make_bottom_panel_item_visible(Control * p_item) { + + EditorNode::get_singleton()->make_bottom_panel_item_visible(p_item); +} + +void EditorPlugin::hide_bottom_panel() { + + EditorNode::get_singleton()->hide_bottom_panel(); +} + void EditorPlugin::inspect_object(Object *p_obj,const String& p_for_property) { EditorNode::get_singleton()->push_item(p_obj,p_for_property); @@ -333,6 +348,7 @@ void EditorPlugin::_bind_methods() { ObjectTypeDB::bind_method(_MD("remove_control_from_bottom_panel","control:Control"),&EditorPlugin::remove_control_from_bottom_panel); ObjectTypeDB::bind_method(_MD("add_custom_type","type","base","script:Script","icon:Texture"),&EditorPlugin::add_custom_type); ObjectTypeDB::bind_method(_MD("remove_custom_type","type"),&EditorPlugin::remove_custom_type); + ObjectTypeDB::bind_method(_MD("get_editor_viewport:Control"), &EditorPlugin::get_editor_viewport); ObjectTypeDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::add_import_plugin); ObjectTypeDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::remove_import_plugin); @@ -346,6 +362,9 @@ void EditorPlugin::_bind_methods() { ObjectTypeDB::bind_method(_MD("inspect_object","object","for_property"),&EditorPlugin::inspect_object,DEFVAL(String())); ObjectTypeDB::bind_method(_MD("update_canvas"),&EditorPlugin::update_canvas); + ObjectTypeDB::bind_method(_MD("make_bottom_panel_item_visible","item:Control"), &EditorPlugin::make_bottom_panel_item_visible); + ObjectTypeDB::bind_method(_MD("hide_bottom_panel"), &EditorPlugin::hide_bottom_panel); + ObjectTypeDB::bind_method(_MD("get_base_control:Control"),&EditorPlugin::get_base_control); ObjectTypeDB::bind_method(_MD("get_undo_redo:UndoRedo"),&EditorPlugin::_get_undo_redo); ObjectTypeDB::bind_method(_MD("get_selection:EditorSelection"),&EditorPlugin::get_selection); diff --git a/tools/editor/editor_plugin.h b/tools/editor/editor_plugin.h index 5b944cc27a..2700c49a6c 100644 --- a/tools/editor/editor_plugin.h +++ b/tools/editor/editor_plugin.h @@ -100,6 +100,7 @@ public: void add_control_to_dock(DockSlot p_slot,Control *p_control); void remove_control_from_docks(Control *p_control); void remove_control_from_bottom_panel(Control *p_control); + Control* get_editor_viewport(); virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial* p_spatial); virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform, const InputEvent& p_event); @@ -130,6 +131,9 @@ public: Control *get_base_control(); + void make_bottom_panel_item_visible(Control *p_item); + void hide_bottom_panel(); + void add_import_plugin(const Ref<EditorImportPlugin>& p_editor_import); void remove_import_plugin(const Ref<EditorImportPlugin>& p_editor_import); diff --git a/tools/editor/editor_run.cpp b/tools/editor/editor_run.cpp index fb0f24c084..5fbb4ae2a0 100644 --- a/tools/editor/editor_run.cpp +++ b/tools/editor/editor_run.cpp @@ -52,6 +52,9 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List args.push_back("localhost:"+String::num(GLOBAL_DEF("debug/debug_port", 6007))); } + args.push_back("-epid"); + args.push_back(String::num(OS::get_singleton()->get_process_ID())); + if (p_custom_args!="") { Vector<String> cargs=p_custom_args.split(" ",false); @@ -132,6 +135,7 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List } + if (p_breakpoints.size()) { args.push_back("-bp"); diff --git a/tools/editor/editor_run.h b/tools/editor/editor_run.h index 0b96a2c91c..5aa2adf801 100644 --- a/tools/editor/editor_run.h +++ b/tools/editor/editor_run.h @@ -53,6 +53,8 @@ public: void run_native_notify() { status=STATUS_PLAY; } void stop(); + OS::ProcessID get_pid() const { return pid; } + void set_debug_collisions(bool p_debug); bool get_debug_collisions() const; diff --git a/tools/editor/icons/2x/icon_distraction_free.png b/tools/editor/icons/2x/icon_distraction_free.png Binary files differnew file mode 100644 index 0000000000..034239a4e7 --- /dev/null +++ b/tools/editor/icons/2x/icon_distraction_free.png diff --git a/tools/editor/icons/2x/icon_remote_transform.png b/tools/editor/icons/2x/icon_remote_transform.png Binary files differindex 9ee66bc70c..dad528615a 100644 --- a/tools/editor/icons/2x/icon_remote_transform.png +++ b/tools/editor/icons/2x/icon_remote_transform.png diff --git a/tools/editor/icons/icon_distraction_free.png b/tools/editor/icons/icon_distraction_free.png Binary files differindex 5896de6044..c6f8a08874 100644 --- a/tools/editor/icons/icon_distraction_free.png +++ b/tools/editor/icons/icon_distraction_free.png diff --git a/tools/editor/icons/icon_remote_transform.png b/tools/editor/icons/icon_remote_transform.png Binary files differindex deff925b53..2a8b5f4d0e 100644 --- a/tools/editor/icons/icon_remote_transform.png +++ b/tools/editor/icons/icon_remote_transform.png diff --git a/tools/editor/icons/source/icon_distraction_free.svg b/tools/editor/icons/source/icon_distraction_free.svg new file mode 100644 index 0000000000..4ae48b2fb6 --- /dev/null +++ b/tools/editor/icons/source/icon_distraction_free.svg @@ -0,0 +1,104 @@ +<?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" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png" + inkscape:export-xdpi="45" + inkscape:export-ydpi="45" + sodipodi:docname="icon_distraction_free.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32.000001" + inkscape:cx="10.344519" + inkscape:cy="8.9631686" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="false" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:snap-midpoints="true" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <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> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 3.7578125 2.34375 L 2.34375 3.7578125 L 5.2929688 6.7070312 L 6.7070312 5.2929688 L 3.7578125 2.34375 z M 12.242188 2.34375 L 9.2929688 5.2929688 L 10.707031 6.7070312 L 13.65625 3.7578125 L 12.242188 2.34375 z M 5.2929688 9.2929688 L 2.34375 12.242188 L 3.7578125 13.65625 L 6.7070312 10.707031 L 5.2929688 9.2929688 z M 10.707031 9.2929688 L 9.2929688 10.707031 L 12.242188 13.65625 L 13.65625 12.242188 L 10.707031 9.2929688 z " + transform="translate(0,1036.3622)" + id="rect4137" /> + <path + style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="m 1,1051.3622 0,-5 5,5 z" + id="path4155" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccc" /> + <path + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" + id="path4158" + d="m 15,1051.3622 0,-5 -5,5 z" + style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="m 15,1037.3622 0,5 -5,-5 z" + id="path4160" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccc" /> + <path + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" + id="path4162" + d="m 1,1037.3622 0,5 5,-5 z" + style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + </g> +</svg> diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 522ceba1dc..fd25843de9 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -1362,10 +1362,8 @@ struct _ScriptEditorItemData { void ScriptEditor::_update_script_colors() { - bool enabled = EditorSettings::get_singleton()->get("text_editor/script_temperature_enabled"); + bool script_temperature_enabled = EditorSettings::get_singleton()->get("text_editor/script_temperature_enabled"); bool highlight_current = EditorSettings::get_singleton()->get("text_editor/highlight_current_script"); - if (!enabled) - return; int hist_size = EditorSettings::get_singleton()->get("text_editor/script_temperature_history_size"); Color hot_color=EditorSettings::get_singleton()->get("text_editor/script_temperature_hot_color"); @@ -1379,22 +1377,25 @@ void ScriptEditor::_update_script_colors() { continue; script_list->set_item_custom_bg_color(i,Color(0,0,0,0)); - if (!n->has_meta("__editor_pass")) { - continue; - } - - int pass=n->get_meta("__editor_pass"); - int h = edit_pass - pass; - if (h>hist_size) { - continue; - } - int non_zero_hist_size = ( hist_size == 0 ) ? 1 : hist_size; - float v = Math::ease((edit_pass-pass)/float(non_zero_hist_size),0.4); bool current = tab_container->get_current_tab() == c; if (current && highlight_current) { script_list->set_item_custom_bg_color(i, EditorSettings::get_singleton()->get("text_editor/current_script_background_color")); - } else { + + } else if (script_temperature_enabled) { + + if (!n->has_meta("__editor_pass")) { + continue; + } + + int pass=n->get_meta("__editor_pass"); + int h = edit_pass - pass; + if (h>hist_size) { + continue; + } + int non_zero_hist_size = ( hist_size == 0 ) ? 1 : hist_size; + float v = Math::ease((edit_pass-pass)/float(non_zero_hist_size),0.4); + script_list->set_item_custom_bg_color(i,hot_color.linear_interpolate(cold_color,v)); } } diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index aa66a2e0d9..3ab906f84e 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -2422,6 +2422,7 @@ void ShaderGraphView::_create_node(int p_id) { colors.push_back("Color"); colors.push_back("LightColor"); colors.push_back("Light"); + colors.push_back("ShadowColor"); colors.push_back("Diffuse"); colors.push_back("Specular"); colors.push_back("Emmision"); @@ -2434,6 +2435,7 @@ void ShaderGraphView::_create_node(int p_id) { reals.push_back("ShadeParam"); reals.push_back("SpecularExp"); reals.push_back("LightAlpha"); + reals.push_back("ShadowAlpha"); reals.push_back("PointSize"); reals.push_back("Discard"); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 1a8d373f7f..6641297491 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -3049,7 +3049,7 @@ void PropertyEditor::update_tree() { if (E) { descr=E->get().brief_description; } - class_descr_cache[type]=descr.world_wrap(80); + class_descr_cache[type]=descr.word_wrap(80); } @@ -3142,7 +3142,7 @@ void PropertyEditor::update_tree() { if (E) { for(int i=0;i<E->get().methods.size();i++) { if (E->get().methods[i].name==setter.operator String()) { - descr=E->get().methods[i].description.strip_edges().world_wrap(80); + descr=E->get().methods[i].description.strip_edges().word_wrap(80); } } } diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index e5a97fa26e..53bfe8cc57 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -254,7 +254,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id) String config_err = n->get_configuration_warning(); if (config_err==String()) return; - config_err=config_err.world_wrap(80); + config_err=config_err.word_wrap(80); warning->set_text(config_err); warning->popup_centered_minsize(); diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index 7fba73ca08..c8170ca9a3 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -216,6 +216,8 @@ void ScriptEditorDebugger::debug_continue() { ERR_FAIL_COND(connection.is_null()); ERR_FAIL_COND(!connection->is_connected()); + OS::get_singleton()->enable_for_stealing_focus(EditorNode::get_singleton()->get_child_process_id()); + Array msg; msg.push_back("continue"); ppeer->put_var(msg); |