mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 22:01:38 +00:00
Android: Add input profile management
Co-authored-by: Charles Lombardo <clombardo169@gmail.com>
This commit is contained in:
parent
7ef229d908
commit
1eeded23df
18 changed files with 612 additions and 6 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <jni.h>
|
||||
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/IniFile.h"
|
||||
#include "Core/HW/GCPad.h"
|
||||
#include "Core/HW/Wiimote.h"
|
||||
|
@ -95,6 +96,33 @@ Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedContro
|
|||
controller->UpdateReferences(g_controller_interface);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedController_loadProfile(
|
||||
JNIEnv* env, jobject obj, jstring j_path)
|
||||
{
|
||||
ControllerEmu::EmulatedController* controller = EmulatedControllerFromJava(env, obj);
|
||||
|
||||
IniFile ini;
|
||||
ini.Load(GetJString(env, j_path));
|
||||
|
||||
controller->LoadConfig(ini.GetOrCreateSection("Profile"));
|
||||
controller->UpdateReferences(g_controller_interface);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedController_saveProfile(
|
||||
JNIEnv* env, jobject obj, jstring j_path)
|
||||
{
|
||||
const std::string path = GetJString(env, j_path);
|
||||
|
||||
File::CreateFullPath(path);
|
||||
|
||||
IniFile ini;
|
||||
|
||||
EmulatedControllerFromJava(env, obj)->SaveConfig(ini.GetOrCreateSection("Profile"));
|
||||
ini.Save(path);
|
||||
}
|
||||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedController_getGcPad(
|
||||
JNIEnv* env, jclass, jint controller_index)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue