added setting correct editor tile size for MM style levels
authorHolger Schemel <info@artsoft.org>
Sun, 5 Nov 2017 23:56:00 +0000 (00:56 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:15 +0000 (23:21 +0100)
src/editor.c

index e311541abdcf975346589cb53addf1787c0c24e6..df592b1f528f39ff055a4add1f0623c4c4503711 100644 (file)
 
 /* default value for element tile size in drawing area */
 #define DEFAULT_EDITOR_TILESIZE                MINI_TILESIZE
+#define DEFAULT_EDITOR_TILESIZE_MM     TILESIZE
 
 
 /*
@@ -8278,12 +8279,19 @@ static int getMaxEdFieldY(boolean has_scrollbar)
 void InitZoomLevelSettings(int zoom_tilesize)
 {
   if (zoom_tilesize == -1)
-    zoom_tilesize = setup.auto_setup.editor_zoom_tilesize;
+  {
+    ed_tilesize = setup.auto_setup.editor_zoom_tilesize;
+
+    if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
+      ed_tilesize = DEFAULT_EDITOR_TILESIZE_MM;
+  }
 
   // limit zoom tilesize by upper and lower bound
-  zoom_tilesize = MIN(MAX(MICRO_TILESIZE, zoom_tilesize), TILESIZE);
+  ed_tilesize = MIN(MAX(MICRO_TILESIZE, ed_tilesize), TILESIZE);
 
-  ed_tilesize = setup.auto_setup.editor_zoom_tilesize = zoom_tilesize;
+  // store zoom tilesize in auto setup file only if it was manually changed
+  if (zoom_tilesize != -1)
+    setup.auto_setup.editor_zoom_tilesize = ed_tilesize;
 
   MAX_ED_FIELDX = getMaxEdFieldX(FALSE);
   MAX_ED_FIELDY = getMaxEdFieldY(FALSE);