소스 검색

Merge pull request #5538 from akien-mga/pr-unused-var

Removed unused variables + dead code
Rémi Verschelde 9 년 전
부모
커밋
f1e1910ae4
68개의 변경된 파일50개의 추가작업 그리고 722개의 파일을 삭제
  1. 0 3
      bin/tests/test_math.cpp
  2. 0 1
      drivers/chibi/cp_envelope.cpp
  3. 2 2
      drivers/chibi/cp_loader_xm.cpp
  4. 1 7
      drivers/chibi/cp_player_data_events.cpp
  5. 4 30
      drivers/gles2/rasterizer_gles2.cpp
  6. 2 0
      drivers/jpegd/image_loader_jpegd.cpp
  7. 0 1
      drivers/openssl/stream_peer_openssl.cpp
  8. 0 1
      drivers/png/resource_saver_png.cpp
  9. 1 9
      drivers/speex/audio_stream_speex.cpp
  10. 3 12
      drivers/theora/video_stream_theora.cpp
  11. 2 5
      main/main.cpp
  12. 0 6
      modules/gdscript/gd_compiler.cpp
  13. 9 48
      modules/gdscript/gd_editor.cpp
  14. 0 1
      modules/gdscript/gd_functions.cpp
  15. 0 2
      modules/gdscript/gd_parser.cpp
  16. 0 1
      modules/gdscript/gd_tokenizer.cpp
  17. 0 1
      modules/gridmap/grid_map.cpp
  18. 1 1
      modules/ik/ik.cpp
  19. 0 1
      platform/bb10/export/export.cpp
  20. 2 1
      platform/x11/joystick_linux.cpp
  21. 0 2
      scene/gui/dialogs.cpp
  22. 0 1
      scene/gui/graph_edit.cpp
  23. 0 1
      scene/gui/label.cpp
  24. 0 5
      scene/gui/line_edit.cpp
  25. 0 2
      scene/gui/progress_bar.cpp
  26. 1 65
      scene/gui/rich_text_label.cpp
  27. 0 1
      scene/gui/scroll_container.cpp
  28. 0 31
      scene/gui/tab_container.cpp
  29. 0 1
      scene/gui/text_edit.cpp
  30. 0 3
      scene/gui/texture_button.cpp
  31. 0 20
      scene/gui/texture_frame.cpp
  32. 0 15
      scene/gui/tree.cpp
  33. 0 10
      scene/gui/video_player.cpp
  34. 0 1
      scene/main/node.cpp
  35. 0 7
      tools/collada/collada.cpp
  36. 0 5
      tools/editor/animation_editor.cpp
  37. 0 3
      tools/editor/dependency_editor.cpp
  38. 4 9
      tools/editor/editor_node.cpp
  39. 0 1
      tools/editor/editor_path.cpp
  40. 0 81
      tools/editor/import_settings.cpp
  41. 1 5
      tools/editor/io_plugins/editor_atlas.cpp
  42. 0 6
      tools/editor/io_plugins/editor_import_collada.cpp
  43. 1 9
      tools/editor/io_plugins/editor_scene_import_plugin.cpp
  44. 0 4
      tools/editor/io_plugins/editor_texture_import_plugin.cpp
  45. 0 2
      tools/editor/io_plugins/editor_translation_import_plugin.cpp
  46. 0 1
      tools/editor/output_strings.cpp
  47. 0 1
      tools/editor/plugins/animation_player_editor_plugin.cpp
  48. 0 2
      tools/editor/plugins/animation_tree_editor_plugin.cpp
  49. 1 10
      tools/editor/plugins/baked_light_baker.cpp
  50. 0 11
      tools/editor/plugins/canvas_item_editor_plugin.cpp
  51. 0 2
      tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp
  52. 0 2
      tools/editor/plugins/collision_polygon_editor_plugin.cpp
  53. 3 9
      tools/editor/plugins/editor_preview_plugins.cpp
  54. 0 2
      tools/editor/plugins/light_occluder_2d_editor_plugin.cpp
  55. 0 2
      tools/editor/plugins/navigation_polygon_editor_plugin.cpp
  56. 0 1
      tools/editor/plugins/particles_editor_plugin.cpp
  57. 0 2
      tools/editor/plugins/polygon_2d_editor_plugin.cpp
  58. 2 8
      tools/editor/plugins/sample_editor_plugin.cpp
  59. 3 2
      tools/editor/plugins/shader_editor_plugin.cpp
  60. 1 2
      tools/editor/plugins/shader_graph_editor_plugin.cpp
  61. 0 75
      tools/editor/plugins/spatial_editor_plugin.cpp
  62. 0 1
      tools/editor/project_export.cpp
  63. 0 3
      tools/editor/project_manager.cpp
  64. 1 5
      tools/editor/property_editor.cpp
  65. 3 24
      tools/editor/scene_tree_dock.cpp
  66. 2 55
      tools/editor/scenes_dock.cpp
  67. 0 1
      tools/editor/script_editor_debugger.cpp
  68. 0 78
      tools/editor/spatial_editor_gizmos.cpp

+ 0 - 3
bin/tests/test_math.cpp

@@ -125,10 +125,7 @@ MainLoop* test() {
 		for (List<StringName>::Element *E=tl.front();E;E=E->next()) {
 
 			Vector<uint8_t> m5b = E->get().operator String().md5_buffer();
-			uint32_t *ub = (uint32_t*)m5b.ptr();
-			//hashes.push_back(ihash(ihash2(ihash3(*ub))));
 			hashes.push_back(hashes.size());
-			//hashes.push_back(E->get().hash());
 
 		}
 

+ 0 - 1
drivers/chibi/cp_envelope.cpp

@@ -359,7 +359,6 @@ uint8_t CPEnvelope::get_node_count() {
 
 const CPEnvelope::Point& CPEnvelope::get_node(int p_idx) {
 	
-	static Point errpoint;
 	if (p_idx<0 || p_idx>=node_count)
 		return node[node_count-1];
 	

+ 2 - 2
drivers/chibi/cp_loader_xm.cpp

@@ -560,8 +560,7 @@ CPLoader::Error CPLoader_XM::load_instrument_internal(CPInstrument *p_instr,bool
 			if (s_idx==-1) ABORT_LOAD;
 			//printf("free sample: %i\n",s_idx);
 			
-			
-			char auxb;
+
 			CPSample& sample=*song->get_sample(s_idx);
 			
 			int sample_size=file->get_dword();
@@ -611,6 +610,7 @@ CPLoader::Error CPLoader_XM::load_instrument_internal(CPInstrument *p_instr,bool
 			sm->set_c5_freq( sample_data, CPTables::get_linear_frequency(CPTables::get_linear_period(note_offset<<1,finetune)) );
 			//printf("NOTE %i,fine %i\n",note_offset,finetune);
 
+			char auxb;
 			auxb=file->get_byte(); //reserved?
 			file->get_byte_array((uint8_t*)instrname,22);
 			sample.set_name(instrname);

+ 1 - 7
drivers/chibi/cp_player_data_events.cpp

@@ -325,8 +325,6 @@ void CPPlayer::update_mixer() {
 		printf("cgb %i\n",(int)v.master_channel->channel_global_volume);
 */
 
-
-		int cv=v.master_channel->channel_global_volume;
 		
 		tmpvol=(uint64_t)v.fadeout_volume;    /* max 1024 - 10 bits */
 		tmpvol*=(uint64_t)v.channel_volume;    /* * max 64 - 6 bits */
@@ -338,13 +336,9 @@ void CPPlayer::update_mixer() {
 		tmpvol*=(uint64_t)song->get_mixing_volume(); /* max 128 - 7 bits */
 		tmpvol*=(uint64_t)control.global_volume;   /* max 128 - 7 bits*/
 				/* total 10+6+8+6+7+7=44 bits */
-		uint64_t preshift=tmpvol;
+
 		tmpvol>>=43; /* Move back to 8 bits range , 44-19+8=43*/
 		
-		/*
-		if (!tmpvol && preshift>>35)
-			tmpvol=1; // even if the volume should be inaudible, some people WANTS to hear this.
-		*/
 		if (tmpvol>CP_VOL_MAX)
 			tmpvol=CP_VOL_MAX;
 		

+ 4 - 30
drivers/gles2/rasterizer_gles2.cpp

@@ -2205,8 +2205,6 @@ Error RasterizerGLES2::_surface_set_arrays(Surface *p_surface, uint8_t *p_mem,ui
 				AABB aabb;
 
 				float scale=1;
-				float max=0;
-
 
 
 				if (p_surface->array[VS::ARRAY_VERTEX].datatype==_GL_HALF_FLOAT_OES) {
@@ -5913,8 +5911,7 @@ Error RasterizerGLES2::_setup_geometry(const Geometry *p_geometry, const Materia
 					base = skinned_buffer;
 					//copy stuff and get it ready for the skeleton
 
-					int src_stride = surf->stride;
-						int dst_stride = surf->stride - ( surf->array[VS::ARRAY_BONES].size + surf->array[VS::ARRAY_WEIGHTS].size );
+					int dst_stride = surf->stride - ( surf->array[VS::ARRAY_BONES].size + surf->array[VS::ARRAY_WEIGHTS].size );
 					const uint8_t *src_weights=&surf->array_local[surf->array[VS::ARRAY_WEIGHTS].ofs];
 					const uint8_t *src_bones=&surf->array_local[surf->array[VS::ARRAY_BONES].ofs];
 					const Skeleton::Bone *skeleton = &p_skeleton->bones[0];
@@ -6316,9 +6313,9 @@ void RasterizerGLES2::_render(const Geometry *p_geometry,const Material *p_mater
 
 void RasterizerGLES2::_setup_shader_params(const Material *p_material) {
 
+#if 0
 	int idx=0;
 	int tex_idx=0;
-#if 0
 	for(Map<StringName,Variant>::Element *E=p_material->shader_cache->params.front();E;E=E->next(),idx++) {
 
 		Variant v; //
@@ -6384,7 +6381,6 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
 	uint16_t prev_light=0x777E;
 	const Geometry *prev_geometry_cmp=NULL;
 	uint8_t prev_light_type=0xEF;
-	const ParamOverrideMap* prev_overrides=NULL; // make it diferent than NULL
 	const Skeleton *prev_skeleton =NULL;
 	uint8_t prev_sort_flags=0xFF;
 	const BakedLightData *prev_baked_light=NULL;
@@ -6392,8 +6388,6 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
 	const float *prev_morph_values=NULL;
 	int prev_receive_shadows_state=-1;
 
-	Geometry::Type prev_geometry_type=Geometry::GEOMETRY_INVALID;
-
 	material_shader.set_conditional(MaterialShaderGLES2::USE_VERTEX_LIGHTING,!shadow && !p_fragment_light);
 	material_shader.set_conditional(MaterialShaderGLES2::USE_FRAGMENT_LIGHTING,!shadow && p_fragment_light);
 	material_shader.set_conditional(MaterialShaderGLES2::USE_SKELETON,false);
@@ -6450,12 +6444,10 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
 				prev_light=0x777E;
 				prev_geometry_cmp=NULL;
 				prev_light_type=0xEF;
-				prev_overrides=NULL; // make it diferent than NULL
 				prev_skeleton =NULL;
 				prev_sort_flags=0xFF;
 				prev_morph_values=NULL;
 				prev_receive_shadows_state=-1;
-				prev_geometry_type=Geometry::GEOMETRY_INVALID;
 				glEnable(GL_BLEND);
 				glDepthMask(GL_TRUE);
 				glEnable(GL_DEPTH_TEST);
@@ -6838,7 +6830,6 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
 		prev_sort_flags=sort_flags;
 		prev_baked_light=baked_light;
 		prev_morph_values=morph_values;
-//		prev_geometry_type=geometry->type;
 		prev_receive_shadows_state=receive_shadows_state;
 	}
 
@@ -8877,8 +8868,6 @@ void RasterizerGLES2::canvas_light_shadow_buffer_update(RID p_buffer, const Matr
 	glEnableVertexAttribArray(VS::ARRAY_VERTEX);
 	canvas_shadow_shader.bind();
 
-	const int vp_height = 10;
-
 	glViewport(0, 0, cls->size,cls->height);
 	_glClearDepth(1.0f);
 	glClearColor(1,1,1,1);
@@ -8920,12 +8909,6 @@ void RasterizerGLES2::canvas_light_shadow_buffer_update(RID p_buffer, const Matr
 		Vector3 cam_target=Matrix3(Vector3(0,0,Math_PI*2*(i/4.0))).xform(Vector3(0,1,0));
 		projection = projection * CameraMatrix(Transform().looking_at(cam_target,Vector3(0,0,-1)).affine_inverse());
 
-		//print_line("near: "+rtos(p_near));
-		//print_line("far: "+rtos(p_far));
-		//projection.set_perspective(60,size/float(vp_height),p_near,p_far);
-
-	//	CameraMatrix light_mat = projection * CameraMatrix(camera);
-
 		canvas_shadow_shader.set_uniform(CanvasShadowShaderGLES2::PROJECTION_MATRIX,projection);
 		canvas_shadow_shader.set_uniform(CanvasShadowShaderGLES2::LIGHT_MATRIX,light);
 
@@ -9501,19 +9484,15 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list,int p_z,const
 		if (ci->copy_back_buffer && framebuffer.active && framebuffer.scale==1) {
 
 			Rect2 rect;
-			int x,y,w,h;
+			int x,y;
 
 			if (ci->copy_back_buffer->full) {
 
 				x = viewport.x;
 				y = window_size.height-(viewport.height+viewport.y);
-				w = viewport.width;
-				h = viewport.height;
 			} else {
 				x = viewport.x+ci->copy_back_buffer->screen_rect.pos.x;
 				y = window_size.height-(viewport.y+ci->copy_back_buffer->screen_rect.pos.y+ci->copy_back_buffer->screen_rect.size.y);
-				w = ci->copy_back_buffer->screen_rect.size.x;
-				h = ci->copy_back_buffer->screen_rect.size.y;
 			}
 			glActiveTexture(GL_TEXTURE0+max_texture_units-1);
 			glBindTexture(GL_TEXTURE_2D,framebuffer.sample_color);
@@ -9531,9 +9510,6 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list,int p_z,const
 			} else {
 				glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,viewport.width,viewport.height);
 			}
-//			if (current_clip) {
-//			//	print_line(" a clip ");
-//			}
 
 			canvas_texscreen_used=true;
 			glActiveTexture(GL_TEXTURE0);
@@ -10496,7 +10472,6 @@ void RasterizerGLES2::_update_framebuffer() {
 
 //	GLuint format_rgba = use_fp16_fb?_GL_RGBA16F_EXT:GL_RGBA;
 	GLuint format_rgba = GL_RGBA;
-	GLuint format_rgb = use_fp16_fb?_GL_RGB16F_EXT:GL_RGB;
 	GLuint format_type = use_fp16_fb?_GL_HALF_FLOAT_OES:GL_UNSIGNED_BYTE;
 	GLuint format_internal=GL_RGBA;
 
@@ -10998,10 +10973,9 @@ void RasterizerGLES2::init() {
 
 	{
 		//shadowmaps
-		OS::VideoMode vm=OS::get_singleton()->get_video_mode();
 
 		//don't use a shadowbuffer too big in GLES, this should be the maximum
-		int max_shadow_size = GLOBAL_DEF("rasterizer/max_shadow_buffer_size",1024);//nearest_power_of_2(MIN(vm.width,vm.height))/2;
+		int max_shadow_size = GLOBAL_DEF("rasterizer/max_shadow_buffer_size",1024);
 		int smsize=max_shadow_size;
 		while(smsize>=16) {
 

+ 2 - 0
drivers/jpegd/image_loader_jpegd.cpp

@@ -129,6 +129,8 @@ static Image _jpegd_mem_loader_func(const uint8_t* p_png,int p_size) {
 
 	Image img;
 	Error err = jpeg_load_image_from_buffer(&img,p_png,p_size);
+	if (err)
+		ERR_PRINT("Couldn't initialize ImageLoaderJPG with the given resource.");
 
 	return img;
 }

+ 0 - 1
drivers/openssl/stream_peer_openssl.cpp

@@ -469,7 +469,6 @@ Error StreamPeerOpenSSL::put_partial_data(const uint8_t* p_data,int p_bytes, int
 	if (p_bytes==0)
 		return OK;
 
-	int s=0;
 	Error err = put_data(p_data,p_bytes);
 	if (err!=OK)
 		return err;

+ 0 - 1
drivers/png/resource_saver_png.cpp

@@ -133,7 +133,6 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) {
 	}
 
 	int pngf=0;
-	int pngb=8;
 	int cs=0;
 
 

+ 1 - 9
drivers/speex/audio_stream_speex.cpp

@@ -69,8 +69,7 @@ int AudioStreamPlaybackSpeex::mix(int16_t* p_buffer,int p_frames) {
 		return 0;
 	};
 
-	int eos = 0;	
-	bool reloaded=false;
+	int eos = 0;
 
 	while (todo > page_size) {
 
@@ -100,7 +99,6 @@ int AudioStreamPlaybackSpeex::mix(int16_t* p_buffer,int p_frames) {
 				packets_available=true;
 			}
 			/*Extract all available packets*/
-			//int packet_no=0;
 			while (todo > page_size && !eos) {
 
 				if (ogg_stream_packetout(&os, &op)!=1) {
@@ -157,7 +155,6 @@ int AudioStreamPlaybackSpeex::mix(int16_t* p_buffer,int p_frames) {
 
 					{
 
-						int frame_offset = 0;
 						int new_frame_size = frame_size;
 
 						/*printf ("packet %d %d\n", packet_no, skip_samples);*/
@@ -165,7 +162,6 @@ int AudioStreamPlaybackSpeex::mix(int16_t* p_buffer,int p_frames) {
 						{
 							/*printf ("chopping first packet\n");*/
 							new_frame_size -= skip_samples;
-							frame_offset = skip_samples;
 						}
 						if (packet_no == page_nb_packets && skip_samples < 0)
 						{
@@ -241,10 +237,8 @@ void AudioStreamPlaybackSpeex::unload() {
 
 void *AudioStreamPlaybackSpeex::process_header(ogg_packet *op, int *frame_size, int *rate, int *nframes, int *channels, int *extra_headers) {
 
-	void *st;
 	SpeexHeader *header;
 	int modeID;
-	SpeexCallback callback;
 
 	header = speex_packet_to_header((char*)op->packet, op->bytes);
 	if (!header)
@@ -353,7 +347,6 @@ void AudioStreamPlaybackSpeex::reload() {
 		/*Loop for all complete pages we got (most likely only one)*/
 		while (ogg_sync_pageout(&oy, &og)==1) {
 
-			int packet_no;
 			if (stream_init == 0) {
 				ogg_stream_init(&os, ogg_page_serialno(&og));
 				stream_init = 1;
@@ -377,7 +370,6 @@ void AudioStreamPlaybackSpeex::reload() {
 
 			last_granule = page_granule;
 			/*Extract all available packets*/
-			packet_no=0;
 			while (!eos && ogg_stream_packetout(&os, &op)==1)
 			{
 				/*If first packet, process as Speex header*/

+ 3 - 12
drivers/theora/video_stream_theora.cpp

@@ -81,12 +81,12 @@ int VideoStreamPlaybackTheora::queue_page(ogg_page *page){
 
 void VideoStreamPlaybackTheora::video_write(void){
 	th_ycbcr_buffer yuv;
-	int y_offset, uv_offset;
 	th_decode_ycbcr_out(td,yuv);
 
+	/*
+	int y_offset, uv_offset;
 	y_offset=(ti.pic_x&~1)+yuv[0].stride*(ti.pic_y&~1);
 
-	/*
 	{
 		int pixels = size.x * size.y;
 		frame_data.resize(pixels * 4);
@@ -117,7 +117,7 @@ void VideoStreamPlaybackTheora::video_write(void){
 		DVector<uint8_t>::Write w = frame_data.write();
 		char* dst = (char*)w.ptr();
 
-		uv_offset=(ti.pic_x/2)+(yuv[1].stride)*(ti.pic_y/2);
+		//uv_offset=(ti.pic_x/2)+(yuv[1].stride)*(ti.pic_y/2);
 
 		if (px_fmt == TH_PF_444) {
 
@@ -543,16 +543,10 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
 	bool frame_done=false;
 	bool audio_done=!vorbis_p;
 
-	bool theora_done=false;
-
 	while (!frame_done || (!audio_done && !vorbis_eos)) {
 		//a frame needs to be produced
 
 		ogg_packet op;
-		bool audio_pending = false;
-
-
-		bool no_vorbis=false;
 		bool no_theora=false;
 
 
@@ -604,8 +598,6 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
 
 				int tr = vorbis_synthesis_read(&vd, ret-to_read);
 
-				audio_pending=true;
-
 
 				if (vd.granulepos>=0) {
 				//	print_line("wrote: "+itos(audio_frames_wrote)+" gpos: "+itos(vd.granulepos));
@@ -627,7 +619,6 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
 					}
 				} else {  /* we need more data; break out to suck in another page */
 					//printf("need moar data\n");
-					no_vorbis=true;
 					break;
 				};
 			}

+ 2 - 5
main/main.cpp

@@ -101,7 +101,6 @@ static bool init_fullscreen=false;
 static bool init_use_custom_pos=false;
 static bool debug_collisions=false;
 static bool debug_navigation=false;
-static bool allow_hidpi=true;
 static Vector2 init_custom_pos;
 static int video_driver_idx=-1;
 static int audio_driver_idx=-1;
@@ -262,7 +261,6 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
 	Vector<String> breakpoints;
 	bool use_custom_res=true;
 	bool force_res=false;
-	bool profile=false;
 
 	I=args.front();
 
@@ -916,6 +914,8 @@ Error Main::setup2() {
 		if (boot_logo_path!=String() /*&& FileAccess::exists(boot_logo_path)*/) {
 			print_line("Boot splash path: "+boot_logo_path);
 			Error err = boot_logo.load(boot_logo_path);
+			if (err)
+				ERR_PRINTS("Non-existing or invalid boot splash at: " + boot_logo_path + ". Loading default splash.");
 		}
 
 		if (!boot_logo.empty()) {
@@ -1040,7 +1040,6 @@ bool Main::start() {
 	String _import_script;
 	String dumpstrings;
 	bool noquit=false;
-	bool convert_old=false;
 	bool export_debug=false;
 	bool project_manager_request = false;
 	List<String> args = OS::get_singleton()->get_cmdline_args();
@@ -1050,8 +1049,6 @@ bool Main::start() {
 			doc_base=false;
 		} else if (args[i]=="-noquit") {
 			noquit=true;
-		} else if (args[i]=="-convert_old") {
-			convert_old=true;
 		} else if (args[i]=="-editor" || args[i]=="-e") {
 			editor=true;
 		} else if (args[i] == "-pm" || args[i] == "-project_manager") {

+ 0 - 6
modules/gdscript/gd_compiler.cpp

@@ -460,7 +460,6 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre
 
 						const GDParser::Node *instance = on->arguments[0];
 
-						bool in_static=false;
 						if (instance->type==GDParser::Node::TYPE_SELF) {
 							//room for optimization
 
@@ -771,8 +770,6 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre
 
 						Vector<int> setchain;
 
-						int prev_key_idx=-1;
-
 						for(List<GDParser::OperatorNode*>::Element *E=chain.back();E;E=E->prev()) {
 
 
@@ -822,7 +819,6 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre
 							setchain.push_back(named ? GDFunction::OPCODE_SET_NAMED : GDFunction::OPCODE_SET);
 
 							prev_pos=dst_pos;
-							prev_key_idx=key_idx;
 
 						}
 
@@ -1211,7 +1207,6 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode *
 
 	if (p_func) {
 		for(int i=0;i<p_func->arguments.size();i++) {
-			int idx = i;
 			codegen.add_stack_identifier(p_func->arguments[i],i);
 #ifdef TOOLS_ENABLED
 			argnames.push_back(p_func->arguments[i]);
@@ -1449,7 +1444,6 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa
 	p_script->name=p_class->name;
 
 
-	int index_from=0;
 	Ref<GDNativeClass> native;
 
 	if (p_class->extends_used) {

+ 9 - 48
modules/gdscript/gd_editor.cpp

@@ -449,57 +449,21 @@ static Ref<Reference> _get_parent_class(GDCompletionContext& context) {
 			}
 
 			String base=context._class->extends_class[0];
-			const GDParser::ClassNode *p = context._class->owner;
-			Ref<GDScript> base_class;
-#if 0
-			while(p) {
-
-				if (p->subclasses.has(base)) {
-
-					base_class=p->subclasses[base];
-					break;
-				}
-				p=p->_owner;
-			}
-#endif
-			if (base_class.is_valid()) {
-#if 0
-				for(int i=1;i<context._class->extends_class.size();i++) {
-
-					String subclass=context._class->extends_class[i];
-
-					if (base_class->subclasses.has(subclass)) {
-
-						base_class=base_class->subclasses[subclass];
-					} else {
-
-						//print_line("Could not find subclass: "+subclass);
-						return _get_type_from_class(context); //fail please
-					}
-				}
-
-				script=base_class;
-#endif
-
-			} else {
-
-				if (context._class->extends_class.size()>1) {
 
-					return REF();
+			if (context._class->extends_class.size()>1) {
 
+				return REF();
 
-				}
-				//if not found, try engine classes
-				if (!GDScriptLanguage::get_singleton()->get_global_map().has(base)) {
-
-					return REF();
-				}
+			}
+			//if not found, try engine classes
+			if (!GDScriptLanguage::get_singleton()->get_global_map().has(base)) {
 
-				int base_idx = GDScriptLanguage::get_singleton()->get_global_map()[base];
-				native = GDScriptLanguage::get_singleton()->get_global_array()[base_idx];
-				return native;
+				return REF();
 			}
 
+			int base_idx = GDScriptLanguage::get_singleton()->get_global_map()[base];
+			native = GDScriptLanguage::get_singleton()->get_global_array()[base_idx];
+			return native;
 
 		}
 
@@ -2100,10 +2064,8 @@ static void _find_call_arguments(GDCompletionContext& context,const GDParser::No
 }
 
 Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base_path, Object*p_owner, List<String>* r_options, String &r_call_hint) {
-	//print_line( p_code.replace(String::chr(0xFFFF),"<cursor>"));
 
 	GDParser p;
-	//Error parse(const String& p_code, const String& p_base_path="", bool p_just_validate=false,const String& p_self_path="",bool p_for_completion=false);
 
 	Error err = p.parse(p_code,p_base_path,false,"",true);
 	bool isfunction=false;
@@ -2204,7 +2166,6 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base
 								if (code!="") {
 									//if there is code, parse it. This way is slower but updates in real-time
 									GDParser p;
-									//Error parse(const String& p_code, const String& p_base_path="", bool p_just_validate=false,const String& p_self_path="",bool p_for_completion=false);
 
 									Error err = p.parse(scr->get_source_code(),scr->get_path().get_base_dir(),true,"",false);
 

+ 0 - 1
modules/gdscript/gd_functions.cpp

@@ -502,7 +502,6 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
 
 			Ref<FuncRef> fr = memnew( FuncRef);
 
-			Object *obj = *p_args[0];
 			fr->set_instance(*p_args[0]);
 			fr->set_function(*p_args[1]);
 

+ 0 - 2
modules/gdscript/gd_parser.cpp

@@ -514,8 +514,6 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
 		} else if (/*tokenizer->get_token()==GDTokenizer::TK_OP_ADD ||*/ tokenizer->get_token()==GDTokenizer::TK_OP_SUB || tokenizer->get_token()==GDTokenizer::TK_OP_NOT || tokenizer->get_token()==GDTokenizer::TK_OP_BIT_INVERT) {
 
 			//single prefix operators like !expr -expr ++expr --expr
-			OperatorNode *op = alloc_node<OperatorNode>();
-
 			Expression e;
 			e.is_op=true;
 

+ 0 - 1
modules/gdscript/gd_tokenizer.cpp

@@ -1156,7 +1156,6 @@ Vector<uint8_t> GDTokenizerBuffer::parse_code_string(const String& p_code) {
 	GDTokenizerText tt;
 	tt.set_code(p_code);
 	int line=-1;
-	int col=0;
 
 	while(true) {
 

+ 0 - 1
modules/gridmap/grid_map.cpp

@@ -912,7 +912,6 @@ void GridMap::_octant_bake(const OctantKey &p_key, const Ref<TriangleMesh>& p_tm
 						int lc = p_lights.size();
 						const BakeLight* bl = p_lights.ptr();
 						float ofs = cell_size*0.02;
-						float att = 0.2;
 
 
 						for(;V;V=V->next()) {

+ 1 - 1
modules/ik/ik.cpp

@@ -241,7 +241,7 @@ void InverseKinematics::_notification(int p_what)
 			}
 		} break;
 		case NOTIFICATION_PROCESS: {
-			float delta = get_process_delta_time();
+
 			Spatial *sksp = skel->cast_to<Spatial>();
 			if (!bound)
 				break;

+ 0 - 1
platform/bb10/export/export.cpp

@@ -714,7 +714,6 @@ Error EditorExportPlatformBB10::run(int p_device, int p_flags) {
 	args.push_back("-installApp");
 	args.push_back("-launchApp");
 	args.push_back("-device");
-	int idx = devices[p_device].index;
 	String host = EditorSettings::get_singleton()->get("blackberry/device_"+itos(p_device+1)+"/host");
 	String pass = EditorSettings::get_singleton()->get("blackberry/device_"+itos(p_device+1)+"/password");
 	args.push_back(host);

+ 2 - 1
platform/x11/joystick_linux.cpp

@@ -45,7 +45,9 @@
 #define test_bit(nr, addr)  (((1UL << ((nr) % LONG_BITS)) & ((addr)[(nr) / LONG_BITS])) != 0)
 #define NBITS(x) ((((x)-1)/LONG_BITS)+1)
 
+#ifdef UDEV_ENABLED
 static const char* ignore_str = "/dev/input/js";
+#endif
 
 joystick_linux::Joystick::Joystick() {
 	fd = -1;
@@ -198,7 +200,6 @@ void joystick_linux::monitor_joysticks(udev *p_udev) {
 		}
 		usleep(50000);
 	}
-	//printf("exit udev\n");
 	udev_monitor_unref(mon);
 }
 #endif

+ 0 - 2
scene/gui/dialogs.cpp

@@ -62,7 +62,6 @@ void WindowDialog::_input_event(const InputEvent& p_event) {
 
 		Point2 rel( p_event.mouse_motion.relative_x, p_event.mouse_motion.relative_y );
 		Point2 pos = get_pos();
-		Size2 size = get_size();
 
 		pos+=rel;
 
@@ -409,7 +408,6 @@ AcceptDialog::AcceptDialog() {
 	ok->set_text(RTR("OK"));
 	hbc->add_child(ok);
 	hbc->add_spacer();
-	//add_child(ok);
 
 
 	ok->connect("pressed", this,"_ok");

+ 0 - 1
scene/gui/graph_edit.cpp

@@ -774,7 +774,6 @@ void GraphEdit::set_zoom(float p_zoom) {
 
 	Vector2 sbofs = (Vector2( h_scroll->get_val(), v_scroll->get_val() ) + get_size()/2)/zoom;
 
-	float prev_zoom = zoom;
 	zoom = p_zoom;
 	top_layer->update();
 

+ 0 - 1
scene/gui/label.cpp

@@ -144,7 +144,6 @@ void Label::_notification(int p_what) {
 		if (!wc)
 			return;
 
-		int c = 0;
 		int line=0;
 		int line_to=lines_skipped + (lines_visible>0?lines_visible:1);
 		while(wc) {

+ 0 - 5
scene/gui/line_edit.cpp

@@ -980,10 +980,6 @@ void LineEdit::set_cursor_pos(int p_pos) {
 
 	cursor_pos=p_pos;
 
-//	if (cursor_pos>(window_pos+get_window_length())) {
-//	set_window_pos(cursor_pos-get_window_lengt//h());
-//	}
-
 	if (!is_inside_tree()) {
 
 		window_pos=cursor_pos;
@@ -1002,7 +998,6 @@ void LineEdit::set_cursor_pos(int p_pos) {
 
 		if (window_width<0)
 			return;
-		int width_to_cursor=0;
 		int wp=window_pos;
 
 		if (font.is_valid()) {

+ 0 - 2
scene/gui/progress_bar.cpp

@@ -51,7 +51,6 @@ void ProgressBar::_notification(int p_what) {
 		Ref<StyleBox> fg = get_stylebox("fg");
 		Ref<Font> font = get_font("font");
 		Color font_color=get_color("font_color");
-		Color font_color_shadow=get_color("font_color_shadow");
 
 		draw_style_box(bg,Rect2(Point2(),get_size()));
 		float r = get_unit_value();
@@ -63,7 +62,6 @@ void ProgressBar::_notification(int p_what) {
 		}
 
 		if (percent_visible) {
-			int fh=font->get_height();
 			String txt=itos(int(get_unit_value()*100))+"%";
 			font->draw_halign(get_canvas_item(),Point2(0,font->get_ascent()+(get_size().height-font->get_height())/2),HALIGN_CENTER,get_size().width,txt,font_color);
 		}

+ 1 - 65
scene/gui/rich_text_label.cpp

@@ -270,7 +270,6 @@ if (m_height > line_height) {\
 					if (p_mode!=PROCESS_CACHE) {
 						lh=line<l.height_caches.size()?l.height_caches[line]:1;
 					}
-					bool found_space=false;
 
 					while (c[end]!=0 && !(end && c[end-1]==' ' && c[end]!=' ')) {
 
@@ -284,30 +283,13 @@ if (m_height > line_height) {\
 						}
 
 						w+=cw;
-
-						if (c[end]==' ') {
-
-							fw+=cw;
-							/*
-							if (p_mode==PROCESS_CACHE) {
-								fw+=cw;
-							} else if (align==ALIGN_FILL && line<l.space_caches.size() && l.space_caches[line]>0) {
-								//print_line(String(c,end)+": "+itos(l.offset_caches[line])+"/"+itos(l.space_caches[line]));
-								//sub_space=cw;
-								found_space=true;
-							} else {
-								fw+=cw;
-							}*/
-						} else {
-							fw+=cw;
-						}
+						fw+=cw;
 
 						end++;
 					}
 
 					ENSURE_WIDTH(w);
 
-					//print_line("END: "+String::chr(c[end])+".");
 					if (end && c[end-1]==' ') {
 						if (p_mode==PROCESS_CACHE) {
 							spaces_size+=font->get_char_size(' ').width;
@@ -319,27 +301,17 @@ if (m_height > line_height) {\
 						}
 						spaces++;
 
-						/*
-						if (found_space) {
-							int ln = MIN(l.offset_caches.size()-1,line);
-
-							fw+=l.offset_caches[ln]/l.space_caches[ln];
-						}*/
-
 					}
 
 
 					{
 
-
 						int ofs=0;
 
 						for(int i=0;i<end;i++) {
 							int pofs=wofs+ofs;
 
 
-
-
 							if (p_mode==PROCESS_POINTER && r_click_char && p_click_pos.y>=p_ofs.y+y && p_click_pos.y<=p_ofs.y+y+lh) {
 								//int o = (wofs+w)-p_click_pos.x;
 
@@ -354,15 +326,6 @@ if (m_height > line_height) {\
 								if (p_click_pos.x-cw/2>p_ofs.x+align_ofs+pofs) {
 
 									rchar=int((&c[i])-cf);
-									//print_line("GOT: "+itos(rchar));
-
-
-									//if (i==end-1 && p_click_pos.x+cw/2 > pofs)
-									//	rchar++;
-									//int o = (wofs+w)-p_click_pos.x;
-
-								//	if (o>cw/2)
-								//		rchar++;
 								}
 
 
@@ -402,12 +365,9 @@ if (m_height > line_height) {\
 								}
 
 
-								//print_line("draw char: "+String::chr(c[i]));
-
 								if (underline) {
 									Color uc=color;
 									uc.a*=0.5;
-									//VS::get_singleton()->canvas_item_add_line(ci,Point2(pofs,y+ascent+2),Point2(pofs+cw,y+ascent+2),uc);
 									int uy = y+lh-fh+ascent+2;
 									VS::get_singleton()->canvas_item_add_line(ci,p_ofs+Point2(align_ofs+pofs,uy),p_ofs+Point2(align_ofs+pofs+cw,uy),uc);
 								}
@@ -462,28 +422,6 @@ if (m_height > line_height) {\
 				if (p_mode!=PROCESS_CACHE)
 					lh = line<l.height_caches.size()?l.height_caches[line]:1;
 
-
-#if 0
-				if (p_mode==PROCESS_POINTER && r_click_item ) {
-					//previous last "wrapped" line
-					int pl = line-1;
-					if (pl<0 || lines[pl].height_caches.size()==0)
-						break;
-					int py=lines[pl].offset_caches[ lines[pl].offset_caches.size() -1 ];
-					int ph=lines[pl].height_caches[ lines[pl].height_caches.size() -1 ];
-					print_line("py: "+itos(py));
-					print_line("ph: "+itos(ph));
-
-					rchar=0;
-					if (p_click_pos.y>=py && p_click_pos.y<=py+ph) {
-						if (r_outside) *r_outside=true;
-						*r_click_item=it;
-						*r_click_char=rchar;
-						return;
-					}
-				}
-
-#endif
 			} break;
 			case ITEM_TABLE: {
 
@@ -493,7 +431,6 @@ if (m_height > line_height) {\
 				int vseparation=get_constant("table_vseparation");
 				Color ccolor = _find_color(table,p_base_color);
 				Vector2 draw_ofs = Point2(wofs,y);
-				int max_y=get_size().height;
 
 				if (p_mode==PROCESS_CACHE) {
 
@@ -1825,7 +1762,6 @@ bool RichTextLabel::search(const String& p_string,bool p_from_selection) {
 		charidx=selection.to_char+1;
 	}
 
-	int line=-1;
 	while(it) {
 
 		if (it->type==ITEM_TEXT) {

+ 0 - 1
scene/gui/scroll_container.cpp

@@ -177,7 +177,6 @@ void ScrollContainer::_input_event(const InputEvent& p_input_event) {
 
 void ScrollContainer::_update_scrollbar_pos() {
 
-	Size2 size = get_size();
 	Size2 hmin = h_scroll->get_combined_minimum_size();
 	Size2 vmin = v_scroll->get_combined_minimum_size();
 

+ 0 - 31
scene/gui/tab_container.cpp

@@ -40,8 +40,6 @@ int TabContainer::_get_top_margin() const {
 
 	int h = MAX( tab_bg->get_minimum_size().height,tab_fg->get_minimum_size().height);
 
-//	h+=MIN( get_constant("label_valign_fg"), get_constant("label_valign_bg") );
-
 	int ch = font->get_height();;
 	for(int i=0;i<get_child_count();i++) {
 
@@ -207,9 +205,7 @@ void TabContainer::_notification(int p_what) {
 			Ref<StyleBox> tab_bg = get_stylebox("tab_bg");
 			Ref<StyleBox> tab_fg = get_stylebox("tab_fg");
 			Ref<Texture> incr = get_icon("increment");
-			Ref<Texture> incr_hl = get_icon("increment_hilite");
 			Ref<Texture> decr = get_icon("decrement");
-			Ref<Texture> decr_hl = get_icon("decrement_hilite");
 			Ref<Texture> menu = get_icon("menu");
 			Ref<Texture> menu_hl = get_icon("menu_hl");
 			Ref<Font> font = get_font("font");
@@ -219,9 +215,6 @@ void TabContainer::_notification(int p_what) {
 			int side_margin = get_constant("side_margin");
 			int top_margin = _get_top_margin();
 
-			int label_valign_fg = get_constant("label_valign_fg");
-			int label_valign_bg = get_constant("label_valign_bg");
-
 
 			Size2 top_size = Size2( size.width, top_margin );
 
@@ -338,17 +331,14 @@ void TabContainer::_notification(int p_what) {
 
 
 				Ref<StyleBox> sb;
-				int va;
 				Color col;
 
 				if (idx==current) {
 
 					sb=tab_fg;
-					va=label_valign_fg;
 					col=color_fg;
 				} else {
 					sb=tab_bg;
-					va=label_valign_bg;
 					col=color_bg;
 				}
 
@@ -371,23 +361,7 @@ void TabContainer::_notification(int p_what) {
 				}
 
 				font->draw(ci, Point2i( lpos.x, sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-font->get_height())/2+font->get_ascent() ), s, col );
-				//ofs+=sb_ms.x+w;
-
-				/*
-				int sb_mw = sb->get_minimum_size().width;
-				int font_ofs = sb_mw / 2;
-
-				Rect2i rect =Rect2( ofs, 0, w+sb_mw, top_margin);
 
-				rect.size
-				sb->draw(ci,rect);
-				rect.y+=va;
-				rect.height+=va;
-				int font_y = (rect.height - font->get_height())/2;
-
-				font->draw(ci, Point2( ofs+font_ofs, va+font_y ), s, col );
-
-*/
 				idx++;
 			}
 
@@ -477,7 +451,6 @@ void TabContainer::set_current_tab(int p_current) {
 
 	ERR_FAIL_INDEX( p_current, get_tab_count() );
 
-    //printf("DEBUG %p: set_current_tab to %i\n", this, p_current);
 	current=p_current;
 
 	int idx=0;
@@ -560,7 +533,6 @@ Control* TabContainer::get_current_tab_control() const {
 void TabContainer::remove_child_notify(Node *p_child) {
 
 	int tc = get_tab_count();
-//	bool set_curent=false;
 	if (current==tc-1) {
 		current--;
 		if (current<0)
@@ -705,9 +677,6 @@ Size2 TabContainer::get_minimum_size() const {
 		if (c->is_set_as_toplevel())
 			continue;
 
-		//if (!c->has_meta("_tab_name"))
-		//	continue;
-
 		if (!c->is_visible())
 			continue;
 

+ 0 - 1
scene/gui/text_edit.cpp

@@ -4137,7 +4137,6 @@ void TextEdit::_update_completion_candidates() {
 	completion_options.clear();
 	completion_index=0;
 	completion_base=s;
-	int ci_match=0;
 	Vector<float> sim_cache;
 	for(int i=0;i<completion_strings.size();i++) {
 		if (s == completion_strings[i]) {

+ 0 - 3
scene/gui/texture_button.cpp

@@ -76,10 +76,7 @@ void TextureButton::_notification(int p_what) {
 	switch( p_what ) {
 
 		case NOTIFICATION_DRAW: {
-			RID canvas_item = get_canvas_item();
 			DrawMode draw_mode = get_draw_mode();
-//			if (normal.is_null())
-//				break;
 
 			Ref<Texture> texdraw;
 

+ 0 - 20
scene/gui/texture_frame.cpp

@@ -37,9 +37,6 @@ void TextureFrame::_notification(int p_what) {
 			return;
 
 
-
-		RID ci = get_canvas_item();
-
 		switch(stretch_mode) {
 			case STRETCH_SCALE_ON_EXPAND: {
 				Size2 s=expand?get_size():texture->get_size();
@@ -85,23 +82,6 @@ void TextureFrame::_notification(int p_what) {
 
 		}
 
-
-/*
-		Vector<Point2> points;
-		points.resize(4);
-		points[0]=Point2(0,0);
-		points[1]=Point2(s.x,0);
-		points[2]=Point2(s.x,s.y);
-		points[3]=Point2(0,s.y);
-		Vector<Point2> uvs;
-		uvs.resize(4);
-		uvs[0]=Point2(0,0);
-		uvs[1]=Point2(1,0);
-		uvs[2]=Point2(1,1);
-		uvs[3]=Point2(0,1);
-
-		VisualServer::get_singleton()->canvas_item_add_primitive(ci,points,Vector<Color>(),uvs,texture->get_rid());
-*/
 	}
 }
 

+ 0 - 15
scene/gui/tree.cpp

@@ -973,22 +973,12 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
 
 	/* Draw label, if height fits */
 
-	Point2i guide_from;
 
 		bool skip=(p_item==root && hide_root);
-   // printf("skip (%p == %p && %i) %i\n",p_item,root,hide_root,skip);
 
 
 	if (!skip && (p_pos.y+label_h-cache.offset.y)>0) {
 
-	  //  printf("entering\n");
-
-		int height=label_h;
-
-		Point2i guide_space=Point2i( cache.guide_width , height );
-
-
-
 		if (!hide_folding && p_item->childs) { //has childs, draw the guide box
 
 			Ref<Texture> arrow;
@@ -1660,7 +1650,6 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_
 		/* editing */
 
 		bool bring_up_editor=force_select_on_already_selected ? (c.selected && already_selected) : c.selected;
-		bool bring_up_value_editor=false;
 		String editor_text=c.text;
 
 		switch (c.mode) {
@@ -1711,9 +1700,6 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_
 					bring_up_editor=false;
 				} else {
 
-					Ref<Texture> updown = cache.updown;
-
-
 					if (x >= (col_width-item_h/2)) {
 
 						/* touching the combo */
@@ -1760,7 +1746,6 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_
 					}  else {
 
 						editor_text=String::num( p_item->cells[col].val, Math::decimals( p_item->cells[col].step ) );
-						bring_up_value_editor=false;
 						if (select_mode==SELECT_MULTI && get_tree()->get_last_event_id() == focus_in_id)
 							bring_up_editor=false;
 

+ 0 - 10
scene/gui/video_player.cpp

@@ -116,7 +116,6 @@ void VideoPlayer::_notification(int p_notification) {
 
 		case NOTIFICATION_ENTER_TREE: {
 
-			//set_idle_process(false); //don't annoy
 			if (stream.is_valid() && autoplay && !get_tree()->is_editor_hint()) {
 				play();
 			}
@@ -141,13 +140,6 @@ void VideoPlayer::_notification(int p_notification) {
 
 			playback->update(delta);
 
-			/*int prev_width = texture->get_width();
-			stream->pop_frame(texture);
-			if (prev_width == 0) {
-				update();
-				minimum_size_changed();
-			};*/
-
 		} break;
 
 		case NOTIFICATION_DRAW: {
@@ -158,8 +150,6 @@ void VideoPlayer::_notification(int p_notification) {
 				return;
 
 			Size2 s=expand?get_size():texture->get_size();
-			RID ci = get_canvas_item();
-			printf("drawing with size %f, %f\n", s.x, s.y);
 			draw_texture_rect(texture,Rect2(Point2(),s),false);
 
 		} break;

+ 0 - 1
scene/main/node.cpp

@@ -1206,7 +1206,6 @@ void Node::add_to_group(const StringName& p_identifier,bool p_persistent) {
 
 	GroupData gd;
 
-	SceneTree::Group *gptr=NULL;
 	if (data.tree) {
 		gd.group=data.tree->add_to_group(p_identifier,this);
 	} else {

+ 0 - 7
tools/collada/collada.cpp

@@ -681,9 +681,6 @@ void Collada::_parse_effect_material(XMLParser& parser,Effect &effect,String &id
 											} else {
 												String uri = effect.params[surface];
 
-												int channel=0;
-												//if (parser.has_attribute("texcoord"))
-
 
 												if (what=="diffuse") {
 													effect.diffuse.texture=uri;
@@ -759,9 +756,6 @@ void Collada::_parse_effect_material(XMLParser& parser,Effect &effect,String &id
 								} else {
 									String uri = effect.params[surface];
 
-									int channel=0;
-									//if (parser.has_attribute("texcoord"))
-
 									if (parser.has_attribute("bumptype") && parser.get_attribute_value("bumptype")!="NORMALMAP") {
 										WARN_PRINT("'bump' texture type is not NORMALMAP, only NORMALMAP is supported.")
 									}
@@ -2636,7 +2630,6 @@ void Collada::_find_morph_nodes(VisualScene *p_vscene,Node *p_node) {
 					base=sk.base;
 				} else if (state.morph_controller_data_map.has(base)) {
 
-					MorphControllerData &sk = state.morph_controller_data_map[base];
 					state.morph_ownership_map[base]=nj->id;
 					break;
 				} else {

+ 0 - 5
tools/editor/animation_editor.cpp

@@ -85,7 +85,6 @@ private:
 			int points = 48;
 			if (mode==MODE_MULTIPLE) {
 
-				int max_draw = 16;
 				Color mcolor=color;
 				mcolor.a*=0.3;
 
@@ -1356,7 +1355,6 @@ void AnimationKeyEditor::_track_editor_draw() {
 		}
 	}
 
-	Color sep_color=color;
 	color.a*=0.5;
 
 	for(int i=0;i<fit;i++) {
@@ -1806,8 +1804,6 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) {
 	Ref<Font> font = te->get_font("font","Tree");
 	int sep = get_constant("vseparation","Tree");
 	int hsep = get_constant("hseparation","Tree");
-	Color color = get_color("font_color","Tree");
-	Color sepcolor = get_color("guide_color","Tree");
 	Ref<Texture> remove_icon = get_icon("Remove","EditorIcons");
 	Ref<Texture> move_up_icon = get_icon("MoveUp","EditorIcons");
 	Ref<Texture> move_down_icon = get_icon("MoveDown","EditorIcons");
@@ -3007,7 +3003,6 @@ void AnimationKeyEditor::_update_menu() {
 
 	updating=true;
 
-	bool empty= !animation.is_valid();
 	if (animation.is_valid()) {
 
 		length->set_val(animation->get_length());

+ 0 - 3
tools/editor/dependency_editor.cpp

@@ -80,8 +80,6 @@ void DependencyEditor::_fix_and_find(EditorFileSystemDirectory *efsd, Map<String
 			continue;
 
 		String path = efsd->get_file_path(i);
-		Map<String,String> &ss = candidates[file];
-
 
 		for(Map<String,String>::Element *E=candidates[file].front();E;E=E->next()) {
 
@@ -420,7 +418,6 @@ void DependencyRemoveDialog::show(const Vector<String> &to_erase) {
 	exist=false;
 	owners->clear();
 	files.clear();
-	TreeItem *root=owners->create_item();
 	for(int i=0;i<to_erase.size();i++) {
 		files[to_erase[i]]=NULL;
 	}

+ 4 - 9
tools/editor/editor_node.cpp

@@ -597,7 +597,6 @@ void EditorNode::save_resource(const Ref<Resource>& p_resource) {
 void EditorNode::save_resource_as(const Ref<Resource>& p_resource,const String& p_at_path) {
 
 	file->set_mode(EditorFileDialog::MODE_SAVE_FILE);
-	bool relpaths =  (p_resource->has_meta("__editor_relpaths__") && p_resource->get_meta("__editor_relpaths__").operator bool());
 
 	current_option=RESOURCE_SAVE_AS;
 	List<String> extensions;
@@ -1551,9 +1550,10 @@ void EditorNode::_property_editor_back() {
 
 void EditorNode::_imported(Node *p_node) {
 
-	Node *scene = editor_data.get_edited_scene_root();
-//	add_edited_scene(p_node);
 /*
+	Node *scene = editor_data.get_edited_scene_root();
+	add_edited_scene(p_node);
+
 	if (scene) {
 		String path = scene->get_filename();
 		p_node->set_filename(path);
@@ -2129,7 +2129,6 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
 			}
 
 			file->set_mode(EditorFileDialog::MODE_SAVE_FILE);
-			bool relpaths = (scene->has_meta("__editor_relpaths__") && scene->get_meta("__editor_relpaths__").operator bool());
 
 
 			List<String> extensions;
@@ -2210,8 +2209,6 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
 
 			}
 
-			bool relpaths = (scene->has_meta("__editor_relpaths__") && scene->get_meta("__editor_relpaths__").operator bool());
-
 			file->set_mode(EditorFileDialog::MODE_SAVE_FILE);
 
 			file->set_current_path(cpath);
@@ -2220,8 +2217,8 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
 
 		} break;
 		case FILE_SAVE_OPTIMIZED: {
-			Node *scene = editor_data.get_edited_scene_root();
 #if 0
+			Node *scene = editor_data.get_edited_scene_root();
 			if (!scene) {
 
 				current_option=-1;
@@ -5644,8 +5641,6 @@ EditorNode::EditorNode() {
 	ED_SHORTCUT("editor/prev_tab", TTR("Previous tab"), KEY_MASK_CMD+KEY_MASK_SHIFT+KEY_TAB);
 
 
-	Separator *vs=NULL;
-
 	file_menu->set_tooltip(TTR("Operations with scene files."));
 	p=file_menu->get_popup();
 	p->add_shortcut(ED_SHORTCUT("editor/new_scene",TTR("New Scene")),FILE_NEW_SCENE);

+ 0 - 1
tools/editor/editor_path.cpp

@@ -38,7 +38,6 @@ void EditorPath::_notification(int p_what) {
 
 			RID ci=get_canvas_item();
 			Ref<Font> label_font = get_font("font","Label");
-			Color label_color = get_color("font_color","Label");
 			Size2i size = get_size();
 			Ref<Texture> sn = get_icon("SmallNext","EditorIcons");
 

+ 0 - 81
tools/editor/import_settings.cpp

@@ -36,21 +36,6 @@ void ImportSettingsDialog::_item_pressed(int p_idx) {
 		return;
 
 	String p=edited->get_metadata(0);
-#if 0
-	if (EditorImportDB::get_singleton()->is_image(p)) {
-
-		uint32_t flags = EditorImportDB::get_singleton()->get_image_flags(p);
-		bool pressed = !popup->is_item_checked(p_idx);
-		if (pressed)
-			flags|=(1<<p_idx);
-		else
-			flags&=~(1<<p_idx);
-
-
-		EditorImportDB::get_singleton()->set_image_flags(p,flags);
-		edited->set_text(2,_str_from_flags(flags));
-	}
-#endif
 }
 
 void ImportSettingsDialog::_item_edited() {
@@ -58,38 +43,8 @@ void ImportSettingsDialog::_item_edited() {
 	if (updating)
 		return;
 	TreeItem *it=tree->get_selected();
-	int ec=tree->get_edited_column();
 
 	String p=it->get_metadata(0);
-#if 0
-	if (EditorImportDB::get_singleton()->is_image(p)) {
-
-		if (ec==1) {
-
-
-			EditorImportDB::get_singleton()->set_image_format(p,EditorImport::ImageFormat(int(it->get_range(1))));
-
-		} else if (ec==2) {
-
-
-			int flags = EditorImportDB::get_singleton()->get_image_flags(p);
-			for(int i=0;i<popup->get_item_count();i++) {
-
-				popup->set_item_checked(i,flags&(1<<i));
-			}
-
-			Rect2 r = tree->get_custom_popup_rect();
-			popup->set_size(Size2(r.size.width,1));
-			popup->set_pos(/*tree->get_global_pos()+*/r.pos+Point2(0,r.size.height));
-			popup->popup();
-		}
-
-		edited=it;
-
-	}
-#endif
-
-
 }
 
 
@@ -167,42 +122,6 @@ bool ImportSettingsDialog::_generate_fs(TreeItem *p_parent,EditorFileSystemDirec
 
 	}
 
-#if 0
-		if (!EditorImportDB::get_singleton()->is_image(path) && !EditorImportDB::get_singleton()->is_scene(path))
-			continue;
-
-		String f = p_dir->get_file(i);
-		TreeItem *ti = tree->create_item(p_parent);
-		ti->set_text(0,f);
-		String type = p_dir->get_file_type(i);
-		Ref<Texture> icon = get_icon( (has_icon(type,"EditorIcons")?type:String("Object")),"EditorIcons");
-
-
-		if (EditorImportDB::get_singleton()->is_image(path)) {
-
-
-			ti->set_tooltip(0,"Type: Image\nSource: "+EditorImportDB::get_singleton()->get_file_source(path)+"\nSource MD5: "+EditorImportDB::get_singleton()->get_file_md5(path));
-			ti->set_cell_mode(1,TreeItem::CELL_MODE_RANGE);
-			ti->set_editable(1,true);
-			ti->set_range_config(1,0,3,1);
-			ti->set_range(1,EditorImportDB::get_singleton()->get_image_format(path));
-			ti->set_text(1,texformat);
-			ti->set_cell_mode(2,TreeItem::CELL_MODE_CUSTOM);
-			ti->set_editable(2,true);
-			ti->set_metadata(0,path);
-
-			String txt;
-			uint32_t flags=EditorImportDB::get_singleton()->get_image_flags(path);
-			txt=_str_from_flags(flags);
-
-			ti->set_text(2,txt);
-		}
-
-		ti->set_icon(0, icon);
-		valid=true;
-#endif
-
-
 	return valid;
 }
 

+ 1 - 5
tools/editor/io_plugins/editor_atlas.cpp

@@ -82,7 +82,6 @@ void EditorAtlas::fit(const Vector<Size2i>& p_rects,Vector<Point2i>& r_result, S
 
 		//place them
 		int ofs=0;
-		int limit_h=0;
 
 		for(int j=0;j<wrects.size();j++) {
 
@@ -106,8 +105,6 @@ void EditorAtlas::fit(const Vector<Size2i>& p_rects,Vector<Point2i>& r_result, S
 
 			int end_h = from_y+wrects[j].s.height;
 			int end_w = ofs+wrects[j].s.width;
-			if (ofs==0)
-				limit_h=end_h;
 
 			for(int k=0;k<wrects[j].s.width;k++) {
 
@@ -120,8 +117,7 @@ void EditorAtlas::fit(const Vector<Size2i>& p_rects,Vector<Point2i>& r_result, S
 			if (end_w > max_w)
 				max_w=end_w;
 
-			//if (ofs==0 || end_h>limit_h ) //while h limit not reched, keep stacking
-				ofs+=wrects[j].s.width;
+			ofs+=wrects[j].s.width;
 
 		}
 

+ 0 - 6
tools/editor/io_plugins/editor_import_collada.cpp

@@ -2278,12 +2278,6 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
 		NodeMap &nm = node_map[at.target];
 		String path = scene->get_path_to(nm.node);
 
-		Collada::Node *cn = collada.state.scene_map[at.target];
-		//if (cn->ignore_anim) {
-		//	print_line("warning, ignoring property animation on node: "+nm.path);
-			//continue;
-		//}
-
 		animation->add_track(Animation::TYPE_VALUE);
 		int track = animation->get_track_count() -1;
 

+ 1 - 9
tools/editor/io_plugins/editor_scene_import_plugin.cpp

@@ -2680,12 +2680,6 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
 	progress.step(TTR("Importing Scene.."),2);
 
 
-	bool reimport = bool(from->get_option("reimport"));
-	int this_time_action = from->get_option("import_this_time");
-	int next_time_action = from->get_option("import_next_time");
-
-	int import_action = reimport?this_time_action:next_time_action;
-
 	from->set_source_md5(0,FileAccess::get_md5(src_path));
 	from->set_editor(get_name());
 
@@ -2694,8 +2688,6 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
 
 	Map<Ref<Mesh>,Ref<Shape> > collision_map;
 
-	Ref<ResourceImportMetadata> imd = memnew(ResourceImportMetadata);
-
 	Map< Ref<ImageTexture>,TextureRole > imagemap;
 
 	scene=_fix_node(scene,scene,collision_map,scene_flags,imagemap);
@@ -2811,7 +2803,7 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
 			target_path=target_path.basename()+".tex";
 
 			Ref<ResourceImportMetadata> imd = memnew( ResourceImportMetadata );
-			print_line("flags: "+itos(image_flags));
+
 			uint32_t flags = image_flags;
 			if (E->get()==TEXTURE_ROLE_DIFFUSE && scene_flags&SCENE_FLAG_LINEARIZE_DIFFUSE_TEXTURES)
 				flags|=EditorTextureImportPlugin::IMAGE_FLAG_CONVERT_TO_LINEAR;

+ 0 - 4
tools/editor/io_plugins/editor_texture_import_plugin.cpp

@@ -1192,8 +1192,6 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc
 		}
 		ep.step(TTR("Converting Images"),sources.size());
 
-		int base_index=0;
-
 
 		Map<uint64_t,int> source_md5;
 		Map<int,List<int> > source_map;
@@ -1760,7 +1758,6 @@ void EditorTextureImportPlugin::reimport_multiple_files(const Vector<String>& p_
 	Vector<String> valid;
 
 
-	bool warning=false;
 	for(int i=0;i<p_list.size();i++) {
 
 		Ref<ResourceImportMetadata> rimd = ResourceLoader::load_import_metadata(p_list[i]);
@@ -1768,7 +1765,6 @@ void EditorTextureImportPlugin::reimport_multiple_files(const Vector<String>& p_
 		if (type=="texture" || type.begins_with("texture_")) {
 
 			if ((rimd->has_option("atlas") && rimd->get_option("atlas")) || (rimd->has_option("large") && rimd->get_option("large"))) {
-				warning=true;
 				continue;
 			}
 

+ 0 - 2
tools/editor/io_plugins/editor_translation_import_plugin.cpp

@@ -425,7 +425,6 @@ Error EditorTranslationImportPlugin::import(const String& p_path, const Ref<Reso
 
 	ERR_FAIL_COND_V( !f, ERR_INVALID_PARAMETER );
 
-	bool first=false;
 	bool skip_first = from->get_option("skip_first");
 	int index = from->get_option("index");
 	index+=1;
@@ -439,7 +438,6 @@ Error EditorTranslationImportPlugin::import(const String& p_path, const Ref<Reso
 
 	while(line.size()>1) {
 
-
 		if (!skip_first) {
 			ERR_FAIL_INDEX_V(index,line.size(),ERR_INVALID_DATA );
 			translation->add_message(line[0].strip_edges(),line[index]);

+ 0 - 1
tools/editor/output_strings.cpp

@@ -32,7 +32,6 @@
 
 void OutputStrings::update_scrollbars() {
 
-	Size2 size = get_size();
 	Size2 hmin = h_scroll->get_combined_minimum_size();
 	Size2 vmin = v_scroll->get_combined_minimum_size();
 

+ 0 - 1
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);

+ 0 - 2
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"));
 

+ 1 - 10
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;

+ 0 - 11
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]={
 

+ 0 - 2
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++) {
 
 

+ 0 - 2
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();

+ 3 - 9
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 {

+ 0 - 2
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++) {
 
 

+ 0 - 2
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++) {
 
 

+ 0 - 1
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

+ 0 - 2
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++) {
 
 

+ 2 - 8
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;
 					}
 

+ 3 - 2
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);
 

+ 1 - 2
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++) {

+ 0 - 75
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;
 }
 

+ 0 - 1
tools/editor/project_export.cpp

@@ -431,7 +431,6 @@ void ProjectExportDialog::_validate_platform() {
 
 void ProjectExportDialog::_export_mode_changed(int p_idx) {
 
-	bool do_all = p_idx==0;
 	if (EditorImportExport::get_singleton()->get_export_filter()==p_idx)
 		return;
 	EditorImportExport::get_singleton()->set_export_filter(EditorImportExport::ExportFilter(p_idx));

+ 0 - 3
tools/editor/project_manager.cpp

@@ -823,9 +823,6 @@ void ProjectManager::_bind_methods() {
 
 ProjectManager::ProjectManager() {
 
-	int margin = get_constant("margin","Dialogs");
-	int button_margin = get_constant("button_margin","Dialogs");
-
 	// load settings
 	if (!EditorSettings::get_singleton())
 		EditorSettings::create();

+ 1 - 5
tools/editor/property_editor.cpp

@@ -389,7 +389,6 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
 				List<String> names;
 				names.push_back("value:");
 				config_value_editors(1,1,50,names);
-				Vector3 vec=v;
 				value_editor[0]->set_text( String::num(v) );
 			}
 
@@ -436,7 +435,6 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty
 				List<String> names;
 				names.push_back("string:");
 				config_value_editors(1,1,50,names);
-				Vector3 vec=v;
 				value_editor[0]->set_text( v );
 			}
 
@@ -3345,7 +3343,6 @@ void PropertyEditor::update_tree() {
 				String type;
 				if (p.hint==PROPERTY_HINT_RESOURCE_TYPE)
 					type=p.hint_string;
-				bool notnil=false;
 
 				if (obj->get( p.name ).get_type() == Variant::NIL || obj->get( p.name ).operator RefPtr().is_null()) {
 					item->set_text(1,"<null>");
@@ -3368,8 +3365,7 @@ void PropertyEditor::update_tree() {
 
 					} else {
 						item->set_text(1,"<"+res->get_type()+">");
-					};
-					notnil=true;
+					}
 
 					if (has_icon(res->get_type(),"EditorIcons")) {
 						type=res->get_type();

+ 3 - 24
tools/editor/scene_tree_dock.cpp

@@ -382,11 +382,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
 				ERR_FAIL_COND(!top_node->get_parent());
 				ERR_FAIL_COND(!bottom_node->get_parent());
 
-				int top_node_pos = top_node->get_index();
 				int bottom_node_pos = bottom_node->get_index();
-
-				int top_node_pos_next = top_node_pos + (MOVING_DOWN ? 1 : -1);
-				int bottom_node_pos_next = bottom_node_pos + (MOVING_DOWN ? 1 : -1);
+				int top_node_pos_next = top_node->get_index() + (MOVING_DOWN ? 1 : -1);
 
 				editor_data->get_undo_redo().add_do_method(top_node->get_parent(), "move_child", top_node, top_node_pos_next);
 				editor_data->get_undo_redo().add_undo_method(bottom_node->get_parent(), "move_child", bottom_node, bottom_node_pos);
@@ -1108,17 +1105,8 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec
 				editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to<Node2D>()->get_global_transform());
 			if (node->cast_to<Spatial>())
 				editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to<Spatial>()->get_global_transform());
-			if (node->cast_to<Control>()) {
-				bool can_do_it=false;
-				Control *c=node->cast_to<Control>();
-				if (c->get_parent()->cast_to<Container>())
-					can_do_it=false;
-				for(int i=0;i<4;i++) {
-					if (c->get_anchor(Margin(i))!=ANCHOR_BEGIN)
-						can_do_it=false;
-				}
+			if (node->cast_to<Control>())
 				editor_data->get_undo_redo().add_do_method(node,"set_global_pos",node->cast_to<Control>()->get_global_pos());
-			}
 		}
 
 		editor_data->get_undo_redo().add_do_method(this,"_set_owners",edited_scene,owners);
@@ -1161,17 +1149,8 @@ void SceneTreeDock::_do_reparent(Node* p_new_parent,int p_position_in_parent,Vec
 				editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to<Node2D>()->get_transform());
 			if (node->cast_to<Spatial>())
 				editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to<Spatial>()->get_transform());
-			if (node->cast_to<Control>()) {
-				bool can_do_it=false;
-				Control *c=node->cast_to<Control>();
-				if (c->get_parent()->cast_to<Container>())
-					can_do_it=false;
-				for(int i=0;i<4;i++) {
-					if (c->get_anchor(Margin(i))!=ANCHOR_BEGIN)
-						can_do_it=false;
-				}
+			if (node->cast_to<Control>())
 				editor_data->get_undo_redo().add_undo_method(node,"set_pos",node->cast_to<Control>()->get_pos());
-			}
 		}
 
 

+ 2 - 55
tools/editor/scenes_dock.cpp

@@ -37,6 +37,8 @@
 
 #include "editor_settings.h"
 #include "scene/main/viewport.h"
+
+
 bool ScenesDock::_create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_dir) {
 
 
@@ -57,61 +59,6 @@ bool ScenesDock::_create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_di
 		item->select(0);
 	}
 
-
-	//item->set_custom_bg_color(0,get_color("prop_subsection","Editor"));
-
-	bool has_items=false;
-
-	for(int i=0;i<p_dir->get_subdir_count();i++) {
-
-		if (_create_tree(item,p_dir->get_subdir(i)))
-			has_items=true;
-	}
-#if 0
-	for (int i=0;i<p_dir->get_file_count();i++) {
-
-		String file_name = p_dir->get_file(i);
-		String file_path = p_dir->get_file_path(i);
-
-		// ScenesDockFilter::FILTER_PATH
-		String search_from = file_path.right(6); // trim "res://"
-		if (file_filter == ScenesDockFilter::FILTER_NAME)
-			 search_from = file_name;
-		else if (file_filter == ScenesDockFilter::FILTER_FOLDER)
-			search_from = file_path.right(6).get_base_dir();
-
-		if (search_term!="" && search_from.findn(search_term)==-1)
-			continue;
-
-		bool isfave = favorites.has(file_path);
-		if (button_favorite->is_pressed() && !isfave)
-			continue;
-
-		TreeItem *fitem = tree->create_item(item);
-		fitem->set_cell_mode(0,TreeItem::CELL_MODE_CHECK);
-		fitem->set_editable(0,true);
-		fitem->set_checked(0,isfave);
-		fitem->set_text(0,file_name);
-
-		Ref<Texture> icon = get_icon( (has_icon(p_dir->get_file_type(i),"EditorIcons")?p_dir->get_file_type(i):String("Object")),"EditorIcons");
-		fitem->set_icon(0, icon );
-
-
-		fitem->set_metadata(0,file_path);
-		//if (p_dir->files[i]->icon.is_valid()) {
-//			fitem->set_icon(0,p_dir->files[i]->icon);
-//		}
-		has_items=true;
-
-	}
-#endif
-	/*if (!has_items) {
-
-		memdelete(item);
-		return false;
-
-	}*/
-
 	return true;
 }
 

+ 0 - 1
tools/editor/script_editor_debugger.cpp

@@ -819,7 +819,6 @@ void ScriptEditorDebugger::_performance_draw() {
 	if(which.empty())
 		return;
 
-	Color graph_color=get_color("font_color","TextEdit");
 	Ref<StyleBox> graph_sb = get_stylebox("normal","TextEdit");
 	Ref<Font> graph_font = get_font("font","TextEdit");
 

+ 0 - 78
tools/editor/spatial_editor_gizmos.cpp

@@ -424,16 +424,11 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
 		}
 		Transform ti=t.affine_inverse();
 
-		Vector3 ray_from=ti.xform(p_camera->project_ray_origin(p_point));
-		Vector3 ray_dir=t.basis.xform_inv(p_camera->project_ray_normal(p_point)).normalized();
-		Vector3 ray_to = ray_from+ray_dir*4096;
 
 		float min_d=1e20;
 		int idx=-1;
 
 		for(int i=0;i<secondary_handles.size();i++) {
-#if 1
-
 
 			Vector3 hpos = t.xform(secondary_handles[i]);
 			Vector2 p = p_camera->unproject_position(hpos);
@@ -449,31 +444,7 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
 					idx=i+handles.size();
 
 				}
-
-			}
-
-#else
-			AABB aabb;
-			aabb.pos=Vector3(-1,-1,-1)*HANDLE_HALF_SIZE;
-			aabb.size=aabb.pos*-2;
-			aabb.pos+=secondary_handles[i];
-
-
-			Vector3 rpos,rnorm;
-
-			if (aabb.intersects_segment(ray_from,ray_to,&rpos,&rnorm)) {
-
-				real_t dp = ray_dir.dot(rpos);
-				if (dp<min_d) {
-
-					r_pos=t.xform(rpos);
-					r_normal=ti.basis.xform_inv(rnorm).normalized();
-					min_d=dp;
-					idx=i+handles.size();
-
-				}
 			}
-#endif
 		}
 
 		if (p_sec_first && idx!=-1) {
@@ -486,9 +457,6 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
 
 		for(int i=0;i<handles.size();i++) {
 
-#if 1
-
-
 			Vector3 hpos = t.xform(handles[i]);
 			Vector2 p = p_camera->unproject_position(hpos);
 			if (p.distance_to(p_point)<SpatialEditorGizmos::singleton->handle_t->get_width()*0.6) {
@@ -503,32 +471,7 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
 					idx=i;
 
 				}
-
-			}
-
-#else
-
-			AABB aabb;
-			aabb.pos=Vector3(-1,-1,-1)*HANDLE_HALF_SIZE;
-			aabb.size=aabb.pos*-2;
-			aabb.pos+=handles[i];
-
-
-			Vector3 rpos,rnorm;
-
-			if (aabb.intersects_segment(ray_from,ray_to,&rpos,&rnorm)) {
-
-				real_t dp = ray_dir.dot(rpos);
-				if (dp<min_d) {
-
-					r_pos=t.xform(rpos);
-					r_normal=ti.basis.xform_inv(rnorm).normalized();
-					min_d=dp;
-					idx=i;
-
-				}
 			}
-#endif
 		}
 
 		if (idx>=0) {
@@ -612,9 +555,6 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
 		Vector3 ray_dir=ai.basis.xform(p_camera->project_ray_normal(p_point)).normalized();
 		Vector3 rpos,rnorm;
 
-#if 1
-
-
 
 		if (collision_mesh->intersect_ray(ray_from,ray_dir,rpos,rnorm)) {
 
@@ -622,16 +562,6 @@ bool EditorSpatialGizmo::intersect_ray(const Camera *p_camera,const Point2& p_po
 			r_normal=gt.basis.xform(rnorm).normalized();
 			return true;
 		}
-#else
-
-		if (collision_mesh->intersect_segment(ray_from,ray_from+ray_dir*4906.0,rpos,rnorm)) {
-
-			r_pos=gt.xform(rpos);
-			r_normal=gt.basis.xform(rnorm).normalized();
-			return true;
-		}
-
-#endif
 	}
 
 	return false;
@@ -2250,7 +2180,6 @@ void VisibilityNotifierGizmo::set_handle(int p_idx,Camera *p_camera, const Point
 	if (d<0.001)
 		d=0.001;
 
-	Vector3 he = aabb.size;
 	aabb.pos[p_idx]=(aabb.pos[p_idx]+aabb.size[p_idx]*0.5)-d;
 	aabb.size[p_idx]=d*2;
 	notifier->set_aabb(aabb);
@@ -2456,8 +2385,6 @@ void HingeJointSpatialGizmo::redraw() {
 	if (p3d->get_flag(HingeJoint::FLAG_USE_LIMIT) && ll<ul) {
 
 		const int points = 32;
-		float step = (ul-ll)/points;
-
 
 		for(int i=0;i<points;i++) {
 
@@ -2573,8 +2500,6 @@ void SliderJointSpatialGizmo::redraw() {
 	if (ll<ul) {
 
 		const int points = 32;
-		float step = (ul-ll)/points;
-
 
 		for(int i=0;i<points;i++) {
 
@@ -2641,7 +2566,6 @@ SliderJointSpatialGizmo::SliderJointSpatialGizmo(SliderJoint* p_p3d) {
 void ConeTwistJointSpatialGizmo::redraw() {
 
 	clear();
-	float cs = 0.25;
 	Vector<Vector3> points;
 
 	float r = 1.0;
@@ -2837,8 +2761,6 @@ void Generic6DOFJointSpatialGizmo::redraw() {
 		if (enable_ang && ll<=ul) {
 
 			const int points = 32;
-			float step = (ul-ll)/points;
-
 
 			for(int i=0;i<points;i++) {