fixed conveyor belt direction switch names for BD engine
[rocksndiamonds.git] / src / tools.c
index b92cf01b747cd3dbd61a90c4d85790f88f2b7001..2fdcd0b8c7c265ff93ba1cfd2b934df486e683e0 100644 (file)
@@ -3465,11 +3465,27 @@ void DrawMiniLevel(int size_x, int size_y, int scroll_x, int scroll_y)
   redraw_mask |= REDRAW_FIELD;
 }
 
+static int getPreviewLevelWidth(void)
+{
+  if (level.game_engine_type == GAME_ENGINE_TYPE_BD)
+    return (level.native_bd_level->cave->x2 - level.native_bd_level->cave->x1 + 1);
+
+  return lev_fieldx;
+}
+
+static int getPreviewLevelHeight(void)
+{
+  if (level.game_engine_type == GAME_ENGINE_TYPE_BD)
+    return (level.native_bd_level->cave->y2 - level.native_bd_level->cave->y1 + 1);
+
+  return lev_fieldy;
+}
+
 static void DrawPreviewLevelPlayfield(int from_x, int from_y)
 {
   boolean show_level_border = (BorderElement != EL_EMPTY);
-  int level_xsize = lev_fieldx + (show_level_border ? 2 : 0);
-  int level_ysize = lev_fieldy + (show_level_border ? 2 : 0);
+  int level_xsize = getPreviewLevelWidth()  + (show_level_border ? 2 : 0);
+  int level_ysize = getPreviewLevelHeight() + (show_level_border ? 2 : 0);
   int tile_size = preview.tile_size;
   int preview_width  = preview.xsize * tile_size;
   int preview_height = preview.ysize * tile_size;
@@ -6268,7 +6284,7 @@ bd_object_mapping_list[] =
   },
   {
     O_CONVEYOR_DIR_SWITCH,                     TRUE,
-    EL_BD_CONVEYOR_DIR_SWITCH_RIGHT,           -1, -1
+    EL_BD_CONVEYOR_DIR_SWITCH_NORMAL,          -1, -1
   },
   {
     O_ACID,                                    TRUE,
@@ -7015,11 +7031,11 @@ bd_object_mapping_list[] =
   },
   {
     O_CONVEYOR_DIR_NORMAL,                     FALSE,
-    EL_BD_CONVEYOR_DIR_SWITCH_RIGHT,           -1, -1
+    EL_BD_CONVEYOR_DIR_SWITCH_NORMAL,          -1, -1
   },
   {
     O_CONVEYOR_DIR_CHANGED,                    FALSE,
-    EL_BD_CONVEYOR_DIR_SWITCH_LEFT,            -1, -1
+    EL_BD_CONVEYOR_DIR_SWITCH_CHANGED,         -1, -1
   },
   {
     O_CONVEYOR_SWITCH_OFF,                     FALSE,