diff options
| author | Léo Lam <leo@leolam.fr> | 2020-10-19 12:17:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-19 12:17:59 +0200 |
| commit | a209410e70bcec6c9136ea6d11570b94cbdbba31 (patch) | |
| tree | fb70ec5d0e524ecd51dacb8359018810724299eb /Source/Android/jni/NativeConfig.cpp | |
| parent | b3cb08830ba176a469c1f7014f201a45ca696999 (diff) | |
| parent | 286124852064acafd9c4225ae6facc33b40f9637 (diff) | |
Merge pull request #9148 from JosJuice/android-active-layer
Android: Fix setting read during play with local game layer active
Diffstat (limited to 'Source/Android/jni/NativeConfig.cpp')
| -rw-r--r-- | Source/Android/jni/NativeConfig.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/Android/jni/NativeConfig.cpp b/Source/Android/jni/NativeConfig.cpp index dfc90329af..636514a3ed 100644 --- a/Source/Android/jni/NativeConfig.cpp +++ b/Source/Android/jni/NativeConfig.cpp @@ -15,6 +15,7 @@ constexpr jint LAYER_BASE_OR_CURRENT = 0; constexpr jint LAYER_LOCAL_GAME = 1; +constexpr jint LAYER_ACTIVE = 2; static Config::Location GetLocation(JNIEnv* env, jstring file, jstring section, jstring key) { @@ -48,21 +49,31 @@ static Config::Location GetLocation(JNIEnv* env, jstring file, jstring section, static std::shared_ptr<Config::Layer> GetLayer(jint layer, const Config::Location& location) { + Config::LayerType layer_type; + switch (layer) { case LAYER_BASE_OR_CURRENT: if (GetActiveLayerForConfig(location) == Config::LayerType::Base) - return Config::GetLayer(Config::LayerType::Base); + layer_type = Config::LayerType::Base; else - return Config::GetLayer(Config::LayerType::CurrentRun); + layer_type = Config::LayerType::CurrentRun; + break; case LAYER_LOCAL_GAME: - return Config::GetLayer(Config::LayerType::LocalGame); + layer_type = Config::LayerType::LocalGame; + break; + + case LAYER_ACTIVE: + layer_type = Config::GetActiveLayerForConfig(location); + break; default: ASSERT(false); return nullptr; } + + return Config::GetLayer(layer_type); } template <typename T> |
