X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftape.c;h=8087860ba5b33d4a7fd2f7ec4396a3f6a7910e06;hb=0f93b05731f58802973324200cfd8aecb11a4786;hp=963ca1e89a6253b7a8f6d25fc9c264612395554c;hpb=33843542519f8ddc28d1ad563124b151cf79425c;p=rocksndiamonds.git diff --git a/src/tape.c b/src/tape.c index 963ca1e8..8087860b 100644 --- a/src/tape.c +++ b/src/tape.c @@ -356,20 +356,26 @@ void DrawVideoDisplaySymbol(unsigned int state) DrawVideoDisplay(state, VIDEO_DISPLAY_SYMBOL_ONLY); } -void DrawVideoDisplayPlayState() +void DrawVideoDisplayCurrentState() { int state = 0; DrawVideoDisplay(VIDEO_STATE_OFF, 0); - state |= VIDEO_STATE_PLAY_ON; - if (tape.pausing) - { state |= VIDEO_STATE_PAUSE_ON; + + if (tape.recording) + { + state |= VIDEO_STATE_REC_ON; + + if (tape.single_step) + state |= VIDEO_STATE_1STEP_ON; } - else + else if (tape.playing) { + state |= VIDEO_STATE_PLAY_ON; + if (tape.deactivate_display) state |= VIDEO_STATE_WARP2_ON; else if (tape.warp_forward) @@ -666,14 +672,24 @@ void TapeRecordAction(byte action_raw[MAX_PLAYERS]) } } -void TapeTogglePause(boolean toggle_manual) +void TapeTogglePause(boolean toggle_mode) { + if (tape.playing && tape.pausing && (toggle_mode & TAPE_TOGGLE_PLAY_PAUSE)) + { + // continue playing in normal mode + tape.fast_forward = FALSE; + tape.warp_forward = FALSE; + tape.deactivate_display = FALSE; + + tape.pause_before_end = FALSE; + } + tape.pausing = !tape.pausing; - if (tape.single_step && toggle_manual) + if (tape.single_step && (toggle_mode & TAPE_TOGGLE_MANUAL)) tape.single_step = FALSE; - DrawVideoDisplayPlayState(); + DrawVideoDisplayCurrentState(); if (tape.deactivate_display) { @@ -883,7 +899,7 @@ static void TapeStartWarpForward() TapeDeactivateDisplayOn(); - DrawVideoDisplayPlayState(); + DrawVideoDisplayCurrentState(); } static void TapeStopWarpForward() @@ -896,7 +912,7 @@ static void TapeStopWarpForward() TapeDeactivateDisplayOff(game_status == GAME_MODE_PLAYING); - DrawVideoDisplayPlayState(); + DrawVideoDisplayCurrentState(); } static void TapeSingleStep() @@ -1308,7 +1324,7 @@ static void HandleTapeButtonsExt(int id) { tape.pause_before_end = !tape.pause_before_end; - DrawVideoDisplayPlayState(); + DrawVideoDisplayCurrentState(); } else if (tape.recording) { @@ -1361,14 +1377,7 @@ static void HandleTapeButtonsExt(int id) { if (tape.pausing) /* PAUSE -> PLAY */ { - // continue playing in normal mode - tape.fast_forward = FALSE; - tape.warp_forward = FALSE; - tape.deactivate_display = FALSE; - - tape.pause_before_end = FALSE; - - TapeTogglePause(TAPE_TOGGLE_MANUAL); + TapeTogglePause(TAPE_TOGGLE_MANUAL | TAPE_TOGGLE_PLAY_PAUSE); } else if (!tape.fast_forward) /* PLAY -> FFWD */ { @@ -1393,7 +1402,7 @@ static void HandleTapeButtonsExt(int id) TapeDeactivateDisplayOff(game_status == GAME_MODE_PLAYING); } - DrawVideoDisplayPlayState(); + DrawVideoDisplayCurrentState(); } break;