summaryrefslogtreecommitdiff
path: root/Source/Android/src
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2013-08-19 20:55:50 -0400
committerLioncash <mathew1800@gmail.com>2013-08-19 20:55:50 -0400
commita87b967cde154a159cc0cea0a77867956e02260d (patch)
tree5576af7acdbdbd441e0d8f23ff6caef73e3d4d3b /Source/Android/src
parent377202b9f6154ae56c5b2f0a45e235ceaeb6da9c (diff)
[Android] Simplify saving settings to the ini file. Since the setting names are known, there's no reason to loop through them.
This will likely be simplified further very soon.
Diffstat (limited to 'Source/Android/src')
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/GameListActivity.java43
1 files changed, 5 insertions, 38 deletions
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/GameListActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/GameListActivity.java
index bbc3a0be72..625265be35 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/GameListActivity.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/GameListActivity.java
@@ -25,10 +25,8 @@ import java.util.List;
public final class GameListActivity extends Activity
implements GameListFragment.OnGameListZeroListener
{
-
private int mCurFragmentNum = 0;
private Fragment mCurFragment;
- enum keyTypes {TYPE_STRING, TYPE_BOOL};
private ActionBarDrawerToggle mDrawerToggle;
private DrawerLayout mDrawerLayout;
@@ -112,44 +110,13 @@ public final class GameListActivity extends Activity
// Settings
case 2:
{
- String Keys[] = {
- "cpuCorePref",
- "dualCorePref",
- "gpuPref",
- };
- String ConfigKeys[] = {
- "Core-CPUCore",
- "Core-CPUThread",
- "Core-GFXBackend",
- };
-
- keyTypes KeysTypes[] = {
- keyTypes.TYPE_STRING,
- keyTypes.TYPE_BOOL,
- keyTypes.TYPE_STRING,
- };
+ // Saves the settings that the user has set in the settings menu to the Dolphin ini files.
+ // This is done so that changes can be reflected when the emulator is run next.
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
- // Set our preferences here
- for (int a = 0; a < Keys.length; ++a)
- {
- String ConfigValues[] = ConfigKeys[a].split("-");
- String Key = ConfigValues[0];
- String Value = ConfigValues[1];
-
- switch(KeysTypes[a])
- {
- case TYPE_STRING:
- String strPref = prefs.getString(Keys[a], "");
- NativeLibrary.SetConfig("Dolphin.ini", Key, Value, strPref);
- break;
- case TYPE_BOOL:
- boolean boolPref = prefs.getBoolean(Keys[a], true);
- NativeLibrary.SetConfig("Dolphin.ini", Key, Value, boolPref ? "True" : "False");
- break;
- }
-
- }
+ NativeLibrary.SetConfig("Dolphin.ini", "Core", "CPUCore", prefs.getString("cpuCorePref", ""));
+ NativeLibrary.SetConfig("Dolphin.ini", "Core", "CPUThread", prefs.getBoolean("dualCorePref", true) ? "True" : "False");
+ NativeLibrary.SetConfig("Dolphin.ini", "Core", "GFXBackend", prefs.getString("gpuPref", ""));
}
break;