mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-10-12 02:09:17 +00:00
rsx/lv2: Make the hw cursor resolution-aware
This commit is contained in:
@@ -56,7 +56,13 @@ void _sys_rsx_init_cursor_overlay()
|
||||
{
|
||||
if (auto manager = g_fxo->try_get<rsx::overlays::display_manager>())
|
||||
{
|
||||
manager->create<rsx::overlays::bitmap_cursor>();
|
||||
auto cursor = manager->create<rsx::overlays::bitmap_cursor>();
|
||||
if (const auto avconfig = g_fxo->try_get<rsx::avconf>())
|
||||
{
|
||||
cursor->set_screen_size(
|
||||
::narrow<u16>(avconfig->resolution_x),
|
||||
::narrow<u16>(avconfig->resolution_y));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -157,14 +157,26 @@ namespace rsx
|
||||
|
||||
void bitmap_cursor::enable()
|
||||
{
|
||||
std::lock_guard lock(m_mutex);
|
||||
|
||||
m_visible = true;
|
||||
}
|
||||
|
||||
void bitmap_cursor::disable()
|
||||
{
|
||||
std::lock_guard lock(m_mutex);
|
||||
|
||||
m_visible = false;
|
||||
}
|
||||
|
||||
void bitmap_cursor::set_screen_size(u16 w, u16 h)
|
||||
{
|
||||
std::lock_guard lock(m_mutex);
|
||||
|
||||
m_virtual_width = w;
|
||||
m_virtual_height = h;
|
||||
}
|
||||
|
||||
void bitmap_cursor::set_pos(s32 x, s32 y)
|
||||
{
|
||||
std::lock_guard lock(m_mutex);
|
||||
|
||||
@@ -57,7 +57,11 @@ namespace rsx
|
||||
void disable();
|
||||
void set_pos(s32 x, s32 y);
|
||||
void set_bitmap(u32 address);
|
||||
void set_screen_size(u16 w, u16 h);
|
||||
|
||||
compiled_resource get_compiled() override;
|
||||
u16 get_virtual_width() const override { return m_virtual_width; }
|
||||
u16 get_virtual_height() const override { return m_virtual_height; }
|
||||
|
||||
private:
|
||||
bool m_visible = false;
|
||||
@@ -65,6 +69,9 @@ namespace rsx
|
||||
std::unique_ptr<overlays::image_view> m_bitmap;
|
||||
overlays::memory_image_info m_image_storage;
|
||||
|
||||
u16 m_virtual_width = 1280;
|
||||
u16 m_virtual_height = 720;
|
||||
|
||||
shared_mutex m_mutex;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user