summaryrefslogtreecommitdiff
path: root/Source/Android/jni/ButtonManager.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2019-06-19 11:51:00 +0200
committerGitHub <noreply@github.com>2019-06-19 11:51:00 +0200
commit16afac9da9ef28f76d05b2ea8a373e8d461f81bc (patch)
tree553ed00c721e5abfe1f8b94a2215bb4a782f5fc3 /Source/Android/jni/ButtonManager.cpp
parent7dbfcb6870e9c376f5253237ed6e013bc25ba5cc (diff)
parent47e776d3789f7127fd2e80bc4988653a3ef001c2 (diff)
Merge pull request #7927 from weihuoya/android-key-map
android: simplify config loading code
Diffstat (limited to 'Source/Android/jni/ButtonManager.cpp')
-rw-r--r--Source/Android/jni/ButtonManager.cpp37
1 files changed, 2 insertions, 35 deletions
diff --git a/Source/Android/jni/ButtonManager.cpp b/Source/Android/jni/ButtonManager.cpp
index 7530e37cfd..1ba6de758e 100644
--- a/Source/Android/jni/ButtonManager.cpp
+++ b/Source/Android/jni/ButtonManager.cpp
@@ -565,41 +565,8 @@ void Init(const std::string& gameId)
}
// Init our controller bindings
IniFile ini;
- ini.Load(File::GetUserPath(D_CONFIG_IDX) + std::string("Dolphin.ini"));
- for (u32 a = 0; a < configStrings.size(); ++a)
- {
- for (int padID = 0; padID < 8; ++padID)
- {
- std::ostringstream config;
- config << configStrings[a] << "_" << padID;
- BindType type;
- int bindnum;
- char dev[128];
- bool hasbind = false;
- char modifier = '+';
- std::string value;
- ini.GetOrCreateSection("Android")->Get(config.str(), &value, "None");
- if (value == "None")
- continue;
- if (std::string::npos != value.find("Axis"))
- {
- hasbind = true;
- type = BIND_AXIS;
- sscanf(value.c_str(), "Device '%127[^\']'-Axis %d%c", dev, &bindnum, &modifier);
- }
- else if (std::string::npos != value.find("Button"))
- {
- hasbind = true;
- type = BIND_BUTTON;
- sscanf(value.c_str(), "Device '%127[^\']'-Button %d", dev, &bindnum);
- }
- if (hasbind)
- AddBind(std::string(dev),
- new sBind(padID, configTypes[a], type, bindnum, modifier == '-' ? -1.0f : 1.0f));
- }
- }
-
- ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + std::string(gameId + ".ini"));
+ ini.Load(File::GetUserPath(D_CONFIG_IDX) + std::string("Dolphin.ini"), true);
+ ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + std::string(gameId + ".ini"), true);
for (u32 a = 0; a < configStrings.size(); ++a)
{
for (int padID = 0; padID < 8; ++padID)