diff src/main/macosx/SDLMain.m @ 58:bd6b0a910a65

* Removed fullscreen menu option from the "Window" menu * Updated the BUGS file * Fixed command line parameters when launched from Finder * Implemented setting the icon window caption * Implemented frameless style windows * Added note about SDL_RESIZABLE implementation to SDL_QuartzVideo.m * Window close requests now go through the event filtering system
author Sam Lantinga <slouken@lokigames.com>
date Mon, 11 Jun 2001 06:44:43 +0000
parents 45b1c4303f87
children 4382c38dfbee
line wrap: on
line diff
--- a/src/main/macosx/SDLMain.m	Mon Jun 11 00:08:35 2001 +0000
+++ b/src/main/macosx/SDLMain.m	Mon Jun 11 06:44:43 2001 +0000
@@ -23,12 +23,6 @@
 	SDL_PushEvent(&event);
 }
 
-/* Invoked from the "Make fulllscreen" menu item */
-- (void) makeFullscreen:(id)sender
-{
-    
-}
-
 /* Set the working directory to the .app's parent directory */
 - (void) setupWorkingDirectory
 {
@@ -53,16 +47,16 @@
 /* Called when the internal event loop has just started running */
 - (void) applicationDidFinishLaunching: (NSNotification *) note
 {
+    int status;
+
     /* Set the working directory to the .app's parent directory */
     [ self setupWorkingDirectory ];
-    
-    /* This is passed if we are launched by double-clicking */
-    if ( gArgc >= 2 && strncmp (gArgv[1], "-psn", 4) == 0 )
-        gArgc = 1;
-    
+
     /* Hand off to main application code */
-    SDL_main (gArgc, gArgv);
-    exit(0);
+    status = SDL_main (gArgc, gArgv);
+
+    /* We're done, thank you for playing */
+    exit(status);
 }
 @end
 
@@ -76,13 +70,19 @@
     /* Copy the arguments into a global variable */
     int i;
     
-    gArgc = argc;
-    gArgv = (char**) malloc (sizeof(*gArgv) * gArgc);
+    /* This is passed if we are launched by double-clicking */
+    if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+        gArgc = 1;
+    } else {
+        gArgc = argc;
+    }
+    gArgv = (char**) malloc (sizeof(*gArgv) * (gArgc+1));
     assert (gArgv != NULL);
     for (i = 0; i < gArgc; i++) {
-        gArgv[i] = strdup (argv[i]);
+        gArgv[i] = argv[i];
     }
-    
+    gArgv[i] = NULL;
+
     NSApplicationMain (argc, argv);
     return 0;
-}
\ No newline at end of file
+}