rnd-20110322-1-src
[rocksndiamonds.git] / src / editor.c
index 83df2e15c5048d51ef8dc7bce33d29cc7f367ec4..53123487787f240b81d36fff743e1389d7da5d8e 100644 (file)
 #define RANDOM_USE_QUANTITY            1
 
 /* maximal size of level editor drawing area */
+#if NEW_TILESIZE
+#define MAX_ED_FIELDX          (SCR_FIELDX)
+#define MAX_ED_FIELDY          (SCR_FIELDY - 1)
+#else
 #define MAX_ED_FIELDX          (2 * SCR_FIELDX)
 #define MAX_ED_FIELDY          (2 * SCR_FIELDY - 1)
+#endif
 
 
 /*
@@ -2710,7 +2715,7 @@ static struct
     GADGET_ID_CONTINUOUS_SNAPPING,     GADGET_ID_NONE,
     &level.continuous_snapping,
     NULL,
-    "continuos snapping",              "use snapping without releasing key"
+    "continuous snapping",             "use snapping without releasing key"
   },
   {
     ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(7),
@@ -5143,7 +5148,7 @@ static void DrawElementBorder(int dest_x, int dest_y, int width, int height,
   int by2 = TILEY - by;
   int i;
 
-  getGraphicSource(border_graphic, 0, &src_bitmap, &src_x, &src_y);
+  getFixedGraphicSource(border_graphic, 0, &src_bitmap, &src_x, &src_y);
 
   BlitBitmap(src_bitmap, drawto, src_x, src_y,
             bx, by, dest_x - bx, dest_y - by);
@@ -7409,6 +7414,11 @@ void DrawLevelEd()
   FadeOut(REDRAW_FIELD);
 #endif
 
+#if 1
+  /* needed if different viewport properties defined for editor */
+  ChangeViewportPropertiesIfNeeded();
+#endif
+
   OpenDoor(DOOR_OPEN_2 | DOOR_NO_DELAY);
 
 #if DEBUG
@@ -7438,6 +7448,10 @@ void DrawLevelEd()
   BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto,
             DOOR_GFX_PAGEX6, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY);
 
+#if 0
+  printf("::: %d, %d  /  %d, %d\n", VX, VY, EX, EY);
+#endif
+
   /* draw bigger door */
   DrawSpecialEditorDoor();
 
@@ -8164,7 +8178,7 @@ static int PrintElementDescriptionFromFile(char *filename, int start_line)
   int max_lines_per_screen = (SYSIZE - pad_y) / font_height - 1;
 
   return DrawTextFile(sx, sy, filename, font_nr, max_chars_per_line, -1,
-                     max_lines_per_screen, -1, TRUE, FALSE, FALSE);
+                     max_lines_per_screen, 0, -1, TRUE, FALSE, FALSE);
 }
 
 static void DrawPropertiesInfo()
@@ -8803,7 +8817,7 @@ static void DrawEditorElementAnimation(int x, int y)
               ANIM_MODE(graphic) == ANIM_CE_SCORE ?
               custom_element.collect_score_initial : FrameCounter);
 
-  DrawGraphicAnimationExt(drawto, x, y, graphic, frame, NO_MASKING);
+  DrawFixedGraphicAnimationExt(drawto, x, y, graphic, frame, NO_MASKING);
 }
 
 static void DrawEditorElementName(int x, int y, int element)
@@ -10708,10 +10722,10 @@ static void HandleDrawingAreas(struct GadgetInfo *gi)
                             gi->y + sy * MINI_TILEY,
                             el2edimg(new_element));
        else
-         DrawGraphicExt(drawto,
-                        gi->x + sx * TILEX,
-                        gi->y + sy * TILEY,
-                        el2img(new_element), 0);
+         DrawFixedGraphicExt(drawto,
+                             gi->x + sx * TILEX,
+                             gi->y + sy * TILEY,
+                             el2img(new_element), 0);
 
        if (id == GADGET_ID_CUSTOM_GRAPHIC)
          new_element = GFX_ELEMENT(new_element);
@@ -11505,7 +11519,9 @@ static void HandleControlButtons(struct GadgetInfo *gi)
 
       BackToFront();           /* force redraw of undrawn special door */
 
+#if 0
       DrawCompleteVideoDisplay();
+#endif
 
       level_editor_test_game = TRUE;