X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=470271cbefe3a68b6de54c4fc79d1a6d9b23cc6c;hb=2d57e3c2b6241f64246029e78b4b004b4a0ebf2f;hp=d3f8196bac56506101241334fdca3e5a20b564a3;hpb=d5b2ac0f473b0868014826e2c6488c72c79008f1;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index d3f8196b..470271cb 100644 --- a/src/events.c +++ b/src/events.c @@ -79,13 +79,15 @@ void EventLoop(void) } } } - - HandleNoXEvent(); + else + HandleNoEvent(); /* don't use all CPU time when idle; the main loop while playing has its own synchronization and is CPU friendly, too */ - if (game_status != PLAYING) + if (game_status == PLAYING) + HandleGameActions(); + else { SyncDisplay(); if (!PendingEvent()) /* delay only if no pending events */ @@ -258,7 +260,7 @@ void HandleMotionEvent(MotionEvent *event) if (!PointerInWindow(window)) return; /* window and pointer are on different screens */ -#if 0 +#if 1 if (button_status == MB_RELEASED && game_status != LEVELED) return; #endif @@ -424,6 +426,7 @@ void HandleButton(int mx, int my, int button) void HandleKey(Key key, int key_status) { int joy = 0; + boolean anyTextGadgetActiveOrJustFinished = anyTextGadgetActive(); static struct SetupKeyboardInfo custom_key; static struct { @@ -587,7 +590,8 @@ void HandleKey(Key key, int key_status) break; case LEVELED: - HandleLevelEditorKeyInput(key); + if (!anyTextGadgetActiveOrJustFinished) + HandleLevelEditorKeyInput(key); break; case PLAYING: @@ -738,7 +742,7 @@ void HandleKey(Key key, int key_status) } } -void HandleNoXEvent() +void HandleNoEvent() { if (button_status && game_status != PLAYING) { @@ -752,9 +756,6 @@ void HandleNoXEvent() #endif HandleJoystick(); - - if (game_status == PLAYING) - HandleGameActions(); } static int HandleJoystickForAllPlayers()