From: Holger Schemel Date: Thu, 7 Jan 1999 00:28:43 +0000 (+0100) Subject: rnd-19990107-2 X-Git-Tag: 1.3.0^2~34 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=57bbc28786e5cc6c531b53ef5e29512b1e0b73e8;p=rocksndiamonds.git rnd-19990107-2 --- diff --git a/src/editor.c b/src/editor.c index 6c137565..1265f4f7 100644 --- a/src/editor.c +++ b/src/editor.c @@ -18,6 +18,7 @@ #include "buttons.h" #include "files.h" #include "game.h" +#include "tape.h" /* positions in the level editor */ #define ED_WIN_MB_LEFT_XPOS 7 @@ -909,6 +910,8 @@ void DrawLevelEd() CloseDoor(DOOR_CLOSE_ALL); + OpenDoor(DOOR_OPEN_2 | DOOR_NO_DELAY); + if (level_editor_test_game) { for(x=0; xjx >= SBX_Left + MIDPOSX) @@ -581,17 +569,6 @@ void InitGame() scroll_y = (local_player->jy <= SBY_Lower + MIDPOSY ? local_player->jy - MIDPOSY : SBY_Lower); -#else - scroll_x = scroll_y = -1; - if (local_player->jx >= MIDPOSX-1) - scroll_x = (local_player->jx <= lev_fieldx-MIDPOSX ? - local_player->jx - MIDPOSX : - lev_fieldx - SCR_FIELDX + 1); - if (local_player->jy >= MIDPOSY-1) - scroll_y = (local_player->jy <= lev_fieldy-MIDPOSY ? - local_player->jy - MIDPOSY : - lev_fieldy - SCR_FIELDY + 1); -#endif CloseDoor(DOOR_CLOSE_1); @@ -630,7 +607,7 @@ void InitGame() DOOR_GFX_PAGEX1 + GAME_CONTROL_XPOS, DOOR_GFX_PAGEY1 + GAME_CONTROL_YPOS); - OpenDoor(DOOR_OPEN_1); + OpenDoor(DOOR_OPEN_ALL); if (setup.sound_music) PlaySoundLoop(background_loop[level_nr % num_bg_loops]); @@ -3919,19 +3896,13 @@ boolean MoveFigure(struct PlayerInfo *player, int dx, int dy) { if (jx != old_jx) /* player has moved horizontally */ { - if ((player->MovDir == MV_LEFT && scroll_x > jx-MIDPOSX+offset) || - (player->MovDir == MV_RIGHT && scroll_x < jx-MIDPOSX-offset)) + if ((player->MovDir == MV_LEFT && scroll_x > jx - MIDPOSX + offset) || + (player->MovDir == MV_RIGHT && scroll_x < jx - MIDPOSX - offset)) scroll_x = jx-MIDPOSX + (scroll_x < jx-MIDPOSX ? -offset : +offset); -#if 1 /* don't scroll over playfield boundaries */ if (scroll_x < SBX_Left || scroll_x > SBX_Right) scroll_x = (scroll_x < SBX_Left ? SBX_Left : SBX_Right); -#else - /* don't scroll over playfield boundaries */ - if (scroll_x < -1 || scroll_x > lev_fieldx - SCR_FIELDX + 1) - scroll_x = (scroll_x < -1 ? -1 : lev_fieldx - SCR_FIELDX + 1); -#endif /* don't scroll more than one field at a time */ scroll_x = old_scroll_x + SIGN(scroll_x - old_scroll_x); @@ -3943,19 +3914,13 @@ boolean MoveFigure(struct PlayerInfo *player, int dx, int dy) } else /* player has moved vertically */ { - if ((player->MovDir == MV_UP && scroll_y > jy-MIDPOSY+offset) || - (player->MovDir == MV_DOWN && scroll_y < jy-MIDPOSY-offset)) + if ((player->MovDir == MV_UP && scroll_y > jy - MIDPOSY + offset) || + (player->MovDir == MV_DOWN && scroll_y < jy - MIDPOSY - offset)) scroll_y = jy-MIDPOSY + (scroll_y < jy-MIDPOSY ? -offset : +offset); -#if 1 /* don't scroll over playfield boundaries */ if (scroll_y < SBY_Upper || scroll_y > SBY_Lower) scroll_y = (scroll_y < SBY_Upper ? SBY_Upper : SBY_Lower); -#else - /* don't scroll over playfield boundaries */ - if (scroll_y < -1 || scroll_y > lev_fieldy - SCR_FIELDY + 1) - scroll_y = (scroll_y < -1 ? -1 : lev_fieldy - SCR_FIELDY + 1); -#endif /* don't scroll more than one field at a time */ scroll_y = old_scroll_y + SIGN(scroll_y - old_scroll_y); diff --git a/src/main.h b/src/main.h index f1d50048..c945cec0 100644 --- a/src/main.h +++ b/src/main.h @@ -65,14 +65,8 @@ typedef unsigned char byte; #define SCR_FIELDY 17 #define MAX_BUF_XSIZE (SCR_FIELDX + 2) #define MAX_BUF_YSIZE (SCR_FIELDY + 2) - -#if 0 -#define MIN_LEV_FIELDX (SCR_FIELDX - 2) -#define MIN_LEV_FIELDY (SCR_FIELDY - 2) -#else #define MIN_LEV_FIELDX 3 #define MIN_LEV_FIELDY 3 -#endif #define STD_LEV_FIELDX 64 #define STD_LEV_FIELDY 32 #define MAX_LEV_FIELDX 128 diff --git a/src/misc.c b/src/misc.c index 3b3f6a04..63ca326e 100644 --- a/src/misc.c +++ b/src/misc.c @@ -315,6 +315,25 @@ void MarkTileDirty(int x, int y) redraw_mask |= REDRAW_TILES; } +void SetBorderElement() +{ + int x, y; + + BorderElement = EL_LEERRAUM; + + for(y=0; y