- if (tape.playing)
- Delay(wait_delay_value);
- else
- WaitForEventToContinue();
-
- if (anim_mode != ANIM_NONE)
- PlaySoundStereo(sound_closing, SOUND_MIDDLE);
-
- if (anim_mode != ANIM_NONE)
- {
- /* close envelope window vertically */
- for (i = level.envelope_ysize[envelope_nr]; i >= 0; i--)
- {
- int xsize = level.envelope_xsize[envelope_nr] + 2;
- int ysize = i + 2;
- int startx = (SXSIZE - xsize * font_width) / 2;
- int starty = (SYSIZE - ysize * font_height) / 2;
-
- SetDrawtoField(DRAW_BUFFERED);
-
- BlitBitmap(fieldbuffer, backbuffer, FX, FY, SXSIZE, SYSIZE, SX, SY);
-
- SetDrawtoField(DRAW_BACKBUFFER);
-
- for (y=0; y < ysize; y++) for (x=0; x < xsize; x++)
- DrawEnvelopeBackground(envelope_nr, startx, starty, x, y, xsize, ysize,
- font_nr);
-
- DrawTextToTextArea(SX + startx + font_width, SY + starty + font_height,
- level.envelope_text[envelope_nr], FONT_TEXT_1,
- level.envelope_xsize[envelope_nr], i, mask_mode);
+void ShowEnvelope(int envelope_nr)
+{
+ int element = EL_ENVELOPE_1 + envelope_nr;
+ int graphic = IMG_BACKGROUND_ENVELOPE_1 + envelope_nr;
+ int sound_opening = element_info[element].sound[ACTION_OPENING];
+ int sound_closing = element_info[element].sound[ACTION_CLOSING];
+ boolean ffwd_delay = (tape.playing && tape.fast_forward);
+ int wait_delay_value = (ffwd_delay ? 500 : 1000);
+ int anim_mode = graphic_info[graphic].anim_mode;
+ int main_anim_mode = (anim_mode == ANIM_NONE ? ANIM_VERTICAL|ANIM_HORIZONTAL:
+ anim_mode == ANIM_DEFAULT ? ANIM_VERTICAL : anim_mode);