rnd-19980918
[rocksndiamonds.git] / src / editor.c
index b5567dfdf13120b884ed6ba111d53282bf261238..fef23e2b5d3ba6fb172af8e1205a82aa10320606 100644 (file)
@@ -19,6 +19,8 @@
 #include "buttons.h"
 #include "files.h"
 
+#define CHOICE_DELAY_VALUE     100
+
 static int level_xpos,level_ypos;
 static BOOL edit_mode;
 static BOOL name_typing;
@@ -350,26 +352,26 @@ void DrawLevelEd()
     else
       graphic = GFX_LEERRAUM;
 
-    DrawMiniGraphicExtHiRes(pix[PIX_DB_DOOR],gc,
-                           DOOR_GFX_PAGEX1+ED_BUTTON_ELEM_XPOS+3 + 
-                           (i%MAX_ELEM_X)*ED_BUTTON_ELEM_XSIZE,
-                           DOOR_GFX_PAGEY1+ED_BUTTON_ELEM_YPOS+3 +
-                           (i/MAX_ELEM_X)*ED_BUTTON_ELEM_YSIZE,
-                           graphic);
+    DrawMiniGraphicExt(pix[PIX_DB_DOOR],gc,
+                      DOOR_GFX_PAGEX1+ED_BUTTON_ELEM_XPOS+3 + 
+                      (i%MAX_ELEM_X)*ED_BUTTON_ELEM_XSIZE,
+                      DOOR_GFX_PAGEY1+ED_BUTTON_ELEM_YPOS+3 +
+                      (i/MAX_ELEM_X)*ED_BUTTON_ELEM_YSIZE,
+                      graphic);
   }
 
-  DrawMiniGraphicExtHiRes(pix[PIX_DB_DOOR],gc,
-                         DOOR_GFX_PAGEX1+ED_WIN_MB_LEFT_XPOS,
-                         DOOR_GFX_PAGEY1+ED_WIN_MB_LEFT_YPOS,
-                         el2gfx(new_element1));
-  DrawMiniGraphicExtHiRes(pix[PIX_DB_DOOR],gc,
-                         DOOR_GFX_PAGEX1+ED_WIN_MB_MIDDLE_XPOS,
-                         DOOR_GFX_PAGEY1+ED_WIN_MB_MIDDLE_YPOS,
-                         el2gfx(new_element2));
-  DrawMiniGraphicExtHiRes(pix[PIX_DB_DOOR],gc,
-                         DOOR_GFX_PAGEX1+ED_WIN_MB_RIGHT_XPOS,
-                         DOOR_GFX_PAGEY1+ED_WIN_MB_RIGHT_YPOS,
-                         el2gfx(new_element3));
+  DrawMiniGraphicExt(pix[PIX_DB_DOOR],gc,
+                    DOOR_GFX_PAGEX1+ED_WIN_MB_LEFT_XPOS,
+                    DOOR_GFX_PAGEY1+ED_WIN_MB_LEFT_YPOS,
+                    el2gfx(new_element1));
+  DrawMiniGraphicExt(pix[PIX_DB_DOOR],gc,
+                    DOOR_GFX_PAGEX1+ED_WIN_MB_MIDDLE_XPOS,
+                    DOOR_GFX_PAGEY1+ED_WIN_MB_MIDDLE_YPOS,
+                    el2gfx(new_element2));
+  DrawMiniGraphicExt(pix[PIX_DB_DOOR],gc,
+                    DOOR_GFX_PAGEX1+ED_WIN_MB_RIGHT_XPOS,
+                    DOOR_GFX_PAGEY1+ED_WIN_MB_RIGHT_YPOS,
+                    el2gfx(new_element3));
   DrawTextExt(pix[PIX_DB_DOOR],gc,
              DOOR_GFX_PAGEX2+ED_WIN_LEVELNR_XPOS,
              DOOR_GFX_PAGEY1+ED_WIN_LEVELNR_YPOS,
@@ -676,7 +678,7 @@ void LevelEd(int mx, int my, int button)
     if (((choice == ED_BUTTON_EUP && element_shift>0) ||
         (choice == ED_BUTTON_EDOWN &&
          element_shift<elements_in_list-MAX_ELEM_X*MAX_ELEM_Y)) &&
-       DelayReached(&choice_delay,10))
+       DelayReached(&choice_delay, CHOICE_DELAY_VALUE))
     {
       int i, step;
 
@@ -709,18 +711,18 @@ void LevelEd(int mx, int my, int button)
       else if (last_button==3)
        new_element3 = new_element;
 
-      DrawMiniGraphicExtHiRes(drawto,gc,
-                             DX+ED_WIN_MB_LEFT_XPOS,
-                             DY+ED_WIN_MB_LEFT_YPOS,
-                             el2gfx(new_element1));
-      DrawMiniGraphicExtHiRes(drawto,gc,
-                             DX+ED_WIN_MB_MIDDLE_XPOS,
-                             DY+ED_WIN_MB_MIDDLE_YPOS,
-                             el2gfx(new_element2));
-      DrawMiniGraphicExtHiRes(drawto,gc,
-                             DX+ED_WIN_MB_RIGHT_XPOS,
-                             DY+ED_WIN_MB_RIGHT_YPOS,
-                             el2gfx(new_element3));
+      DrawMiniGraphicExt(drawto,gc,
+                        DX+ED_WIN_MB_LEFT_XPOS,
+                        DY+ED_WIN_MB_LEFT_YPOS,
+                        el2gfx(new_element1));
+      DrawMiniGraphicExt(drawto,gc,
+                        DX+ED_WIN_MB_MIDDLE_XPOS,
+                        DY+ED_WIN_MB_MIDDLE_YPOS,
+                        el2gfx(new_element2));
+      DrawMiniGraphicExt(drawto,gc,
+                        DX+ED_WIN_MB_RIGHT_XPOS,
+                        DY+ED_WIN_MB_RIGHT_YPOS,
+                        el2gfx(new_element3));
       redraw_mask |= REDRAW_DOOR_1;
     }
   
@@ -746,7 +748,7 @@ void LevelEd(int mx, int my, int button)
        case ED_BUTTON_LEFT:
          if (level_xpos>=0)
          {
-           if (!DelayReached(&choice_delay,10))
+           if (!DelayReached(&choice_delay, CHOICE_DELAY_VALUE))
              break;
            if (lev_fieldx<2*SCR_FIELDX-2)
              break;
@@ -763,7 +765,7 @@ void LevelEd(int mx, int my, int button)
        case ED_BUTTON_RIGHT:
          if (level_xpos<=lev_fieldx-2*SCR_FIELDX)
          {
-           if (!DelayReached(&choice_delay,10))
+           if (!DelayReached(&choice_delay, CHOICE_DELAY_VALUE))
              break;
            if (lev_fieldx<2*SCR_FIELDX-2)
              break;
@@ -780,7 +782,7 @@ void LevelEd(int mx, int my, int button)
        case ED_BUTTON_UP:
          if (level_ypos>=0)
          {
-           if (!DelayReached(&choice_delay,10))
+           if (!DelayReached(&choice_delay, CHOICE_DELAY_VALUE))
              break;
            if (lev_fieldy<2*SCR_FIELDY-2)
              break;
@@ -797,7 +799,7 @@ void LevelEd(int mx, int my, int button)
        case ED_BUTTON_DOWN:
          if (level_ypos<=lev_fieldy-2*SCR_FIELDY)
          {
-           if (!DelayReached(&choice_delay,10))
+           if (!DelayReached(&choice_delay, CHOICE_DELAY_VALUE))
              break;
            if (lev_fieldy<2*SCR_FIELDY-2)
              break;
@@ -864,7 +866,8 @@ void LevelEd(int mx, int my, int button)
       int choice = CheckCountButtons(mx,my,button);
       int step = (button==1 ? 1 : button==2 ? 5 : button==3 ? 10 : 0);
 
-      if (choice>=0 && choice<36 && DelayReached(&choice_delay,10))
+      if (choice >= 0 && choice < 36 &&
+         DelayReached(&choice_delay, CHOICE_DELAY_VALUE))
       {
        if (!(choice % 2))
          step = -step;