X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=73505d24269569b52cb9927acfbd9a36a62f18a1;hb=f89a490028c36509216b97a96b779b779c2065c9;hp=c02e590f5fb026eb3d4c59cf09a03725a804b265;hpb=7927e26b1ec2ef8b787a35d7867bdc40249cd2ee;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index c02e590f..73505d24 100644 --- a/src/game.c +++ b/src/game.c @@ -3083,6 +3083,7 @@ void InitGame() { int full_lev_fieldx = lev_fieldx + (BorderElement != EL_EMPTY ? 2 : 0); int full_lev_fieldy = lev_fieldy + (BorderElement != EL_EMPTY ? 2 : 0); + int fade_mask = REDRAW_FIELD; boolean emulate_bd = TRUE; /* unless non-BOULDERDASH elements found */ boolean emulate_sb = TRUE; /* unless non-SOKOBAN elements found */ @@ -3097,15 +3098,33 @@ void InitGame() 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(); - FadeOut(REDRAW_FIELD); + if (CheckIfRedrawGlobalBorderIsNeeded()) + 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 + +#if 1 + ClearField(); +#endif DrawCompleteVideoDisplay(); @@ -3919,7 +3938,7 @@ void InitGame() BlitScreenToBitmap(backbuffer); /* !!! FIX THIS (END) !!! */ - FadeIn(REDRAW_FIELD); + FadeIn(fade_mask); #if 1 // full screen redraw is required at this point in the following cases: @@ -4405,7 +4424,7 @@ void GameEnd() { game_status = GAME_MODE_MAIN; - DrawAndFadeInMainMenu(REDRAW_FIELD); + DrawMainMenu(); return; } @@ -4416,7 +4435,7 @@ void GameEnd() game_status = GAME_MODE_MAIN; - DrawAndFadeInMainMenu(REDRAW_FIELD); + DrawMainMenu(); return; } @@ -4435,9 +4454,6 @@ void GameEnd() { game_status = GAME_MODE_SCORES; - /* needed if different viewport properties defined for scores */ - ChangeViewportPropertiesIfNeeded(); - DrawHallOfFame(hi_pos); if (raise_level) @@ -4458,7 +4474,7 @@ void GameEnd() TapeErase(); } - DrawAndFadeInMainMenu(REDRAW_FIELD); + DrawMainMenu(); } } @@ -11057,9 +11073,18 @@ void GameActions() if (tape.playing && tape.warp_forward && !tape.pausing) game_frame_delay_value = 0; +#if 0 + /* ---------- main game synchronization point ---------- */ + + int skip = WaitUntilDelayReached(&game_frame_delay, game_frame_delay_value); + + printf("::: skip == %d\n", skip); + +#else /* ---------- main game synchronization point ---------- */ WaitUntilDelayReached(&game_frame_delay, game_frame_delay_value); +#endif if (network_playing && !network_player_action_received) { @@ -14461,13 +14486,13 @@ void RequestQuitGameExt(boolean skip_request, boolean quick_quit, char *message) game_status = GAME_MODE_MAIN; - DrawAndFadeInMainMenu(REDRAW_FIELD); + DrawMainMenu(); } else { game_status = GAME_MODE_MAIN; - DrawAndFadeInMainMenu(REDRAW_FIELD); + DrawMainMenu(); } } }