From f8a79a97c7d12da43b111a756f09ee7ad5ea28e9 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 3 Mar 2020 10:36:29 -0300 Subject: Effective DisplayServer separation, rename X11 -> LinuxBSD --- scene/2d/particles_2d.cpp | 2 +- scene/2d/touch_screen_button.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'scene/2d') diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index 2ba2fd8f79..e5c17fe9a4 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -228,7 +228,7 @@ bool Particles2D::get_fractional_delta() const { String Particles2D::get_configuration_warning() const { - if (OS::get_singleton()->get_current_video_driver() == OS::VIDEO_DRIVER_GLES2) { + if (VisualServer::get_singleton()->is_low_end()) { return TTR("GPU-based particles are not supported by the GLES2 video driver.\nUse the CPUParticles2D node instead. You can use the \"Convert to CPUParticles\" option for this purpose."); } diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index 20d73113dc..0f79e12275 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -33,6 +33,7 @@ #include "core/input/input.h" #include "core/input/input_map.h" #include "core/os/os.h" +#include "scene/main/viewport.h" void TouchScreenButton::set_texture(const Ref &p_texture) { @@ -114,7 +115,7 @@ void TouchScreenButton::_notification(int p_what) { if (!is_inside_tree()) return; - if (!Engine::get_singleton()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility == VISIBILITY_TOUCHSCREEN_ONLY) + if (!Engine::get_singleton()->is_editor_hint() && !!DisplayServer::get_singleton()->screen_is_touchscreen(DisplayServer::get_singleton()->window_get_current_screen(get_viewport()->get_window_id())) && visibility == VISIBILITY_TOUCHSCREEN_ONLY) return; if (finger_pressed != -1) { @@ -145,7 +146,7 @@ void TouchScreenButton::_notification(int p_what) { } break; case NOTIFICATION_ENTER_TREE: { - if (!Engine::get_singleton()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility == VISIBILITY_TOUCHSCREEN_ONLY) + if (!Engine::get_singleton()->is_editor_hint() && !!DisplayServer::get_singleton()->screen_is_touchscreen(DisplayServer::get_singleton()->window_get_current_screen(get_viewport()->get_window_id())) && visibility == VISIBILITY_TOUCHSCREEN_ONLY) return; update(); -- cgit v1.2.3