X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftools.c;h=a11f692eb2d66a2abd495ceab77017d10b0de2ca;hp=63bff391ce32a9c3c82b0dba25dfa8a863abf79a;hb=39fb4fecfb8d4647d3563bdb18ce0065f6129522;hpb=aa22230dfe2af522e1f7b40acb56983fd1044e42 diff --git a/src/tools.c b/src/tools.c index 63bff391..a11f692e 100644 --- a/src/tools.c +++ b/src/tools.c @@ -981,6 +981,8 @@ static void FadeExt(int fade_mask, int fade_mode, int fade_type) draw_border_function); redraw_mask &= ~fade_mask; + + ClearEventQueue(); } static void SetScreenStates_BeforeFadingIn() @@ -2800,6 +2802,8 @@ void AnimateEnvelope(int envelope_nr, int anim_mode, int action) SkipUntilDelayReached(&anim_delay, anim_delay_value, &i, last_frame); } + + ClearEventQueue(); } void ShowEnvelope(int envelope_nr) @@ -3083,6 +3087,8 @@ void AnimateEnvelopeRequest(int anim_mode, int action) SkipUntilDelayReached(&anim_delay, anim_delay_value, &i, last_frame); } + + ClearEventQueue(); } void ShowEnvelopeRequest(char *text, unsigned int req_state, int action) @@ -4564,6 +4570,7 @@ static boolean RequestDoor(char *text, unsigned int req_state) /* pause network game while waiting for request to answer */ if (network.enabled && game_status == GAME_MODE_PLAYING && + !AllPlayersGone && req_state & REQUEST_WAIT_FOR_INPUT) SendToServer_PausePlaying(); @@ -4704,6 +4711,7 @@ static boolean RequestDoor(char *text, unsigned int req_state) /* continue network game after request */ if (network.enabled && game_status == GAME_MODE_PLAYING && + !AllPlayersGone && req_state & REQUEST_WAIT_FOR_INPUT) SendToServer_ContinuePlaying(); @@ -4730,6 +4738,7 @@ static boolean RequestEnvelope(char *text, unsigned int req_state) /* pause network game while waiting for request to answer */ if (network.enabled && game_status == GAME_MODE_PLAYING && + !AllPlayersGone && req_state & REQUEST_WAIT_FOR_INPUT) SendToServer_PausePlaying(); @@ -4787,6 +4796,7 @@ static boolean RequestEnvelope(char *text, unsigned int req_state) /* continue network game after request */ if (network.enabled && game_status == GAME_MODE_PLAYING && + !AllPlayersGone && req_state & REQUEST_WAIT_FOR_INPUT) SendToServer_ContinuePlaying(); @@ -5419,6 +5429,8 @@ unsigned int MoveDoor(unsigned int door_state) DrawMaskedBorder(REDRAW_DOOR_1); DrawMaskedBorder(REDRAW_DOOR_2); + ClearEventQueue(); + return (door1 | door2); } @@ -8103,7 +8115,7 @@ int getBeltSwitchElementFromBeltNrAndBeltDir(int belt_nr, int belt_dir) boolean getTeamMode_EM() { - return game.team_mode; + return game.team_mode || network_playing; } int getGameFrameDelay_EM(int native_em_game_frame_delay) @@ -9203,7 +9215,10 @@ void PlayMenuMusicExt(int music) if (!setup.sound_music) return; - PlayMusic(music); + if (IS_LOOP_MUSIC(music)) + PlayMusicLoop(music); + else + PlayMusic(music); } void PlayMenuMusic() @@ -9379,6 +9394,13 @@ void ResetFontStatus() SetFontStatus(-1); } +void SetLevelSetInfo(char *identifier, int level_nr) +{ + setString(&levelset.identifier, identifier); + + levelset.level_nr = level_nr; +} + boolean CheckIfPlayfieldViewportHasChanged() { // if game status has not changed, playfield viewport has not changed either