diff --git a/demos/3d/truck_town/crane.scn b/demos/3d/truck_town/crane.scn index 080bd8ea172..2c4645af69f 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 2c49926d662..35de0106b5f 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 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 057de329dfd..9f2fd032fa3 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 7d9aca4b4d9..f2d9eaf1e5e 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 b1db087fb38..95bae2d32af 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 de2b5219a9b..904b6ba52fd 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 5fac34396ca..3f82cafc612 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 7085ae6a568..b19168f5368 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