Native UI refactored (#4623)

Refactor and improve native overlays
This commit is contained in:
kd-11 2018-05-20 23:05:00 +03:00 committed by GitHub
parent 68fff54a8b
commit f6f45b8699
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 310 additions and 219 deletions

View file

@ -344,6 +344,11 @@ namespace rsx
void thread::on_task()
{
if (supports_native_ui)
{
m_overlay_manager = fxm::make_always<rsx::overlays::display_manager>();
}
on_init_thread();
reset();
@ -2344,69 +2349,6 @@ namespace rsx
return performance_counters.approximate_load;
}
//TODO: Move these helpers into a better class dedicated to shell interface handling (use idm?)
//They are not dependent on rsx at all
rsx::overlays::save_dialog* thread::shell_open_save_dialog()
{
if (supports_native_ui)
{
auto ptr = new rsx::overlays::save_dialog();
m_custom_ui.reset(ptr);
return ptr;
}
else
{
return nullptr;
}
}
rsx::overlays::message_dialog* thread::shell_open_message_dialog()
{
if (supports_native_ui)
{
auto ptr = new rsx::overlays::message_dialog();
m_custom_ui.reset(ptr);
return ptr;
}
else
{
return nullptr;
}
}
rsx::overlays::trophy_notification* thread::shell_open_trophy_notification()
{
if (supports_native_ui)
{
auto ptr = new rsx::overlays::trophy_notification();
m_custom_ui.reset(ptr);
return ptr;
}
else
{
return nullptr;
}
}
rsx::overlays::user_interface* thread::shell_get_current_dialog()
{
//TODO: Only get dialog type interfaces
return m_custom_ui.get();
}
bool thread::shell_close_dialog()
{
//TODO: Only get dialog type interfaces
if (m_custom_ui)
{
m_invalidated_ui = std::move(m_custom_ui);
shell_do_cleanup();
return true;
}
return false;
}
namespace reports
{
void ZCULL_control::set_enabled(class ::rsx::thread* ptimer, bool state)