From 70b7f42e22c58ef77ed901a32d7911cb8c851345 Mon Sep 17 00:00:00 2001 From: emoose Date: Fri, 10 Jan 2025 22:27:43 +0000 Subject: [PATCH] InputManager: fix issue with A/B/Start/Back in non-debug builds --- src/input_manager.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/input_manager.cpp b/src/input_manager.cpp index 82ed46c..835e1c9 100644 --- a/src/input_manager.cpp +++ b/src/input_manager.cpp @@ -483,12 +483,17 @@ class InputManager if (!std::filesystem::exists(iniPath)) return false; + spdlog::info(__FUNCTION__ " - reading INI from {}", iniPath.string()); + std::vector> pad_binds; std::vector> key_binds; std::ifstream file(iniPath); if (!file || !file.is_open()) + { + spdlog::error(__FUNCTION__ " - failed to read INI, using defaults"); return false; + } std::string line; bool inBindingSection = false; @@ -541,7 +546,12 @@ class InputManager file.close(); if (key_binds.size() <= 0 && pad_binds.size() <= 0) + { + spdlog::error(__FUNCTION__ " - failed to read binds from INI, using defaults"); return false; + } + + spdlog::info(__FUNCTION__ " - {} key binds, {} pad binds", key_binds.size(), pad_binds.size()); // we have binds, reset any of our defaults @@ -571,7 +581,7 @@ class InputManager SwitchId switchId = SwitchId::Count; // is this a volume? - for (int i = 0; i < int(ADChannel::Count); i++) + for (int i = 0; i < 3; i++) { if (!stricmp(actionName.c_str(), volumeNames[i].c_str())) { @@ -624,7 +634,7 @@ class InputManager SwitchId switchId = SwitchId::Count; // Check if it's a volume action - for (int i = 0; i < int(ADChannel::Count); i++) + for (int i = 0; i < 3; i++) { if (!stricmp(actionName.c_str(), volumeNames[i].c_str())) {