rnd-19980930-1
[rocksndiamonds.git] / src / editor.c
index b5567dfdf13120b884ed6ba111d53282bf261238..3434b4c2219731c842b9c7eadc82276f21d7b07e 100644 (file)
@@ -1,13 +1,12 @@
 /***********************************************************
 *  Rocks'n'Diamonds -- McDuffin Strikes Back!              *
 *----------------------------------------------------------*
-*  ©1995 Artsoft Development                               *
-*        Holger Schemel                                    *
-*        33659 Bielefeld-Senne                             *
-*        Telefon: (0521) 493245                            *
-*        eMail: aeglos@valinor.owl.de                      *
-*               aeglos@uni-paderborn.de                    *
-*               q99492@pbhrzx.uni-paderborn.de             *
+*  (c) 1995-98 Artsoft Entertainment                       *
+*              Holger Schemel                              *
+*              Oststrasse 11a                              *
+*              33604 Bielefeld                             *
+*              phone: ++49 +521 290471                     *
+*              email: aeglos@valinor.owl.de                *
 *----------------------------------------------------------*
 *  editor.c                                                *
 ***********************************************************/
@@ -19,6 +18,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;
@@ -84,6 +85,11 @@ int editor_element[] =
   EL_CHAR_A + ('N' - 'A'),
   EL_CHAR_A + ('E' - 'A'),
 
+  EL_SPIELER1,
+  EL_SPIELER2,
+  EL_SPIELER3,
+  EL_SPIELER4,
+
   EL_SPIELFIGUR,
   EL_LEERRAUM,
   EL_ERDREICH,
@@ -350,26 +356,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 +682,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 +715,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 +752,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 +769,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 +786,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 +803,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 +870,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;