From 90e8811a711b5daa481c1c3a36a9cbeae4ad233c Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 8 Mar 2014 00:10:21 +0100 Subject: [PATCH] rnd-20140308-1-src --- src/conftime.h | 2 +- src/editor.c | 8 ++++++++ src/screens.c | 9 +++++++++ src/tape.c | 16 ++++++++++++++++ src/tools.c | 19 +++++++++++++++++++ 5 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/conftime.h b/src/conftime.h index 725b3fdc..5e5f42be 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2014-03-07 10:48" +#define COMPILE_DATE_STRING "2014-03-07 21:52" diff --git a/src/editor.c b/src/editor.c index 7c513965..1fe6e544 100644 --- a/src/editor.c +++ b/src/editor.c @@ -7751,6 +7751,7 @@ void DrawLevelEd() #if 1 FadeOut(REDRAW_FIELD); + // FadeOut(REDRAW_ALL); #endif #if 1 @@ -7758,7 +7759,11 @@ void DrawLevelEd() ChangeViewportPropertiesIfNeeded(); #endif +#if 1 + OpenDoor(DOOR_OPEN_1 | DOOR_OPEN_2 | DOOR_NO_DELAY); +#else OpenDoor(DOOR_OPEN_2 | DOOR_NO_DELAY); +#endif #if DEBUG CheckElementDescriptions(); @@ -7832,6 +7837,7 @@ void DrawLevelEd() #if 1 FadeIn(REDRAW_FIELD); + // FadeIn(REDRAW_ALL); #endif /* copy actual editor door content to door double buffer for OpenDoor() */ @@ -7848,7 +7854,9 @@ void DrawLevelEd() BackToFront(); #endif +#if 0 OpenDoor(DOOR_OPEN_1); +#endif } static void AdjustDrawingAreaGadgets() diff --git a/src/screens.c b/src/screens.c index 5bcaa1d5..aeef4fec 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1481,6 +1481,11 @@ void DrawMainMenuExt(int fade_mask, boolean do_fading) MapTapeButtons(); MapScreenMenuGadgets(SCREEN_MASK_MAIN); +#if 1 + /* copy actual game door content to door double buffer for OpenDoor() */ + BlitBitmap(drawto, bitmap_db_door_2, VX, VY, VXSIZE, VYSIZE, 0, 0); +#endif + #if 1 if (fade_mask == REDRAW_ALL) { @@ -1958,6 +1963,10 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) game_status = GAME_MODE_SETUP; setup_mode = SETUP_MODE_MAIN; +#if 1 + ChangeViewportPropertiesIfNeeded(); +#endif + DrawSetupScreen(); } else if (pos == MAIN_CONTROL_QUIT) diff --git a/src/tape.c b/src/tape.c index 782db9be..9a5aaa91 100644 --- a/src/tape.c +++ b/src/tape.c @@ -544,6 +544,20 @@ void DrawCompleteVideoDisplay() tape.date, tape.length); #endif +#if 1 + + struct GraphicInfo *g_tape = &graphic_info[IMG_BACKGROUND_TAPE]; + + /* draw tape background */ + BlitBitmap(g_tape->bitmap, drawto, g_tape->src_x, g_tape->src_y, + gfx.vxsize, gfx.vysize, gfx.vx, gfx.vy); + + /* draw tape buttons (forced) */ + UnmapTapeButtons(); + MapTapeButtons(); + +#else + #if 1 struct GraphicInfo *g_tape = &graphic_info[IMG_BACKGROUND_TAPE]; int tape_button_graphics[] = @@ -584,6 +598,8 @@ void DrawCompleteVideoDisplay() DOOR_GFX_PAGEY2 + VIDEO_CONTROL_YPOS, VIDEO_CONTROL_XSIZE, VIDEO_CONTROL_YSIZE, gfx.vx + VIDEO_CONTROL_XPOS, gfx.vy + VIDEO_CONTROL_YPOS); +#endif + #endif DrawVideoDisplay(VIDEO_ALL_OFF, 0); diff --git a/src/tools.c b/src/tools.c index 21728e5a..c6c5acf8 100644 --- a/src/tools.c +++ b/src/tools.c @@ -5702,6 +5702,7 @@ unsigned int MoveDoor(unsigned int door_state) if (door_state & DOOR_ACTION) { boolean door_panel_drawn[NUM_DOORS]; + boolean panel_has_doors[NUM_DOORS]; boolean door_part_skip[MAX_DOOR_PARTS]; boolean door_part_done[MAX_DOOR_PARTS]; boolean door_part_done_all; @@ -5712,6 +5713,9 @@ unsigned int MoveDoor(unsigned int door_state) int current_move_delay = 0; int k; + for (i = 0; i < NUM_DOORS; i++) + panel_has_doors[i] = FALSE; + for (i = 0; i < MAX_DOOR_PARTS; i++) { struct DoorPartControlInfo *dpc = &door_part_controls[i]; @@ -5742,6 +5746,7 @@ unsigned int MoveDoor(unsigned int door_state) struct DoorPartPosInfo *pos = dpc->pos; struct GraphicInfo *g = &graphic_info[dpc->graphic]; int door_token = dpc->door_token; + int door_index = DOOR_INDEX_FROM_TOKEN(door_token); boolean is_panel = DOOR_PART_IS_PANEL(nr); int step_xoffset = ABS(pos->step_xoffset); int step_yoffset = ABS(pos->step_yoffset); @@ -5764,6 +5769,9 @@ unsigned int MoveDoor(unsigned int door_state) if (door_part_skip[nr]) continue; + if (!is_panel) + panel_has_doors[door_index] = TRUE; + max_move_delay = MAX(max_move_delay, move_delay); max_step_delay = (max_step_delay == 0 ? step_delay : euclid(max_step_delay, step_delay)); @@ -6009,9 +6017,16 @@ unsigned int MoveDoor(unsigned int door_state) door_part_done[nr] = TRUE; #endif +#if 1 + // continue door part animations, but not panel after door has closed + if (!door_part_done[nr] && + !(is_panel && door_closing && panel_has_doors[door_index])) + door_part_done_all = FALSE; +#else // continue door part animations, but not panel after door has closed if (!door_part_done[nr] && !(is_panel && door_closing)) door_part_done_all = FALSE; +#endif #if 0 if (!door_part_done[nr]) @@ -11271,9 +11286,13 @@ void ChangeViewportPropertiesIfNeeded() int *door_2_x = (game_status == GAME_MODE_EDITOR ? &EX : &VX); int *door_2_y = (game_status == GAME_MODE_EDITOR ? &EY : &VY); #endif +#if 1 + int gfx_game_mode = game_status; +#else int gfx_game_mode = (game_status == GAME_MODE_PLAYING || game_status == GAME_MODE_EDITOR ? game_status : GAME_MODE_MAIN); +#endif int gfx_game_mode2 = (game_status == GAME_MODE_EDITOR ? GAME_MODE_DEFAULT : game_status); struct RectWithBorder *vp_playfield = &viewport.playfield[gfx_game_mode]; -- 2.34.1