diff options
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/animated_sprite.cpp | 2 | ||||
-rw-r--r-- | scene/2d/area_2d.cpp | 12 | ||||
-rw-r--r-- | scene/2d/area_2d.h | 4 | ||||
-rw-r--r-- | scene/2d/camera_2d.cpp | 12 | ||||
-rw-r--r-- | scene/2d/canvas_item.cpp | 8 | ||||
-rw-r--r-- | scene/2d/collision_object_2d.cpp | 4 | ||||
-rw-r--r-- | scene/2d/navigation2d.cpp | 2 | ||||
-rw-r--r-- | scene/2d/navigation_polygon.cpp | 2 | ||||
-rw-r--r-- | scene/2d/physics_body_2d.cpp | 10 | ||||
-rw-r--r-- | scene/2d/screen_button.cpp | 6 | ||||
-rw-r--r-- | scene/2d/sprite.cpp | 12 | ||||
-rw-r--r-- | scene/2d/tile_map.cpp | 8 |
12 files changed, 46 insertions, 36 deletions
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index ac24e4ee97..64d6ef5560 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -429,7 +429,7 @@ void AnimatedSprite::_notification(int p_what) { //texture->draw_rect(ci,dst_rect,false,modulate); texture->draw_rect_region(ci,dst_rect,Rect2(Vector2(),texture->get_size())); -// VisualServer::get_singleton()->canvas_item_add_texture_rect_region(ci,dst_rect,texture->get_rid(),src_rect,modulate); + //VisualServer::get_singleton()->canvas_item_add_texture_rect_region(ci,dst_rect,texture->get_rid(),src_rect,modulate); } break; } diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index a72e1164b4..67c596421f 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -418,7 +418,7 @@ void Area2D::_notification(int p_what) { } -void Area2D::set_enable_monitoring(bool p_enable) { +void Area2D::set_monitoring(bool p_enable) { if (p_enable==monitoring) @@ -443,7 +443,7 @@ void Area2D::set_enable_monitoring(bool p_enable) { } } -bool Area2D::is_monitoring_enabled() const { +bool Area2D::is_monitoring() const { return monitoring; } @@ -629,8 +629,8 @@ void Area2D::_bind_methods() { ClassDB::bind_method(_MD("set_layer_mask_bit","bit","value"),&Area2D::set_layer_mask_bit); ClassDB::bind_method(_MD("get_layer_mask_bit","bit"),&Area2D::get_layer_mask_bit); - ClassDB::bind_method(_MD("set_enable_monitoring","enable"),&Area2D::set_enable_monitoring); - ClassDB::bind_method(_MD("is_monitoring_enabled"),&Area2D::is_monitoring_enabled); + ClassDB::bind_method(_MD("set_monitoring","enable"),&Area2D::set_monitoring); + ClassDB::bind_method(_MD("is_monitoring"),&Area2D::is_monitoring); ClassDB::bind_method(_MD("set_monitorable","enable"),&Area2D::set_monitorable); ClassDB::bind_method(_MD("is_monitorable"),&Area2D::is_monitorable); @@ -664,7 +664,7 @@ void Area2D::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"0,100,0.01"),_SCS("set_linear_damp"),_SCS("get_linear_damp")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"0,100,0.01"),_SCS("set_angular_damp"),_SCS("get_angular_damp")); ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"priority",PROPERTY_HINT_RANGE,"0,128,1"),_SCS("set_priority"),_SCS("get_priority")); - ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"monitoring"),_SCS("set_enable_monitoring"),_SCS("is_monitoring_enabled")); + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"monitoring"),_SCS("set_monitoring"),_SCS("is_monitoring")); ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"monitorable"),_SCS("set_monitorable"),_SCS("is_monitorable")); ADD_GROUP("Collision","collision_"); ADD_PROPERTYNO( PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); @@ -687,7 +687,7 @@ Area2D::Area2D() : CollisionObject2D(Physics2DServer::get_singleton()->area_crea monitorable=false; collision_mask=1; layer_mask=1; - set_enable_monitoring(true); + set_monitoring(true); set_monitorable(true); } diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h index e1adc16666..68bada707b 100644 --- a/scene/2d/area_2d.h +++ b/scene/2d/area_2d.h @@ -153,8 +153,8 @@ public: void set_priority(real_t p_priority); real_t get_priority() const; - void set_enable_monitoring(bool p_enable); - bool is_monitoring_enabled() const; + void set_monitoring(bool p_enable); + bool is_monitoring() const; void set_monitorable(bool p_enable); bool is_monitorable() const; diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index b921db239d..0bafef1b83 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -52,7 +52,7 @@ void Camera2D::_update_scroll() { if (viewport) { viewport->set_canvas_transform( xform ); } - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,group_name,"_camera_moved",xform); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME,group_name,"_camera_moved",xform); }; } @@ -145,7 +145,7 @@ Transform2D Camera2D::get_camera_transform() { float c = smoothing*get_fixed_process_delta_time(); smoothed_camera_pos = ((camera_pos-smoothed_camera_pos)*c)+smoothed_camera_pos; ret_camera_pos=smoothed_camera_pos; - // camera_pos=camera_pos*(1.0-smoothing)+new_camera_pos*smoothing; + //camera_pos=camera_pos*(1.0-smoothing)+new_camera_pos*smoothing; } else { ret_camera_pos=smoothed_camera_pos=camera_pos; @@ -252,7 +252,7 @@ void Camera2D::_notification(int p_what) { canvas = get_canvas(); - RID vp = viewport->get_viewport(); + RID vp = viewport->get_viewport_rid(); group_name = "__cameras_"+itos(vp.get_id()); canvas_group_name ="__cameras_c"+itos(canvas.get_id()); @@ -375,7 +375,7 @@ void Camera2D::make_current() { if (!is_inside_tree()) { current=true; } else { - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,group_name,"_make_current",this); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME,group_name,"_make_current",this); } } @@ -383,7 +383,7 @@ void Camera2D::clear_current() { current=false; if (is_inside_tree()) { - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,group_name,"_make_current",(Object*)(NULL)); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME,group_name,"_make_current",(Object*)(NULL)); } } @@ -573,7 +573,7 @@ void Camera2D::set_custom_viewport(Node *p_viewport) { else viewport=get_viewport(); - RID vp = viewport->get_viewport(); + RID vp = viewport->get_viewport_rid(); group_name = "__cameras_"+itos(vp.get_id()); canvas_group_name ="__cameras_c"+itos(canvas.get_id()); add_to_group(group_name); diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 0a3e06602b..817707f96e 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -394,7 +394,7 @@ void CanvasItem::_enter_canvas() { else get_viewport()->gui_reset_canvas_sort_index(); - get_tree()->call_group(SceneTree::GROUP_CALL_UNIQUE,group,"_toplevel_raise_self"); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE,group,"_toplevel_raise_self"); } else { @@ -444,7 +444,7 @@ void CanvasItem::_notification(int p_what) { break; if (group!="") { - get_tree()->call_group(SceneTree::GROUP_CALL_UNIQUE,group,"_toplevel_raise_self"); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE,group,"_toplevel_raise_self"); } else { CanvasItem *p = get_parent_item(); ERR_FAIL_COND(!p); @@ -818,7 +818,7 @@ Ref<World2D> CanvasItem::get_world_2d() const { RID CanvasItem::get_viewport_rid() const { ERR_FAIL_COND_V(!is_inside_tree(),RID()); - return get_viewport()->get_viewport(); + return get_viewport()->get_viewport_rid(); } void CanvasItem::set_block_transform_notify(bool p_enable) { @@ -1115,7 +1115,7 @@ CanvasItem::CanvasItem() : xform_change(this) { drawing=false; behind=false; block_transform_notify=false; -// viewport=NULL; + //viewport=NULL; canvas_layer=NULL; use_parent_material=false; global_invalid=true; diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index e90bf8b96e..3668963251 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -282,7 +282,7 @@ void CollisionObject2D::set_shape(int p_shape_idx, const Ref<Shape2D>& p_shape) else Physics2DServer::get_singleton()->body_set_shape(get_rid(),p_shape_idx,p_shape->get_rid()); -// _update_shapes(); + //_update_shapes(); } void CollisionObject2D::set_shape_transform(int p_shape_idx, const Transform2D& p_transform) { @@ -295,7 +295,7 @@ void CollisionObject2D::set_shape_transform(int p_shape_idx, const Transform2D& else Physics2DServer::get_singleton()->body_set_shape_transform(get_rid(),p_shape_idx,p_transform); -// _update_shapes(); + //_update_shapes(); } Ref<Shape2D> CollisionObject2D::get_shape(int p_shape_idx) const { diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index 2d0fbf1cfc..03c2c698eb 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -432,7 +432,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect while(!found_route) { if (open_list.size()==0) { - // print_line("NOU OPEN LIST"); + //print_line("NOU OPEN LIST"); break; } //check open list diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index b91b2d4f56..012120d023 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -310,7 +310,7 @@ void NavigationPolygonInstance::set_enabled(bool p_enabled) { if (get_tree()->is_editor_hint() || get_tree()->is_debugging_navigation_hint()) update(); -// update_gizmo(); + //update_gizmo(); } bool NavigationPolygonInstance::is_enabled() const { diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 46a345f1cb..feecbd9e20 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -375,7 +375,7 @@ void RigidBody2D::_body_inout(int p_status, ObjectID p_instance, int p_body_shap if (!E) { E = contact_monitor->body_map.insert(objid,BodyState()); -// E->get().rc=0; + //E->get().rc=0; E->get().in_scene=node && node->is_inside_tree(); if (node) { node->connect(SceneStringNames::get_singleton()->tree_entered,this,SceneStringNames::get_singleton()->_body_enter_tree,make_binds(objid)); @@ -494,7 +494,7 @@ void RigidBody2D::_direct_state_changed(Object *p_state) { int local_shape = state->get_contact_local_shape(i); int shape = state->get_contact_collider_shape(i); -// bool found=false; + //bool found=false; Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.find(obj); if (!E) { @@ -1141,8 +1141,10 @@ Vector2 KinematicBody2D::move(const Vector2& p_motion) { float d = a.distance_to(b); - //if (d<margin) - /// continue; + /* + if (d<margin) + continue; + */ recover_motion+=(b-a)*0.4; } diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index 99147b0a39..20db63b66f 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -307,8 +307,10 @@ Rect2 TouchScreenButton::get_item_rect() const { if (texture.is_null()) return Rect2(0,0,1,1); - //if (texture.is_null()) - // return CanvasItem::get_item_rect(); + /* + if (texture.is_null()) + return CanvasItem::get_item_rect(); + */ return Rect2(Size2(),texture->get_size()); } diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index 01aa99c6a4..bea45aae4e 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -255,8 +255,10 @@ Rect2 Sprite::get_item_rect() const { if (texture.is_null()) return Rect2(0,0,1,1); - //if (texture.is_null()) - // return CanvasItem::get_item_rect(); + /* + if (texture.is_null()) + return CanvasItem::get_item_rect(); + */ Size2i s; @@ -510,8 +512,10 @@ Rect2 ViewportSprite::get_item_rect() const { if (texture.is_null()) return Rect2(0,0,1,1); - //if (texture.is_null()) - // return CanvasItem::get_item_rect(); + /* + if (texture.is_null()) + return CanvasItem::get_item_rect(); + */ Size2i s; diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 26f9f7b879..a7bb53bf63 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -610,7 +610,7 @@ Map<TileMap::PosKey,TileMap::Quadrant>::Element *TileMap::_create_quadrant(const xform.set_origin( q.pos ); -// q.canvas_item = VisualServer::get_singleton()->canvas_item_create(); + //q.canvas_item = VisualServer::get_singleton()->canvas_item_create(); q.body=Physics2DServer::get_singleton()->body_create(use_kinematic?Physics2DServer::BODY_MODE_KINEMATIC:Physics2DServer::BODY_MODE_STATIC); Physics2DServer::get_singleton()->body_attach_object_instance_ID(q.body,get_instance_ID()); Physics2DServer::get_singleton()->body_set_layer_mask(q.body,collision_layer); @@ -849,8 +849,10 @@ void TileMap::_set_tile_data(const PoolVector<int>& p_data) { bool transpose = v&(1<<31); v&=(1<<29)-1; -// if (x<-20 || y <-20 || x>4000 || y>4000) -// continue; + /* + if (x<-20 || y <-20 || x>4000 || y>4000) + continue; + */ set_cell(x,y,v,flip_h,flip_v,transpose); } |