Skip to content

Commit bc0a9a7

Browse files
committed
use input manager controller counter
1 parent 42d2a20 commit bc0a9a7

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

src/gui/input/InputSettings2.cpp

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -297,28 +297,7 @@ wxWindow* InputSettings2::initialize_page(size_t index)
297297

298298
std::pair<size_t, size_t> InputSettings2::get_emulated_controller_types() const
299299
{
300-
size_t vpad = 0, wpad = 0;
301-
for(size_t i = 0; i < m_notebook->GetPageCount(); ++i)
302-
{
303-
auto* page = m_notebook->GetPage(i);
304-
auto* page_data = (wxControllerPageData*)page->GetClientObject();
305-
if (!page_data)
306-
continue;
307-
308-
if (!page_data->ref().m_controller) // = disabled
309-
continue;
310-
311-
const auto api_type = page_data->ref().m_controller->type();
312-
if (api_type >= EmulatedController::MAX)
313-
continue;
314-
315-
if (api_type == EmulatedController::VPAD)
316-
++vpad;
317-
else
318-
++wpad;
319-
}
320-
321-
return std::make_pair(vpad, wpad);
300+
return InputManager::instance().get_controller_count();
322301
}
323302

324303
std::shared_ptr<ControllerBase> InputSettings2::get_active_controller() const

0 commit comments

Comments
 (0)