From: Holger Schemel Date: Wed, 31 Jan 2018 21:01:11 +0000 (+0100) Subject: fixed bug with always drawing level playfield in editor after test playing X-Git-Tag: 4.1.0.0~24 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=adbac7f8da2ae3ec52cd6f08e8c4c6fedacfc804;p=rocksndiamonds.git fixed bug with always drawing level playfield in editor after test playing - even if the last edit mode was "level info", "element properties" etc. - this bug was introduced by the commit with the following message: "added editor door 1 animation if viewport is unchanged and contains toolbox" (no commit ID given here due to frequent use of "git rebase") --- diff --git a/src/editor.c b/src/editor.c index c716bdae..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) @@ -8505,7 +8517,7 @@ void DrawLevelEd() UnmapAllGadgets(); - DrawDrawingWindow_PlayfieldOnly(); + DrawEditModeWindow_PlayfieldOnly(); DrawMaskedBorder(fade_mask); @@ -8852,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];