From 4a7114262343e39235569525b7939896f806b4e6 Mon Sep 17 00:00:00 2001 From: quabug Date: Wed, 3 Dec 2014 12:17:23 +0800 Subject: Add move_child_notify method in Node class --- scene/main/node.cpp | 6 ++++++ scene/main/node.h | 1 + 2 files changed, 7 insertions(+) diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 292e4d1a7b..4163e6a1b8 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -271,6 +271,7 @@ void Node::move_child(Node *p_child,int p_pos) { data.children[i]->data.pos=i; } // notification second + move_child_notify(p_child); for (int i=0;inotification( NOTIFICATION_MOVED_IN_PARENT ); @@ -310,6 +311,11 @@ void Node::remove_child_notify(Node *p_child) { // to be used when not wanted } +void Node::move_child_notify(Node *p_child) { + + // to be used when not wanted +} + void Node::set_fixed_process(bool p_process) { if (data.fixed_process==p_process) diff --git a/scene/main/node.h b/scene/main/node.h index 9229e2f9bb..371a5325ca 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -142,6 +142,7 @@ protected: virtual void add_child_notify(Node *p_child); virtual void remove_child_notify(Node *p_child); + virtual void move_child_notify(Node *p_child); void remove_and_delete_child(Node *p_child); void _propagate_replace_owner(Node *p_owner,Node* p_by_owner); -- cgit v1.2.3 From 25f8f5339a803d55d448d1760b5e8671e0946509 Mon Sep 17 00:00:00 2001 From: quabug Date: Wed, 3 Dec 2014 13:29:28 +0800 Subject: use tab instead of space --- scene/main/node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 4163e6a1b8..45a30d7bca 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -271,7 +271,7 @@ void Node::move_child(Node *p_child,int p_pos) { data.children[i]->data.pos=i; } // notification second - move_child_notify(p_child); + move_child_notify(p_child); for (int i=0;inotification( NOTIFICATION_MOVED_IN_PARENT ); -- cgit v1.2.3 From c79be979d47daae613d1b1bbc732a30a74f56543 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 7 Dec 2014 02:04:20 -0300 Subject: Batch of Bugfixes -=-=-=-=-=-=-=-=- -Fixed Export UV XForm (should work now). #923 -Fixed enforcement of limits in property editor. #919 -Fixed long-standing bug of export editings in script inheritance. #914, #859, #756 -Fixed horrible error reporting in shader language. #912 -Added kinematic collision with plane (please test well). #911 -Fixed double animation track insert when using 2D rigs. #904 -VKey updates offset parameter in sprite edition. #901 -Do not allow anymore a script to preload itself. (does not fix #899, but narrows it down) -Avoid connection editor from overriding selected text. #897 -Fixed timer autostart. #876 -Fixed collision layers in 3D physics. #872 -Improved operators in shader #857 -Fixed ambient lighting bug #834 -Avoid editor from processing gamepad input #813 -Added not keyword #752 Please test! --- demos/3d/truck_town/crane.scn | Bin 23916 -> 24164 bytes doc/base/classes.xml | 199 ++++++++++++++++------ drivers/gles2/rasterizer_gles2.cpp | 4 +- drivers/gles2/shaders/material.glsl | 2 +- modules/gdscript/gd_editor.cpp | 2 +- modules/gdscript/gd_parser.cpp | 16 +- modules/gdscript/gd_parser.h | 5 +- modules/gdscript/gd_script.cpp | 164 ++++++++++++++---- modules/gdscript/gd_script.h | 13 +- scene/2d/animated_sprite.cpp | 7 +- scene/2d/area_2d.cpp | 15 ++ scene/2d/area_2d.h | 1 + scene/2d/polygon_2d.cpp | 1 + scene/2d/sprite.cpp | 6 + scene/3d/area.cpp | 18 ++ scene/3d/area.h | 1 + scene/3d/light.cpp | 4 +- scene/3d/sprite_3d.cpp | 10 ++ scene/3d/visual_instance.cpp | 8 +- scene/gui/tree.cpp | 7 + scene/main/scene_main_loop.cpp | 3 + scene/main/timer.cpp | 3 +- scene/scene_string_names.cpp | 2 + scene/scene_string_names.h | 1 + servers/physics/body_pair_sw.cpp | 2 +- servers/physics/collision_solver_sw.cpp | 44 ++++- servers/physics/collision_solver_sw.h | 1 + servers/visual/rasterizer.cpp | 2 +- servers/visual/shader_language.cpp | 16 +- tools/editor/animation_editor.cpp | 7 + tools/editor/editor_node.cpp | 2 + tools/editor/plugins/polygon_2d_editor_plugin.cpp | 9 + tools/editor/plugins/script_editor_plugin.cpp | 2 +- tools/editor/plugins/shader_editor_plugin.cpp | 5 +- tools/export/blender25/io_scene_dae/export_dae.py | 24 ++- 35 files changed, 491 insertions(+), 115 deletions(-) diff --git a/demos/3d/truck_town/crane.scn b/demos/3d/truck_town/crane.scn index 080bd8ea17..2c4645af69 100644 Binary files a/demos/3d/truck_town/crane.scn and b/demos/3d/truck_town/crane.scn differ diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 2c49926d66..35de0106b5 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -3281,6 +3281,12 @@ + + + + + + @@ -3418,6 +3424,12 @@ + + + + + + @@ -4828,6 +4840,10 @@ + + + + @@ -11647,6 +11663,14 @@ + + + + + + + + @@ -15474,14 +15498,12 @@ Finally, when a node is freed, it will free all its children nodes too. - + - Called when entered the scene. - + - Called when being removed from the scene. @@ -15634,11 +15656,10 @@ - + - Return wether the node is inside a scene tree (a tree where the topmost node is a [RootNode]) @@ -15882,11 +15903,10 @@ - - + + - Get the current SceneMainLoop. Only returned if the node is inside the scene, else returns null. @@ -15917,28 +15937,24 @@ - + - Emitted when the node enters the scene. + Emitted when the node is renamed. - + - Emitted when the node is renamed. - + - Emitted when the node exits the scene. - - Notification received when the node enters the Scene Tree and gains access to the [RootNode]. Note that children nodes will not have received the notification at that time yet. + - - Notification received when the node exits the Scene Tree and loses access to the [RootNode]. Note that parent nodes will not have received the notification at that time yet. + @@ -16554,6 +16570,10 @@ + + + + @@ -17334,7 +17354,7 @@ - + @@ -17368,6 +17388,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Provides an opaque background for [Control] children. @@ -18039,6 +18123,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -18173,7 +18281,7 @@ - + @@ -19534,7 +19642,7 @@ - + @@ -20994,7 +21102,7 @@ - + @@ -24091,6 +24199,12 @@ + + + + + + @@ -24364,6 +24478,12 @@ Return true if the body has the ability to fall asleep when not moving. See [set_can_sleep]. + + + + + + @@ -25275,13 +25395,10 @@ - + - Scene-Based implementation of the MainLoop. - Scene implementation of the MainLoop. All scenes edited using the editor are loaded with this main loop, which provides the base for the scene system.[br] - All group operations (get nodes, call, etc) is performed here. All nodes in a group can be called a specific functions, set a property or notified. This happens in scene-order. @@ -25292,7 +25409,6 @@ - Call a notification in all the nodes belonging to a given group. See GROUP_CALL_* enum for options. @@ -25305,7 +25421,6 @@ - Set a property in all the nodes belonging to a given group. See GROUP_CALL_* enum for options. @@ -25314,7 +25429,6 @@ - Get all the nods belonging to a given group. @@ -25327,21 +25441,18 @@ - Set to true if the application will quit automatically when quit is requested (Alt-f4 or ctrl-c). - Set to true to tell nodes and the scene that it is being edited. This is used by editors, not release. - Return true if the scene is being run inside an editor. @@ -25360,19 +25471,16 @@ - Set pause. The built-in pause system is very basic and only meant to avoid processing nodes not allowed to work in pause mode. - Return true if the scene is paused. - Handle a current input event (avoid further processing of it). @@ -25385,12 +25493,10 @@ - Return the frame index (how many frames were drawn). - Quit the application. @@ -25407,7 +25513,6 @@ - Queue an object for deletion next time the loop goes idle. @@ -25428,41 +25533,33 @@ - Call a function for all the nodes in a given group. - Emitted when the screen changes size. - Emitted when a node is removed from the scene. - Emitted when the scene tree changed (nodes added/removed/moved/etc) - Regular group call flag (no flags). - Call a group in inverse-scene order. - Call a group immediately (usually calls are delivered on idle). - Call a group only once, even if call is performed many times. @@ -32543,7 +32640,7 @@ - + @@ -32601,6 +32698,12 @@ + + + + + + diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 057de329df..9f2fd032fa 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -4648,7 +4648,8 @@ void RasterizerGLES2::_add_geometry( const Geometry* p_geometry, const InstanceD if (m->flags[VS::MATERIAL_FLAG_INVERT_FACES]) e->mirror=!e->mirror; - e->light_type=0xFF; // no lights! + //e->light_type=0xFF; // no lights! + e->light_type=3; //light type 3 is no light? e->light=0xFFFF; if (!shadow && !has_blend_alpha && has_alpha && m->depth_draw_mode==VS::MATERIAL_DEPTH_DRAW_OPAQUE_PRE_PASS_ALPHA) { @@ -9122,6 +9123,7 @@ void RasterizerGLES2::init() { use_anisotropic_filter=true; float_linear_supported=true; float_supported=true; + use_rgba_shadowmaps=false; glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,&anisotropic_level); anisotropic_level=MIN(anisotropic_level,float(GLOBAL_DEF("rasterizer/anisotropic_filter_level",4.0))); diff --git a/drivers/gles2/shaders/material.glsl b/drivers/gles2/shaders/material.glsl index 7d9aca4b4d..f2d9eaf1e5 100644 --- a/drivers/gles2/shaders/material.glsl +++ b/drivers/gles2/shaders/material.glsl @@ -1214,7 +1214,7 @@ LIGHT_SHADER_CODE # if !defined(LIGHT_TYPE_DIRECTIONAL) && !defined(LIGHT_TYPE_OMNI) && !defined (LIGHT_TYPE_SPOT) //none #ifndef SHADELESS - diffuse.rgb=vec3(0.0,0.0,0.0); + diffuse.rgb=ambient_light *diffuse.rgb; #endif # endif diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index b1db087fb3..95bae2d32a 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -66,7 +66,7 @@ bool GDScriptLanguage::validate(const String& p_script, int &r_line_error,int &r GDParser parser; - Error err = parser.parse(p_script,p_path.get_base_dir(),true); + Error err = parser.parse(p_script,p_path.get_base_dir(),true,p_path); if (err) { r_line_error=parser.get_error_line(); r_col_error=parser.get_error_column(); diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index de2b5219a9..904b6ba52f 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -225,7 +225,14 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_ String path = tokenizer->get_token_constant(); if (!path.is_abs_path() && base_path!="") path=base_path+"/"+path; - path = path.replace("///","//"); + path = path.replace("///","//").simplify_path(); + if (path==self_path) { + + _set_error("Can't preload itself (use 'get_script()')."); + return NULL; + + } + Ref res; if (!validating) { @@ -2616,8 +2623,9 @@ Error GDParser::_parse(const String& p_base_path) { return OK; } -Error GDParser::parse_bytecode(const Vector &p_bytecode,const String& p_base_path) { +Error GDParser::parse_bytecode(const Vector &p_bytecode,const String& p_base_path, const String &p_self_path) { + self_path=p_self_path; GDTokenizerBuffer *tb = memnew( GDTokenizerBuffer ); tb->set_code_buffer(p_bytecode); tokenizer=tb; @@ -2628,9 +2636,9 @@ Error GDParser::parse_bytecode(const Vector &p_bytecode,const String& p } -Error GDParser::parse(const String& p_code,const String& p_base_path,bool p_just_validate) { - +Error GDParser::parse(const String& p_code, const String& p_base_path, bool p_just_validate, const String &p_self_path) { + self_path=p_self_path; GDTokenizerText *tt = memnew( GDTokenizerText ); tt->set_code(p_code); diff --git a/modules/gdscript/gd_parser.h b/modules/gdscript/gd_parser.h index 5fac34396c..3f82cafc61 100644 --- a/modules/gdscript/gd_parser.h +++ b/modules/gdscript/gd_parser.h @@ -373,6 +373,7 @@ private: List tab_level; String base_path; + String self_path; PropertyInfo current_export; @@ -398,8 +399,8 @@ public: String get_error() const; int get_error_line() const; int get_error_column() const; - Error parse(const String& p_code, const String& p_base_path="", bool p_just_validate=false); - Error parse_bytecode(const Vector &p_bytecode,const String& p_base_path=""); + Error parse(const String& p_code, const String& p_base_path="", bool p_just_validate=false,const String& p_self_path=""); + Error parse_bytecode(const Vector &p_bytecode,const String& p_base_path="",const String& p_self_path=""); const Node *get_parse_tree() const; diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 7085ae6a56..b19168f536 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -1523,6 +1523,7 @@ void GDScript::_placeholder_erased(PlaceHolderScriptInstance *p_placeholder) { placeholders.erase(p_placeholder); } +/* void GDScript::_update_placeholder(PlaceHolderScriptInstance *p_placeholder) { @@ -1563,7 +1564,7 @@ void GDScript::_update_placeholder(PlaceHolderScriptInstance *p_placeholder) { p_placeholder->update(plist,default_values); -} +}*/ #endif ScriptInstance* GDScript::instance_create(Object *p_this) { @@ -1582,7 +1583,8 @@ ScriptInstance* GDScript::instance_create(Object *p_this) { }*/ PlaceHolderScriptInstance *si = memnew( PlaceHolderScriptInstance(GDScriptLanguage::get_singleton(),Ref