mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 22:56:52 +01:00
[Android] Let NativeLibrary handle initial folder structure creation.
This commit is contained in:
parent
957c263367
commit
96394da1c2
@ -63,27 +63,16 @@ public final class DolphinEmulator<MainActivity> extends Activity
|
||||
Intent ListIntent = new Intent(this, GameListActivity.class);
|
||||
startActivityForResult(ListIntent, 1);
|
||||
|
||||
// Make the assets directory
|
||||
String BaseDir = Environment.getExternalStorageDirectory()+File.separator+"dolphin-emu";
|
||||
File directory = new File(BaseDir);
|
||||
directory.mkdirs();
|
||||
|
||||
String ConfigDir = BaseDir + File.separator + "Config";
|
||||
directory = new File(ConfigDir);
|
||||
directory.mkdirs();
|
||||
|
||||
String GCDir = BaseDir + File.separator + "GC";
|
||||
directory = new File(GCDir);
|
||||
directory.mkdirs();
|
||||
|
||||
String WiiDir = BaseDir + File.separator + "Wii";
|
||||
directory = new File(WiiDir);
|
||||
directory.mkdirs();
|
||||
|
||||
// Copy assets if needed
|
||||
File file = new File(WiiDir + File.separator + "setting-usa.txt");
|
||||
if(!file.exists())
|
||||
{
|
||||
NativeLibrary.CreateUserFolders();
|
||||
CopyAsset("ButtonA.png", BaseDir + File.separator + "ButtonA.png");
|
||||
CopyAsset("ButtonB.png", BaseDir + File.separator + "ButtonB.png");
|
||||
CopyAsset("ButtonStart.png", BaseDir + File.separator + "ButtonStart.png");
|
||||
|
@ -118,7 +118,11 @@ public final class NativeLibrary
|
||||
*/
|
||||
public static native void LoadState(int slot);
|
||||
|
||||
|
||||
/**
|
||||
* Creates the initial folder structure in /sdcard/dolphin-emu/
|
||||
*
|
||||
*/
|
||||
public static native void CreateUserFolders();
|
||||
|
||||
/**
|
||||
* Begins emulation.
|
||||
|
@ -309,6 +309,23 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadState(JN
|
||||
State::Load(slot);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_CreateUserFolders(JNIEnv *env, jobject obj)
|
||||
{
|
||||
File::CreateFullPath(File::GetUserPath(D_CONFIG_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_WIIUSER_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_CACHE_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_DUMPDSP_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_HIRESTEXTURES_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_SCREENSHOTS_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_STATESAVES_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_MAILLOGS_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX) + USA_DIR DIR_SEP);
|
||||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX) + EUR_DIR DIR_SEP);
|
||||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX) + JAP_DIR DIR_SEP);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj, jobject _surf)
|
||||
{
|
||||
surf = ANativeWindow_fromSurface(env, _surf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user