From: Holger Schemel Date: Wed, 12 Aug 1998 23:43:58 +0000 (+0200) Subject: rnd-19980813-1 X-Git-Tag: 1.2.0^2~97 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=19b6c35938826bfd71478d7ddaf1a4729420d3b2;p=rocksndiamonds.git rnd-19980813-1 --- diff --git a/src/cartoons.c b/src/cartoons.c index 7cc59d1a..1c193f6f 100644 --- a/src/cartoons.c +++ b/src/cartoons.c @@ -139,12 +139,17 @@ void HandleAnimation(int mode) SetDrawtoField(DRAW_DIRECT); } + if (soft_scrolling_on && game_status==PLAYING) + XCopyArea(display,fieldbuffer,backbuffer,gc, + FX,FY, SXSIZE,SYSIZE, + SX,SY); + return; break; case ANIM_CONTINUE: break; case ANIM_STOP: - redraw_mask |= REDRAW_FIELD; + redraw_mask |= (REDRAW_FIELD | REDRAW_FROM_BACKBUFFER); /* Redraw background even when in direct drawing mode */ draw_mode = direct_draw_on; diff --git a/src/events.c b/src/events.c index ed43f4ec..1b77ca40 100644 --- a/src/events.c +++ b/src/events.c @@ -160,6 +160,11 @@ void HandleExposeEvent(XExposeEvent *event) SetDrawtoField(DRAW_DIRECT); } + if (soft_scrolling_on && game_status==PLAYING) + XCopyArea(display,fieldbuffer,backbuffer,gc, + FX,FY, SXSIZE,SYSIZE, + SX,SY); + XCopyArea(display,drawto,window,gc, x,y, width,height, x,y); XFlush(display); @@ -202,6 +207,7 @@ void HandleFocusEvent(XFocusChangeEvent *event) XAutoRepeatOn(display); old_joystick_status = joystick_status; joystick_status = JOYSTICK_OFF; + key_joystick_mapping = 0; } else if (event->type == FocusIn) { diff --git a/src/files.h b/src/files.h index 1489d289..e34532a1 100644 --- a/src/files.h +++ b/src/files.h @@ -32,6 +32,7 @@ #define SETUP_2ND_JOYSTICK (1<<7) #define SETUP_QUICK_DOORS (1<<8) #define SETUP_SCROLL_DELAY (1<<9) +#define SETUP_SOFT_SCROLL (1<<10) #define DEFAULT_SETUP (SETUP_TOONS | \ SETUP_SOUND | \ @@ -49,6 +50,7 @@ #define SETUP_2ND_JOYSTICK_ON(x) (((x) & SETUP_2ND_JOYSTICK) != 0) #define SETUP_QUICK_DOORS_ON(x) (((x) & SETUP_QUICK_DOORS) != 0) #define SETUP_SCROLL_DELAY_ON(x) (((x) & SETUP_SCROLL_DELAY) != 0) +#define SETUP_SOFT_SCROLL_ON(x) (((x) & SETUP_SOFT_SCROLL) != 0) BOOL CreateNewScoreFile(void); BOOL CreateNewNamesFile(int); diff --git a/src/game.c b/src/game.c index dbc54582..01d6b72c 100644 --- a/src/game.c +++ b/src/game.c @@ -49,6 +49,7 @@ void GetPlayerConfig() joystick_nr = SETUP_2ND_JOYSTICK_ON(player.setup); quick_doors = SETUP_QUICK_DOORS_ON(player.setup); scroll_delay_on = SETUP_SCROLL_DELAY_ON(player.setup); + soft_scrolling_on = SETUP_SOFT_SCROLL_ON(player.setup); if (joystick_nr != old_joystick_nr) { @@ -74,6 +75,7 @@ void InitGame() FrameCounter = 0; TimeFrames = 0; TimeLeft = level.time; + ScreenMovPos = 0; PlayerMovDir = MV_NO_MOVING; PlayerMovPos = 0; PlayerFrame = 0; @@ -2751,6 +2753,9 @@ void GameActions() */ + DrawPlayerField(); + + BackToFront(); } @@ -2869,6 +2874,7 @@ BOOL MoveFigureOneStep(int dx, int dy, int real_dx, int real_dy) BOOL MoveFigure(int dx, int dy) { static long move_delay = 0; + static int last_move_dir = MV_NO_MOVING; int moved = MF_NO_ACTION; int oldJX = JX, oldJY = JY; @@ -2901,6 +2907,22 @@ BOOL MoveFigure(int dx, int dy) return(FALSE); } + + if (last_move_dir & (MV_LEFT | MV_RIGHT)) + { + if (!(moved |= MoveFigureOneStep(0,dy, dx,dy))) + moved |= MoveFigureOneStep(dx,0, dx,dy); + } + else + { + if (!(moved |= MoveFigureOneStep(dx,0, dx,dy))) + moved |= MoveFigureOneStep(0,dy, dx,dy); + } + + last_move_dir = MV_NO_MOVING; + + + /* if (moved |= MoveFigureOneStep(dx,0, dx,dy)) moved |= MoveFigureOneStep(0,dy, dx,dy); else @@ -2908,6 +2930,7 @@ BOOL MoveFigure(int dx, int dy) moved |= MoveFigureOneStep(0,dy, dx,dy); moved |= MoveFigureOneStep(dx,0, dx,dy); } + */ if (moved & MF_MOVING) { @@ -2938,6 +2961,8 @@ BOOL MoveFigure(int dx, int dy) PlayerMovDir = (oldJY < JY ? MV_DOWN : MV_UP); DrawLevelField(JX,JY); /* für "ErdreichAnbroeckeln()" */ + + last_move_dir = PlayerMovDir; } TestIfHeroHitsBadThing(); @@ -2961,6 +2986,8 @@ void ScrollFigure(int init) { if (PlayerMovPos && oldX != -1 && oldY != -1) { + if (Feld[JX2][JY2] == EL_LEERRAUM) + Feld[JX2][JY2] = EL_UNSICHTBAR; DrawLevelElement(oldX,oldY, Feld[oldX][oldY]); DrawPlayerField(); } @@ -2969,8 +2996,10 @@ void ScrollFigure(int init) oldY = JY2; actual_frame_counter = FrameCounter; + /* redraw[redraw_x1 + oldX][redraw_y1 + oldY] = 1; redraw_tiles++; + */ /* DrawLevelElement(oldX,oldY, Feld[oldX][oldY]); @@ -2991,6 +3020,9 @@ void ScrollFigure(int init) redraw_mask |= REDRAW_FIELD; } + if (Feld[oldX][oldY] == EL_UNSICHTBAR) + Feld[oldX][oldY] = EL_LEERRAUM; + DrawLevelElement(oldX,oldY, Feld[oldX][oldY]); DrawPlayerField(); diff --git a/src/main.h b/src/main.h index 4bdf70f1..90dcd6d2 100644 --- a/src/main.h +++ b/src/main.h @@ -67,11 +67,12 @@ typedef int BOOL; #define IN_SCR_FIELD(x,y) ((x)>=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2) #define IN_LEV_FIELD(x,y) ((x)>=0 && (x)=0 &&(y)