rnd-19980909
[rocksndiamonds.git] / src / events.c
index edce9a9c4ac35ae3a8026938199847e2e3f24c10..af4a4c5690f17aa8878fda42b2f556e10348567e 100644 (file)
@@ -65,10 +65,13 @@ void EventLoop(void)
     else                       /* got no event, but don't be lazy... */
     {
       HandleNoXEvent();
-      Delay(1000);             /* don't use all CPU time when idle */
-    }
 
-    XSync(display,FALSE);
+      /* 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)
+       Delay(1000);
+    }
 
     if (game_status==EXITGAME)
       return;
@@ -612,29 +615,6 @@ void HandleKey(KeySym key, int key_status)
            Delay(1000000);
          }
 
-         break;
-
-       case XK_z:
-         {
-           static int test_picture_pos = 0;
-
-           printf("test picture %d\n", test_picture_pos);
-
-           XCopyArea(display,test_pix[test_picture_pos],window,gc,
-                     0,0, 100,100,
-                     0,0);
-           /*
-           XCopyArea(display,test_clipmask[test_picture_pos],window,gc,
-                     0,0, 100,100,
-                     100,0);
-                     */
-           XFlush(display);
-           XSync(display,FALSE);
-           Delay(1000000);
-
-           test_picture_pos = (test_picture_pos + 1) % test_picture_count;
-         }
-
          break;
 #endif