From 44c2aaaa7338da0291cbc06359ffb0d68c5a0bba Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 1 Oct 2014 09:57:17 +0200 Subject: [PATCH] fixed 'quick menu doors' and sounds for door and envelope requests --- ChangeLog | 3 +++ src/conftime.h | 2 +- src/tools.c | 29 ++++++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cdf4fdbe..a6867518 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2014-10-01 + * fixed "quick menu doors" and sounds for door and envelope requests + 2014-09-29 * fixed display bugs with certain custom menu definitions regarding the hall of fame (high scores) and setup screens that require scrolling diff --git a/src/conftime.h b/src/conftime.h index 8aace495..e12f98de 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2014-09-30 01:29" +#define COMPILE_DATE_STRING "2014-10-01 09:50" diff --git a/src/tools.c b/src/tools.c index 7de35d14..335d983a 100644 --- a/src/tools.c +++ b/src/tools.c @@ -2381,6 +2381,19 @@ void AnimateEnvelopeRequest(int anim_mode, int action) int ystep = (ystart < yend || xstep == 0 ? 1 : 0); int x, y; + if (setup.quick_doors) + { + xstart = xend; + ystart = yend; + } + else + { + if (action == ACTION_OPENING) + PlayMenuSoundStereo(SND_DOOR_OPENING, SOUND_MIDDLE); + else if (action == ACTION_CLOSING) + PlayMenuSoundStereo(SND_DOOR_CLOSING, SOUND_MIDDLE); + } + for (x = xstart, y = ystart; x <= xend && y <= yend; x += xstep, y += ystep) { int xsize = (action == ACTION_CLOSING ? xend - (x - xstart) : x) + 2; @@ -4147,6 +4160,7 @@ unsigned int MoveDoor(unsigned int door_state) int max_step_delay = 0; // delay (ms) between two animation frames int num_move_steps = 0; // number of animation steps for all doors int current_move_delay = 0; + int start = 0; int k; for (i = 0; i < NUM_DOORS; i++) @@ -4206,7 +4220,20 @@ unsigned int MoveDoor(unsigned int door_state) door_delay_value = max_step_delay; - for (k = 0; k < num_move_steps; k++) + if ((door_state & DOOR_NO_DELAY) || setup.quick_doors) + { + start = num_move_steps - 1; + } + else + { + /* opening door sound has priority over simultaneously closing door */ + if (door_state & (DOOR_OPEN_1 | DOOR_OPEN_2)) + PlayMenuSoundStereo(SND_DOOR_OPENING, SOUND_MIDDLE); + else if (door_state & (DOOR_CLOSE_1 | DOOR_CLOSE_2)) + PlayMenuSoundStereo(SND_DOOR_CLOSING, SOUND_MIDDLE); + } + + for (k = start; k < num_move_steps; k++) { door_part_done_all = TRUE; -- 2.34.1