rsx/overlays: Introduce 'native' HUD UI and implement some common dialogs (#4011)

This commit is contained in:
kd-11 2018-01-17 19:14:00 +03:00 committed by GitHub
parent 34c49c77b2
commit 71f69d1d48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 3682 additions and 213 deletions

View file

@ -481,9 +481,6 @@ namespace rsx
// TODO: exit condition
while (!Emu.IsStopped())
{
//Execute backend-local tasks first
do_local_task();
//Wait for external pause events
if (external_interrupt_lock.load())
{
@ -491,6 +488,9 @@ namespace rsx
while (external_interrupt_lock.load()) _mm_pause();
}
//Execute backend-local tasks first
do_local_task(ctrl->put.load() == internal_get.load());
//Set up restore state if needed
if (sync_point_request)
{
@ -2179,7 +2179,13 @@ namespace rsx
void thread::pause()
{
external_interrupt_lock.store(true);
while (!external_interrupt_ack.load()) _mm_pause();
while (!external_interrupt_ack.load())
{
if (Emu.IsStopped())
break;
_mm_pause();
}
external_interrupt_ack.store(false);
}
@ -2187,4 +2193,67 @@ namespace rsx
{
external_interrupt_lock.store(false);
}
//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;
}
}