From e9a6882bc320b470d42ba59a1cb1284fbd6b04d0 Mon Sep 17 00:00:00 2001 From: Benau Date: Sat, 13 Jul 2019 13:46:20 +0800 Subject: [PATCH] Fix data path discovery in iOS --- src/io/file_manager.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/io/file_manager.cpp b/src/io/file_manager.cpp index 0249f0329..e93117614 100644 --- a/src/io/file_manager.cpp +++ b/src/io/file_manager.cpp @@ -94,13 +94,22 @@ bool macSetBundlePathIfRelevant(std::string& data_dir) CFRelease(main_bundle_URL); CFRelease(cf_string_ref); - std::string contents = std::string(path) + std::string("/Contents"); + // IOS version of stk store data folder directly inside supertuxkart.app + std::string contents = std::string(path) + "/"; +#ifndef IOS_STK + contents += std::string("Contents"); +#endif if(contents.find(".app") != std::string::npos) { +#ifdef IOS_STK + data_dir = contents; + return true; +#else Log::debug("[FileManager]", "yes"); // executable is inside an app bundle, use app bundle-relative paths data_dir = contents + std::string("/Resources/"); return true; +#endif } else {