rnd-20021027-1-src
[rocksndiamonds.git] / src / editor.c
index 6dc35c7c3270b3ecc6102684314bed2c30d92c1c..7b066ee9741e44497b7fac6f37b3e4f959f30717 100644 (file)
@@ -754,7 +754,7 @@ int editor_element[] =
   EL_CHAR('S'),
   EL_CHAR('H'),
 
-  EL_PLAYER,
+  EL_PLAYER1,
   EL_EMPTY,
   EL_SAND,
   EL_STEELWALL,
@@ -799,7 +799,7 @@ int editor_element[] =
   EL_PLAYER3,
   EL_PLAYER4,
 
-  EL_PLAYER,
+  EL_PLAYER1,
   EL_EMPTY,
   EL_SAND,
   EL_ROCK,
@@ -1490,7 +1490,7 @@ static void CreateControlButtons()
     gd_x2 = DOOR_GFX_PAGEX6 + ED_ELEMENTLIST_XPOS;
     gd_y  = DOOR_GFX_PAGEY1 + ED_ELEMENTLIST_YPOS;
 
-    getMiniGraphicSource(el2gfx(editor_element[i]),
+    getMiniGraphicSource(el2img(editor_element[i]),
                         &deco_bitmap, &deco_x, &deco_y);
     deco_xpos = (ED_ELEMENTLIST_XSIZE - MINI_TILEX) / 2;
     deco_ypos = (ED_ELEMENTLIST_YSIZE - MINI_TILEY) / 2;
@@ -2101,8 +2101,7 @@ static boolean LevelContainsPlayer()
 
   for(y=0; y<lev_fieldy; y++) 
     for(x=0; x<lev_fieldx; x++)
-      if (Feld[x][y] == EL_PLAYER ||
-         Feld[x][y] == EL_PLAYER1 ||
+      if (Feld[x][y] == EL_PLAYER1 ||
          Feld[x][y] == EL_SP_MURPHY) 
        player_found = TRUE;
 
@@ -2144,13 +2143,13 @@ void DrawLevelEd()
   /* draw mouse button brush elements */
   DrawMiniGraphicExt(drawto,
                     DX + ED_WIN_MB_LEFT_XPOS, DY + ED_WIN_MB_LEFT_YPOS,
-                    el2gfx(new_element1));
+                    el2img(new_element1));
   DrawMiniGraphicExt(drawto,
                     DX + ED_WIN_MB_MIDDLE_XPOS, DY + ED_WIN_MB_MIDDLE_YPOS,
-                    el2gfx(new_element2));
+                    el2img(new_element2));
   DrawMiniGraphicExt(drawto,
                     DX + ED_WIN_MB_RIGHT_XPOS, DY + ED_WIN_MB_RIGHT_YPOS,
-                    el2gfx(new_element3));
+                    el2img(new_element3));
 
   /* draw bigger door */
   DrawSpecialEditorDoor();
@@ -2323,21 +2322,21 @@ static void PickDrawingElement(int button, int element)
     new_element1 = element;
     DrawMiniGraphicExt(drawto,
                       DX + ED_WIN_MB_LEFT_XPOS, DY + ED_WIN_MB_LEFT_YPOS,
-                      el2gfx(new_element1));
+                      el2img(new_element1));
   }
   else if (button == 2)
   {
     new_element2 = element;
     DrawMiniGraphicExt(drawto,
                       DX + ED_WIN_MB_MIDDLE_XPOS, DY + ED_WIN_MB_MIDDLE_YPOS,
-                      el2gfx(new_element2));
+                      el2img(new_element2));
   }
   else
   {
     new_element3 = element;
     DrawMiniGraphicExt(drawto,
                       DX + ED_WIN_MB_RIGHT_XPOS, DY + ED_WIN_MB_RIGHT_YPOS,
-                      el2gfx(new_element3));
+                      el2img(new_element3));
   }
 
   redraw_mask |= REDRAW_DOOR_1;
@@ -2682,7 +2681,7 @@ static void DrawPropertiesWindow()
             SX + xstart * MINI_TILEX - MINI_TILEX/2,
             SY + ystart * MINI_TILEY - MINI_TILEY/2);
 
-  DrawGraphic(xstart/2, ystart/2, el2gfx(properties_element));
+  DrawGraphic(xstart / 2, ystart / 2, el2img(properties_element), 0);
 
   /* copy the whole stuff to the definitive location */
   BlitBitmap(drawto, drawto,
@@ -3447,14 +3446,14 @@ static void HandleDrawingAreas(struct GadgetInfo *gi)
        }
        else if (new_element != Feld[lx][ly])
        {
-         if (new_element == EL_PLAYER)
+         if (new_element == EL_PLAYER1)
          {
            /* remove player at old position */
            for(y=0; y<lev_fieldy; y++)
            {
              for(x=0; x<lev_fieldx; x++)
              {
-               if (Feld[x][y] == EL_PLAYER || Feld[x][y] == EL_PLAYER1)
+               if (Feld[x][y] == EL_PLAYER1)
                {
                  Feld[x][y] = EL_EMPTY;
                  if (x - level_xpos >= 0 && x - level_xpos < ed_fieldx &&
@@ -3475,11 +3474,11 @@ static void HandleDrawingAreas(struct GadgetInfo *gi)
        DrawMiniGraphicExt(drawto,
                           gi->x + sx * MINI_TILEX,
                           gi->y + sy * MINI_TILEY,
-                          el2gfx(new_element));
+                          el2img(new_element));
        DrawMiniGraphicExt(window,
                           gi->x + sx * MINI_TILEX,
                           gi->y + sy * MINI_TILEY,
-                          el2gfx(new_element));
+                          el2img(new_element));
 
        if (id == GADGET_ID_AMOEBA_CONTENT)
          level.amoeba_content = new_element;
@@ -3801,7 +3800,7 @@ static void HandleControlButtons(struct GadgetInfo *gi)
        int element = editor_element[element_shift + i];
 
        UnmapGadget(gi);
-       getMiniGraphicSource(el2gfx(element), &gd->bitmap, &gd->x, &gd->y);
+       getMiniGraphicSource(el2img(element), &gd->bitmap, &gd->x, &gd->y);
        ModifyGadget(gi, GDI_INFO_TEXT, getElementInfoText(element), GDI_END);
        MapGadget(gi);
       }