Revert f0a8372278 for SDL1.2 only

This commit is contained in:
Celtic Minstrel 2015-09-23 23:33:54 -04:00
parent f0a8372278
commit eebe3cfb75

View file

@ -16,6 +16,38 @@ static char **gArgv;
@interface SDLApplication : NSApplication
@end
#if !SDL_VERSION_ATLEAST(2,0,0)
@implementation SDLApplication
/* Invoked from the Quit menu item */
- (void)terminate:(id)sender
{
/* Post a SDL_QUIT event */
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
}
- (BOOL)_handleKeyEquivalent:(NSEvent *)theEvent
{
[[super mainMenu] performKeyEquivalent:theEvent];
return YES;
}
- (void) sendEvent:(NSEvent *)event
{
if(NSKeyDown == [event type] || NSKeyUp == [event type])
{
if([event modifierFlags] & NSCommandKeyMask)
{
[super sendEvent: event];
}
} else {
[super sendEvent: event];
}
}
@end
#endif
/* The main class of the application, the application's delegate */
@implementation SDLMain