rnd-20060323-1-src
authorHolger Schemel <info@artsoft.org>
Thu, 23 Mar 2006 10:20:04 +0000 (11:20 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:51:16 +0000 (10:51 +0200)
src/conftime.h
src/game.c
src/game_em/graphics.c

index 67a4fe6b2773ccceed5ebc730932ea436df2cb61..2414d9152f8da6bcc84dfced7a59cddba84c78ab 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-03-20 23:36]"
+#define COMPILE_DATE_STRING "[2006-03-23 10:55]"
index 98751de41aaeca52086e4695ff2c67da64730a98..8f5a51fe4fb9d77af9a4ec40888aba90f454fed9 100644 (file)
@@ -1209,14 +1209,18 @@ inline void DrawGameValue_Dynamite(int value)
 
 inline void DrawGameValue_Keys(int key[MAX_NUM_KEYS])
 {
+  int base_key_graphic = EL_KEY_1;
   int i;
 
+  if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
+    base_key_graphic = EL_EM_KEY_1;
+
   /* currently only 4 of 8 possible keys are displayed */
   for (i = 0; i < STD_NUM_KEYS; i++)
   {
     if (key[i])
       DrawMiniGraphicExt(drawto, DX_KEYS + i * MINI_TILEX, DY_KEYS,
-                        el2edimg(EL_KEY_1 + i));
+                        el2edimg(base_key_graphic + i));
     else
       BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
                 DOOR_GFX_PAGEX5 + XX_KEYS + i * MINI_TILEX, YY_KEYS,
@@ -1282,7 +1286,9 @@ void DrawAllGameValues(int emeralds, int dynamite, int score, int time,
 
 void DrawGameDoorValues()
 {
-  int i;
+  int dynamite_state = 0;
+  int key_bits = 0;
+  int i, j;
 
   if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
   {
@@ -1291,6 +1297,7 @@ void DrawGameDoorValues()
     return;
   }
 
+#if 0
   DrawGameValue_Level(level_nr);
 
   DrawGameValue_Emeralds(local_player->gems_still_needed);
@@ -1298,8 +1305,37 @@ void DrawGameDoorValues()
   DrawGameValue_Score(local_player->score);
   DrawGameValue_Time(TimeLeft);
 
-  for (i = 0; i < MAX_PLAYERS; i++)
+#else
+
+  if (game.centered_player_nr == -1)
+  {
+    for (i = 0; i < MAX_PLAYERS; i++)
+    {
+      for (j = 0; j < MAX_NUM_KEYS; j++)
+       if (stored_player[i].key[j])
+         key_bits |= (1 << j);
+
+      dynamite_state += stored_player[i].inventory_size;
+    }
+
+#if 0
     DrawGameValue_Keys(stored_player[i].key);
+#endif
+  }
+  else
+  {
+    int player_nr = game.centered_player_nr;
+
+    for (i = 0; i < MAX_NUM_KEYS; i++)
+      if (stored_player[player_nr].key[i])
+       key_bits |= (1 << i);
+
+    dynamite_state = stored_player[player_nr].inventory_size;
+  }
+
+  DrawAllGameValues(local_player->gems_still_needed, dynamite_state,
+                   local_player->score, TimeLeft, key_bits);
+#endif
 }
 
 #if 0
@@ -8021,7 +8057,11 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
          {
            stored_player[i].key[KEY_NR(element)] = key_state;
 
+#if 1
+           DrawGameDoorValues();
+#else
            DrawGameValue_Keys(stored_player[i].key);
+#endif
 
            redraw_mask |= REDRAW_DOOR_1;
          }
@@ -9404,10 +9444,11 @@ void GameActions_RND()
       sy = stored_player[game.centered_player_nr_next].jy;
     }
 
-    DrawRelocateScreen(sx, sy, MV_NONE, TRUE, setup.quick_switch);
-
     game.centered_player_nr = game.centered_player_nr_next;
     game.set_centered_player = FALSE;
+
+    DrawRelocateScreen(sx, sy, MV_NONE, TRUE, setup.quick_switch);
+    DrawGameDoorValues();
   }
 #endif
 
@@ -11634,7 +11675,11 @@ int DigField(struct PlayerInfo *player,
       if (player->inventory_size < MAX_INVENTORY_SIZE)
        player->inventory_element[player->inventory_size++] = element;
 
+#if 1
+      DrawGameDoorValues();
+#else
       DrawGameValue_Dynamite(local_player->inventory_size);
+#endif
     }
     else if (element == EL_DYNABOMB_INCREASE_NUMBER)
     {
@@ -11653,7 +11698,11 @@ int DigField(struct PlayerInfo *player,
     {
       player->key[KEY_NR(element)] = TRUE;
 
+#if 1
+      DrawGameDoorValues();
+#else
       DrawGameValue_Keys(player->key);
+#endif
 
       redraw_mask |= REDRAW_DOOR_1;
     }
@@ -11685,7 +11734,11 @@ int DigField(struct PlayerInfo *player,
          if (player->inventory_size < MAX_INVENTORY_SIZE)
            player->inventory_element[player->inventory_size++] = element;
 
+#if 1
+      DrawGameDoorValues();
+#else
       DrawGameValue_Dynamite(local_player->inventory_size);
+#endif
     }
     else if (collect_count > 0)
     {
@@ -12170,7 +12223,11 @@ boolean DropElement(struct PlayerInfo *player)
     {
       player->inventory_size--;
 
+#if 1
+      DrawGameDoorValues();
+#else
       DrawGameValue_Dynamite(local_player->inventory_size);
+#endif
 
       if (new_element == EL_DYNAMITE)
        new_element = EL_DYNAMITE_ACTIVE;
index 649a258a86bc98a7694f162db566e9e9bd49fe2c..64b7129a81739d9984ecf232a4f3fca8ff9081ac 100644 (file)
@@ -1008,12 +1008,47 @@ void game_animscreen(void)
 
 void DrawGameDoorValues_EM()
 {
+#if 1
+  int dynamite_state;
+  int key_state;
+#else
   int dynamite_state = ply[0].dynamite;                /* !!! ONLY PLAYER 1 !!! */
-  int all_keys_state = ply[0].keys | ply[1].keys | ply[2].keys | ply[3].keys;
+  int key_state = ply[0].keys | ply[1].keys | ply[2].keys | ply[3].keys;
+#endif
+
+#if 1
+  if (game.centered_player_nr == -1)
+  {
+#if 1
+    int i;
+
+    dynamite_state = 0;
+    key_state = 0;
+
+    for (i = 0; i < MAX_PLAYERS; i++)
+    {
+      dynamite_state += ply[i].dynamite;
+      key_state |= ply[i].keys;
+    }
+
+#else
+
+    dynamite_state = ply[0].dynamite;          /* !!! ONLY PLAYER 1 !!! */
+    key_state = ply[0].keys | ply[1].keys | ply[2].keys | ply[3].keys;
+#endif
+  }
+  else
+  {
+    int player_nr = game.centered_player_nr;
+
+    dynamite_state = ply[player_nr].dynamite;
+    key_state = ply[player_nr].keys;
+  }
+#endif
 
 #if 1
   DrawAllGameValues(lev.required, dynamite_state, lev.score,
-                   lev.time, all_keys_state);
+                   lev.time, key_state);
 #else
   DrawAllGameValues(lev.required, ply1.dynamite, lev.score,
                    DISPLAY_TIME(lev.time), ply1.keys | ply2.keys);