Merge remote-tracking branch 'sandstranger/fix-bad-code-in-command-line'
commit
545ca9c9b4
@ -1,18 +1,20 @@
|
||||
#include "android_commandLine.h"
|
||||
#include "string.h"
|
||||
|
||||
const char *argvData[15];
|
||||
int argcData;
|
||||
|
||||
|
||||
const char **argvData;
|
||||
int argcData;
|
||||
|
||||
JNIEXPORT void JNICALL Java_ui_activity_GameActivity_commandLine(JNIEnv *env,
|
||||
jobject obj, jint argc, jobjectArray stringArray) {
|
||||
jboolean iscopy;
|
||||
argcData = (int) argc;
|
||||
argvData[0]="openmw";
|
||||
for (int i = 0; i < argcData; i++) {
|
||||
jstring string = (jstring) (*env).GetObjectArrayElement(stringArray, i);
|
||||
argvData[i+1] = (env)->GetStringUTFChars(string, &iscopy);
|
||||
argvData= new const char * [argcData+1];
|
||||
argvData[0] = "openmw";
|
||||
for (int i = 1; i < argcData+1; i++) {
|
||||
jstring string = (jstring) (*env).GetObjectArrayElement(stringArray, i-1);
|
||||
argvData[i] = (env)->GetStringUTFChars(string, &iscopy);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue