X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame.c;h=cea1b769be4fd43ad9ece0c2710720b63434caa9;hp=ae9346768b163531732e0fe2b5feca802ba7d630;hb=8c7cf0796617d786268af85fc5e5f1ad7846f3a1;hpb=b42cb98ebc3215ce864e9dd19371b48afff4c2fd diff --git a/src/game.c b/src/game.c index ae934676..cea1b769 100644 --- a/src/game.c +++ b/src/game.c @@ -1949,7 +1949,7 @@ static void InitField(int x, int y, boolean init_game) CheckTriggeredElementChange(x, y, element, CE_CREATION_OF_X); } -static inline void InitField_WithBug1(int x, int y, boolean init_game) +inline static void InitField_WithBug1(int x, int y, boolean init_game) { InitField(x, y, init_game); @@ -1959,7 +1959,7 @@ static inline void InitField_WithBug1(int x, int y, boolean init_game) InitMovDir(x, y); } -static inline void InitField_WithBug2(int x, int y, boolean init_game) +inline static void InitField_WithBug2(int x, int y, boolean init_game) { int old_element = Feld[x][y]; @@ -3091,9 +3091,10 @@ void InitGame() int initial_move_dir = MV_DOWN; int i, j, x, y; - game_status = GAME_MODE_PLAYING; + // required here to update video display before fading (FIX THIS) + DrawMaskedBorder(REDRAW_DOOR_2); - StopAnimation(); + game_status = GAME_MODE_PLAYING; if (!game.restart_level) CloseDoor(DOOR_CLOSE_1); @@ -3106,11 +3107,13 @@ void InitGame() else FadeSetEnterScreen(); - if (CheckIfRedrawGlobalBorderIsNeeded()) + if (CheckIfGlobalBorderHasChanged()) fade_mask = REDRAW_ALL; FadeOut(fade_mask); + OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); + ClearField(); DrawCompleteVideoDisplay(); @@ -3925,6 +3928,8 @@ void InitGame() BlitScreenToBitmap(backbuffer); /* !!! FIX THIS (END) !!! */ + DrawMaskedBorder(fade_mask); + FadeIn(fade_mask); #if 1 @@ -3954,9 +3959,14 @@ void InitGame() { UnmapGameButtons(); UnmapTapeButtons(); + + FreeGameButtons(); + CreateGameButtons(); + game_gadget[SOUND_CTRL_ID_MUSIC]->checked = setup.sound_music; game_gadget[SOUND_CTRL_ID_LOOPS]->checked = setup.sound_loops; game_gadget[SOUND_CTRL_ID_SIMPLE]->checked = setup.sound_simple; + MapGameButtons(); MapTapeButtons(); @@ -4886,7 +4896,11 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, int frame_delay_value = (ffwd_delay ? FfwdFrameDelay : GameFrameDelay); int wait_delay_value = (no_delay ? 0 : frame_delay_value); - if (quick_relocation) + if (level.lazy_relocation && IN_VIS_FIELD(SCREENX(x), SCREENY(y))) + { + RedrawPlayfield(); + } + else if (quick_relocation) { if (!IN_VIS_FIELD(SCREENX(x), SCREENY(y)) || center_screen) { @@ -4965,7 +4979,7 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, } } - RedrawPlayfield(TRUE, 0,0,0,0); + RedrawPlayfield(); } else { @@ -5007,7 +5021,6 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, offset_y - MIDPOSY); } - ScrollScreen(NULL, SCROLL_GO_ON); /* scroll last frame to full tile */ while (scroll_x != scroll_xx || scroll_y != scroll_yy) @@ -10972,23 +10985,6 @@ void GameActions() byte tape_action[MAX_PLAYERS]; int i; - for (i = 0; i < MAX_PLAYERS; i++) - { - struct PlayerInfo *player = &stored_player[i]; - - // allow engine snapshot if movement attempt was stopped - if ((game.snapshot.last_action[i] & KEY_MOTION) != 0 && - (player->action & KEY_MOTION) == 0) - game.snapshot.changed_action = TRUE; - - // allow engine snapshot in case of snapping/dropping attempt - if ((game.snapshot.last_action[i] & KEY_BUTTON) == 0 && - (player->action & KEY_BUTTON) != 0) - game.snapshot.changed_action = TRUE; - - game.snapshot.last_action[i] = player->action; - } - /* detect endless loops, caused by custom element programming */ if (recursion_loop_detected && recursion_loop_depth == 0) { @@ -11195,6 +11191,21 @@ void GameActions() #endif #endif + for (i = 0; i < MAX_PLAYERS; i++) + { + // allow engine snapshot in case of changed movement attempt + if ((game.snapshot.last_action[i] & KEY_MOTION) != + (stored_player[i].effective_action & KEY_MOTION)) + game.snapshot.changed_action = TRUE; + + // allow engine snapshot in case of snapping/dropping attempt + if ((game.snapshot.last_action[i] & KEY_BUTTON) == 0 && + (stored_player[i].effective_action & KEY_BUTTON) != 0) + game.snapshot.changed_action = TRUE; + + game.snapshot.last_action[i] = stored_player[i].effective_action; + } + if (level.game_engine_type == GAME_ENGINE_TYPE_EM) { GameActions_EM_Main();