|
@@ -44,8 +44,9 @@ static char **forward_argv;
|
|
|
static int exit_status;
|
|
static int exit_status;
|
|
|
static UIWindow *launch_window;
|
|
static UIWindow *launch_window;
|
|
|
|
|
|
|
|
-// Urho3D: added variable
|
|
|
|
|
|
|
+// Urho3D: added variables
|
|
|
const char* resource_dir = 0;
|
|
const char* resource_dir = 0;
|
|
|
|
|
+const char* documents_dir = 0;
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
int main(int argc, char **argv)
|
|
|
{
|
|
{
|
|
@@ -95,6 +96,22 @@ const char* SDL_IOS_GetResourceDir()
|
|
|
return resource_dir;
|
|
return resource_dir;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// Urho3D: added function
|
|
|
|
|
+const char* SDL_IOS_GetDocumentsDir()
|
|
|
|
|
+{
|
|
|
|
|
+ if (!documents_dir)
|
|
|
|
|
+ {
|
|
|
|
|
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
|
|
|
|
+ NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
|
|
|
|
|
+
|
|
|
|
|
+ const char *temp = [basePath UTF8String];
|
|
|
|
|
+ documents_dir = malloc(strlen(temp) + 1);
|
|
|
|
|
+ strcpy(documents_dir, temp);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return documents_dir;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
static void
|
|
static void
|
|
|
SDL_IdleTimerDisabledChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
|
|
SDL_IdleTimerDisabledChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
|
|
|
{
|
|
{
|