rnd-20040412-1-src
[rocksndiamonds.git] / src / tools.c
index 2d35e042e0b67db6629289cf29ee25bf6725ec65..39af85ee9d9b4c7be50fd7751e5c8b8a5d045765 100644 (file)
@@ -256,6 +256,7 @@ void BackToFront()
   {
     if (redraw_mask & REDRAW_DOOR_1)
       BlitBitmap(backbuffer, window, DX, DY, DXSIZE, DYSIZE, DX, DY);
+
     if (redraw_mask & REDRAW_DOOR_2)
     {
 #if 0
@@ -301,10 +302,10 @@ void BackToFront()
   if (redraw_mask & REDRAW_TILES)
   {
     for (x = 0; x < SCR_FIELDX; x++)
-      for (y =0 ; y < SCR_FIELDY; y++)
+      for (y = 0 ; y < SCR_FIELDY; y++)
        if (redraw[redraw_x1 + x][redraw_y1 + y])
          BlitBitmap(buffer, window,
-                    FX + x * TILEX, FX + y * TILEY, TILEX, TILEY,
+                    FX + x * TILEX, FY + y * TILEY, TILEX, TILEY,
                     SX + x * TILEX, SY + y * TILEY);
   }
 
@@ -877,11 +878,16 @@ void DrawPlayer(struct PlayerInfo *player)
   else if (player_is_moving && IS_ACCESSIBLE_UNDER(last_element))
     DrawLevelFieldThruMask(last_jx, last_jy);
 
-  /* ... and the field the player is entering */
-  if (IS_ACCESSIBLE_INSIDE(element))
-    DrawLevelField(jx, jy);
-  else if (IS_ACCESSIBLE_UNDER(element))
-    DrawLevelFieldThruMask(jx, jy);
+#if 1
+  if (!player->is_pushing)
+#endif
+  {
+    /* ... and the field the player is entering */
+    if (IS_ACCESSIBLE_INSIDE(element))
+      DrawLevelField(jx, jy);
+    else if (IS_ACCESSIBLE_UNDER(element))
+      DrawLevelFieldThruMask(jx, jy);
+  }
 
   if (setup.direct_draw)
   {
@@ -2305,8 +2311,8 @@ boolean Request(char *text, unsigned int req_state)
     if (!(req_state & REQ_STAY_CLOSED) && (old_door_state & DOOR_OPEN_1))
     {
       BlitBitmap(bitmap_db_door, bitmap_db_door,
-                DOOR_GFX_PAGEX2,DOOR_GFX_PAGEY1, DXSIZE,DYSIZE,
-                DOOR_GFX_PAGEX1,DOOR_GFX_PAGEY1);
+                DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE,
+                DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
       OpenDoor(DOOR_OPEN_1);
     }
   }
@@ -2888,6 +2894,11 @@ int el_dir2img(int element, int direction)
   return el_act_dir2img(element, ACTION_DEFAULT, direction);
 }
 
+int el2baseimg(int element)
+{
+  return element_info[element].graphic[ACTION_DEFAULT];
+}
+
 int el2img(int element)
 {
   element = GFX_ELEMENT(element);