rnd-19980930-1
[rocksndiamonds.git] / src / events.c
index 9a2cdd41b6f6cce864ff645838e8572564bd3d9d..d0684ed3d220061fbcb3076b55b6ddd1c97054b2 100644 (file)
@@ -1,13 +1,12 @@
 /***********************************************************
 *  Rocks'n'Diamonds -- McDuffin Strikes Back!              *
 *----------------------------------------------------------*
-*  ©1995 Artsoft Development                               *
-*        Holger Schemel                                    *
-*        33659 Bielefeld-Senne                             *
-*        Telefon: (0521) 493245                            *
-*        eMail: aeglos@valinor.owl.de                      *
-*               aeglos@uni-paderborn.de                    *
-*               q99492@pbhrzx.uni-paderborn.de             *
+*  (c) 1995-98 Artsoft Entertainment                       *
+*              Holger Schemel                              *
+*              Oststrasse 11a                              *
+*              33604 Bielefeld                             *
+*              phone: ++49 +521 290471                     *
+*              email: aeglos@valinor.owl.de                *
 *----------------------------------------------------------*
 *  events.c                                                *
 ***********************************************************/
@@ -180,8 +179,8 @@ void HandleExposeEvent(XExposeEvent *event)
   {
     int fx = FX, fy = FY;
 
-    fx += (local_player->MovDir & (MV_LEFT|MV_RIGHT) ? ScreenMovPos : 0);
-    fy += (local_player->MovDir & (MV_UP|MV_DOWN)    ? ScreenMovPos : 0);
+    fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
+    fy += (ScreenMovDir & (MV_UP|MV_DOWN)    ? ScreenGfxPos : 0);
 
     XCopyArea(display,fieldbuffer,backbuffer,gc,
              fx,fy, SXSIZE,SYSIZE,
@@ -273,7 +272,7 @@ void HandleButton(int mx, int my, int button)
     int sx = (mx - SX) / TILEX;
     int sy = (my - SY) / TILEY;
 
-    if (IN_SCR_FIELD(sx,sy))
+    if (IN_VIS_FIELD(sx,sy))
     {
       int x = LEVELX(sx);
       int y = LEVELY(sy);
@@ -667,6 +666,20 @@ void HandleKey(KeySym key, int key_status)
            printf("\n");
          }
 
+         break;
+
+       case XK_t:
+         {
+           char *color[] = { "yellow", "red", "green", "blue" };
+
+           do
+             TestPlayer = (TestPlayer + 1) % MAX_PLAYERS;
+           while(!stored_player[TestPlayer].active);
+
+           printf("TestPlayer = %d (%s player)\n",
+                  TestPlayer, color[TestPlayer]);
+         }
+
          break;
 #endif
 
@@ -714,7 +727,12 @@ void HandleJoystick()
 {
   int joystick = Joystick();
   int keyboard = key_joystick_mapping;
+
+  /*
   int joy      = (tape.playing ? TapePlayAction() : (joystick | keyboard));
+  */
+
+  int joy      = (joystick | keyboard);
   int left     = joy & JOY_LEFT;
   int right    = joy & JOY_RIGHT;
   int up       = joy & JOY_UP;