Commit 162ce030 authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko Committed by Adrien Plazas

core-view: Only set default controllers for supported capabilities

Avoids creating controllers that don't do anything.
parent cdc0fdc5
Pipeline #13764 passed with stage
in 16 minutes and 1 second
......@@ -606,13 +606,19 @@ retro_core_view_set_as_default_controller (RetroCoreView *self,
{
RetroControllerType type;
RetroController *controller;
guint64 capabilities;
g_return_if_fail (RETRO_IS_CORE_VIEW (self));
g_return_if_fail (RETRO_IS_CORE (core));
capabilities = retro_core_view_get_controller_capabilities (self);
for (type = RETRO_CONTROLLER_TYPE_NONE;
type < RETRO_CONTROLLER_TYPE_COUNT;
type++) {
if ((capabilities & (1 << type)) == 0)
continue;
controller = retro_core_view_as_controller (self, type);
retro_core_set_default_controller (core, type, controller);
g_object_unref (controller);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment