summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2013-10-19 00:47:21 -0500
committerTim Angus <tim@ngus.net>2014-08-28 11:03:29 +0100
commit06b38d40f5da3793726e0ebf0358d7a4d261ef49 (patch)
tree7ec0b1f93f11a00e358f0b2c09423c7e8d51301c
parentd91deecede3f3335821cb99c913ab768e5024415 (diff)
Ignore -psn* arguments on Mac OS X
Mac OS X adds an argument starting with "-psn" when launched using Finder, Dock, or a terminal using open command and not specifying arguments. It caused the opening videos to be skipped. This change mimics SDL 1.2.
-rw-r--r--src/sys/sys_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c
index f58766f1..41045cd4 100644
--- a/src/sys/sys_main.c
+++ b/src/sys/sys_main.c
@@ -616,6 +616,12 @@ int main( int argc, char **argv )
// Set the initial time base
Sys_Milliseconds( );
+#if MACOS_X
+ // This is passed if we are launched by double-clicking
+ if ( argc >= 2 && Q_strncmp ( argv[1], "-psn", 4 ) == 0 )
+ argc = 1;
+#endif
+
Sys_ParseArgs( argc, argv );
Sys_SetBinaryPath( Sys_Dirname( argv[ 0 ] ) );
Sys_SetDefaultInstallPath( DEFAULT_BASEDIR );