From: Holger Schemel Date: Mon, 20 May 2002 23:13:02 +0000 (+0200) Subject: rnd-20020521-1-src X-Git-Tag: 2.1.0^2~15 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=432aa656f93fcd2f0fa8f61d94e0e36d2192535e;p=rocksndiamonds.git rnd-20020521-1-src --- diff --git a/CHANGES b/CHANGES index 6fc46cd6..433c6048 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ Release Version 2.1.0 [XX XXX XXXX] ----------------------------------- + - added Boulderdash style "snap-pushing" (thanks to Achim Härtel) - bug fixed that prevented walking through tubes when gravity on - enhanced sound system (especially regarding stereo and loop sounds) - new structured setup menu (with sob-menues for graphics and sounds) @@ -7,6 +8,7 @@ Release Version 2.1.0 [XX XXX XXXX] - added support for TrueColor PCX graphics files - added support for 16 bit WAV sound files - added "quick save" and "quick load" functions with shortcut key + - added single-step playing mode (automatic pause after each step) - changed default slipping behaviour of gems back to 2.0.0 style; this is now an element property for gems in the level editor, although existing converted levels use the new EM gems behaviour diff --git a/src/game.c b/src/game.c index 3c81e299..e76ca5a9 100644 --- a/src/game.c +++ b/src/game.c @@ -1349,7 +1349,11 @@ void CheckDynamite(int x, int y) MovDelay[x][y]--; if (MovDelay[x][y]) { +#if 0 if (!(MovDelay[x][y] % 12)) +#else + if (!(MovDelay[x][y] % 6)) +#endif { if (Feld[x][y] == EL_DYNAMITE_ACTIVE) PlaySoundLevel(x, y, SND_DYNAMITE_BURNING); @@ -3144,7 +3148,7 @@ void ContinueMoving(int x, int y) MovPos[x][y] += step; - if (ABS(MovPos[x][y])>=TILEX) /* object reached its destination */ + if (ABS(MovPos[x][y]) >= TILEX) /* object reached its destination */ { Feld[x][y] = EL_LEERRAUM; Feld[newx][newy] = element; @@ -5688,7 +5692,7 @@ int DigField(struct PlayerInfo *player, dy == +1 ? MV_DOWN : MV_NO_MOVING); int element; - if (!player->MovPos) + if (player->MovPos == 0) player->Pushing = FALSE; if (mode == DF_NO_PUSH) @@ -6004,8 +6008,8 @@ int DigField(struct PlayerInfo *player, PlaySoundStereo(SND_SP_EXIT_ENTERING, SOUND_MAX_RIGHT); break; + /* the following elements cannot be pushed by "snapping" */ case EL_FELSBROCKEN: - case EL_BD_ROCK: case EL_BOMBE: case EL_DX_SUPABOMB: case EL_KOKOSNUSS: @@ -6013,7 +6017,12 @@ int DigField(struct PlayerInfo *player, case EL_SP_ZONK: case EL_SP_DISK_ORANGE: case EL_SPRING: - if (dy || mode == DF_SNAP) + if (mode == DF_SNAP) + return MF_NO_ACTION; + /* no "break" -- fall through to next case */ + /* the following elements can be pushed by "snapping" */ + case EL_BD_ROCK: + if (dy) return MF_NO_ACTION; player->Pushing = TRUE; @@ -6040,8 +6049,16 @@ int DigField(struct PlayerInfo *player, return MF_NO_ACTION; #endif - RemoveField(x, y); - Feld[x+dx][y+dy] = element; + if (mode == DF_SNAP) + { + InitMovingField(x, y, move_direction); + ContinueMoving(x, y); + } + else + { + RemoveField(x, y); + Feld[x+dx][y+dy] = element; + } if (element == EL_SPRING) { @@ -6377,6 +6394,9 @@ boolean SnapField(struct PlayerInfo *player, int dx, int dy) if (!dx && !dy) { + if (player->MovPos == 0) + player->Pushing = FALSE; + player->snapped = FALSE; return FALSE; } @@ -6449,6 +6469,8 @@ boolean PlaceBomb(struct PlayerInfo *player) void PlaySoundLevel(int x, int y, int nr) { + static int loop_sound_frame[NUM_SOUND_EFFECTS]; + static int loop_sound_volume[NUM_SOUND_EFFECTS]; int sx = SCREENX(x), sy = SCREENY(y); int volume, stereo_position; int max_distance = 8; @@ -6477,6 +6499,18 @@ void PlaySoundLevel(int x, int y, int nr) (sx + max_distance) * SOUND_MAX_LEFT2RIGHT / (SCR_FIELDX + 2 * max_distance)); + if (IS_LOOP_SOUND(nr)) + { + /* This assures that quieter loop sounds do not overwrite louder ones, + while restarting sound volume comparison with each new game frame. */ + + if (loop_sound_volume[nr] > volume && loop_sound_frame[nr] == FrameCounter) + return; + + loop_sound_volume[nr] = volume; + loop_sound_frame[nr] = FrameCounter; + } + PlaySoundExt(nr, volume, stereo_position, type); } diff --git a/src/timestamp.h b/src/timestamp.h index b740e595..b3b1a58d 100644 --- a/src/timestamp.h +++ b/src/timestamp.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2002-05-20 14:07]" +#define COMPILE_DATE_STRING "[2002-05-20 23:45]"