X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fevents.c;h=9966905b6286a496ee0a97868b2990105d6dc98a;hp=e4f3329e32ab740df7fd18246735a97d19b7c4f2;hb=c38790fcee093efb156366bb4a02dbde55085ca4;hpb=7373d54bd6896193f7f20ed0ff148dacee9d084e diff --git a/src/events.c b/src/events.c index e4f3329e..9966905b 100644 --- a/src/events.c +++ b/src/events.c @@ -218,6 +218,10 @@ static void HandleEvents(void) HandleKeyEvent((KeyEvent *) &event); break; + case EVENT_USER: + HandleUserEvent((UserEvent *) &event); + break; + default: HandleOtherEvents(&event); break; @@ -233,10 +237,6 @@ void HandleOtherEvents(Event *event) { switch (event->type) { - case EVENT_CLIENTMESSAGE: - HandleClientMessageEvent((ClientMessageEvent *) event); - break; - case SDL_CONTROLLERBUTTONDOWN: case SDL_CONTROLLERBUTTONUP: // for any game controller button event, disable overlay buttons @@ -261,6 +261,10 @@ void HandleOtherEvents(Event *event) HandleDropEvent(event); break; + case EVENT_QUIT: + CloseAllAndExit(0); + break; + default: break; } @@ -1424,12 +1428,6 @@ void HandleKeyEvent(KeyEvent *event) HandleKey(key, key_status); } -void HandleClientMessageEvent(ClientMessageEvent *event) -{ - if (CheckCloseWindowEvent(event)) - CloseAllAndExit(0); -} - static int HandleDropFileEvent(char *filename) { Error(ERR_DEBUG, "DROP FILE EVENT: '%s'", filename); @@ -1605,6 +1603,15 @@ void HandleDropEvent(Event *event) SDL_free(event->drop.file); } +void HandleUserEvent(UserEvent *event) +{ + switch (event->code) + { + default: + break; + } +} + void HandleButton(int mx, int my, int button, int button_nr) { static int old_mx = 0, old_my = 0;