rnd-20040103-1-src
[rocksndiamonds.git] / src / tools.c
index cb473ce77e96463fa140c24d7da0bf2ac276036a..aa399caaa197fef426e5e570fb1bf2e298e227c1 100644 (file)
@@ -628,55 +628,13 @@ void DrawPlayer(struct PlayerInfo *player)
   if (element == EL_EXPLOSION)
     return;
 
-#if 1
-
-  action = GetPlayerAction(player, move_dir);
-
-#else
-
-  action = (player->is_pushing   ? ACTION_PUSHING    :
-           player->is_digging    ? ACTION_DIGGING    :
-           player->is_collecting ? ACTION_COLLECTING :
-           player->is_moving     ? ACTION_MOVING     :
-           player->is_snapping   ? ACTION_SNAPPING   :
-           player->is_sleeping   ? ACTION_SLEEPING   :
-           player->is_bored      ? ACTION_BORING     :
-           player->is_waiting    ? ACTION_WAITING    : ACTION_DEFAULT);
-
-  if (player->is_bored && player->num_special_action_bored > 0)
-  {
-    if (player->anim_delay_counter == 0 && player->post_delay_counter == 0)
-    {
-      int graphic_waiting;
-
-      action = ACTION_BORING_1 + SimpleRND(player->num_special_action_bored);
-      special_graphic = el_act_dir2img(EL_SP_MURPHY, action, move_dir);
-
-      player->anim_delay_counter =
-       graphic_info[special_graphic].anim_delay_fixed +
-       SimpleRND(graphic_info[special_graphic].anim_delay_random);
-      player->post_delay_counter =
-       graphic_info[special_graphic].post_delay_fixed +
-       SimpleRND(graphic_info[special_graphic].post_delay_random);
-      player->special_action_bored = action;
-    }
-
-    if (player->anim_delay_counter > 0)
-    {
-      action = player->special_action_bored;
-      player->anim_delay_counter--;
-    }
-
-    if (player->post_delay_counter > 0)
-    {
-      player->post_delay_counter--;
-    }
-  }
-#endif
-
-#if 0
-  printf("::: '%s'\n", element_action_info[action].suffix);
-#endif
+  action = (player->is_pushing    ? ACTION_PUSHING         :
+           player->is_digging    ? ACTION_DIGGING         :
+           player->is_collecting ? ACTION_COLLECTING      :
+           player->is_moving     ? ACTION_MOVING          :
+           player->is_snapping   ? ACTION_SNAPPING        :
+           player->is_dropping   ? ACTION_DROPPING        :
+           player->is_waiting    ? player->action_waiting : ACTION_DEFAULT);
 
   InitPlayerGfxAnimation(player, action, move_dir);
 
@@ -900,7 +858,7 @@ void DrawPlayer(struct PlayerInfo *player)
     SetDrawtoField(DRAW_DIRECT);
   }
 
-  MarkTileDirty(sx,sy);
+  MarkTileDirty(sx, sy);
 }
 
 void getGraphicSource(int graphic, int frame, Bitmap **bitmap, int *x, int *y)
@@ -1024,7 +982,7 @@ void DrawMiniGraphicExt(DrawBuffer *d, int x, int y, int graphic)
   BlitBitmap(src_bitmap, d, src_x, src_y, MINI_TILEX, MINI_TILEY, x, y);
 }
 
-void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic, int frame,
+void DrawGraphicShifted(int x, int y, int dx, int dy, int graphic, int frame,
                        int cut_mode, int mask_mode)
 {
   Bitmap *src_bitmap;
@@ -1144,13 +1102,13 @@ void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic, int frame,
     BlitBitmap(src_bitmap, drawto_field, src_x, src_y, width, height,
               dest_x, dest_y);
 
-  MarkTileDirty(x,y);
+  MarkTileDirty(x, y);
 }
 
 void DrawGraphicShiftedThruMask(int x, int y, int dx, int dy, int graphic,
                                int frame, int cut_mode)
 {
-  DrawGraphicShifted(x,y, dx,dy, graphic, frame, cut_mode, USE_MASKING);
+  DrawGraphicShifted(x, y, dx, dy, graphic, frame, cut_mode, USE_MASKING);
 }
 
 void DrawScreenElementExt(int x, int y, int dx, int dy, int element,
@@ -2068,7 +2026,7 @@ boolean Request(char *text, unsigned int req_state)
   for (ty = 0; ty < MAX_REQUEST_LINES; ty++)
   {
     char text_line[max_request_line_len + 1];
-    int tx, tl, tc;
+    int tx, tl, tc = 0;
 
     if (!*text)
       break;