Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
9ba6bab9
There was an error fetching the commit references. Please try again later.
Commit
9ba6bab9
authored
3 years ago
by
Lioncash
Browse files
Options
Downloads
Patches
Plain Diff
configure_input_player: Avoid unnecessary ParamPackage copies
Avoids churning allocations.
parent
f56226e1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/yuzu/configuration/configure_input_player.cpp
+6
-6
6 additions, 6 deletions
src/yuzu/configuration/configure_input_player.cpp
with
6 additions
and
6 deletions
src/yuzu/configuration/configure_input_player.cpp
+
6
−
6
View file @
9ba6bab9
...
...
@@ -326,7 +326,7 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
connect
(
button
,
&
QPushButton
::
clicked
,
[
=
,
this
]
{
HandleClick
(
button
,
button_id
,
[
=
,
this
](
Common
::
ParamPackage
params
)
{
[
=
,
this
](
const
Common
::
ParamPackage
&
params
)
{
emulated_controller
->
SetButtonParam
(
button_id
,
params
);
},
InputCommon
::
Polling
::
InputType
::
Button
);
...
...
@@ -392,7 +392,7 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
connect
(
button
,
&
QPushButton
::
clicked
,
[
=
,
this
]
{
HandleClick
(
button
,
motion_id
,
[
=
,
this
](
Common
::
ParamPackage
params
)
{
[
=
,
this
](
const
Common
::
ParamPackage
&
params
)
{
emulated_controller
->
SetMotionParam
(
motion_id
,
params
);
},
InputCommon
::
Polling
::
InputType
::
Motion
);
...
...
@@ -783,7 +783,7 @@ void ConfigureInputPlayer::UpdateInputDeviceCombobox() {
if
(
devices
.
size
()
==
1
)
{
const
auto
devices_it
=
std
::
find_if
(
input_devices
.
begin
(),
input_devices
.
end
(),
[
first_engine
,
first_guid
,
first_port
,
first_pad
](
const
Common
::
ParamPackage
param
)
{
[
first_engine
,
first_guid
,
first_port
,
first_pad
](
const
Common
::
ParamPackage
&
param
)
{
return
param
.
Get
(
"engine"
,
""
)
==
first_engine
&&
param
.
Get
(
"guid"
,
""
)
==
first_guid
&&
param
.
Get
(
"port"
,
0
)
==
first_port
&&
param
.
Get
(
"pad"
,
0
)
==
first_pad
;
...
...
@@ -814,7 +814,7 @@ void ConfigureInputPlayer::UpdateInputDeviceCombobox() {
if
(
is_engine_equal
&&
is_port_equal
)
{
const
auto
devices_it
=
std
::
find_if
(
input_devices
.
begin
(),
input_devices
.
end
(),
[
first_engine
,
first_guid
,
second_guid
,
first_port
](
const
Common
::
ParamPackage
param
)
{
[
first_engine
,
first_guid
,
second_guid
,
first_port
](
const
Common
::
ParamPackage
&
param
)
{
const
bool
is_guid_valid
=
(
param
.
Get
(
"guid"
,
""
)
==
first_guid
&&
param
.
Get
(
"guid2"
,
""
)
==
second_guid
)
||
...
...
@@ -1026,7 +1026,7 @@ int ConfigureInputPlayer::GetIndexFromControllerType(Core::HID::NpadStyleIndex t
void
ConfigureInputPlayer
::
UpdateInputDevices
()
{
input_devices
=
input_subsystem
->
GetInputDevices
();
ui
->
comboDevices
->
clear
();
for
(
auto
device
:
input_devices
)
{
for
(
const
auto
&
device
:
input_devices
)
{
ui
->
comboDevices
->
addItem
(
QString
::
fromStdString
(
device
.
Get
(
"display"
,
"Unknown"
)),
{});
}
}
...
...
@@ -1358,7 +1358,7 @@ bool ConfigureInputPlayer::IsInputAcceptable(const Common::ParamPackage& params)
return
params
.
Get
(
"engine"
,
""
)
==
"keyboard"
||
params
.
Get
(
"engine"
,
""
)
==
"mouse"
;
}
const
auto
current_input_device
=
input_devices
[
ui
->
comboDevices
->
currentIndex
()];
const
auto
&
current_input_device
=
input_devices
[
ui
->
comboDevices
->
currentIndex
()];
return
params
.
Get
(
"engine"
,
""
)
==
current_input_device
.
Get
(
"engine"
,
""
)
&&
(
params
.
Get
(
"guid"
,
""
)
==
current_input_device
.
Get
(
"guid"
,
""
)
||
params
.
Get
(
"guid"
,
""
)
==
current_input_device
.
Get
(
"guid2"
,
""
))
&&
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment