Added ability to run without application bundle

You just need executable, zdoom.pk3 and IWAD
This commit is contained in:
alexey.lysiuk 2014-11-15 19:11:01 +02:00
parent 398b36064b
commit 65ce06f274

View file

@ -119,6 +119,21 @@ enum
#endif // prior to 10.5
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
enum
{
NSApplicationActivationPolicyRegular
};
typedef NSInteger NSApplicationActivationPolicy;
@interface NSApplication(ActivationPolicy)
- (BOOL)setActivationPolicy:(NSApplicationActivationPolicy)activationPolicy;
@end
#endif // prior to 10.6
#include <SDL.h>
// Avoid collision between DObject class and Objective-C
@ -2109,6 +2124,13 @@ int main(int argc, char** argv)
[NSApplication sharedApplication];
// The following code isn't mandatory,
// but it enables to run the application without a bundle
if ([NSApp respondsToSelector:@selector(setActivationPolicy:)])
{
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
}
CreateMenu();
appCtrl = [ApplicationController new];