Further work on the Xcode project.

git-svn-id: https://svn.eduke32.com/eduke32@4648 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2014-10-20 07:37:29 +00:00
parent 8771614f87
commit 62b37ddb68
13 changed files with 1474 additions and 70 deletions

View file

@ -10,6 +10,17 @@
# include <windows.h> # include <windows.h>
# endif # endif
#ifdef __APPLE__
#include <TargetConditionals.h>
#if !TARGET_OS_IPHONE
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
# include <CoreFoundation/CoreFoundation.h>
#endif
# include <CoreServices/CoreServices.h>
#endif
#endif
#ifndef UNREFERENCED_PARAMETER #ifndef UNREFERENCED_PARAMETER
#define UNREFERENCED_PARAMETER(x) x=x #define UNREFERENCED_PARAMETER(x) x=x
#endif #endif

View file

@ -6,6 +6,10 @@
*/ */
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include <TargetConditionals.h>
#if TARGET_OS_MAC
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>
#include "sdl_inc.h" #include "sdl_inc.h"
@ -21,8 +25,6 @@
- (void)setAppleMenu:(NSMenu *)menu; - (void)setAppleMenu:(NSMenu *)menu;
@end @end
/* Use this flag to determine whether we use SDLMain.nib or not */
#define SDL_USE_NIB_FILE 0
/* Use this flag to determine whether we use CPS (docking) or not */ /* Use this flag to determine whether we use CPS (docking) or not */
#define SDL_USE_CPS #define SDL_USE_CPS
@ -63,13 +65,6 @@ static NSString *getApplicationName(void)
return appName; return appName;
} }
#if SDL_USE_NIB_FILE
/* A helper category for NSString */
@interface NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
@end
#endif
@interface NSApplication (SDLApplication) @interface NSApplication (SDLApplication)
@end @end
@ -106,32 +101,6 @@ static NSString *getApplicationName(void)
} }
} }
#if SDL_USE_NIB_FILE
/* Fix menu to contain the real app name instead of "SDL App" */
- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
{
NSRange aRange;
NSEnumerator *enumerator;
NSMenuItem *menuItem;
aRange = [[aMenu title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
enumerator = [[aMenu itemArray] objectEnumerator];
while ((menuItem = [enumerator nextObject]))
{
aRange = [[menuItem title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
if ([menuItem hasSubmenu])
[self fixMenu:[menuItem submenu] withAppName:appName];
}
}
#else
static void setApplicationMenu(void) static void setApplicationMenu(void)
{ {
/* warning: this code is very odd */ /* warning: this code is very odd */
@ -239,8 +208,6 @@ static void CustomApplicationMain (int argc, char **argv)
[pool release]; [pool release];
} }
#endif
/* /*
* Catch document open requests...this lets us notice files when the app * Catch document open requests...this lets us notice files when the app
@ -299,11 +266,6 @@ static void CustomApplicationMain (int argc, char **argv)
/* Set the working directory to the .app's parent directory */ /* Set the working directory to the .app's parent directory */
[self setupWorkingDirectory:gFinderLaunch]; [self setupWorkingDirectory:gFinderLaunch];
#if SDL_USE_NIB_FILE
/* Set the main menu to contain the real app name instead of "SDL App" */
[self fixMenu:[nsapp mainMenu] withAppName:getApplicationName()];
#endif
/* Hand off to main application code */ /* Hand off to main application code */
gCalledAppMainline = TRUE; gCalledAppMainline = TRUE;
status = SDL_main (gArgc, gArgv); status = SDL_main (gArgc, gArgv);
@ -380,10 +342,9 @@ int main (int argc, char **argv)
gFinderLaunch = NO; gFinderLaunch = NO;
} }
#if SDL_USE_NIB_FILE
NSApplicationMain (argc, argv);
#else
CustomApplicationMain (argc, argv); CustomApplicationMain (argc, argv);
#endif
return 0; return 0;
} }
#endif

View file

@ -29,13 +29,6 @@
// #include <sys/stat.h> // #include <sys/stat.h>
#include <limits.h> #include <limits.h>
#ifdef __APPLE__
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
# include <CoreFoundation/CoreFoundation.h>
# include <CoreServices/CoreServices.h>
#endif
#endif
#if defined(_MSC_VER) #if defined(_MSC_VER)
# include <io.h> # include <io.h>
#else #else

View file

@ -1,6 +1,7 @@
#include "compat.h" #include "compat.h"
#include "osxbits.h" #include "osxbits.h"
#import <Cocoa/Cocoa.h> #import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#ifndef MAC_OS_VERSION_10_3 #ifndef MAC_OS_VERSION_10_3
# define MAC_OS_VERSION_10_3 1030 # define MAC_OS_VERSION_10_3 1030

View file

@ -13,7 +13,7 @@
#include <signal.h> #include <signal.h>
#include "sdl_inc.h" #include "sdl_inc.h"
#include "compat.h" #include "compat.h"
#include "sdlayer.h" #include "renderlayer.h"
#include "cache1d.h" #include "cache1d.h"
//#include "pragmas.h" //#include "pragmas.h"
#include "a.h" #include "a.h"
@ -48,7 +48,7 @@
# include <ogc/lwp_watchdog.h> # include <ogc/lwp_watchdog.h>
#endif #endif
#if !defined _WIN32 && !defined HAVE_GTK2 && !defined __APPLE__ #if !defined STARTUP_SETUP_WINDOW
int32_t startwin_open(void) { return 0; } int32_t startwin_open(void) { return 0; }
int32_t startwin_close(void) { return 0; } int32_t startwin_close(void) { return 0; }
int32_t startwin_puts(const char *s) { UNREFERENCED_PARAMETER(s); return 0; } int32_t startwin_puts(const char *s) { UNREFERENCED_PARAMETER(s); return 0; }
@ -162,7 +162,7 @@ int32_t wm_msgbox(const char *name, const char *fmt, ...)
vsnprintf(buf,sizeof(buf),fmt,va); vsnprintf(buf,sizeof(buf),fmt,va);
va_end(va); va_end(va);
#if defined(__APPLE__) #if defined(__APPLE__) && !TARGET_OS_IPHONE
return osx_msgbox(name, buf); return osx_msgbox(name, buf);
#elif defined HAVE_GTK2 #elif defined HAVE_GTK2
if (gtkbuild_msgbox(name, buf) >= 0) return 1; if (gtkbuild_msgbox(name, buf) >= 0) return 1;
@ -204,7 +204,7 @@ int32_t wm_ynbox(const char *name, const char *fmt, ...)
vsprintf(buf,fmt,va); vsprintf(buf,fmt,va);
va_end(va); va_end(va);
#if defined __APPLE__ #if defined __APPLE__ && !TARGET_OS_IPHONE
return osx_ynbox(name, buf); return osx_ynbox(name, buf);
#elif defined HAVE_GTK2 #elif defined HAVE_GTK2
{ {

View file

@ -0,0 +1,53 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View file

@ -0,0 +1,51 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"subtype" : "retina4",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View file

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>EDuke32</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
<key>CFBundleIdentifier</key>
<string>com.voidpoint.eduke32</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>EDuke32</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View file

@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

View file

@ -7,6 +7,9 @@
* *
*/ */
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
@interface GameListSource : NSObject <NSComboBoxDataSource> @interface GameListSource : NSObject <NSComboBoxDataSource>
{ {
NSMutableArray *list; NSMutableArray *list;

View file

@ -7,7 +7,7 @@
* *
*/ */
#import <Cocoa/Cocoa.h> #import <Foundation/Foundation.h>
#include "compat.h" #include "compat.h"

View file

@ -7,7 +7,7 @@
* *
*/ */
#import <Cocoa/Cocoa.h> #import <Foundation/Foundation.h>
#include "grpscan.h" #include "grpscan.h"