Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] Let NativeLibrary handle initial folder structure creation.
  • Loading branch information
Sonicadvance1 committed Aug 29, 2013
1 parent 957c263 commit 96394da
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
Expand Up @@ -63,27 +63,16 @@ public void onCreate(Bundle savedInstanceState)
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");
Expand Down
Expand Up @@ -118,7 +118,11 @@
*/
public static native void LoadState(int slot);


/**
* Creates the initial folder structure in /sdcard/dolphin-emu/
*
*/
public static native void CreateUserFolders();

/**
* Begins emulation.
Expand Down
17 changes: 17 additions & 0 deletions Source/Core/DolphinWX/Src/MainAndroid.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 96394da

Please sign in to comment.