From: Holger Schemel Date: Tue, 20 Jun 2006 23:53:10 +0000 (+0200) Subject: rnd-20060621-1-src X-Git-Tag: 3.2.0^2~3 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=54d5d4386f2ee13e9931c659667da7c11dfec197;p=rocksndiamonds.git rnd-20060621-1-src * fixed newly introduced bug with wrongly initializing clipboard element * fixed bug with displaying visible/invisible level border in editor * reorganized some elements in the level editor element list --- diff --git a/ChangeLog b/ChangeLog index 4c3a7ac1..2c0bdd6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-06-21 + * fixed newly introduced bug with wrongly initializing clipboard element + +2006-06-19 + * fixed bug with displaying visible/invisible level border in editor + +2006-06-14 + * reorganized some elements in the level editor element list + 2006-06-06 * fixed bug with displaying any player as "yellow" when moving into acid * fixed bug with displaying running player when player stopped at border diff --git a/src/conftime.h b/src/conftime.h index 3af56902..008c2484 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-06-14 01:07]" +#define COMPILE_DATE_STRING "[2006-06-21 01:26]" diff --git a/src/editor.c b/src/editor.c index e3d3370e..791789dc 100644 --- a/src/editor.c +++ b/src/editor.c @@ -9261,11 +9261,20 @@ static void SetTextCursor(int unused_sx, int unused_sy, int sx, int sy, DrawAreaBorder(sx, sy, sx, sy); } +static void CheckLevelBorderElement(boolean redraw_playfield) +{ + int last_border_element = BorderElement; + + SetBorderElement(); + + if (redraw_playfield && BorderElement != last_border_element) + DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); +} + static void CopyLevelToUndoBuffer(int mode) { static boolean accumulated_undo = FALSE; boolean new_undo_buffer_position = TRUE; - int last_border_element; int x, y; switch (mode) @@ -9298,10 +9307,7 @@ static void CopyLevelToUndoBuffer(int mode) UndoBuffer[undo_buffer_position][x][y] = Feld[x][y]; /* check if drawing operation forces change of border style */ - last_border_element = BorderElement; - SetBorderElement(); - if (BorderElement != last_border_element) - DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); + CheckLevelBorderElement(TRUE); level.changed = TRUE; } @@ -10187,7 +10193,12 @@ static void HandleControlButtons(struct GadgetInfo *gi) for (x = 0; x < lev_fieldx; x++) for (y = 0; y < lev_fieldy; y++) Feld[x][y] = UndoBuffer[undo_buffer_position][x][y]; - DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos,level_ypos); + + /* check if undo operation forces change of border style */ + CheckLevelBorderElement(FALSE); + + DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); + break; case GADGET_ID_INFO: diff --git a/src/files.c b/src/files.c index c53c86d8..c9610592 100644 --- a/src/files.c +++ b/src/files.c @@ -1738,6 +1738,11 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) int element = i; struct ElementInfo *ei = &element_info[element]; + /* never initialize clipboard elements after the very first time */ + /* (to be able to use clipboard elements between several levels) */ + if (IS_CLIPBOARD_ELEMENT(element) && clipboard_elements_initialized) + continue; + if (IS_ENVELOPE(element)) { int envelope_nr = element - EL_ENVELOPE_1; @@ -1760,11 +1765,6 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) } #endif - /* never initialize clipboard elements after the very first time */ - /* (to be able to use clipboard elements between several levels) */ - if (IS_CLIPBOARD_ELEMENT(element) && clipboard_elements_initialized) - continue; - setElementChangePages(ei, 1); setElementChangeInfoToDefaults(ei->change); diff --git a/src/tools.c b/src/tools.c index 8990e7fd..3a2b962a 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1960,8 +1960,17 @@ void DrawPlayer(struct PlayerInfo *player) last_element == EL_EM_DYNAMITE_ACTIVE || last_element == EL_SP_DISK_RED_ACTIVE) DrawDynamite(last_jx, last_jy); +#if 0 + /* !!! this is not enough to prevent flickering of players which are + moving next to each others without a free tile between them -- this + can only be solved by drawing all players layer by layer (first the + background, then the foreground etc.) !!! => TODO */ + else if (!IS_PLAYER(last_jx, last_jy)) + DrawLevelField(last_jx, last_jy); +#else else DrawLevelField(last_jx, last_jy); +#endif if (player->is_pushing && IN_SCR_FIELD(SCREENX(next_jx), SCREENY(next_jy))) DrawLevelElement(next_jx, next_jy, EL_EMPTY);