mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Android: Fix setting read during play with local game layer active
During emulation, when LocalGame has a value but CurrentRun doesn't, we want to read from LocalGame, not CurrentRun. This change exposes a LAYER_ACTIVE option that handles this correctly.
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user