diff --git a/drivers/chibi/cp_envelope.cpp b/drivers/chibi/cp_envelope.cpp index fab8a68adae..9892b6d4b05 100644 --- a/drivers/chibi/cp_envelope.cpp +++ b/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]; diff --git a/drivers/chibi/cp_loader_xm.cpp b/drivers/chibi/cp_loader_xm.cpp index 8ab6abc6507..bff8615a32a 100644 --- a/drivers/chibi/cp_loader_xm.cpp +++ b/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); diff --git a/drivers/chibi/cp_player_data_events.cpp b/drivers/chibi/cp_player_data_events.cpp index 8122988516a..fb5090461b6 100644 --- a/drivers/chibi/cp_player_data_events.cpp +++ b/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; diff --git a/drivers/openssl/stream_peer_openssl.cpp b/drivers/openssl/stream_peer_openssl.cpp index 9349df37931..aa3d8a8f7f9 100644 --- a/drivers/openssl/stream_peer_openssl.cpp +++ b/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; diff --git a/drivers/speex/audio_stream_speex.cpp b/drivers/speex/audio_stream_speex.cpp index 79f3e58ac02..3aa80fd0b94 100644 --- a/drivers/speex/audio_stream_speex.cpp +++ b/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*/ diff --git a/drivers/theora/video_stream_theora.cpp b/drivers/theora/video_stream_theora.cpp index fa2a79dc7b8..1f3832ec16c 100644 --- a/drivers/theora/video_stream_theora.cpp +++ b/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::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; }; } diff --git a/platform/bb10/export/export.cpp b/platform/bb10/export/export.cpp index 7cb0aa36078..14d87aef410 100644 --- a/platform/bb10/export/export.cpp +++ b/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); diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index 7582162b72a..c7b78b980f9 100644 --- a/tools/editor/animation_editor.cpp +++ b/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 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 remove_icon = get_icon("Remove","EditorIcons"); Ref move_up_icon = get_icon("MoveUp","EditorIcons"); Ref 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()); diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp index ad2eb57f004..ef667b75e14 100644 --- a/tools/editor/dependency_editor.cpp +++ b/tools/editor/dependency_editor.cpp @@ -80,8 +80,6 @@ void DependencyEditor::_fix_and_find(EditorFileSystemDirectory *efsd, Mapget_file_path(i); - Map &ss = candidates[file]; - for(Map::Element *E=candidates[file].front();E;E=E->next()) { @@ -420,7 +418,6 @@ void DependencyRemoveDialog::show(const Vector &to_erase) { exist=false; owners->clear(); files.clear(); - TreeItem *root=owners->create_item(); for(int i=0;i& p_resource) { void EditorNode::save_resource_as(const Ref& 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 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 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); diff --git a/tools/editor/editor_path.cpp b/tools/editor/editor_path.cpp index 4cf98e832cd..6b804b6a240 100644 --- a/tools/editor/editor_path.cpp +++ b/tools/editor/editor_path.cpp @@ -38,7 +38,6 @@ void EditorPath::_notification(int p_what) { RID ci=get_canvas_item(); Ref label_font = get_font("font","Label"); - Color label_color = get_color("font_color","Label"); Size2i size = get_size(); Ref sn = get_icon("SmallNext","EditorIcons"); diff --git a/tools/editor/import_settings.cpp b/tools/editor/import_settings.cpp index dfaeca03dbd..53bbd2a878f 100644 --- a/tools/editor/import_settings.cpp +++ b/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<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;iget_item_count();i++) { - - popup->set_item_checked(i,flags&(1<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 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; } diff --git a/tools/editor/output_strings.cpp b/tools/editor/output_strings.cpp index f1b49d23267..a6126466c47 100644 --- a/tools/editor/output_strings.cpp +++ b/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(); diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index 203564e6121..98ba25b482c 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& p_resource) { void AnimationPlayerEditor::_animation_save_as(const Ref& 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 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 a381ec46783..24914e4bc59 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 style = get_stylebox("panel","PopupMenu"); Ref 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 style = get_stylebox("panel","PopupMenu"); Ref 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 1962f81e871..6a88ba4cbe8 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 &p_octree,DVectorget_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 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 caa09fba353..db500cdcdf9 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 &selection = editor_selection->get_selection(); - CanvasItem *single_item=NULL; - bool pivot_found=false; for(Map::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 5ed9f8ab5fb..95364e89214 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 handle= get_icon("EditorHandle","EditorIcons"); - int len = poly.size(); - for(int i=0;iget_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 a057e6c2a1e..b1bce604844 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 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 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 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 EditorSamplePreviewPlugin::generate(const RES& p_from) { for(int j=0;jget_canvas_transform() * node->get_global_transform(); Ref handle= get_icon("EditorHandle","EditorIcons"); - int len = poly.size(); - for(int i=0;iget_navigation_polygon()->get_outline(j)); } - int len = poly.size(); - for(int i=0;iget_canvas_transform() * node->get_global_transform(); Ref handle= get_icon("EditorHandle","EditorIcons"); - int len = poly.size(); - for(int i=0;i& p_sample,Ref& p_sample,Ref88) 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& p_sample,Refadd_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 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 dea2fe4833c..375220051c5 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;iset_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;iget_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(); @@ -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; } diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index 3f82199fc30..103962716bc 100644 --- a/tools/editor/project_export.cpp +++ b/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)); diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index 497ff43a4d0..52f6d1dd9cd 100644 --- a/tools/editor/project_manager.cpp +++ b/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(); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index 4b3f245e44e..7816dd9bc79 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -389,7 +389,6 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty List 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 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,""); @@ -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(); diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 0d0d9ff9532..4526fa26aa1 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/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()->get_global_transform()); if (node->cast_to()) editor_data->get_undo_redo().add_do_method(node,"set_global_transform",node->cast_to()->get_global_transform()); - if (node->cast_to()) { - bool can_do_it=false; - Control *c=node->cast_to(); - if (c->get_parent()->cast_to()) - 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()) editor_data->get_undo_redo().add_do_method(node,"set_global_pos",node->cast_to()->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()->get_transform()); if (node->cast_to()) editor_data->get_undo_redo().add_undo_method(node,"set_transform",node->cast_to()->get_transform()); - if (node->cast_to()) { - bool can_do_it=false; - Control *c=node->cast_to(); - if (c->get_parent()->cast_to()) - 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()) editor_data->get_undo_redo().add_undo_method(node,"set_pos",node->cast_to()->get_pos()); - } } diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp index fa7c898f914..c46178345c6 100644 --- a/tools/editor/scenes_dock.cpp +++ b/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;iget_subdir_count();i++) { - - if (_create_tree(item,p_dir->get_subdir(i))) - has_items=true; - } -#if 0 - for (int i=0;iget_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 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; } diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index 6d8f54d88ff..fc746bc21df 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/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 graph_sb = get_stylebox("normal","TextEdit"); Ref graph_font = get_font("font","TextEdit"); diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp index 1ca62d3a633..edc2fc513d9 100644 --- a/tools/editor/spatial_editor_gizmos.cpp +++ b/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;iunproject_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 (dpunproject_position(hpos); if (p.distance_to(p_point)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=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 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