X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=6d536ec61824da1b027d525fa4620b2cc341e2d5;hb=2443a8a09966a9940e1420c91d24a297325c2a00;hp=2acc4c9453c5fa649aa42c2fb4f8c1a8078bf1f8;hpb=bf7f1c667ad861d6cadacd0b9d6fe517be977a6e;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 2acc4c94..6d536ec6 100644 --- a/src/game.c +++ b/src/game.c @@ -19,7 +19,6 @@ #include "init.h" #include "files.h" #include "tape.h" -#include "joystick.h" #include "network.h" /* this switch controls how rocks move horizontally */ @@ -174,10 +173,10 @@ void GetPlayerConfig() setup.sound = FALSE; if (!audio.loops_available) - { setup.sound_loops = FALSE; + + if (!audio.music_available) setup.sound_music = FALSE; - } if (!video.fullscreen_available) setup.fullscreen = FALSE; @@ -803,6 +802,7 @@ void InitGame() int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW); UnmapGameButtons(); + UnmapTapeButtons(); 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; @@ -4380,6 +4380,9 @@ void GameActions() action_delay_value = (tape.playing && tape.fast_forward ? FfwdFrameDelay : GameFrameDelay); + if (tape.playing && tape.index_search) + action_delay_value = 0; + /* ---------- main game synchronization point ---------- */ WaitUntilDelayReached(&action_delay, action_delay_value); @@ -4414,11 +4417,6 @@ void GameActions() if (tape.pausing) return; - if (tape.playing) - TapePlayDelay(); - else if (tape.recording) - TapeRecordDelay(); - recorded_player_action = (tape.playing ? TapePlayAction() : NULL); for (i=0; imove_delay, player->move_delay_value) && - !(tape.playing && tape.file_version < FILE_VERSION_2_0)) + !(tape.playing && tape.game_version < GAME_VERSION_2_0)) return FALSE; #endif @@ -5831,7 +5829,7 @@ int DigField(struct PlayerInfo *player, return MF_NO_ACTION; #else if (!FrameReached(&player->push_delay, player->push_delay_value) && - !(tape.playing && tape.file_version < FILE_VERSION_2_0) && + !(tape.playing && tape.game_version < GAME_VERSION_2_0) && element != EL_SPRING) return MF_NO_ACTION; #endif @@ -6073,7 +6071,7 @@ int DigField(struct PlayerInfo *player, return MF_NO_ACTION; #else if (!FrameReached(&player->push_delay, player->push_delay_value) && - !(tape.playing && tape.file_version < FILE_VERSION_2_0) && + !(tape.playing && tape.game_version < GAME_VERSION_2_0) && element != EL_BALLOON) return MF_NO_ACTION; #endif @@ -6307,6 +6305,31 @@ void RaiseScoreElement(int element) } } +void RequestQuitGame() +{ + if (AllPlayersGone || + !setup.ask_on_escape || + level_editor_test_game || + Request("Do you really want to quit the game ?", + REQ_ASK | REQ_STAY_CLOSED)) + { +#if defined(PLATFORM_UNIX) + if (options.network) + SendToServer_StopPlaying(); + else +#endif + { + game_status = MAINMENU; + DrawMainMenu(); + } + } + else + { + OpenDoor(DOOR_OPEN_1 | DOOR_COPY_BACK); + } +} + + /* ---------- new game button stuff ---------------------------------------- */ /* graphic position values for game buttons */ @@ -6455,30 +6478,7 @@ static void HandleGameButtons(struct GadgetInfo *gi) switch (id) { case GAME_CTRL_ID_STOP: - if (AllPlayersGone) - { - CloseDoor(DOOR_CLOSE_1); - game_status = MAINMENU; - DrawMainMenu(); - break; - } - - if (level_editor_test_game || - Request("Do you really want to quit the game ?", - REQ_ASK | REQ_STAY_CLOSED)) - { -#if defined(PLATFORM_UNIX) - if (options.network) - SendToServer_StopPlaying(); - else -#endif - { - game_status = MAINMENU; - DrawMainMenu(); - } - } - else - OpenDoor(DOOR_OPEN_1 | DOOR_COPY_BACK); + RequestQuitGame(); break; case GAME_CTRL_ID_PAUSE: @@ -6516,7 +6516,7 @@ static void HandleGameButtons(struct GadgetInfo *gi) setup.sound_music = FALSE; FadeMusic(); } - else if (audio.loops_available) + else if (audio.music_available) { setup.sound = setup.sound_music = TRUE; if (num_bg_loops)