X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame.c;h=15cd41222e7e30e58cba6adf857a1dc87e3c06cc;hp=c7589cf005057b7a46c2fd1ec22ad7ba36d59a08;hb=a48a472e7e5b2e30f48a4cf29c2bf98c7de1b5af;hpb=39ad80f8d48b103622e36e40c951a66579444767 diff --git a/src/game.c b/src/game.c index c7589cf0..15cd4122 100644 --- a/src/game.c +++ b/src/game.c @@ -3354,7 +3354,7 @@ void InitGame(void) SetGameStatus(GAME_MODE_PLAYING); if (level_editor_test_game) - FadeSkipNextFadeIn(); + FadeSkipNextFadeOut(); else FadeSetEnterScreen(); @@ -3365,8 +3365,10 @@ void InitGame(void) ExpireSoundLoops(TRUE); - if (!level_editor_test_game) - FadeOut(fade_mask); + FadeOut(fade_mask); + + if (level_editor_test_game) + FadeSkipNextFadeIn(); // needed if different viewport properties defined for playing ChangeViewportPropertiesIfNeeded(); @@ -12532,10 +12534,11 @@ boolean MovePlayer(struct PlayerInfo *player, int dx, int dy) } else { - int offset = game.scroll_delay_value; + int offset_raw = game.scroll_delay_value; if (jx != old_jx) // player has moved horizontally { + int offset = MIN(offset_raw, (SCR_FIELDX - 2) / 2); int offset_x = offset * (player->MovDir == MV_LEFT ? +1 : -1); int new_scroll_x = jx - MIDPOSX + offset_x; @@ -12556,6 +12559,7 @@ boolean MovePlayer(struct PlayerInfo *player, int dx, int dy) } else // player has moved vertically { + int offset = MIN(offset_raw, (SCR_FIELDY - 2) / 2); int offset_y = offset * (player->MovDir == MV_UP ? +1 : -1); int new_scroll_y = jy - MIDPOSY + offset_y; @@ -15707,8 +15711,6 @@ void MapUndoRedoButtons(void) MapGadget(game_gadget[GAME_CTRL_ID_UNDO]); MapGadget(game_gadget[GAME_CTRL_ID_REDO]); - - ModifyGadget(game_gadget[GAME_CTRL_ID_PAUSE2], GDI_CHECKED, TRUE, GDI_END); } void UnmapUndoRedoButtons(void) @@ -15718,8 +15720,21 @@ void UnmapUndoRedoButtons(void) MapGameButtonsAtSamePosition(GAME_CTRL_ID_UNDO); MapGameButtonsAtSamePosition(GAME_CTRL_ID_REDO); +} - ModifyGadget(game_gadget[GAME_CTRL_ID_PAUSE2], GDI_CHECKED, FALSE, GDI_END); +void ModifyPauseButtons(void) +{ + static int ids[] = + { + GAME_CTRL_ID_PAUSE, + GAME_CTRL_ID_PAUSE2, + GAME_CTRL_ID_PANEL_PAUSE, + -1 + }; + int i; + + for (i = 0; ids[i] > -1; i++) + ModifyGadget(game_gadget[ids[i]], GDI_CHECKED, tape.pausing, GDI_END); } static void MapGameButtonsExt(boolean on_tape) @@ -15753,9 +15768,6 @@ static void RedrawGameButtonsExt(boolean on_tape) for (i = 0; i < NUM_GAME_BUTTONS; i++) if (!on_tape || gamebutton_info[i].allowed_on_tape) RedrawGadget(game_gadget[i]); - - // RedrawGadget() may have set REDRAW_ALL if buttons are defined off-area - redraw_mask &= ~REDRAW_ALL; } static void SetGadgetState(struct GadgetInfo *gi, boolean state)