X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=028e9f4ef91da6b372e5b9547d6f4d822c436c38;hb=d0d2411a139b4ff6c5f9d2ba1df723ffbb0beeb8;hp=73505d24269569b52cb9927acfbd9a36a62f18a1;hpb=f89a490028c36509216b97a96b779b779c2065c9;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 73505d24..028e9f4e 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,40 +3091,30 @@ 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); -#if 1 /* needed if different viewport properties defined for playing */ ChangeViewportPropertiesIfNeeded(); -#endif if (level_editor_test_game) FadeSkipNextFadeIn(); else FadeSetEnterScreen(); - if (CheckIfRedrawGlobalBorderIsNeeded()) + if (CheckIfGlobalBorderHasChanged()) fade_mask = REDRAW_ALL; -#if 0 - printf("::: %d\n", (fade_mask == REDRAW_ALL ? 1 : 0)); -#endif - FadeOut(fade_mask); -#if 0 - /* needed if different viewport properties defined for playing */ - ChangeViewportPropertiesIfNeeded(); -#endif + OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); -#if 1 ClearField(); -#endif DrawCompleteVideoDisplay(); @@ -3938,6 +3928,8 @@ void InitGame() BlitScreenToBitmap(backbuffer); /* !!! FIX THIS (END) !!! */ + DrawMaskedBorder(fade_mask); + FadeIn(fade_mask); #if 1 @@ -3967,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(); @@ -4978,7 +4975,7 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, } } - RedrawPlayfield(TRUE, 0,0,0,0); + RedrawPlayfield(); } else { @@ -10985,23 +10982,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) { @@ -11208,6 +11188,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();