From 79553ab1fa3d707612e80dd03bf95ca65fa0c411 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Tue, 4 Feb 2025 23:11:08 +0100 Subject: refactor file browser --- lib/nes/app/input/input-manager.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/nes/app/input/input-manager.cc') 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(i)); - inputs_[i].device = *it; + inputs_[i].device = &*it; } else { -- cgit v1.3.1