summaryrefslogtreecommitdiff
path: root/lib/nes/app/input/input-manager.cc
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-04 23:11:08 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-04 23:11:08 +0100
commit79553ab1fa3d707612e80dd03bf95ca65fa0c411 (patch)
treef44bec41548d569cfca43c44e0e4ffa7b72ed4ed /lib/nes/app/input/input-manager.cc
parent9c45e9c7df1efa5bc1c8e73b6eaef4726b828d3e (diff)
refactor file browser
Diffstat (limited to 'lib/nes/app/input/input-manager.cc')
-rw-r--r--lib/nes/app/input/input-manager.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/nes/app/input/input-manager.cc b/lib/nes/app/input/input-manager.cc
index 1af0f5b..ceb6690 100644
--- a/lib/nes/app/input/input-manager.cc
+++ b/lib/nes/app/input/input-manager.cc
@@ -68,8 +68,7 @@ namespace nes::app
// This input is not assigned -> use the next available controller if available.
while (it != controllers_.end())
{
- auto controller = *it;
- if (controller->is_reliable() && controller->get_index() == input_device_controller::index::unused)
+ if (it->is_reliable() && it->get_index() == input_device_controller::index::unused)
{
break;
}
@@ -79,9 +78,9 @@ namespace nes::app
if (it != controllers_.end())
{
// We've found an unused controller -> assign it.
- inputs_[i].controller = *it;
+ inputs_[i].controller = &*it;
inputs_[i].controller->set_index(static_cast<input_device_controller::index>(i));
- inputs_[i].device = *it;
+ inputs_[i].device = &*it;
}
else
{