1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

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
This commit is contained in:
Juan Linietsky
2019-06-11 15:43:37 -03:00
parent 9ffe57a10e
commit 3f335ce3d4
287 changed files with 2829 additions and 2540 deletions

View File

@@ -514,7 +514,7 @@ void AnimationNodeStateMachineEditor::_connection_draw(const Vector2 &p_from, co
accent.a *= 0.6;
}
Ref<Texture> icons[6] = {
Ref<Texture2D> icons[6] = {
get_icon("TransitionImmediateBig", "EditorIcons"),
get_icon("TransitionSyncBig", "EditorIcons"),
get_icon("TransitionEndBig", "EditorIcons"),
@@ -533,7 +533,7 @@ void AnimationNodeStateMachineEditor::_connection_draw(const Vector2 &p_from, co
}
state_machine_draw->draw_line(p_from, p_to, linecolor, 2, true);
Ref<Texture> icon = icons[p_mode + (p_auto_advance ? 3 : 0)];
Ref<Texture2D> icon = icons[p_mode + (p_auto_advance ? 3 : 0)];
Transform2D xf;
xf.elements[0] = (p_to - p_from).normalized();
@@ -578,9 +578,9 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() {
Ref<Font> font = get_font("title_font", "GraphNode");
Color font_color = get_color("title_color", "GraphNode");
Ref<Texture> play = get_icon("Play", "EditorIcons");
Ref<Texture> auto_play = get_icon("AutoPlay", "EditorIcons");
Ref<Texture> edit = get_icon("Edit", "EditorIcons");
Ref<Texture2D> play = get_icon("Play", "EditorIcons");
Ref<Texture2D> auto_play = get_icon("AutoPlay", "EditorIcons");
Ref<Texture2D> edit = get_icon("Edit", "EditorIcons");
Color accent = get_color("accent_color", "Editor");
Color linecolor = get_color("font_color", "Label");
linecolor.a *= 0.3;
@@ -686,7 +686,7 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() {
_connection_draw(from, to, AnimationNodeStateMachineTransition::SwitchMode(transition_mode->get_selected()), true, false, false, false);
}
Ref<Texture> tr_reference_icon = get_icon("TransitionImmediateBig", "EditorIcons");
Ref<Texture2D> tr_reference_icon = get_icon("TransitionImmediateBig", "EditorIcons");
float tr_bidi_offset = int(tr_reference_icon->get_height() * 0.8);
//draw transition lines
@@ -796,7 +796,7 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() {
nr.play.position = offset + Vector2(0, (h - play->get_height()) / 2).floor();
nr.play.size = play->get_size();
Ref<Texture> play_tex = onstart ? auto_play : play;
Ref<Texture2D> play_tex = onstart ? auto_play : play;
if (over_node == name && over_node_what == 0) {
state_machine_draw->draw_texture(play_tex, nr.play.position, accent);
@@ -918,14 +918,6 @@ void AnimationNodeStateMachineEditor::_notification(int p_what) {
transition_mode->add_icon_item(get_icon("TransitionSync", "EditorIcons"), TTR("Sync"));
transition_mode->add_icon_item(get_icon("TransitionEnd", "EditorIcons"), TTR("At End"));
//force filter on those, so they deform better
get_icon("TransitionImmediateBig", "EditorIcons")->set_flags(Texture::FLAG_FILTER);
get_icon("TransitionEndBig", "EditorIcons")->set_flags(Texture::FLAG_FILTER);
get_icon("TransitionSyncBig", "EditorIcons")->set_flags(Texture::FLAG_FILTER);
get_icon("TransitionImmediateAutoBig", "EditorIcons")->set_flags(Texture::FLAG_FILTER);
get_icon("TransitionEndAutoBig", "EditorIcons")->set_flags(Texture::FLAG_FILTER);
get_icon("TransitionSyncAutoBig", "EditorIcons")->set_flags(Texture::FLAG_FILTER);
tool_erase->set_icon(get_icon("Remove", "EditorIcons"));
tool_autoplay->set_icon(get_icon("AutoPlay", "EditorIcons"));
tool_end->set_icon(get_icon("AutoEnd", "EditorIcons"));