|
|
@@ -54,16 +54,19 @@ void Urho3DPlayer::Setup()
|
|
|
{
|
|
|
FileSystem* filesystem = GetSubsystem<FileSystem>();
|
|
|
|
|
|
- // On Android and iOS, read command line from a file as parameters can not otherwise be easily given
|
|
|
- #if defined(ANDROID) || defined(IOS)
|
|
|
- SharedPtr<File> commandFile(new File(context_, filesystem->GetProgramDir() + "Data/CommandLine.txt",
|
|
|
- FILE_READ));
|
|
|
- String commandLine = commandFile->ReadLine();
|
|
|
- commandFile->Close();
|
|
|
- ParseArguments(commandLine, false);
|
|
|
- // Reparse engine startup parameters now
|
|
|
- engineParameters_ = Engine::ParseParameters(GetArguments());
|
|
|
- #endif
|
|
|
+ // Read command line from a file if no arguments given. This is primarily intended for mobile platforms.
|
|
|
+ // Note that the command file name uses a hardcoded path that does not utilize the resource system
|
|
|
+ // properly (including resource path prefix), as the resource system is not yet initialized at this point
|
|
|
+ const String commandFileName = filesystem->GetProgramDir() + "Data/CommandLine.txt";
|
|
|
+ if (GetArguments().Empty() && filesystem->FileExists(commandFileName))
|
|
|
+ {
|
|
|
+ SharedPtr<File> commandFile(new File(context_, commandFileName));
|
|
|
+ String commandLine = commandFile->ReadLine();
|
|
|
+ commandFile->Close();
|
|
|
+ ParseArguments(commandLine, false);
|
|
|
+ // Reparse engine startup parameters now
|
|
|
+ engineParameters_ = Engine::ParseParameters(GetArguments());
|
|
|
+ }
|
|
|
|
|
|
// Check for script file name
|
|
|
const Vector<String>& arguments = GetArguments();
|