From: Holger Schemel Date: Wed, 3 Sep 2003 22:42:17 +0000 (+0200) Subject: rnd-20030904-1-src X-Git-Tag: 3.0.3^2~4 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=871f79585ed487482fe670383d0020c04a5e8f74;p=rocksndiamonds.git rnd-20030904-1-src --- diff --git a/src/conftime.h b/src/conftime.h index a055fc9d..6a4286e3 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-09-02 21:26]" +#define COMPILE_DATE_STRING "[2003-09-04 00:41]" diff --git a/src/game.c b/src/game.c index 2ed291e2..3e768d93 100644 --- a/src/game.c +++ b/src/game.c @@ -1994,7 +1994,7 @@ void ShowEnvelope() int i, x, y; /* open envelope window horizontally */ - for (i=2; i <= level.envelope_xsize + 2; i += 2) + for (i = 2; i <= level.envelope_xsize + 2; i += 2) { int startx = (SXSIZE / MINI_TILEX - i) / 2; int starty = (SYSIZE / MINI_TILEY) / 2 - 1; @@ -2020,7 +2020,7 @@ void ShowEnvelope() } /* open envelope window vertically */ - for (i=2; i <= level.envelope_ysize + 2; i += 2) + for (i = 2; i <= level.envelope_ysize + 2; i += 2) { int xsize = level.envelope_xsize + 2; int startx = (SXSIZE / MINI_TILEX - (xsize - 1)) / 2; @@ -2050,7 +2050,67 @@ void ShowEnvelope() Delay(GAME_FRAME_DELAY); } - Delay(3000); + if (tape.playing) + Delay(1000); + else + WaitForEventToContinue(); + + /* close envelope window vertically */ + for (i = level.envelope_ysize + 2; i >= 2; i -= 2) + { + int xsize = level.envelope_xsize + 2; + int startx = (SXSIZE / MINI_TILEX - (xsize - 1)) / 2; + int starty = (SYSIZE / MINI_TILEY - i) / 2; + + SetDrawtoField(DRAW_BUFFERED); + + BlitBitmap(fieldbuffer, backbuffer, FX, FY, SXSIZE, SYSIZE, SX, SY); + + SetDrawtoField(DRAW_BACKBUFFER); + + for (y=0; y < i; y++) for (x=0; x < xsize; x++) + { + int ex = (x == 0 ? -1 : x == xsize - 1 ? +1 : 0); + int ey = (y == 0 ? -1 : y == i - 1 ? +1 : 0); + + DrawEnvelopeBorder(startx + x, starty + y, ex, ey); + } + + DrawTextToTextArea(SX + (startx + 1) * MINI_TILEX, + SY + (starty + 1) * MINI_TILEY, level.envelope, + FONT_TEXT_1, level.envelope_xsize, i - 2); + + redraw_mask |= REDRAW_FIELD | REDRAW_FROM_BACKBUFFER; + BackToFront(); + + Delay(GAME_FRAME_DELAY); + } + + /* close envelope window horizontally */ + for (i = level.envelope_xsize + 2; i >= 2; i -= 2) + { + int startx = (SXSIZE / MINI_TILEX - i) / 2; + int starty = (SYSIZE / MINI_TILEY) / 2 - 1; + + SetDrawtoField(DRAW_BUFFERED); + + BlitBitmap(fieldbuffer, backbuffer, FX, FY, SXSIZE, SYSIZE, SX, SY); + + SetDrawtoField(DRAW_BACKBUFFER); + + for (y=0; y < 2; y++) for (x=0; x < i; x++) + { + int ex = (x == 0 ? -1 : x == i - 1 ? +1 : 0); + int ey = (y == 0 ? -1 : y == 1 ? +1 : 0); + + DrawEnvelopeBorder(startx + x, starty + y, ex, ey); + } + + redraw_mask |= REDRAW_FIELD | REDRAW_FROM_BACKBUFFER; + BackToFront(); + + Delay(GAME_FRAME_DELAY); + } SetDrawtoField(DRAW_BUFFERED); diff --git a/src/tools.c b/src/tools.c index d50b99dd..e104066c 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1780,16 +1780,50 @@ void DrawMicroLevel(int xpos, int ypos, boolean restart) game_status = last_game_status; /* restore current game status */ } -int REQ_in_range(int x, int y) +void WaitForEventToContinue() { - if (y > DY+249 && y < DY+278) + boolean still_wait = TRUE; + + /* simulate releasing mouse button over last gadget, if still pressed */ + if (button_status) + HandleGadgets(-1, -1, 0); + + button_status = MB_RELEASED; + + while (still_wait) { - if (x > DX+1 && x < DX+48) - return 1; - else if (x > DX+51 && x < DX+98) - return 2; + if (PendingEvent()) + { + Event event; + + NextEvent(&event); + + switch (event.type) + { + case EVENT_BUTTONPRESS: + case EVENT_KEYPRESS: + still_wait = FALSE; + break; + + case EVENT_KEYRELEASE: + ClearPlayerAction(); + break; + + default: + HandleOtherEvents(&event); + break; + } + } + else if (AnyJoystickButton() == JOY_BUTTON_NEW_PRESSED) + { + still_wait = FALSE; + } + + DoAnimation(); + + /* don't eat all CPU time */ + Delay(10); } - return 0; } #define MAX_REQUEST_LINES 13 diff --git a/src/tools.h b/src/tools.h index 05f6ed30..f046184a 100644 --- a/src/tools.h +++ b/src/tools.h @@ -120,6 +120,7 @@ void DrawLevel(void); void DrawMiniLevel(int, int, int, int); void DrawMicroLevel(int, int, boolean); +void WaitForEventToContinue(); boolean Request(char *, unsigned int); unsigned int OpenDoor(unsigned int); unsigned int CloseDoor(unsigned int);