X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;h=bcb57abc861ad5ced43efcc88e490ac57850fa26;hb=c1835c332851f0f30f4bc907d4cc995b56472227;hp=64192d85442df06acc93673ac38813d2452ab0de;hpb=8bc96bd91e1540a536099ee7fd16234b1c3d5c05;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index 64192d85..bcb57abc 100644 --- a/src/editor.c +++ b/src/editor.c @@ -3749,7 +3749,6 @@ static void AdjustElementListScrollbar(); static void RedrawDrawingElements(); static void DrawDrawingWindowExt(boolean); static void DrawDrawingWindow(); -static void DrawDrawingWindow_PlayfieldOnly(); static void DrawLevelInfoWindow(); static void DrawPropertiesWindow(); static void DrawPaletteWindow(); @@ -7564,10 +7563,13 @@ static void ResetUndoBuffer() level.changed = FALSE; } -static void DrawEditModeWindow() +static void DrawEditModeWindowExt(boolean remap_toolbox_gadgets) { - ModifyEditorElementList(); - RedrawDrawingElements(); + if (remap_toolbox_gadgets) + { + ModifyEditorElementList(); + RedrawDrawingElements(); + } if (edit_mode == ED_MODE_INFO) DrawLevelInfoWindow(); @@ -7576,7 +7578,17 @@ static void DrawEditModeWindow() else if (edit_mode == ED_MODE_PALETTE) DrawPaletteWindow(); else /* edit_mode == ED_MODE_DRAWING */ - DrawDrawingWindow(); + DrawDrawingWindowExt(remap_toolbox_gadgets); +} + +static void DrawEditModeWindow() +{ + DrawEditModeWindowExt(TRUE); +} + +static void DrawEditModeWindow_PlayfieldOnly() +{ + DrawEditModeWindowExt(FALSE); } static void ChangeEditModeWindow(int new_edit_mode) @@ -8307,7 +8319,9 @@ static int getMaxEdFieldY(boolean has_scrollbar) void InitZoomLevelSettings(int zoom_tilesize) { - if (zoom_tilesize == -1) + static int last_game_engine_type = GAME_ENGINE_TYPE_UNKNOWN; + + if (zoom_tilesize == -1 && level.game_engine_type != last_game_engine_type) { ed_tilesize = setup.auto_setup.editor_zoom_tilesize; ed_tilesize_default = DEFAULT_EDITOR_TILESIZE; @@ -8319,6 +8333,8 @@ void InitZoomLevelSettings(int zoom_tilesize) } } + last_game_engine_type = level.game_engine_type; + // limit zoom tilesize by upper and lower bound ed_tilesize = MIN(MAX(MICRO_TILESIZE, ed_tilesize), TILESIZE); @@ -8501,7 +8517,7 @@ void DrawLevelEd() UnmapAllGadgets(); - DrawDrawingWindow_PlayfieldOnly(); + DrawEditModeWindow_PlayfieldOnly(); DrawMaskedBorder(fade_mask); @@ -8848,11 +8864,6 @@ static void DrawDrawingWindow() DrawDrawingWindowExt(TRUE); } -static void DrawDrawingWindow_PlayfieldOnly() -{ - DrawDrawingWindowExt(FALSE); -} - static int getTabulatorBarWidth() { struct GadgetInfo *gd_gi1 = level_editor_gadget[GADGET_ID_PROPERTIES_INFO];