rnd-20021129-1-src
[rocksndiamonds.git] / src / editor.c
index ec814f42a0f2ed7d6674223738409a97ed359689..35d7021ed97eb0a27cb663e6222d8623ff041592 100644 (file)
@@ -1313,7 +1313,7 @@ static void ScrollMiniLevel(int from_x, int from_y, int scroll)
 
 static void CreateControlButtons()
 {
-  Bitmap *gd_bitmap = pix[PIX_DOOR];
+  Bitmap *gd_bitmap = new_graphic_info[IMG_MENU_DOOR].bitmap;
   struct GadgetInfo *gi;
   unsigned long event_mask;
   int i;
@@ -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;
@@ -1534,7 +1534,7 @@ static void CreateCounterButtons()
 
     for (j=0; j<2; j++)
     {
-      Bitmap *gd_bitmap = pix[PIX_DOOR];
+      Bitmap *gd_bitmap = new_graphic_info[IMG_MENU_DOOR].bitmap;
       struct GadgetInfo *gi;
       int id = (j == 0 ?
                counterbutton_info[i].gadget_id_down :
@@ -1756,7 +1756,7 @@ static void CreateTextInputGadgets()
 
   for (i=0; i<ED_NUM_TEXTINPUT; i++)
   {
-    Bitmap *gd_bitmap = pix[PIX_DOOR];
+    Bitmap *gd_bitmap = new_graphic_info[IMG_MENU_DOOR].bitmap;
     int gd_x, gd_y;
     struct GadgetInfo *gi;
     unsigned long event_mask;
@@ -1803,7 +1803,7 @@ static void CreateScrollbarGadgets()
   for (i=0; i<ED_NUM_SCROLLBARS; i++)
   {
     int id = scrollbar_info[i].gadget_id;
-    Bitmap *gd_bitmap = pix[PIX_DOOR];
+    Bitmap *gd_bitmap = new_graphic_info[IMG_MENU_DOOR].bitmap;
     int gd_x1, gd_x2, gd_y1, gd_y2;
     struct GadgetInfo *gi;
     int items_max, items_visible, item_position;
@@ -1868,7 +1868,7 @@ static void CreateScrollbarGadgets()
 
 static void CreateCheckbuttonGadgets()
 {
-  Bitmap *gd_bitmap = pix[PIX_DOOR];
+  Bitmap *gd_bitmap = new_graphic_info[IMG_MENU_DOOR].bitmap;
   struct GadgetInfo *gi;
   unsigned long event_mask;
   int gd_x1, gd_x2, gd_x3, gd_x4, gd_y;
@@ -2137,25 +2137,25 @@ void DrawLevelEd()
   }
 
   /* copy default editor door content to main double buffer */
-  BlitBitmap(pix[PIX_DOOR], drawto,
+  BlitBitmap(new_graphic_info[IMG_MENU_DOOR].bitmap, drawto,
             DOOR_GFX_PAGEX6, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY);
 
   /* 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();
 
   /* draw new control window */
-  BlitBitmap(pix[PIX_DOOR], drawto,
+  BlitBitmap(new_graphic_info[IMG_MENU_DOOR].bitmap, drawto,
             DOOR_GFX_PAGEX8, 236, EXSIZE, EYSIZE, EX, EY);
 
   redraw_mask |= REDRAW_ALL;
@@ -2163,7 +2163,7 @@ void DrawLevelEd()
   MapControlButtons();
 
   /* copy actual editor door content to door double buffer for OpenDoor() */
-  BlitBitmap(drawto, pix[PIX_DB_DOOR],
+  BlitBitmap(drawto, bitmap_db_door,
             DX, DY, DXSIZE, DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
 
   DrawEditModeWindow();
@@ -2322,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;
@@ -2681,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,
@@ -3474,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;
@@ -3800,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);
       }
@@ -4258,7 +4258,7 @@ void RequestExitLevelEditor(boolean ask_if_level_has_changed)
   else
   {
     CloseDoor(DOOR_CLOSE_1);
-    BlitBitmap(pix[PIX_DB_DOOR], pix[PIX_DB_DOOR],
+    BlitBitmap(bitmap_db_door, bitmap_db_door,
               DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1, DXSIZE,DYSIZE,
               DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
     OpenDoor(DOOR_OPEN_1);