diff options
| author | Rémi Verschelde | 2016-07-06 19:04:21 +0200 |
|---|---|---|
| committer | Rémi Verschelde | 2016-07-07 23:15:59 +0200 |
| commit | 3fcb9b1ec179b99d979d4cfea9b5e3c80e4a3e33 (patch) | |
| tree | a9ab363b5d34a3e314883618c6f34d5368ca79a8 /tools/editor/plugins | |
| parent | b6ac91c0e6416eda0dec226c5dbe5716f293e4f6 (diff) | |
| download | godot-3fcb9b1ec179b99d979d4cfea9b5e3c80e4a3e33.tar.gz godot-3fcb9b1ec179b99d979d4cfea9b5e3c80e4a3e33.tar.zst godot-3fcb9b1ec179b99d979d4cfea9b5e3c80e4a3e33.zip | |
Removed unused variables (second pass) + dead code
Fixes various gcc 5.4.0 warnings for -Wunused-variable and -Wunused-but-set-variable
Diffstat (limited to 'tools/editor/plugins')
15 files changed, 10 insertions, 131 deletions
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index 203564e61..98ba25b48 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -407,7 +407,6 @@ void AnimationPlayerEditor::_animation_save(const Ref<Resource>& p_resource) { void AnimationPlayerEditor::_animation_save_as(const Ref<Resource>& p_resource) { file->set_mode(EditorFileDialog::MODE_SAVE_FILE); - bool relpaths = (p_resource->has_meta("__editor_relpaths__") && p_resource->get_meta("__editor_relpaths__").operator bool()); List<String> extensions; ResourceSaver::get_recognized_extensions(p_resource, &extensions); diff --git a/tools/editor/plugins/animation_tree_editor_plugin.cpp b/tools/editor/plugins/animation_tree_editor_plugin.cpp index a381ec467..24914e4bc 100644 --- a/tools/editor/plugins/animation_tree_editor_plugin.cpp +++ b/tools/editor/plugins/animation_tree_editor_plugin.cpp @@ -90,7 +90,6 @@ Size2 AnimationTreeEditor::get_node_size(const StringName& p_node) const { Ref<StyleBox> style = get_stylebox("panel","PopupMenu"); Ref<Font> font = get_font("font","PopupMenu"); - Color font_color = get_color("font_color","PopupMenu"); Size2 size = style->get_minimum_size(); @@ -633,7 +632,6 @@ AnimationTreeEditor::ClickType AnimationTreeEditor::_locate_click(const Point2& Ref<StyleBox> style = get_stylebox("panel","PopupMenu"); Ref<Font> font = get_font("font","PopupMenu"); - Color font_color = get_color("font_color","PopupMenu"); float h = (font->get_height()+get_constant("vseparation","PopupMenu")); diff --git a/tools/editor/plugins/baked_light_baker.cpp b/tools/editor/plugins/baked_light_baker.cpp index 1962f81e8..6a88ba4cb 100644 --- a/tools/editor/plugins/baked_light_baker.cpp +++ b/tools/editor/plugins/baked_light_baker.cpp @@ -645,7 +645,6 @@ void BakedLightBaker::_octree_insert(int p_octant,Triangle* p_triangle, int p_de leaf_list=child_idx; cell_count++; - int lz = lights.size(); for(int ci=0;ci<8;ci++) { child->light_accum[ci][0]=0; child->light_accum[ci][1]=0; @@ -1016,8 +1015,6 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c //ray_aabb.expand_to(p_end); - const BVH *bvhptr = bvh; - bstack[0]=bvh; stack[0]=TEST_AABB_BIT; @@ -1693,7 +1690,7 @@ void BakedLightBaker::throw_rays(ThreadStack& thread_stack,int p_amount) { Vector3 from = dl.pos; double r1 = double(rand())/RAND_MAX; - double r2 = double(rand())/RAND_MAX; + //double r2 = double(rand())/RAND_MAX; double r3 = double(rand())/RAND_MAX; float d=Math::tan(Math::deg2rad(dl.spot_angle)); @@ -1994,7 +1991,6 @@ void BakedLightBaker::update_octree_images(DVector<uint8_t> &p_octree,DVector<ui const double *normptr=norm_arr.ptr(); */ double norm = 1.0/double(total_rays); - int lz=lights.size(); mult/=multiplier; double saturation = baked_light->get_saturation(); @@ -2261,8 +2257,6 @@ void BakedLightBaker::_plot_pixel_to_lightmap(int x, int y, int width, int heigh continue; n/=len; - const BVH *bvhptr = bvh; - bstack[0]=bvh; stack[0]=TEST_RAY_BIT; @@ -2404,8 +2398,6 @@ Error BakedLightBaker::transfer_to_lightmaps() { float gamma = baked_light->get_gamma_adjust(); float mult = baked_light->get_energy_multiplier(); - - const double *normptr=norm_arr.ptr(); for(int i=0;i<triangles.size();i++) { if (i%200==0) { @@ -2538,7 +2530,6 @@ Error BakedLightBaker::transfer_to_lightmaps() { Vector<uint8_t> copy_data=bt.data; uint8_t *data=bt.data.ptr(); - uint8_t *src_data=copy_data.ptr(); const int max_radius=8; const int shadow_radius=2; const int max_dist=0x7FFFFFFF; diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index caa09fba3..db500cdcd 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -1940,8 +1940,6 @@ void CanvasItemEditor::_viewport_draw() { Map<Node*,Object*> &selection = editor_selection->get_selection(); - CanvasItem *single_item=NULL; - bool pivot_found=false; for(Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) { @@ -1961,15 +1959,6 @@ void CanvasItemEditor::_viewport_draw() { Matrix32 xform=transform * canvas_item->get_global_transform_with_canvas(); VisualServer::get_singleton()->canvas_item_add_set_transform(ci,xform); - Point2 ofs=Point2();//get_global_pos(); - Rect2 draw_rect=rect; - Color light_edit_color=Color(1.0,0.8,0.8); - Color dark_edit_color=Color(0.4,0.1,0.1); - Size2 handle_size=Size2(handle_len,handle_len); - - //select_sb->draw(ci,draw_rect.grow(2)); - //DRAW_EMPTY_RECT( draw_rect.grow(2), light_edit_color ); - //DRAW_EMPTY_RECT( draw_rect.grow(1), dark_edit_color ); Vector2 endpoints[4]={ diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp index 5ed9f8ab5..95364e892 100644 --- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp @@ -349,8 +349,6 @@ void CollisionPolygon2DEditor::_canvas_draw() { Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Ref<Texture> handle= get_icon("EditorHandle","EditorIcons"); - int len = poly.size(); - for(int i=0;i<poly.size();i++) { diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_editor_plugin.cpp index b18afe783..55e38cebc 100644 --- a/tools/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/tools/editor/plugins/collision_polygon_editor_plugin.cpp @@ -381,8 +381,6 @@ void CollisionPolygonEditor::_polygon_draw() { poly=node->get_polygon(); - - int len = poly.size(); float depth = node->get_depth()*0.5; imgeom->clear(); diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/tools/editor/plugins/editor_preview_plugins.cpp index a057e6c2a..b1bce6048 100644 --- a/tools/editor/plugins/editor_preview_plugins.cpp +++ b/tools/editor/plugins/editor_preview_plugins.cpp @@ -36,6 +36,7 @@ #include "scene/resources/mesh.h" #include "scene/resources/bit_mask.h" #include "tools/editor/editor_scale.h" + bool EditorTexturePreviewPlugin::handles(const String& p_type) const { return (ObjectTypeDB::is_type(p_type,"ImageTexture") || ObjectTypeDB::is_type(p_type, "AtlasTexture")); @@ -442,7 +443,6 @@ Ref<Texture> EditorScriptPreviewPlugin::generate(const RES& p_from) { Color keyword_color = EditorSettings::get_singleton()->get("text_editor/keyword_color"); Color text_color = EditorSettings::get_singleton()->get("text_editor/text_color"); Color symbol_color = EditorSettings::get_singleton()->get("text_editor/symbol_color"); - Color comment_color = EditorSettings::get_singleton()->get("text_editor/comment_color"); for(int i=0;i<thumbnail_size;i++) { @@ -607,7 +607,7 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) { -1, -1, -1, -1, 2, 4, 6, 8 }; - int16_t nibble,signed_nibble,diff,step; + int16_t nibble,diff,step; ima_adpcm.last_nibble++; const uint8_t *src_ptr=sdata; @@ -628,10 +628,6 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) { if (ima_adpcm.step_index>88) ima_adpcm.step_index=88; - /* - signed_nibble = (nibble&7) * ((nibble&8)?-1:1); - diff = (2 * signed_nibble + 1) * step / 4; */ - diff = step >> 3 ; if (nibble & 1) diff += step >> 2 ; @@ -748,15 +744,13 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) { for(int j=0;j<h;j++) { - int half,ofs; + int half; float v; if (j<(h/2)) { half=0; - ofs=0; v = (j/(float)(h/2)) * 2.0 - 1.0; } else { half=1; - ofs=h/2; if( (float)(h/2) != 0 ) { v = ((j-(h/2))/(float)(h/2)) * 2.0 - 1.0; } else { diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp index 14e7b14fc..56e58bc98 100644 --- a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp +++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -364,8 +364,6 @@ void LightOccluder2DEditor::_canvas_draw() { Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Ref<Texture> handle= get_icon("EditorHandle","EditorIcons"); - int len = poly.size(); - for(int i=0;i<poly.size();i++) { diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp index 5a8cd8791..22546c72f 100644 --- a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -427,8 +427,6 @@ void NavigationPolygonEditor::_canvas_draw() { poly = Variant(node->get_navigation_polygon()->get_outline(j)); } - int len = poly.size(); - for(int i=0;i<poly.size();i++) { diff --git a/tools/editor/plugins/particles_editor_plugin.cpp b/tools/editor/plugins/particles_editor_plugin.cpp index 93e2fb2f3..7e20cc3f5 100644 --- a/tools/editor/plugins/particles_editor_plugin.cpp +++ b/tools/editor/plugins/particles_editor_plugin.cpp @@ -283,7 +283,6 @@ void ParticlesEditor::_generate_emission_points() { ofs=(Vector3(1,1,1)-dir)*Vector3(Math::randf(),Math::randf(),Math::randf())*aabb.size; ofs+=aabb.pos; - Vector3 dirv = -dir; Vector3 ofsv = ofs + aabb.size * dir; //space it a little diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/tools/editor/plugins/polygon_2d_editor_plugin.cpp index d78508c42..19d1ccc06 100644 --- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/polygon_2d_editor_plugin.cpp @@ -466,8 +466,6 @@ void Polygon2DEditor::_canvas_draw() { Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Ref<Texture> handle= get_icon("EditorHandle","EditorIcons"); - int len = poly.size(); - for(int i=0;i<poly.size();i++) { diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/tools/editor/plugins/sample_editor_plugin.cpp index 69602ac99..7965fa54a 100644 --- a/tools/editor/plugins/sample_editor_plugin.cpp +++ b/tools/editor/plugins/sample_editor_plugin.cpp @@ -151,7 +151,7 @@ void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<Imag -1, -1, -1, -1, 2, 4, 6, 8 }; - int16_t nibble,signed_nibble,diff,step; + int16_t nibble,diff,step; ima_adpcm.last_nibble++; const uint8_t *src_ptr=sdata; @@ -172,10 +172,6 @@ void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<Imag if (ima_adpcm.step_index>88) ima_adpcm.step_index=88; - /* - signed_nibble = (nibble&7) * ((nibble&8)?-1:1); - diff = (2 * signed_nibble + 1) * step / 4; */ - diff = step >> 3 ; if (nibble & 1) diff += step >> 2 ; @@ -285,15 +281,13 @@ void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<Imag for(int j=0;j<h;j++) { - int half,ofs; + int half; float v; if (j<(h/2)) { half=0; - ofs=0; v = (j/(float)(h/2)) * 2.0 - 1.0; } else { half=1; - ofs=h/2; v = ((j-(h/2))/(float)(h/2)) * 2.0 - 1.0; } diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index 0086f76b9..864df42b6 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -118,9 +118,10 @@ void ShaderTextEditor::_load_theme_settings() { get_text_edit()->add_color_region("/*","*/",comment_color,false); get_text_edit()->add_color_region("//","",comment_color,false); - //colorize strings + + /*//colorize strings Color string_color = EDITOR_DEF("text_editor/string_color",Color::hex(0x6b6f00ff)); - /* + List<String> strings; shader->get_shader_mode()->get_string_delimiters(&strings); diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index dea2fe483..375220051 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -186,9 +186,8 @@ void GraphColorRampEdit::_notification(int p_what){ Point prev; prev.offset=0; prev.color=Color(0,0,0); - int w = get_size().x; - int h = get_size().y; + int h = get_size().y; int total_w = get_size().width-get_size().height-3; for(int i=-1;i<points.size();i++) { diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 201ff30f4..91a347c69 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -53,8 +53,6 @@ void SpatialEditorViewport::_update_camera() { if (orthogonal) { - Size2 size = get_size(); - Size2 vpsize = Point2(cursor.distance*size.get_aspect(), cursor.distance / size.get_aspect()); //camera->set_orthogonal(size.width*cursor.distance,get_znear(),get_zfar()); camera->set_orthogonal(2 * cursor.distance, 0.1, 8192); } @@ -276,10 +274,6 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2& p_pos, bool p_append,b r_includes_current=false; List<_RayResult> results; - Vector3 cn=_get_camera_normal(); - Plane cplane(pos,cn.normalized()); - - float min_d=1e20; for (int i=0;i<instances.size();i++) { @@ -649,21 +643,8 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2& p_screenpos,bool p_hili Vector3 ray_pos=_get_ray_pos( Vector2( p_screenpos.x, p_screenpos.y ) ); Vector3 ray=_get_ray( Vector2( p_screenpos.x, p_screenpos.y ) ); - Vector3 cn=_get_camera_normal(); - Plane cplane(ray_pos,cn.normalized()); - Transform gt = spatial_editor->get_gizmo_transform(); float gs=gizmo_scale; - /* - if (orthogonal) { - gs= cursor.distance/surface->get_size().get_aspect(); - - } else { - gs = cplane.distance_to(gt.origin); - } - - gs*=GIZMO_SCALE_DEFAULT; -*/ if (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_MOVE) { @@ -1268,16 +1249,6 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { if (_edit.gizmo.is_valid()) { - Plane plane=Plane(_edit.gizmo_initial_pos,_get_camera_normal()); - - - Vector3 ray_pos=_get_ray_pos( Vector2( m.x, m.y ) ); - Vector3 ray=_get_ray( Vector2( m.x, m.y ) ); - - //Vector3 intersection; - //if (!plane.intersects_ray(ray_pos,ray,&intersection)) - // break; - _edit.gizmo->set_handle(_edit.gizmo_handle,camera,Vector2(m.x,m.y)); Variant v = _edit.gizmo->get_handle_value(_edit.gizmo_handle); String n = _edit.gizmo->get_handle_name(_edit.gizmo_handle); @@ -1808,16 +1779,6 @@ void SpatialEditorViewport::_notification(int p_what) { continue; - /* - ?? - if (!se->poly_instance.is_valid()) - continue; - if (!ObjectDB::get_instance( E->key() )) { - VisualServer::get_singleton()->free( se->poly_instance ); - se->poly_instance=RID(); - continue; - } - */ VisualInstance *vi=sp->cast_to<VisualInstance>(); @@ -1855,35 +1816,6 @@ void SpatialEditorViewport::_notification(int p_what) { surface->update(); } - //grid - Vector3 grid_cam_axis=_get_camera_normal(); - /* - for(int i=0;i<3;i++) { - - - Vector3 axis; - axis[i]=1; - - bool should_be_visible= grid_enabled && (grid_enable[i] || (Math::abs(grid_cam_axis.dot(axis))>0.99 && orthogonal)); - - if (should_be_visible!=grid_visible[i]) { - - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,should_be_visible); - grid_visible[i]=should_be_visible; - } - } - - if (last_grid_snap!=spatial_editor->get_translate_snap()) { - - - last_grid_snap=spatial_editor->get_translate_snap() - Transform gridt; - gridt.basis.scale(Vector3(last_grid_snap,last_grid_snap,last_grid_snap)); - for(int i=0;i<3;i++) - VisualServer::get_singleton()->instance_set_transform(grid_instance[i],gridt); - - }*/ - } if (p_what==NOTIFICATION_ENTER_TREE) { @@ -2565,16 +2497,9 @@ Object *SpatialEditor::_get_editor_data(Object *p_what) { si->sbox_instance=VisualServer::get_singleton()->instance_create2(selection_box->get_rid(),sp->get_world()->get_scenario()); VS::get_singleton()->instance_geometry_set_cast_shadows_setting(si->sbox_instance, VS::SHADOW_CASTING_SETTING_OFF); - RID inst = sp->call("_get_visual_instance_rid"); - -// if (inst.is_valid()) -// si->aabb = VisualServer::get_singleton()->instance_get_base_aabb(inst); - - if (get_tree()->is_editor_hint()) editor->call("edit_node",sp); - return si; } |
