diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-06-06 22:06:58 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-06-06 22:06:58 -0300 |
commit | b524b40fdc5325c840192ce92dbed8108ccef2d9 (patch) | |
tree | ec7f74db082b4b91f7614ed4391c53bc73b60bfd /tools/editor | |
parent | 14c4c1b568ffa40a179332fbc77e9b52c6bdf514 (diff) |
-fixed many memory initialization issues
-fixed deadlock on previews thread
-fixed compilation errors on unix
Diffstat (limited to 'tools/editor')
9 files changed, 28 insertions, 13 deletions
diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp index e3508e4493..b1bbd71f7b 100644 --- a/tools/editor/editor_file_dialog.cpp +++ b/tools/editor/editor_file_dialog.cpp @@ -348,7 +348,6 @@ void EditorFileDialog::_push_history() { } } - void EditorFileDialog::_item_dc_selected(int p_item) { @@ -672,7 +671,7 @@ void EditorFileDialog::set_current_dir(const String& p_dir) { dir_access->change_dir(p_dir); update_dir(); invalidate(); - _push_history(); + //_push_history(); } @@ -852,8 +851,8 @@ void EditorFileDialog::_favorite_move_up(){ if (current>0 && current<favorites->get_item_count()) { Vector<String> favorited = EditorSettings::get_singleton()->get_favorite_dirs(); - int a_idx=favorited.find(favorites->get_item_metadata(current-1)); - int b_idx=favorited.find(favorites->get_item_metadata(current)); + int a_idx=favorited.find(String(favorites->get_item_metadata(current-1))); + int b_idx=favorited.find(String(favorites->get_item_metadata(current))); if (a_idx==-1 || b_idx==-1) return; @@ -873,8 +872,8 @@ void EditorFileDialog::_favorite_move_down(){ if (current>=0 && current<favorites->get_item_count()-1) { Vector<String> favorited = EditorSettings::get_singleton()->get_favorite_dirs(); - int a_idx=favorited.find(favorites->get_item_metadata(current+1)); - int b_idx=favorited.find(favorites->get_item_metadata(current)); + int a_idx=favorited.find(String(favorites->get_item_metadata(current+1))); + int b_idx=favorited.find(String(favorites->get_item_metadata(current))); if (a_idx==-1 || b_idx==-1) return; @@ -1143,6 +1142,7 @@ EditorFileDialog::EditorFileDialog() { show_hidden_files=true; display_mode=DISPLAY_THUMBNAILS; + local_history_pos=0; VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); diff --git a/tools/editor/editor_resource_preview.cpp b/tools/editor/editor_resource_preview.cpp index 86f6661e8a..f684b49a2c 100644 --- a/tools/editor/editor_resource_preview.cpp +++ b/tools/editor/editor_resource_preview.cpp @@ -98,7 +98,7 @@ void EditorResourcePreview::_thread() { if (queue.size()) { - //print_line("pop from queue"); + QueueItem item = queue.front()->get(); queue.pop_front(); @@ -106,6 +106,7 @@ void EditorResourcePreview::_thread() { Ref<Texture> texture; + //print_line("pop from queue "+item.path); uint64_t modtime = FileAccess::get_modified_time(item.path); int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); @@ -206,7 +207,7 @@ void EditorResourcePreview::queue_resource_preview(const String& p_path, Object* } - //print_line("send to thread"); + //print_line("send to thread "+p_path); QueueItem item; item.function=p_receiver_func; item.id=p_receiver->get_instance_ID(); diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp index a44eae4d3f..4f7ec1839a 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -600,9 +600,9 @@ EditorTextureImportDialog::EditorTextureImportDialog(EditorTextureImportPlugin* file_select->set_access(EditorFileDialog::ACCESS_FILESYSTEM); add_child(file_select); if (!large) - file_select->set_mode(FileDialog::MODE_OPEN_FILES); + file_select->set_mode(EditorFileDialog::MODE_OPEN_FILES); else - file_select->set_mode(FileDialog::MODE_OPEN_FILE); + file_select->set_mode(EditorFileDialog::MODE_OPEN_FILE); file_select->connect("files_selected", this,"_choose_files"); file_select->connect("file_selected", this,"_choose_file"); diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp index a533c6aa1e..8eea723126 100644 --- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp @@ -380,6 +380,7 @@ void CollisionPolygon2DEditor::_bind_methods() { CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) { + node=NULL; canvas_item_editor=NULL; editor=p_editor; undo_redo = editor->get_undo_redo(); diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_editor_plugin.cpp index de40727f1b..381cfd74ab 100644 --- a/tools/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/tools/editor/plugins/collision_polygon_editor_plugin.cpp @@ -533,6 +533,7 @@ void CollisionPolygonEditor::_bind_methods() { CollisionPolygonEditor::CollisionPolygonEditor(EditorNode *p_editor) { + node=NULL; editor=p_editor; undo_redo = editor->get_undo_redo(); diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/tools/editor/plugins/editor_preview_plugins.cpp index 9532c6b9e9..a77ba9a605 100644 --- a/tools/editor/plugins/editor_preview_plugins.cpp +++ b/tools/editor/plugins/editor_preview_plugins.cpp @@ -63,14 +63,15 @@ EditorTexturePreviewPlugin::EditorTexturePreviewPlugin() { Ref<Texture> EditorPackedScenePreviewPlugin::_gen_from_imd(Ref<ResourceImportMetadata> p_imd) { - if (p_imd.is_null()) + if (p_imd.is_null()) { return Ref<Texture>(); + } if (!p_imd->has_option("thumbnail")) return Ref<Texture>(); Variant tn = p_imd->get_option("thumbnail"); - print_line(Variant::get_type_name(tn.get_type())); + //print_line(Variant::get_type_name(tn.get_type())); DVector<uint8_t> thumbnail = tn; int len = thumbnail.size(); diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp index bf882857d9..757b5327dd 100644 --- a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp +++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -411,6 +411,7 @@ void LightOccluder2DEditor::_bind_methods() { LightOccluder2DEditor::LightOccluder2DEditor(EditorNode *p_editor) { + node=NULL; canvas_item_editor=NULL; editor=p_editor; undo_redo = editor->get_undo_redo(); diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp index bc15741d0f..fa1f614413 100644 --- a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -459,7 +459,7 @@ void NavigationPolygonEditor::_bind_methods() { } NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) { - + node=NULL; canvas_item_editor=NULL; editor=p_editor; undo_redo = editor->get_undo_redo(); diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 0b3f3e0626..77663f39c0 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -2216,6 +2216,14 @@ void SpatialEditorViewport::reset() { SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, EditorNode *p_editor, int p_index) { + _edit.mode=TRANSFORM_NONE; + _edit.plane=TRANSFORM_VIEW; + _edit.edited_gizmo=0; + _edit.snap=1; + _edit.gizmo_handle=0; + + + index=p_index; editor=p_editor; editor_selection=editor->get_editor_selection();; @@ -3615,6 +3623,8 @@ void SpatialEditor::_default_light_angle_input(const InputEvent& p_event) { SpatialEditor::SpatialEditor(EditorNode *p_editor) { + gizmo.visible=true; + gizmo.scale=1.0; viewport_environment = Ref<Environment>( memnew( Environment ) ); undo_redo=p_editor->get_undo_redo(); |