#######################################################################################################################* *-----------------------------------------------------Configuration-------------------------------------------------------* *#########################################################################################################################*/
| 149 | *-----------------------------------------------------Configuration-------------------------------------------------------* |
| 150 | *#########################################################################################################################*/ |
| 151 | cc_result Platform_SetDefaultCurrentDirectory(int argc, char **argv) { |
| 152 | cc_string dir; char dirBuffer[FILENAME_SIZE + 1]; |
| 153 | String_InitArray_NT(dir, dirBuffer); |
| 154 | JNIEnv* env; |
| 155 | Java_GetCurrentEnv(env); |
| 156 | |
| 157 | jobject obj = Java_ICall_Obj(env, JAVA_getGameDataDir, NULL); |
| 158 | Java_DecodeString(env, obj, &dir); |
| 159 | |
| 160 | Java_DeleteLocalRef(env, obj); |
| 161 | // TODO should be raw path |
| 162 | dir.buffer[dir.length] = '\0'; |
| 163 | Platform_Log1("DATA DIR: %s|", &dir); |
| 164 | |
| 165 | int res = chdir(dir.buffer) == -1 ? errno : 0; |
| 166 | if (!res) return 0; |
| 167 | |
| 168 | // show the path to the user |
| 169 | // TODO there must be a better way |
| 170 | Window_ShowDialog("Failed to set working directory to", dir.buffer); |
| 171 | return res; |
| 172 | } |
| 173 | |
| 174 | void GetDeviceUUID(cc_string* str) { |
| 175 | JNIEnv* env; |
nothing calls this directly
no test coverage detected