MainAndroid: Allow specifying path for savestates
This commit is contained in:
parent
1df69c5750
commit
d9dd210739
|
@ -297,6 +297,13 @@ public final class NativeLibrary
|
||||||
*/
|
*/
|
||||||
public static native void SaveState(int slot);
|
public static native void SaveState(int slot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Saves a game state to the specified path.
|
||||||
|
*
|
||||||
|
* @param path The path to save state to.
|
||||||
|
*/
|
||||||
|
public static native void SaveStateAs(String path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads a game state from the slot number.
|
* Loads a game state from the slot number.
|
||||||
*
|
*
|
||||||
|
@ -304,6 +311,13 @@ public final class NativeLibrary
|
||||||
*/
|
*/
|
||||||
public static native void LoadState(int slot);
|
public static native void LoadState(int slot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads a game state from the specified path.
|
||||||
|
*
|
||||||
|
* @param path The path to load state from.
|
||||||
|
*/
|
||||||
|
public static native void LoadStateAs(String path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the current working user directory
|
* Sets the current working user directory
|
||||||
* If not set, it auto-detects a location
|
* If not set, it auto-detects a location
|
||||||
|
|
|
@ -449,9 +449,15 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetFilename(
|
||||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveState(JNIEnv* env,
|
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveState(JNIEnv* env,
|
||||||
jobject obj,
|
jobject obj,
|
||||||
jint slot);
|
jint slot);
|
||||||
|
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveStateAs(JNIEnv* env,
|
||||||
|
jobject obj,
|
||||||
|
jstring path);
|
||||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadState(JNIEnv* env,
|
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadState(JNIEnv* env,
|
||||||
jobject obj,
|
jobject obj,
|
||||||
jint slot);
|
jint slot);
|
||||||
|
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadStateAs(JNIEnv* env,
|
||||||
|
jobject obj,
|
||||||
|
jstring path);
|
||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_org_dolphinemu_dolphinemu_services_DirectoryInitializationService_CreateUserDirectories(
|
Java_org_dolphinemu_dolphinemu_services_DirectoryInitializationService_CreateUserDirectories(
|
||||||
JNIEnv* env, jobject obj);
|
JNIEnv* env, jobject obj);
|
||||||
|
@ -650,6 +656,14 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveState(JN
|
||||||
State::Save(slot);
|
State::Save(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveStateAs(JNIEnv* env,
|
||||||
|
jobject obj,
|
||||||
|
jstring path)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> guard(s_host_identity_lock);
|
||||||
|
State::SaveAs(GetJString(env, path));
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadState(JNIEnv* env,
|
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadState(JNIEnv* env,
|
||||||
jobject obj,
|
jobject obj,
|
||||||
jint slot)
|
jint slot)
|
||||||
|
@ -658,6 +672,14 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadState(JN
|
||||||
State::Load(slot);
|
State::Load(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadStateAs(JNIEnv* env,
|
||||||
|
jobject obj,
|
||||||
|
jstring path)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> guard(s_host_identity_lock);
|
||||||
|
State::LoadAs(GetJString(env, path));
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_org_dolphinemu_dolphinemu_services_DirectoryInitializationService_SetSysDirectory(
|
Java_org_dolphinemu_dolphinemu_services_DirectoryInitializationService_SetSysDirectory(
|
||||||
JNIEnv* env, jobject obj, jstring jPath)
|
JNIEnv* env, jobject obj, jstring jPath)
|
||||||
|
|
Loading…
Reference in New Issue