rsx/lv2: Make the hw cursor resolution-aware

This commit is contained in:
kd-11
2026-10-02 19:56:35 +03:00
committed by kd-11
parent 5d8efbfeb9
commit 1c757181a0
3 changed files with 26 additions and 1 deletions
+7 -1
View File
@@ -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));
}
}
}
+12
View File
@@ -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);
+7
View File
@@ -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;
};