From: Holger Schemel Date: Sat, 9 Aug 2003 01:20:02 +0000 (+0200) Subject: rnd-20030809-2-src X-Git-Tag: 3.0.1^2~9 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=837dfa6e81b54c0eeb00eeb7cf472f68d5947bab;p=rocksndiamonds.git rnd-20030809-2-src --- diff --git a/src/conftime.h b/src/conftime.h index a28d19fe..6a9ce93c 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-08-09 01:35]" +#define COMPILE_DATE_STRING "[2003-08-09 03:13]" diff --git a/src/game.c b/src/game.c index 46151883..7968b389 100644 --- a/src/game.c +++ b/src/game.c @@ -1960,22 +1960,50 @@ void RelocatePlayer(int x, int y, int element) } RemoveField(player->jx, player->jy); + DrawLevelField(player->jx, player->jy); } InitPlayerField(x, y, element, TRUE); if (player == local_player) { - scroll_x = (local_player->jx < SBX_Left + MIDPOSX ? SBX_Left : - local_player->jx > SBX_Right + MIDPOSX ? SBX_Right : - local_player->jx - MIDPOSX); + int scroll_xx = -999, scroll_yy = -999; - scroll_y = (local_player->jy < SBY_Upper + MIDPOSY ? SBY_Upper : - local_player->jy > SBY_Lower + MIDPOSY ? SBY_Lower : - local_player->jy - MIDPOSY); - } + while (scroll_xx != scroll_x || scroll_yy != scroll_y) + { + int dx = 0, dy = 0; + int fx = FX, fy = FY; - DrawLevel(); + scroll_xx = (local_player->jx < SBX_Left + MIDPOSX ? SBX_Left : + local_player->jx > SBX_Right + MIDPOSX ? SBX_Right : + local_player->jx - MIDPOSX); + + scroll_yy = (local_player->jy < SBY_Upper + MIDPOSY ? SBY_Upper : + local_player->jy > SBY_Lower + MIDPOSY ? SBY_Lower : + local_player->jy - MIDPOSY); + + dx = (scroll_xx < scroll_x ? +1 : scroll_xx > scroll_x ? -1 : 0); + dy = (scroll_yy < scroll_y ? +1 : scroll_yy > scroll_y ? -1 : 0); + + scroll_x -= dx; + scroll_y -= dy; + + fx += dx * TILEX / 2; + fy += dy * TILEY / 2; + + ScrollLevel(dx, dy); + DrawAllPlayers(); + + /* scroll in to steps of half tile size to make things smoother */ + BlitBitmap(drawto_field, window, fx, fy, SXSIZE, SYSIZE, SX, SY); + FlushDisplay(); + Delay(GAME_FRAME_DELAY); + + /* scroll second step to align at full tile size */ + BackToFront(); + Delay(GAME_FRAME_DELAY); + } + } } void Explode(int ex, int ey, int phase, int mode) @@ -5295,6 +5323,9 @@ static void ChangeElementNowExt(int x, int y, int target_element) TestIfBadThingTouchesHero(x, y); TestIfPlayerTouchesCustomElement(x, y); TestIfElementTouchesCustomElement(x, y); + + if (ELEM_IS_PLAYER(target_element)) + RelocatePlayer(x, y, target_element); } static void ChangeElementNow(int x, int y, int element) @@ -6188,24 +6219,24 @@ void ScrollLevel(int dx, int dy) int x, y; BlitBitmap(drawto_field, drawto_field, - FX + TILEX*(dx == -1) - softscroll_offset, - FY + TILEY*(dy == -1) - softscroll_offset, - SXSIZE - TILEX*(dx!=0) + 2*softscroll_offset, - SYSIZE - TILEY*(dy!=0) + 2*softscroll_offset, - FX + TILEX*(dx == 1) - softscroll_offset, - FY + TILEY*(dy == 1) - softscroll_offset); + FX + TILEX * (dx == -1) - softscroll_offset, + FY + TILEY * (dy == -1) - softscroll_offset, + SXSIZE - TILEX * (dx!=0) + 2 * softscroll_offset, + SYSIZE - TILEY * (dy!=0) + 2 * softscroll_offset, + FX + TILEX * (dx == 1) - softscroll_offset, + FY + TILEY * (dy == 1) - softscroll_offset); if (dx) { x = (dx == 1 ? BX1 : BX2); - for (y=BY1; y<=BY2; y++) + for (y=BY1; y <= BY2; y++) DrawScreenField(x, y); } if (dy) { y = (dy == 1 ? BY1 : BY2); - for (x=BX1; x<=BX2; x++) + for (x=BX1; x <= BX2; x++) DrawScreenField(x, y); } diff --git a/src/init.c b/src/init.c index cde94b12..ce61ae8b 100644 --- a/src/init.c +++ b/src/init.c @@ -2778,7 +2778,8 @@ void InitElementPropertiesEngine(int engine_version) CAN_EXPLODE_IMPACT(i))); /* ---------- CAN_EXPLODE_3X3 ------------------------------------------ */ - SET_PROPERTY(i, EP_CAN_EXPLODE_3X3, !CAN_EXPLODE_1X1(i)); + SET_PROPERTY(i, EP_CAN_EXPLODE_3X3, (CAN_EXPLODE(i) && + !CAN_EXPLODE_1X1(i))); /* ---------- CAN_BE_CRUMBLED ------------------------------------------ */ SET_PROPERTY(i, EP_CAN_BE_CRUMBLED,