From 0e93a1df793de92f4ec6f4bb097cfd5aa94a7157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 28 Apr 2021 14:15:29 +0200 Subject: Remove obsolete LargeTexture, it's no longer useful since 3.x It existed in early Godot releases to allow working around hardware limitations on max texture sizes (e.g. hardware limits of 1024x1024 pixels). Nowadays the max texture size supported natively by Godot is 16384x16384, and even low end mobile hardware should support at least 4096x4096. The LargeTexture implementation is basically just an array with offsets, sizes and textures and should be easy to replicate with a custom Texture resource if needed - solving most of its bugs on the way as the implementation removed here has various unimplemented or incomplete methods. --- editor/plugins/canvas_item_editor_plugin.cpp | 3 +-- editor/plugins/editor_preview_plugins.cpp | 3 --- editor/plugins/texture_editor_plugin.cpp | 2 +- editor/plugins/tile_set_editor_plugin.cpp | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) (limited to 'editor/plugins') diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index fc3e15aa52..6ac47595dc 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -6518,8 +6518,7 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Varian type == "CurveTexture" || type == "GradientTexture" || type == "StreamTexture2D" || - type == "AtlasTexture" || - type == "LargeTexture") { + type == "AtlasTexture") { Ref texture = Ref(Object::cast_to(*res)); if (!texture.is_valid()) { continue; diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index d3e5854786..87eeb82101 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -81,7 +81,6 @@ bool EditorTexturePreviewPlugin::generate_small_preview_automatically() const { Ref EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2 &p_size) const { Ref img; Ref atex = p_from; - Ref ltex = p_from; if (atex.is_valid()) { Ref tex = atex->get_atlas(); if (!tex.is_valid()) { @@ -94,8 +93,6 @@ Ref EditorTexturePreviewPlugin::generate(const RES &p_from, const Siz } img = atlas->get_rect(atex->get_region()); - } else if (ltex.is_valid()) { - img = ltex->to_image(); } else { Ref tex = p_from; if (tex.is_valid()) { diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 253f8878d2..ecf7370834 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -143,7 +143,7 @@ TextureEditor::~TextureEditor() { // bool EditorInspectorPluginTexture::can_handle(Object *p_object) { - return Object::cast_to(p_object) != nullptr || Object::cast_to(p_object) != nullptr || Object::cast_to(p_object) != nullptr || Object::cast_to(p_object) != nullptr || Object::cast_to(p_object) != nullptr; + return Object::cast_to(p_object) != nullptr || Object::cast_to(p_object) != nullptr || Object::cast_to(p_object) != nullptr || Object::cast_to(p_object) != nullptr; } void EditorInspectorPluginTexture::parse_begin(Object *p_object) { diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index feaf609557..f683c4b10d 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -319,7 +319,7 @@ void TileSetEditor::_notification(int p_what) { tool_editmode[EDITMODE_NAVIGATION]->set_icon(get_theme_icon("Navigation2D", "EditorIcons")); tool_editmode[EDITMODE_BITMASK]->set_icon(get_theme_icon("PackedDataContainer", "EditorIcons")); tool_editmode[EDITMODE_PRIORITY]->set_icon(get_theme_icon("MaterialPreviewLight1", "EditorIcons")); - tool_editmode[EDITMODE_ICON]->set_icon(get_theme_icon("LargeTexture", "EditorIcons")); + tool_editmode[EDITMODE_ICON]->set_icon(get_theme_icon("Image", "EditorIcons")); tool_editmode[EDITMODE_Z_INDEX]->set_icon(get_theme_icon("Sort", "EditorIcons")); scroll->add_theme_style_override("bg", get_theme_stylebox("bg", "Tree")); -- cgit v1.2.3