From: Holger Schemel Date: Mon, 28 Dec 1998 01:49:52 +0000 (+0100) Subject: rnd-19981228-1 X-Git-Tag: 1.3.0^2~45 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1d5a33fc89d071c8e8a242ff3b51258f1b6b0e1e;p=rocksndiamonds.git rnd-19981228-1 --- diff --git a/src/editor.c b/src/editor.c index 54741f74..2adf93c8 100644 --- a/src/editor.c +++ b/src/editor.c @@ -205,7 +205,7 @@ int editor_element[] = EL_BETON, EL_FELSBODEN, - EL_SIEB2_LEER, + EL_SIEB2_INAKTIV, EL_AUSGANG_ZU, EL_AUSGANG_AUF, @@ -252,7 +252,7 @@ int editor_element[] = EL_BETON, EL_MAUERWERK, EL_FELSBODEN, - EL_SIEB_LEER, + EL_SIEB_INAKTIV, EL_EDELSTEIN, EL_DIAMANT, @@ -1994,7 +1994,7 @@ static void DrawPropertiesWindow() { EL_AMOEBE_NORM, &level.tempo_amoebe, TEXT_SPEED }, { EL_AMOEBE_VOLL, &level.tempo_amoebe, TEXT_SPEED }, { EL_AMOEBE_BD, &level.tempo_amoebe, TEXT_SPEED }, - { EL_SIEB_LEER, &level.dauer_sieb, TEXT_DURATION }, + { EL_SIEB_INAKTIV, &level.dauer_sieb, TEXT_DURATION }, { EL_ABLENK_AUS, &level.dauer_ablenk, TEXT_DURATION }, { -1, NULL, NULL } }; diff --git a/src/events.c b/src/events.c index 3870ed81..f4ab83e3 100644 --- a/src/events.c +++ b/src/events.c @@ -552,6 +552,22 @@ void HandleKey(KeySym key, int key_status) break; #endif +#if 1 + case XK_m: + if (MoveSpeed == 8) + { + MoveSpeed = 4; + ScrollStepSize = TILEX/4; + } + else + { + MoveSpeed = 8; + ScrollStepSize = TILEX/8; + } + printf("MoveSpeed == %d\n", MoveSpeed); + break; +#endif + case XK_f: ScrollStepSize = TILEX/8; printf("ScrollStepSize == %d (1/8)\n", ScrollStepSize); diff --git a/src/game.c b/src/game.c index ec95ff6d..fbaccc24 100644 --- a/src/game.c +++ b/src/game.c @@ -389,7 +389,9 @@ void InitGame() ScreenMovPos = 0; ScreenGfxPos = 0; - AllPlayersGone = SiebAktiv = FALSE; + AllPlayersGone = FALSE; + SiebAktiv = FALSE; + SiebCount = 0; for (i=0; i 0) { - for (y=0; y0 && TimeFrames>=(1000/GameFrameDelay) && !tape.pausing) + if (TimeLeft > 0 && TimeFrames >= (1000 / GameFrameDelay) && !tape.pausing) { TimeFrames = 0; TimeLeft--; @@ -3610,7 +3631,7 @@ boolean MoveFigureOneStep(struct PlayerInfo *player, jy = player->jy = new_jy; StorePlayer[jx][jy] = player->element_nr; - player->MovPos = (dx > 0 || dy > 0 ? -1 : 1) * 7*TILEX/8; + player->MovPos = (dx > 0 || dy > 0 ? -1 : 1) * (TILEX - TILEX / MoveSpeed); ScrollFigure(player, SCROLL_INIT); @@ -3634,10 +3655,15 @@ boolean MoveFigure(struct PlayerInfo *player, int dx, int dy) /* should only happen if pre-1.2 tape recordings are played */ /* this is only for backward compatibility */ + int old_move_speed = MoveSpeed; + #if DEBUG printf("THIS SHOULD ONLY HAPPEN WITH PRE-1.2 LEVEL TAPES.\n"); #endif + /* scroll remaining steps with finest movement resolution */ + MoveSpeed = 8; + while (player->MovPos) { ScrollFigure(player, SCROLL_GO_ON); @@ -3646,6 +3672,8 @@ boolean MoveFigure(struct PlayerInfo *player, int dx, int dy) DrawAllPlayers(); BackToFront(); } + + MoveSpeed = old_move_speed; } if (player->last_move_dir & (MV_LEFT | MV_RIGHT)) @@ -3780,7 +3808,7 @@ void ScrollFigure(struct PlayerInfo *player, int mode) else if (!FrameReached(&player->actual_frame_counter, 1)) return; - player->MovPos += (player->MovPos > 0 ? -1 : 1) * TILEX/8; + player->MovPos += (player->MovPos > 0 ? -1 : 1) * TILEX / MoveSpeed; player->GfxPos = ScrollStepSize * (player->MovPos / ScrollStepSize); if (Feld[last_jx][last_jy] == EL_PLAYER_IS_LEAVING) @@ -3820,7 +3848,7 @@ void ScrollScreen(struct PlayerInfo *player, int mode) if (ScreenMovPos) { - ScreenMovPos += (ScreenMovPos > 0 ? -1 : 1) * TILEX/8; + ScreenMovPos += (ScreenMovPos > 0 ? -1 : 1) * TILEX / MoveSpeed; ScreenGfxPos = ScrollStepSize * (ScreenMovPos / ScrollStepSize); redraw_mask |= REDRAW_FIELD; } diff --git a/src/init.c b/src/init.c index 63e6e576..6b4bece7 100644 --- a/src/init.c +++ b/src/init.c @@ -853,11 +853,13 @@ void InitElementProperties() EL_AMOEBE_BD, EL_MORAST_VOLL, EL_MORAST_LEER, - EL_SIEB_VOLL, + EL_SIEB_INAKTIV, EL_SIEB_LEER, + EL_SIEB_VOLL, EL_SIEB_TOT, - EL_SIEB2_VOLL, + EL_SIEB2_INAKTIV, EL_SIEB2_LEER, + EL_SIEB2_VOLL, EL_SIEB2_TOT, EL_LIFE, EL_LIFE_ASYNC, @@ -1168,7 +1170,7 @@ void InitElementProperties() EL_FELSBODEN, EL_FELSBROCKEN, EL_EDELSTEIN_BD, - EL_SIEB2_LEER, + EL_SIEB2_INAKTIV, EL_AUSGANG_ZU, EL_AUSGANG_AUF, EL_BETON, @@ -1256,7 +1258,9 @@ void InitElementProperties() EL_BADEWANNE3, EL_BADEWANNE4, EL_BADEWANNE5, + EL_SIEB_INAKTIV, EL_SIEB_TOT, + EL_SIEB2_INAKTIV, EL_SIEB2_TOT, EL_AMOEBA2DIAM, EL_BLOCKED, diff --git a/src/main.c b/src/main.c index 1ee567d0..68934fc9 100644 --- a/src/main.c +++ b/src/main.c @@ -96,7 +96,9 @@ int BX1 = 0, BY1 = 0, BX2 = SCR_FIELDX-1, BY2 = SCR_FIELDY-1; int ZX,ZY, ExitX,ExitY; int AllPlayersGone; int FrameCounter, TimeFrames, TimeLeft; -int MampferMax, MampferNr, SiebAktiv; +int MampferMax, MampferNr; +boolean SiebAktiv; +int SiebCount; boolean network_player_action_received = FALSE; diff --git a/src/main.h b/src/main.h index 3c77e192..077fab94 100644 --- a/src/main.h +++ b/src/main.h @@ -437,7 +437,9 @@ extern int BX1,BY1, BX2,BY2; extern int ZX,ZY, ExitX,ExitY; extern int AllPlayersGone; extern int FrameCounter, TimeFrames, TimeLeft; -extern int MampferMax, MampferNr, SiebAktiv; +extern int MampferMax, MampferNr; +extern boolean SiebAktiv; +extern int SiebCount; extern boolean network_player_action_received; @@ -548,8 +550,10 @@ extern int num_bg_loops; #define EL_MORAST_VOLL 17 #define EL_TROPFEN 18 #define EL_BOMBE 19 -#define EL_SIEB_LEER 20 -#define EL_SIEB_VOLL 21 +#define EL_SIEB_INAKTIV 20 + +#define EL_UNUSED_21 21 + #define EL_SALZSAEURE 22 #define EL_AMOEBE_NASS 23 #define EL_AMOEBE_NORM 24 @@ -589,8 +593,10 @@ extern int num_bg_loops; #define EL_ERZ_EDEL_BD 58 #define EL_ERZ_EDEL_GELB 59 #define EL_MAMPFER2 60 -#define EL_SIEB2_LEER 61 -#define EL_SIEB2_VOLL 62 +#define EL_SIEB2_INAKTIV 61 + +#define EL_UNUSED_62 62 + #define EL_DYNABOMB 63 #define EL_DYNABOMB_NR 64 #define EL_DYNABOMB_SZ 65 @@ -641,10 +647,14 @@ extern int num_bg_loops; #define EL_BADEWANNE3 102 #define EL_BADEWANNE4 103 #define EL_BADEWANNE5 104 -#define EL_SIEB_TOT 105 -#define EL_AUSGANG_ACT 106 + +#define EL_UNUSED_105 105 +#define EL_UNUSED_106 106 + #define EL_AUSGANG_AUF 107 -#define EL_SIEB2_TOT 108 + +#define EL_UNUSED_108 108 + #define EL_AMOEBA2DIAM 109 #define EL_MAULWURF 110 #define EL_PINGUIN 111 @@ -751,16 +761,25 @@ extern int num_bg_loops; #define EL_UNUSED_254 254 #define EL_UNUSED_255 255 -/* "unreal" runtime elements */ -#define EL_BLOCKED 300 -#define EL_EXPLODING 301 -#define EL_CRACKINGNUT 302 -#define EL_BLURB_LEFT 303 -#define EL_BLURB_RIGHT 304 -#define EL_AMOEBING 305 -#define EL_MAUERND 306 -#define EL_BURNING 307 -#define EL_PLAYER_IS_LEAVING 308 +/* "real" (and therefore drawable) runtime elements */ +#define EL_SIEB_LEER 300 +#define EL_SIEB2_LEER 301 +#define EL_SIEB_VOLL 302 +#define EL_SIEB2_VOLL 303 +#define EL_SIEB_TOT 304 +#define EL_SIEB2_TOT 305 +#define EL_AUSGANG_ACT 306 + +/* "unreal" (and therefore not drawable) runtime elements */ +#define EL_BLOCKED 400 +#define EL_EXPLODING 401 +#define EL_CRACKINGNUT 402 +#define EL_BLURB_LEFT 403 +#define EL_BLURB_RIGHT 404 +#define EL_AMOEBING 405 +#define EL_MAUERND 406 +#define EL_BURNING 407 +#define EL_PLAYER_IS_LEAVING 408 /* game graphics: ** 0 - 209: graphics from "RocksScreen" @@ -871,9 +890,10 @@ extern int num_bg_loops; #define GFX_SOKOBAN_FELD_VOLL 123 #define GFX_GEBLUBBER 124 /* Zeile 8 (128) */ -#define GFX_SIEB_LEER 128 -#define GFX_SIEB_VOLL GFX_SIEB_LEER -#define GFX_SIEB_TOT GFX_SIEB_LEER +#define GFX_SIEB_INAKTIV 128 +#define GFX_SIEB_LEER GFX_SIEB_INAKTIV +#define GFX_SIEB_VOLL GFX_SIEB_INAKTIV +#define GFX_SIEB_TOT GFX_SIEB_INAKTIV #define GFX_ERZ_EDEL 132 #define GFX_ERZ_DIAM 133 #define GFX_ERZ_EDEL_ROT 134 @@ -906,9 +926,10 @@ extern int num_bg_loops; #define GFX_MAUER_L1 GFX_MAUER_LEFT #define GFX_MAUER_L 170 #define GFX_MAUER_LEBT 171 -#define GFX_SIEB2_LEER 172 -#define GFX_SIEB2_VOLL GFX_SIEB2_LEER -#define GFX_SIEB2_TOT GFX_SIEB2_LEER +#define GFX_SIEB2_INAKTIV 172 +#define GFX_SIEB2_LEER GFX_SIEB2_INAKTIV +#define GFX_SIEB2_VOLL GFX_SIEB2_INAKTIV +#define GFX_SIEB2_TOT GFX_SIEB2_INAKTIV /* Zeile 11 (176) */ #define GFX_AUSGANG_ZU 176 #define GFX_AUSGANG_ACT 177 diff --git a/src/screens.c b/src/screens.c index f38ab854..11c62850 100644 --- a/src/screens.c +++ b/src/screens.c @@ -386,8 +386,8 @@ static int helpscreen_action[] = GFX_DIAMANT,1,10, HA_NEXT, GFX_LIFE,1,100, HA_NEXT, GFX_LIFE_ASYNC,1,100, HA_NEXT, - GFX_SIEB_LEER,4,2, HA_NEXT, - GFX_SIEB2_LEER,4,2, HA_NEXT, + GFX_SIEB_INAKTIV,4,2, HA_NEXT, + GFX_SIEB2_INAKTIV,4,2, HA_NEXT, GFX_AUSGANG_ZU,1,100, GFX_AUSGANG_ACT,4,2, GFX_AUSGANG_AUF+0,4,2, GFX_AUSGANG_AUF+3,1,2, GFX_AUSGANG_AUF+2,1,2, GFX_AUSGANG_AUF+1,1,2, HA_NEXT, diff --git a/src/tools.c b/src/tools.c index 9d3b3fc0..3184acaa 100644 --- a/src/tools.c +++ b/src/tools.c @@ -122,10 +122,26 @@ void BackToFront() } if (setup.soft_scrolling || - ABS(ScreenGfxPos) + ScrollStepSize == TILEX || - ABS(ScreenGfxPos) == ScrollStepSize || + ABS(ScreenMovPos) + ScrollStepSize == TILEX || + ABS(ScreenMovPos) == ScrollStepSize || redraw_tiles > REDRAWTILES_THRESHOLD) + { XCopyArea(display, buffer, window, gc, fx, fy, SXSIZE, SYSIZE, SX, SY); + +#ifdef DEBUG +#if 0 + printf("redrawing all (ScreenGfxPos == %d) because %s\n", + ScreenGfxPos, + (setup.soft_scrolling ? + "setup.soft_scrolling" : + ABS(ScreenGfxPos) + ScrollStepSize == TILEX ? + "ABS(ScreenGfxPos) + ScrollStepSize == TILEX" : + ABS(ScreenGfxPos) == ScrollStepSize ? + "ABS(ScreenGfxPos) == ScrollStepSize" : + "redraw_tiles > REDRAWTILES_THRESHOLD")); +#endif +#endif + } } redraw_mask &= ~REDRAW_MAIN; } @@ -974,10 +990,10 @@ void DrawScreenElementExt(int x, int y, int dx, int dy, int element, if (element != EL_SP_INFOTRON) graphic += phase * (element == EL_FELSBROCKEN ? 2 : 1); } - else if ((element == EL_SIEB_LEER || element == EL_SIEB2_LEER || - element == EL_SIEB_VOLL || element == EL_SIEB2_VOLL) && SiebAktiv) + else if (element == EL_SIEB_LEER || element == EL_SIEB2_LEER || + element == EL_SIEB_VOLL || element == EL_SIEB2_VOLL) { - graphic += 3 - (SiebAktiv % 8) / 2; + graphic += 3 + getGraphicAnimationPhase(4, 4, ANIM_REVERSE); } else if (IS_AMOEBOID(element)) { @@ -1836,6 +1852,7 @@ int el2gfx(int element) case EL_MORAST_VOLL: return GFX_MORAST_VOLL; case EL_TROPFEN: return GFX_TROPFEN; case EL_BOMBE: return GFX_BOMBE; + case EL_SIEB_INAKTIV: return GFX_SIEB_INAKTIV; case EL_SIEB_LEER: return GFX_SIEB_LEER; case EL_SIEB_VOLL: return GFX_SIEB_VOLL; case EL_SIEB_TOT: return GFX_SIEB_TOT; @@ -1896,6 +1913,7 @@ int el2gfx(int element) case EL_ERZ_EDEL_ROT: return GFX_ERZ_EDEL_ROT; case EL_ERZ_EDEL_LILA: return GFX_ERZ_EDEL_LILA; case EL_MAMPFER2: return GFX_MAMPFER2; + case EL_SIEB2_INAKTIV: return GFX_SIEB2_INAKTIV; case EL_SIEB2_LEER: return GFX_SIEB2_LEER; case EL_SIEB2_VOLL: return GFX_SIEB2_VOLL; case EL_SIEB2_TOT: return GFX_SIEB2_TOT;