From 3f335ce3d446372eeb9ed87f7e117099c4d2dd6a Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 11 Jun 2019 15:43:37 -0300 Subject: [PATCH] Texture refactor -Texture renamed to Texture2D -TextureLayered as base now inherits 2Darray, cubemap and cubemap array -Removed all references to flags in textures (they will go in the shader) -Texture3D gone for now (will come back later done properly) -Create base rasterizer for RenderDevice, RasterizerRD --- drivers/SCsub | 4 +- drivers/dummy/rasterizer_dummy.h | 2 +- drivers/dummy/texture_loader_dummy.cpp | 2 +- drivers/gles2/rasterizer_canvas_gles2.h | 2 +- drivers/gles2/rasterizer_gles2.h | 2 +- drivers/gles2/rasterizer_storage_gles2.cpp | 2 +- drivers/gles2/rasterizer_storage_gles2.h | 4 +- drivers/gles3/rasterizer_canvas_gles3.h | 2 +- drivers/gles3/rasterizer_gles3.h | 2 +- drivers/gles3/rasterizer_storage_gles3.cpp | 2 +- drivers/gles3/rasterizer_storage_gles3.h | 4 +- editor/animation_bezier_editor.cpp | 6 +- editor/animation_bezier_editor.h | 6 +- editor/animation_track_editor.cpp | 56 +- editor/animation_track_editor.h | 14 +- editor/animation_track_editor_plugins.cpp | 20 +- editor/animation_track_editor_plugins.h | 4 +- editor/code_editor.cpp | 4 +- editor/code_editor.h | 2 +- editor/connections_dialog.cpp | 2 +- editor/create_dialog.h | 2 +- editor/dependency_editor.cpp | 12 +- editor/doc/doc_data.cpp | 2 +- editor/editor_asset_installer.cpp | 4 +- editor/editor_audio_buses.cpp | 6 +- editor/editor_audio_buses.h | 2 +- editor/editor_data.cpp | 2 +- editor/editor_data.h | 4 +- editor/editor_export.cpp | 4 +- editor/editor_export.h | 8 +- editor/editor_file_dialog.cpp | 22 +- editor/editor_file_dialog.h | 8 +- editor/editor_help.cpp | 2 +- editor/editor_help_search.cpp | 4 +- editor/editor_help_search.h | 2 +- editor/editor_inspector.cpp | 16 +- editor/editor_inspector.h | 2 +- editor/editor_log.cpp | 6 +- editor/editor_node.cpp | 34 +- editor/editor_node.h | 10 +- editor/editor_path.cpp | 4 +- editor/editor_plugin.cpp | 18 +- editor/editor_plugin.h | 6 +- editor/editor_profiler.cpp | 4 +- editor/editor_properties.cpp | 24 +- editor/editor_properties.h | 2 +- editor/editor_resource_preview.cpp | 20 +- editor/editor_resource_preview.h | 12 +- editor/editor_run_native.cpp | 2 +- editor/editor_spin_slider.cpp | 6 +- editor/editor_themes.cpp | 9 +- editor/filesystem_dock.cpp | 26 +- editor/filesystem_dock.h | 6 +- editor/groups_editor.cpp | 2 +- editor/import/editor_import_collada.cpp | 8 +- editor/import/editor_scene_importer_gltf.cpp | 10 +- editor/import/editor_scene_importer_gltf.h | 4 +- .../resource_importer_layered_texture.cpp | 144 ++- .../resource_importer_layered_texture.h | 24 +- editor/import/resource_importer_obj.cpp | 8 +- editor/import/resource_importer_texture.cpp | 97 +- editor/import/resource_importer_texture.h | 21 +- .../resource_importer_texture_atlas.cpp | 6 +- editor/inspector_dock.cpp | 4 +- editor/pane_drag.cpp | 4 +- editor/plugins/abstract_polygon_2d_editor.cpp | 4 +- .../animation_blend_space_1d_editor.cpp | 4 +- .../animation_blend_space_2d_editor.cpp | 4 +- .../plugins/animation_player_editor_plugin.h | 2 +- .../animation_state_machine_editor.cpp | 22 +- .../plugins/asset_library_editor_plugin.cpp | 6 +- editor/plugins/asset_library_editor_plugin.h | 12 +- editor/plugins/canvas_item_editor_plugin.cpp | 28 +- editor/plugins/canvas_item_editor_plugin.h | 6 +- .../collision_polygon_editor_plugin.cpp | 4 +- .../collision_shape_2d_editor_plugin.cpp | 2 +- editor/plugins/curve_editor_plugin.cpp | 6 +- editor/plugins/curve_editor_plugin.h | 2 +- editor/plugins/editor_preview_plugins.cpp | 87 +- editor/plugins/editor_preview_plugins.h | 22 +- editor/plugins/item_list_editor_plugin.cpp | 2 +- editor/plugins/item_list_editor_plugin.h | 16 +- editor/plugins/material_editor_plugin.cpp | 4 +- editor/plugins/mesh_library_editor_plugin.cpp | 2 +- editor/plugins/particles_2d_editor_plugin.cpp | 6 +- editor/plugins/particles_editor_plugin.cpp | 2 - editor/plugins/path_2d_editor_plugin.cpp | 8 +- editor/plugins/polygon_2d_editor_plugin.cpp | 4 +- editor/plugins/root_motion_editor_plugin.cpp | 6 +- editor/plugins/script_editor_plugin.cpp | 8 +- editor/plugins/script_editor_plugin.h | 2 +- editor/plugins/script_text_editor.cpp | 4 +- editor/plugins/script_text_editor.h | 2 +- editor/plugins/spatial_editor_plugin.cpp | 18 +- editor/plugins/spatial_editor_plugin.h | 2 +- editor/plugins/sprite_editor_plugin.cpp | 4 +- .../plugins/sprite_frames_editor_plugin.cpp | 28 +- editor/plugins/text_editor.cpp | 2 +- editor/plugins/text_editor.h | 2 +- editor/plugins/texture_editor_plugin.cpp | 8 +- editor/plugins/texture_editor_plugin.h | 6 +- .../plugins/texture_region_editor_plugin.cpp | 8 +- editor/plugins/theme_editor_plugin.cpp | 12 +- editor/plugins/tile_map_editor_plugin.cpp | 6 +- editor/plugins/tile_set_editor_plugin.cpp | 26 +- editor/plugins/tile_set_editor_plugin.h | 8 +- .../plugins/visual_shader_editor_plugin.cpp | 5 +- editor/project_manager.cpp | 12 +- editor/property_editor.cpp | 4 +- editor/property_selector.cpp | 6 +- editor/pvrtc_compress.cpp | 4 +- editor/quick_open.cpp | 12 +- editor/quick_open.h | 4 +- editor/scene_tree_dock.cpp | 2 +- editor/scene_tree_editor.cpp | 4 +- editor/script_create_dialog.cpp | 4 +- editor/script_editor_debugger.cpp | 6 +- main/main.cpp | 2 +- main/tests/test_physics_2d.cpp | 12 +- modules/assimp/import_utils.h | 16 +- modules/dds/texture_loader_dds.cpp | 2 +- modules/etc/texture_loader_pkm.cpp | 2 +- .../gdnative/arvr/arvr_interface_gdnative.cpp | 3 +- .../videodecoder/video_stream_gdnative.cpp | 10 +- .../videodecoder/video_stream_gdnative.h | 2 +- modules/gridmap/grid_map_editor_plugin.cpp | 2 +- modules/opensimplex/noise_texture.cpp | 26 +- modules/opensimplex/noise_texture.h | 11 +- modules/pvr/texture_loader_pvr.cpp | 11 +- modules/theora/video_stream_theora.cpp | 8 +- modules/theora/video_stream_theora.h | 2 +- .../visual_script/visual_script_editor.cpp | 20 +- modules/visual_script/visual_script_editor.h | 4 +- .../visual_script_property_selector.cpp | 4 +- modules/webm/video_stream_webm.cpp | 9 +- modules/webm/video_stream_webm.h | 2 +- platform/android/export/export.cpp | 4 +- platform/android/os_android.h | 2 +- platform/iphone/export/export.cpp | 2 +- platform/iphone/os_iphone.h | 2 +- platform/javascript/export/export.cpp | 8 +- platform/javascript/os_javascript.cpp | 2 +- platform/javascript/os_javascript.h | 2 +- platform/osx/export/export.cpp | 2 +- platform/osx/os_osx.h | 2 +- platform/osx/os_osx.mm | 2 +- platform/server/os_server.h | 2 +- platform/uwp/export/export.cpp | 2 +- platform/uwp/os_uwp.h | 2 +- platform/windows/os_windows.cpp | 2 +- platform/windows/os_windows.h | 2 +- platform/x11/os_x11.cpp | 6 +- platform/x11/os_x11.h | 2 +- scene/2d/animated_sprite.cpp | 10 +- scene/2d/animated_sprite.h | 22 +- scene/2d/canvas_item.cpp | 20 +- scene/2d/canvas_item.h | 16 +- scene/2d/cpu_particles_2d.cpp | 12 +- scene/2d/cpu_particles_2d.h | 12 +- scene/2d/light_2d.cpp | 6 +- scene/2d/light_2d.h | 6 +- scene/2d/line_2d.cpp | 6 +- scene/2d/line_2d.h | 6 +- scene/2d/mesh_instance_2d.cpp | 12 +- scene/2d/mesh_instance_2d.h | 12 +- scene/2d/multimesh_instance_2d.cpp | 12 +- scene/2d/multimesh_instance_2d.h | 12 +- scene/2d/particles_2d.cpp | 12 +- scene/2d/particles_2d.h | 12 +- scene/2d/path_texture.cpp | 12 +- scene/2d/path_texture.h | 18 +- scene/2d/polygon_2d.cpp | 10 +- scene/2d/polygon_2d.h | 6 +- scene/2d/sprite.cpp | 18 +- scene/2d/sprite.h | 12 +- scene/2d/tile_map.cpp | 4 +- scene/2d/touch_screen_button.cpp | 12 +- scene/2d/touch_screen_button.h | 12 +- scene/3d/baked_lightmap.cpp | 14 +- scene/3d/baked_lightmap.h | 6 +- scene/3d/immediate_geometry.cpp | 4 +- scene/3d/immediate_geometry.h | 4 +- scene/3d/sprite_3d.cpp | 11 +- scene/3d/sprite_3d.h | 6 +- scene/3d/voxel_light_baker.cpp | 4 +- scene/gui/button.cpp | 10 +- scene/gui/button.h | 6 +- scene/gui/check_box.cpp | 12 +- scene/gui/check_button.cpp | 8 +- scene/gui/color_picker.cpp | 2 +- scene/gui/control.cpp | 10 +- scene/gui/control.h | 6 +- scene/gui/file_dialog.cpp | 4 +- scene/gui/file_dialog.h | 2 +- scene/gui/gradient_edit.cpp | 1 - scene/gui/graph_edit.cpp | 6 +- scene/gui/graph_node.cpp | 20 +- scene/gui/graph_node.h | 6 +- scene/gui/item_list.cpp | 18 +- scene/gui/item_list.h | 16 +- scene/gui/line_edit.cpp | 10 +- scene/gui/line_edit.h | 6 +- scene/gui/nine_patch_rect.cpp | 6 +- scene/gui/nine_patch_rect.h | 6 +- scene/gui/option_button.cpp | 10 +- scene/gui/option_button.h | 6 +- scene/gui/popup_menu.cpp | 28 +- scene/gui/popup_menu.h | 18 +- scene/gui/rich_text_label.cpp | 6 +- scene/gui/rich_text_label.h | 4 +- scene/gui/scroll_bar.cpp | 18 +- scene/gui/slider.cpp | 10 +- scene/gui/spin_box.cpp | 4 +- scene/gui/spin_box.h | 2 +- scene/gui/split_container.cpp | 6 +- scene/gui/tab_container.cpp | 52 +- scene/gui/tab_container.h | 4 +- scene/gui/tabs.cpp | 66 +- scene/gui/tabs.h | 14 +- scene/gui/text_edit.cpp | 6 +- scene/gui/text_edit.h | 20 +- scene/gui/texture_button.cpp | 32 +- scene/gui/texture_button.h | 30 +- scene/gui/texture_progress.cpp | 20 +- scene/gui/texture_progress.h | 20 +- scene/gui/texture_rect.cpp | 6 +- scene/gui/texture_rect.h | 6 +- scene/gui/tree.cpp | 38 +- scene/gui/tree.h | 28 +- scene/gui/video_player.cpp | 4 +- scene/gui/video_player.h | 2 +- scene/main/viewport.cpp | 23 +- scene/main/viewport.h | 9 +- scene/register_scene_types.cpp | 12 +- .../resources/default_theme/default_theme.cpp | 12 +- scene/resources/default_theme/default_theme.h | 2 +- scene/resources/dynamic_font.cpp | 54 +- scene/resources/dynamic_font.h | 6 +- scene/resources/environment.cpp | 9 +- scene/resources/environment.h | 6 +- scene/resources/font.cpp | 10 +- scene/resources/font.h | 6 +- scene/resources/material.cpp | 42 +- scene/resources/material.h | 8 +- scene/resources/mesh_library.cpp | 10 +- scene/resources/mesh_library.h | 6 +- scene/resources/particles_material.cpp | 30 +- scene/resources/particles_material.h | 30 +- scene/resources/shader.cpp | 8 +- scene/resources/shader.h | 6 +- scene/resources/sky.cpp | 30 +- scene/resources/sky.h | 6 +- scene/resources/style_box.cpp | 12 +- scene/resources/style_box.h | 12 +- scene/resources/texture.cpp | 900 ++++++------------ scene/resources/texture.h | 349 ++----- scene/resources/theme.cpp | 14 +- scene/resources/theme.h | 10 +- scene/resources/tile_set.cpp | 16 +- scene/resources/tile_set.h | 12 +- scene/resources/video_stream.h | 3 +- scene/resources/visual_shader.h | 2 +- scene/resources/visual_shader_nodes.cpp | 92 +- scene/resources/visual_shader_nodes.h | 28 +- servers/camera/camera_feed.cpp | 26 +- servers/camera/camera_feed.h | 3 + servers/visual/SCsub | 2 + servers/visual/rasterizer/SCsub | 6 + .../visual/{ => rasterizer}/rasterizer.cpp | 0 servers/visual/{ => rasterizer}/rasterizer.h | 63 +- .../rasterizer/rasterizer_canvas_rd.cpp | 1 + .../visual/rasterizer/rasterizer_canvas_rd.h | 28 + servers/visual/rasterizer/rasterizer_rd.cpp | 7 + servers/visual/rasterizer/rasterizer_rd.h | 49 + .../rasterizer_scene_forward_rd.cpp | 1 + .../rasterizer/rasterizer_scene_forward_rd.h | 85 ++ .../rasterizer/rasterizer_storage_rd.cpp | 78 ++ .../visual/rasterizer/rasterizer_storage_rd.h | 579 +++++++++++ servers/visual/visual_server_canvas.h | 4 +- servers/visual/visual_server_globals.h | 2 +- servers/visual/visual_server_raster.h | 50 +- servers/visual/visual_server_scene.h | 2 +- servers/visual/visual_server_viewport.h | 2 +- servers/visual/visual_server_wrap_mt.cpp | 1 - servers/visual/visual_server_wrap_mt.h | 49 +- servers/visual_server.cpp | 68 +- servers/visual_server.h | 103 +- 287 files changed, 2829 insertions(+), 2540 deletions(-) create mode 100644 servers/visual/rasterizer/SCsub rename servers/visual/{ => rasterizer}/rasterizer.cpp (100%) rename servers/visual/{ => rasterizer}/rasterizer.h (95%) create mode 100644 servers/visual/rasterizer/rasterizer_canvas_rd.cpp create mode 100644 servers/visual/rasterizer/rasterizer_canvas_rd.h create mode 100644 servers/visual/rasterizer/rasterizer_rd.cpp create mode 100644 servers/visual/rasterizer/rasterizer_rd.h create mode 100644 servers/visual/rasterizer/rasterizer_scene_forward_rd.cpp create mode 100644 servers/visual/rasterizer/rasterizer_scene_forward_rd.h create mode 100644 servers/visual/rasterizer/rasterizer_storage_rd.cpp create mode 100644 servers/visual/rasterizer/rasterizer_storage_rd.h diff --git a/drivers/SCsub b/drivers/SCsub index 3ea7f23bc41..072addc2b3c 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -24,8 +24,8 @@ SConscript('winmidi/SCsub') # Graphics drivers if (env["platform"] != "server"): - SConscript('gles3/SCsub') - SConscript('gles2/SCsub') +# SConscript('gles3/SCsub') +# SConscript('gles2/SCsub') SConscript('vulkan/SCsub') SConscript('gl_context/SCsub') else: diff --git a/drivers/dummy/rasterizer_dummy.h b/drivers/dummy/rasterizer_dummy.h index 4521b9208d3..ea99655cb67 100644 --- a/drivers/dummy/rasterizer_dummy.h +++ b/drivers/dummy/rasterizer_dummy.h @@ -35,7 +35,7 @@ #include "core/rid_owner.h" #include "core/self_list.h" #include "scene/resources/mesh.h" -#include "servers/visual/rasterizer.h" +#include "servers/visual/rasterizer/rasterizer.h" #include "servers/visual_server.h" class RasterizerSceneDummy : public RasterizerScene { diff --git a/drivers/dummy/texture_loader_dummy.cpp b/drivers/dummy/texture_loader_dummy.cpp index 2dfc0afe78b..bf51d765275 100644 --- a/drivers/dummy/texture_loader_dummy.cpp +++ b/drivers/dummy/texture_loader_dummy.cpp @@ -74,7 +74,7 @@ void ResourceFormatDummyTexture::get_recognized_extensions(List *p_exten } bool ResourceFormatDummyTexture::handles_type(const String &p_type) const { - return ClassDB::is_parent_class(p_type, "Texture"); + return ClassDB::is_parent_class(p_type, "Texture2D"); } String ResourceFormatDummyTexture::get_resource_type(const String &p_path) const { diff --git a/drivers/gles2/rasterizer_canvas_gles2.h b/drivers/gles2/rasterizer_canvas_gles2.h index f6ae6a60c05..ce8761b448b 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.h +++ b/drivers/gles2/rasterizer_canvas_gles2.h @@ -32,7 +32,7 @@ #define RASTERIZERCANVASGLES2_H #include "rasterizer_storage_gles2.h" -#include "servers/visual/rasterizer.h" +#include "servers/visual/rasterizer/rasterizer.h" #include "shaders/canvas.glsl.gen.h" #include "shaders/lens_distorted.glsl.gen.h" diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index 9a5501f13d1..3d0debc0ed3 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -34,7 +34,7 @@ #include "rasterizer_canvas_gles2.h" #include "rasterizer_scene_gles2.h" #include "rasterizer_storage_gles2.h" -#include "servers/visual/rasterizer.h" +#include "servers/visual/rasterizer/rasterizer.h" class RasterizerGLES2 : public Rasterizer { diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index f929771c864..17f0565acff 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -1721,7 +1721,7 @@ void RasterizerStorageGLES2::shader_get_param_list(RID p_shader, List texture_owner; + mutable RID_PtrOwner texture_owner; Ref _get_gl_image_and_format(const Ref &p_image, Image::Format p_format, uint32_t p_flags, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool p_force_decompress) const; diff --git a/drivers/gles3/rasterizer_canvas_gles3.h b/drivers/gles3/rasterizer_canvas_gles3.h index 8e7a3ae873b..b25fbd97f0e 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.h +++ b/drivers/gles3/rasterizer_canvas_gles3.h @@ -32,7 +32,7 @@ #define RASTERIZERCANVASGLES3_H #include "rasterizer_storage_gles3.h" -#include "servers/visual/rasterizer.h" +#include "servers/visual/rasterizer/rasterizer.h" #include "shaders/canvas_shadow.glsl.gen.h" #include "shaders/lens_distorted.glsl.gen.h" diff --git a/drivers/gles3/rasterizer_gles3.h b/drivers/gles3/rasterizer_gles3.h index de7c1ab7e1d..6b5ce683a43 100644 --- a/drivers/gles3/rasterizer_gles3.h +++ b/drivers/gles3/rasterizer_gles3.h @@ -34,7 +34,7 @@ #include "rasterizer_canvas_gles3.h" #include "rasterizer_scene_gles3.h" #include "rasterizer_storage_gles3.h" -#include "servers/visual/rasterizer.h" +#include "servers/visual/rasterizer/rasterizer.h" class RasterizerGLES3 : public Rasterizer { diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 2a25c1d6cc3..0113c5335d2 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -2471,7 +2471,7 @@ void RasterizerStorageGLES3::shader_get_param_list(RID p_shader, List texture_owner; + mutable RID_PtrOwner texture_owner; Ref _get_gl_image_and_format(const Ref &p_image, Image::Format p_format, uint32_t p_flags, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool &r_srgb, bool p_force_decompress) const; diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index af2760e82bc..719e4af6b53 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -258,7 +258,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { draw_line(Point2(right_limit, 0), Point2(right_limit, get_size().height), linecolor); - Ref close_icon = get_icon("Close", "EditorIcons"); + Ref close_icon = get_icon("Close", "EditorIcons"); close_icon_rect.position = Vector2(get_size().width - close_icon->get_width() - hsep, hsep); close_icon_rect.size = close_icon->get_size(); @@ -290,7 +290,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { if (node) { int ofs = 0; - Ref icon = EditorNode::get_singleton()->get_object_icon(node, "Node"); + Ref icon = EditorNode::get_singleton()->get_object_icon(node, "Node"); h = MAX(h, icon->get_height()); @@ -391,7 +391,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { { //draw OTHER curves float scale = timeline->get_zoom_scale(); - Ref point = get_icon("KeyValue", "EditorIcons"); + Ref point = get_icon("KeyValue", "EditorIcons"); for (Map::Element *E = subtrack_colors.front(); E; E = E->next()) { _draw_track(E->key(), E->get()); diff --git a/editor/animation_bezier_editor.h b/editor/animation_bezier_editor.h index ef4e62231f4..2be388fd579 100644 --- a/editor/animation_bezier_editor.h +++ b/editor/animation_bezier_editor.h @@ -63,9 +63,9 @@ class AnimationBezierTrackEdit : public Control { Vector view_rects; - Ref bezier_icon; - Ref bezier_handle_icon; - Ref selected_icon; + Ref bezier_icon; + Ref bezier_handle_icon; + Ref selected_icon; Rect2 close_icon_rect; diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 2edfcced602..cc64db22ccf 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1442,11 +1442,11 @@ void AnimationTimelineEdit::_anim_loop_pressed() { int AnimationTimelineEdit::get_buttons_width() const { - Ref interp_mode = get_icon("TrackContinuous", "EditorIcons"); - Ref interp_type = get_icon("InterpRaw", "EditorIcons"); - Ref loop_type = get_icon("InterpWrapClamp", "EditorIcons"); - Ref remove_icon = get_icon("Remove", "EditorIcons"); - Ref down_icon = get_icon("select_arrow", "Tree"); + Ref interp_mode = get_icon("TrackContinuous", "EditorIcons"); + Ref interp_type = get_icon("InterpRaw", "EditorIcons"); + Ref loop_type = get_icon("InterpWrapClamp", "EditorIcons"); + Ref remove_icon = get_icon("Remove", "EditorIcons"); + Ref down_icon = get_icon("select_arrow", "Tree"); int total_w = interp_mode->get_width() + interp_type->get_width() + loop_type->get_width() + remove_icon->get_width(); total_w += (down_icon->get_width() + 4 * EDSCALE) * 4; @@ -1456,7 +1456,7 @@ int AnimationTimelineEdit::get_buttons_width() const { int AnimationTimelineEdit::get_name_limit() const { - Ref hsize_icon = get_icon("Hsize", "EditorIcons"); + Ref hsize_icon = get_icon("Hsize", "EditorIcons"); int limit = MAX(name_limit, add_track->get_minimum_size().width + hsize_icon->get_width()); @@ -1504,7 +1504,7 @@ void AnimationTimelineEdit::_notification(int p_what) { if (l <= 0) l = 0.001; //avoid crashor - Ref hsize_icon = get_icon("Hsize", "EditorIcons"); + Ref hsize_icon = get_icon("Hsize", "EditorIcons"); hsize_rect = Rect2(get_name_limit() - hsize_icon->get_width() - 2 * EDSCALE, (get_size().height - hsize_icon->get_height()) / 2, hsize_icon->get_width(), hsize_icon->get_height()); draw_texture(hsize_icon, hsize_rect.position); @@ -1934,7 +1934,7 @@ void AnimationTrackEdit::_notification(int p_what) { Ref font = get_font("font", "Label"); Color color = get_color("font_color", "Label"); - Ref type_icons[6] = { + Ref type_icons[6] = { get_icon("KeyValue", "EditorIcons"), get_icon("KeyXform", "EditorIcons"), get_icon("KeyCall", "EditorIcons"), @@ -1950,7 +1950,7 @@ void AnimationTrackEdit::_notification(int p_what) { { - Ref check = animation->track_is_enabled(track) ? get_icon("checked", "CheckBox") : get_icon("unchecked", "CheckBox"); + Ref check = animation->track_is_enabled(track) ? get_icon("checked", "CheckBox") : get_icon("unchecked", "CheckBox"); int ofs = in_group ? check->get_width() : 0; //not the best reference for margin but.. @@ -1958,7 +1958,7 @@ void AnimationTrackEdit::_notification(int p_what) { draw_texture(check, check_rect.position); ofs += check->get_width() + hsep; - Ref type_icon = type_icons[animation->track_get_type(track)]; + Ref type_icon = type_icons[animation->track_get_type(track)]; draw_texture(type_icon, Point2(ofs, int(get_size().height - type_icon->get_height()) / 2)); ofs += type_icon->get_width() + hsep; @@ -1987,7 +1987,7 @@ void AnimationTrackEdit::_notification(int p_what) { } text_color.a *= 0.7; } else if (node) { - Ref icon = EditorNode::get_singleton()->get_object_icon(node, "Node"); + Ref icon = EditorNode::get_singleton()->get_object_icon(node, "Node"); draw_texture(icon, Point2(ofs, int(get_size().height - icon->get_height()) / 2)); icon_cache = icon; @@ -2049,17 +2049,17 @@ void AnimationTrackEdit::_notification(int p_what) { { - Ref wrap_icon[2] = { + Ref wrap_icon[2] = { get_icon("InterpWrapClamp", "EditorIcons"), get_icon("InterpWrapLoop", "EditorIcons"), }; - Ref interp_icon[3] = { + Ref interp_icon[3] = { get_icon("InterpRaw", "EditorIcons"), get_icon("InterpLinear", "EditorIcons"), get_icon("InterpCubic", "EditorIcons") }; - Ref cont_icon[4] = { + Ref cont_icon[4] = { get_icon("TrackContinuous", "EditorIcons"), get_icon("TrackDiscrete", "EditorIcons"), get_icon("TrackTrigger", "EditorIcons"), @@ -2068,7 +2068,7 @@ void AnimationTrackEdit::_notification(int p_what) { int ofs = get_size().width - timeline->get_buttons_width(); - Ref down_icon = get_icon("select_arrow", "Tree"); + Ref down_icon = get_icon("select_arrow", "Tree"); draw_line(Point2(ofs, 0), Point2(ofs, get_size().height), linecolor, Math::round(EDSCALE)); @@ -2084,7 +2084,7 @@ void AnimationTrackEdit::_notification(int p_what) { update_mode = Animation::UPDATE_CONTINUOUS; } - Ref update_icon = cont_icon[update_mode]; + Ref update_icon = cont_icon[update_mode]; update_mode_rect.position.x = ofs; update_mode_rect.position.y = int(get_size().height - update_icon->get_height()) / 2; @@ -2105,7 +2105,7 @@ void AnimationTrackEdit::_notification(int p_what) { update_mode_rect.size.x += down_icon->get_width(); bezier_edit_rect = Rect2(); } else if (animation->track_get_type(track) == Animation::TYPE_BEZIER) { - Ref bezier_icon = get_icon("EditBezier", "EditorIcons"); + Ref bezier_icon = get_icon("EditBezier", "EditorIcons"); update_mode_rect.size.x += down_icon->get_width(); bezier_edit_rect.position = update_mode_rect.position + (update_mode_rect.size - bezier_icon->get_size()) / 2; bezier_edit_rect.size = bezier_icon->get_size(); @@ -2126,7 +2126,7 @@ void AnimationTrackEdit::_notification(int p_what) { Animation::InterpolationType interp_mode = animation->track_get_interpolation_type(track); - Ref icon = interp_icon[interp_mode]; + Ref icon = interp_icon[interp_mode]; interp_mode_rect.position.x = ofs; interp_mode_rect.position.y = int(get_size().height - icon->get_height()) / 2; @@ -2159,7 +2159,7 @@ void AnimationTrackEdit::_notification(int p_what) { bool loop_wrap = animation->track_get_interpolation_loop_wrap(track); - Ref icon = wrap_icon[loop_wrap ? 1 : 0]; + Ref icon = wrap_icon[loop_wrap ? 1 : 0]; loop_mode_rect.position.x = ofs; loop_mode_rect.position.y = int(get_size().height - icon->get_height()) / 2; @@ -2190,7 +2190,7 @@ void AnimationTrackEdit::_notification(int p_what) { { //erase - Ref icon = get_icon("Remove", "EditorIcons"); + Ref icon = get_icon("Remove", "EditorIcons"); remove_rect.position.x = ofs + ((get_size().width - ofs) - icon->get_width()) / 2; remove_rect.position.y = int(get_size().height - icon->get_height()) / 2; @@ -2271,7 +2271,7 @@ void AnimationTrackEdit::draw_key(int p_index, float p_pixels_sec, int p_x, bool if (p_x < p_clip_left || p_x > p_clip_right) return; - Ref icon_to_draw = p_selected ? selected_icon : type_icon; + Ref icon_to_draw = p_selected ? selected_icon : type_icon; // Override type icon for invalid value keys, unless selected. if (!p_selected && animation->track_get_type(track) == Animation::TYPE_VALUE) { @@ -2335,12 +2335,12 @@ void AnimationTrackEdit::draw_bg(int p_clip_left, int p_clip_right) { void AnimationTrackEdit::draw_fg(int p_clip_left, int p_clip_right) { } -void AnimationTrackEdit::draw_texture_clipped(const Ref &p_texture, const Vector2 &p_pos) { +void AnimationTrackEdit::draw_texture_clipped(const Ref &p_texture, const Vector2 &p_pos) { draw_texture_region_clipped(p_texture, Rect2(p_pos, p_texture->get_size()), Rect2(Point2(), p_texture->get_size())); } -void AnimationTrackEdit::draw_texture_region_clipped(const Ref &p_texture, const Rect2 &p_rect, const Rect2 &p_region) { +void AnimationTrackEdit::draw_texture_region_clipped(const Ref &p_texture, const Rect2 &p_rect, const Rect2 &p_region) { int clip_left = timeline->get_name_limit(); int clip_right = get_size().width - timeline->get_buttons_width(); @@ -2391,7 +2391,7 @@ void AnimationTrackEdit::set_animation_and_track(const Ref &p_animati track = p_track; update(); - Ref type_icons[6] = { + Ref type_icons[6] = { get_icon("KeyValue", "EditorIcons"), get_icon("KeyXform", "EditorIcons"), get_icon("KeyCall", "EditorIcons"), @@ -2413,7 +2413,7 @@ NodePath AnimationTrackEdit::get_path() const { Size2 AnimationTrackEdit::get_minimum_size() const { - Ref texture = get_icon("Object", "EditorIcons"); + Ref texture = get_icon("Object", "EditorIcons"); Ref font = get_font("font", "Label"); int separation = get_constant("vseparation", "ItemList"); @@ -3199,7 +3199,7 @@ void AnimationTrackEditGroup::_notification(int p_what) { } } -void AnimationTrackEditGroup::set_type_and_name(const Ref &p_type, const String &p_name, const NodePath &p_node) { +void AnimationTrackEditGroup::set_type_and_name(const Ref &p_type, const String &p_name, const NodePath &p_node) { icon = p_type; node_name = p_name; node = p_node; @@ -4214,7 +4214,7 @@ void AnimationTrackEditor::_update_tracks() { if (!group_sort.has(base_path)) { AnimationTrackEditGroup *g = memnew(AnimationTrackEditGroup); - Ref icon = get_icon("Node", "EditorIcons"); + Ref icon = get_icon("Node", "EditorIcons"); String name = base_path; String tooltip; if (root && root->has_node(base_path)) { @@ -5273,7 +5273,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) { } String text; - Ref icon = get_icon("Node", "EditorIcons"); + Ref icon = get_icon("Node", "EditorIcons"); if (node) { if (has_icon(node->get_class(), "EditorIcons")) { icon = get_icon(node->get_class(), "EditorIcons"); diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 79abda2d49b..c2660652d6b 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -158,8 +158,8 @@ class AnimationTrackEdit : public Control { Rect2 remove_rect; Rect2 bezier_edit_rect; - Ref type_icon; - Ref selected_icon; + Ref type_icon; + Ref selected_icon; PopupMenu *menu; @@ -167,7 +167,7 @@ class AnimationTrackEdit : public Control { void _zoom_changed(); - Ref icon_cache; + Ref icon_cache; String path_cache; void _menu_selected(int p_index); @@ -208,8 +208,8 @@ public: virtual void draw_fg(int p_clip_left, int p_clip_right); //helper - void draw_texture_clipped(const Ref &p_texture, const Vector2 &p_pos); - void draw_texture_region_clipped(const Ref &p_texture, const Rect2 &p_rect, const Rect2 &p_region); + void draw_texture_clipped(const Ref &p_texture, const Vector2 &p_pos); + void draw_texture_region_clipped(const Ref &p_texture, const Rect2 &p_rect, const Rect2 &p_region); void draw_rect_clipped(const Rect2 &p_rect, const Color &p_color, bool p_filled = true); int get_track() const; @@ -251,7 +251,7 @@ class AnimationBezierTrackEdit; class AnimationTrackEditGroup : public Control { GDCLASS(AnimationTrackEditGroup, Control); - Ref icon; + Ref icon; String node_name; NodePath node; Node *root; @@ -264,7 +264,7 @@ protected: void _notification(int p_what); public: - void set_type_and_name(const Ref &p_type, const String &p_name, const NodePath &p_node); + void set_type_and_name(const Ref &p_type, const String &p_name, const NodePath &p_node); virtual Size2 get_minimum_size() const; void set_timeline(AnimationTimelineEdit *p_timeline); void set_root(Node *p_root); diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index bb008e621e0..bcdd09987f6 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -42,12 +42,12 @@ /// BOOL /// int AnimationTrackEditBool::get_key_height() const { - Ref checked = get_icon("checked", "CheckBox"); + Ref checked = get_icon("checked", "CheckBox"); return checked->get_height(); } Rect2 AnimationTrackEditBool::get_key_rect(int p_index, float p_pixels_sec) { - Ref checked = get_icon("checked", "CheckBox"); + Ref checked = get_icon("checked", "CheckBox"); return Rect2(-checked->get_width() / 2, 0, checked->get_width(), get_size().height); } @@ -58,7 +58,7 @@ bool AnimationTrackEditBool::is_key_selectable_by_distance() const { void AnimationTrackEditBool::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) { bool checked = get_animation()->track_get_key_value(get_track(), p_index); - Ref icon = get_icon(checked ? "checked" : "unchecked", "CheckBox"); + Ref icon = get_icon(checked ? "checked" : "unchecked", "CheckBox"); Vector2 ofs(p_x - icon->get_width() / 2, int(get_size().height - icon->get_height()) / 2); @@ -360,7 +360,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se if (Object::cast_to(object) || Object::cast_to(object)) { - Ref texture = object->call("get_texture"); + Ref texture = object->call("get_texture"); if (!texture.is_valid()) { return AnimationTrackEdit::get_key_rect(p_index, p_pixels_sec); } @@ -404,7 +404,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se animation = get_animation()->track_get_key_value(animation_track, animaiton_index); } - Ref texture = sf->get_frame(animation, frame); + Ref texture = sf->get_frame(animation, frame); if (!texture.is_valid()) { return AnimationTrackEdit::get_key_rect(p_index, p_pixels_sec); } @@ -434,7 +434,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in return; } - Ref texture; + Ref texture; Rect2 region; if (Object::cast_to(object) || Object::cast_to(object)) { @@ -710,13 +710,13 @@ void AnimationTrackEditSubAnim::set_node(Object *p_object) { int AnimationTrackEditVolumeDB::get_key_height() const { - Ref volume_texture = get_icon("ColorTrackVu", "EditorIcons"); + Ref volume_texture = get_icon("ColorTrackVu", "EditorIcons"); return volume_texture->get_height() * 1.2; } void AnimationTrackEditVolumeDB::draw_bg(int p_clip_left, int p_clip_right) { - Ref volume_texture = get_icon("ColorTrackVu", "EditorIcons"); + Ref volume_texture = get_icon("ColorTrackVu", "EditorIcons"); int tex_h = volume_texture->get_height(); int y_from = (get_size().height - tex_h) / 2; @@ -728,7 +728,7 @@ void AnimationTrackEditVolumeDB::draw_bg(int p_clip_left, int p_clip_right) { void AnimationTrackEditVolumeDB::draw_fg(int p_clip_left, int p_clip_right) { - Ref volume_texture = get_icon("ColorTrackVu", "EditorIcons"); + Ref volume_texture = get_icon("ColorTrackVu", "EditorIcons"); int tex_h = volume_texture->get_height(); int y_from = (get_size().height - tex_h) / 2; int db0 = y_from + (24 / 80.0) * tex_h; @@ -763,7 +763,7 @@ void AnimationTrackEditVolumeDB::draw_key_link(int p_index, float p_pixels_sec, to_x = p_clip_right; } - Ref volume_texture = get_icon("ColorTrackVu", "EditorIcons"); + Ref volume_texture = get_icon("ColorTrackVu", "EditorIcons"); int tex_h = volume_texture->get_height(); int y_from = (get_size().height - tex_h) / 2; diff --git a/editor/animation_track_editor_plugins.h b/editor/animation_track_editor_plugins.h index 4a21ca4d27f..378070a45d4 100644 --- a/editor/animation_track_editor_plugins.h +++ b/editor/animation_track_editor_plugins.h @@ -35,8 +35,8 @@ class AnimationTrackEditBool : public AnimationTrackEdit { GDCLASS(AnimationTrackEditBool, AnimationTrackEdit); - Ref icon_checked; - Ref icon_unchecked; + Ref icon_checked; + Ref icon_unchecked; public: virtual int get_key_height() const; diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index e05ace53daa..f3da1b59b2c 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -819,8 +819,8 @@ void CodeTextEditor::_complete_request() { text_editor->code_complete(entries, forced); } -Ref CodeTextEditor::_get_completion_icon(const ScriptCodeCompletionOption &p_option) { - Ref tex; +Ref CodeTextEditor::_get_completion_icon(const ScriptCodeCompletionOption &p_option) { + Ref tex; switch (p_option.kind) { case ScriptCodeCompletionOption::KIND_CLASS: { if (has_icon(p_option.display, "EditorIcons")) { diff --git a/editor/code_editor.h b/editor/code_editor.h index fc064071662..6b733a2b3c9 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -167,7 +167,7 @@ class CodeTextEditor : public VBoxContainer { void _update_font(); void _complete_request(); - Ref _get_completion_icon(const ScriptCodeCompletionOption &p_option); + Ref _get_completion_icon(const ScriptCodeCompletionOption &p_option); void _font_resize_timeout(); bool _add_font_size(int p_delta); diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 1853133bc70..7e283bb27f4 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -903,7 +903,7 @@ void ConnectionsDock::update_tree() { while (base) { List node_signals2; - Ref icon; + Ref icon; String name; if (!did_script) { diff --git a/editor/create_dialog.h b/editor/create_dialog.h index 94ff1b5bb26..a807e50f659 100644 --- a/editor/create_dialog.h +++ b/editor/create_dialog.h @@ -77,7 +77,7 @@ class CreateDialog : public ConfirmationDialog { void _confirmed(); void _text_changed(const String &p_newtext); - Ref _get_editor_icon(const String &p_type) const; + Ref _get_editor_icon(const String &p_type) const; void add_type(const String &p_type, HashMap &p_types, TreeItem *p_root, TreeItem **to_select); diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index df957611cf9..46f6815f776 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -174,7 +174,7 @@ void DependencyEditor::_update_list() { TreeItem *root = tree->create_item(); - Ref folder = get_icon("folder", "FileDialog"); + Ref folder = get_icon("folder", "FileDialog"); bool broken = false; @@ -195,7 +195,7 @@ void DependencyEditor::_update_list() { } String name = path.get_file(); - Ref icon = EditorNode::get_singleton()->get_class_icon(type); + Ref icon = EditorNode::get_singleton()->get_class_icon(type); item->set_text(0, name); item->set_icon(0, icon); item->set_metadata(0, type); @@ -338,7 +338,7 @@ void DependencyEditorOwners::_fill_owners(EditorFileSystemDirectory *efsd) { if (!found) continue; - Ref icon = EditorNode::get_singleton()->get_class_icon(efsd->get_file_type(i)); + Ref icon = EditorNode::get_singleton()->get_class_icon(efsd->get_file_type(i)); owners->add_item(efsd->get_file_path(i), icon); } @@ -446,7 +446,7 @@ void DependencyRemoveDialog::_build_removed_dependency_tree(const Vector icon = EditorNode::get_singleton()->get_class_icon(rd.file_type); + Ref icon = EditorNode::get_singleton()->get_class_icon(rd.file_type); TreeItem *file_item = owners->create_item(tree_items[rd.dependency]); file_item->set_text(0, rd.file); file_item->set_icon(0, icon); @@ -609,7 +609,7 @@ void DependencyErrorDialog::show(Mode p_mode, const String &p_for_file, const Ve if (report[i].get_slice_count("::") > 0) type = report[i].get_slice("::", 1); - Ref icon = EditorNode::get_singleton()->get_class_icon(type); + Ref icon = EditorNode::get_singleton()->get_class_icon(type); TreeItem *ti = files->create_item(root); ti->set_text(0, dep); @@ -720,7 +720,7 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMa String type = efsd->get_file_type(i); - Ref icon = EditorNode::get_singleton()->get_class_icon(type); + Ref icon = EditorNode::get_singleton()->get_class_icon(type); ti->set_icon(0, icon); int ds = efsd->get_file_deps(i).size(); ti->set_text(1, itos(ds)); diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index adfffe27ba1..0d9e53c71c1 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -483,7 +483,7 @@ void DocData::generate(bool p_basic_types) { PropertyDoc pd; pd.name = E->get(); - pd.type = "Texture"; + pd.type = "Texture2D"; c.theme_properties.push_back(pd); } l.clear(); diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 86611bd20af..783b996c4d4 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -110,7 +110,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { ret = unzGoToNextFile(pkg); } - Map > extension_guess; + Map > extension_guess; { extension_guess["png"] = get_icon("ImageTexture", "EditorIcons"); extension_guess["jpg"] = get_icon("ImageTexture", "EditorIcons"); @@ -122,7 +122,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { extension_guess["vs"] = get_icon("VisualScript", "EditorIcons"); } - Ref generic_extension = get_icon("Object", "EditorIcons"); + Ref generic_extension = get_icon("Object", "EditorIcons"); unzClose(pkg); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 0a60aabd2d1..594322f00d9 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -144,8 +144,8 @@ void EditorAudioBus::_notification(int p_what) { if (activity_found != channel[i].prev_active) { if (activity_found) { - channel[i].vu_l->set_over_texture(Ref()); - channel[i].vu_r->set_over_texture(Ref()); + channel[i].vu_l->set_over_texture(Ref()); + channel[i].vu_r->set_over_texture(Ref()); } else { channel[i].vu_l->set_over_texture(disabled_vu); channel[i].vu_r->set_over_texture(disabled_vu); @@ -944,7 +944,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { if (!ClassDB::can_instance(E->get())) continue; - Ref icon = EditorNode::get_singleton()->get_class_icon(E->get()); + Ref icon = EditorNode::get_singleton()->get_class_icon(E->get()); String name = E->get().operator String().replace("AudioEffect", ""); effect_options->add_item(name); effect_options->set_item_metadata(effect_options->get_item_count() - 1, E->get()); diff --git a/editor/editor_audio_buses.h b/editor/editor_audio_buses.h index ef6f7e458fe..72098c7232c 100644 --- a/editor/editor_audio_buses.h +++ b/editor/editor_audio_buses.h @@ -54,7 +54,7 @@ class EditorAudioBus : public PanelContainer { GDCLASS(EditorAudioBus, PanelContainer); - Ref disabled_vu; + Ref disabled_vu; LineEdit *track_name; MenuButton *bus_options; VSlider *slider; diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 0b43fd5ac09..d7c610f1093 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -479,7 +479,7 @@ EditorPlugin *EditorData::get_editor_plugin(int p_idx) { return editor_plugins[p_idx]; } -void EditorData::add_custom_type(const String &p_type, const String &p_inherits, const Ref