X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;h=084a2d587d8a9e003e13b64a76325ce97dca17b1;hb=80e96bb2c18af80bdf42240afb36af0e507d4f3e;hp=ac7b42de8b395f178fd8a7a33879ed9a6423918f;hpb=ed5a795f1fd2d48a1372d46c06d86d2faab7e3c4;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index ac7b42de..084a2d58 100644 --- a/src/editor.c +++ b/src/editor.c @@ -3092,7 +3092,7 @@ static struct { -1, ED_AREA_1X1_SETTINGS_YPOS(5), GADGET_ID_CUSTOM_CHANGE_TRIGGER, GADGET_ID_CHANGE_OTHER_ACTION, - &custom_element_change.trigger_element, 1, 1, + &custom_element_change.initial_trigger_element, 1, 1, NULL, NULL, NULL, "other element triggering change" }, @@ -4988,10 +4988,36 @@ static void DrawDrawingArea(int id) static void ScrollMiniLevel(int from_x, int from_y, int scroll) { - int x,y; +#if 1 + static Bitmap *tmp_backbuffer = NULL; +#endif + int x, y; int dx = (scroll == ED_SCROLL_LEFT ? -1 : scroll == ED_SCROLL_RIGHT ? 1 : 0); int dy = (scroll == ED_SCROLL_UP ? -1 : scroll == ED_SCROLL_DOWN ? 1 : 0); +#if 1 + if (tmp_backbuffer == NULL) + tmp_backbuffer = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH); + + /* needed when blitting directly to same bitmap -- should not be needed with + recent SDL libraries, but apparently does not work in 1.2.11 directly */ + BlitBitmap(drawto, tmp_backbuffer, + SX + (dx == -1 ? MINI_TILEX : 0), + SY + (dy == -1 ? MINI_TILEY : 0), + (ed_fieldx * MINI_TILEX) - (dx != 0 ? MINI_TILEX : 0), + (ed_fieldy * MINI_TILEY) - (dy != 0 ? MINI_TILEY : 0), + SX + (dx == +1 ? MINI_TILEX : 0), + SY + (dy == +1 ? MINI_TILEY : 0)); + BlitBitmap(tmp_backbuffer, drawto, + SX + (dx == +1 ? MINI_TILEX : 0), + SY + (dy == +1 ? MINI_TILEY : 0), + (ed_fieldx * MINI_TILEX) - (dx != 0 ? MINI_TILEX : 0), + (ed_fieldy * MINI_TILEY) - (dy != 0 ? MINI_TILEY : 0), + SX + (dx == +1 ? MINI_TILEX : 0), + SY + (dy == +1 ? MINI_TILEY : 0)); + +#else + BlitBitmap(drawto, drawto, SX + (dx == -1 ? MINI_TILEX : 0), SY + (dy == -1 ? MINI_TILEY : 0), @@ -4999,6 +5025,10 @@ static void ScrollMiniLevel(int from_x, int from_y, int scroll) (ed_fieldy * MINI_TILEY) - (dy != 0 ? MINI_TILEY : 0), SX + (dx == +1 ? MINI_TILEX : 0), SY + (dy == +1 ? MINI_TILEY : 0)); +#endif + + printf("::: ScrollMiniLevel: A.1\n"); + if (dx) { x = (dx == 1 ? 0 : ed_fieldx - 1); @@ -5012,6 +5042,8 @@ static void ScrollMiniLevel(int from_x, int from_y, int scroll) DrawMiniElementOrWall(x, y, from_x, from_y); } + printf("::: ScrollMiniLevel: Z\n"); + redraw_mask |= REDRAW_FIELD; BackToFront(); } @@ -6562,8 +6594,8 @@ static void replace_custom_element_in_settings(int element_from, if (change->target_element == element_from) change->target_element = element_to; - if (change->trigger_element == element_from) - change->trigger_element = element_to; + if (change->initial_trigger_element == element_from) + change->initial_trigger_element = element_to; for (y = 0; y < 3; y++) for (x = 0; x < 3; x++) @@ -7066,6 +7098,12 @@ void DrawLevelEd() BlitBitmap(drawto, bitmap_db_door, DX, DY, DXSIZE, DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1); +#if 1 + /* draw new control window (with border) to window */ + redraw_mask |= REDRAW_ALL; + BackToFront(); +#endif + OpenDoor(DOOR_OPEN_1); } @@ -10294,7 +10332,10 @@ static void HandleCounterButtons(struct GadgetInfo *gi) if (counter_id == ED_COUNTER_ID_SELECT_LEVEL) { LoadLevel(level_nr); + LoadScore(level_nr); + TapeErase(); + ResetUndoBuffer(); DrawEditModeWindow();