Input: make move handler dynamic

This commit is contained in:
Megamouse 2022-07-06 14:35:50 +02:00
parent 2bf17f5d3c
commit 639b8112b6
4 changed files with 27 additions and 23 deletions

View file

@ -12,8 +12,15 @@ LOG_CHANNEL(input_log, "Input");
void basic_mouse_handler::Init(const u32 max_connect)
{
if (m_info.max_connect > 0)
{
// Already initialized
return;
}
m_mice.clear();
m_mice.emplace_back(Mouse());
memset(&m_info, 0, sizeof(MouseInfo));
m_info = {};
m_info.max_connect = max_connect;
m_info.now_connect = std::min(::size32(m_mice), max_connect);
m_info.info = input::g_mice_intercepted ? CELL_MOUSE_INFO_INTERCEPTED : 0; // Ownership of mouse data: 0=Application, 1=System