mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-20 06:53:30 +00:00
Fixes and enhancements from my MCPE repository. (https://github.com/mschiller890/mcpe64)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "App.h"
|
||||
#include "AppPlatform_android.h"
|
||||
#include <android_native_app_glue.h>
|
||||
|
||||
// Horrible, I know. / A
|
||||
#ifndef MAIN_CLASS
|
||||
@@ -38,7 +39,15 @@ static void setupExternalPath(struct android_app* state, MAIN_CLASS* app)
|
||||
const char* str = env->GetStringUTFChars((jstring) pathString, NULL);
|
||||
app->externalStoragePath = str;
|
||||
app->externalCacheStoragePath = str;
|
||||
LOGI(str);
|
||||
LOGI("%s", str);
|
||||
|
||||
// ensure the process working directory is set to a writable location
|
||||
// on Android the default cwd may be '/' which isn't writable. By chdir'ing
|
||||
// to the external storage path we make relative fopen calls (e.g. "options.txt")
|
||||
// succeed and persist across launches, fixing the "options never save" bug.
|
||||
if (chdir(str) != 0) {
|
||||
LOGI("chdir to %s failed: %s", str, strerror(errno));
|
||||
}
|
||||
|
||||
env->ReleaseStringUTFChars((jstring)pathString, str);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user