X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftape.c;h=8c1e059b15f7d49416749c66cfc5615715aa800b;hp=540341fbc19d6bbb097909ac70ad57d168fbedc7;hb=5c5685a92a0ca8060018c4d035e6b37fea7e0f5a;hpb=3d0f4cbf554ab915658eff72e22bb0e75947531b diff --git a/src/tape.c b/src/tape.c index 540341fb..8c1e059b 100644 --- a/src/tape.c +++ b/src/tape.c @@ -401,8 +401,7 @@ void DrawCompleteVideoDisplay() gfx.vxsize, gfx.vysize, gfx.vx, gfx.vy); /* draw tape buttons (forced) */ - UnmapTapeButtons(); - MapTapeButtons(); + RedrawOrRemapTapeButtons(); DrawVideoDisplay(VIDEO_ALL_OFF, 0); @@ -711,6 +710,9 @@ void TapeTogglePause(boolean toggle_mode) // restart step/move snapshots after quick loading tape SaveEngineSnapshotToListInitial(); + + // do not map undo/redo buttons after quick loading tape + return; } if (setup.show_snapshot_buttons && @@ -1110,7 +1112,7 @@ void AutoPlayTape() Print("Level %03d: ", level_nr); LoadLevel(level_nr); - if (level.no_valid_file) + if (level.no_level_file || level.no_valid_file) { Print("(no level)\n"); continue; @@ -1122,7 +1124,10 @@ void AutoPlayTape() continue; #endif - LoadSolutionTape(level_nr); + if (options.mytapes) + LoadTape(level_nr); + else + LoadSolutionTape(level_nr); if (tape.no_valid_file) { @@ -1287,6 +1292,34 @@ void UnmapTapeButtons() UnmapGameButtons(); } +void RedrawTapeButtons() +{ + int i; + + for (i = 0; i < NUM_TAPE_BUTTONS; i++) + RedrawGadget(tape_gadget[i]); + + if (tape.show_game_buttons) + RedrawGameButtons(); + + // RedrawGadget() may have set REDRAW_ALL if buttons are defined off-area + redraw_mask &= ~REDRAW_ALL; +} + +void RedrawOrRemapTapeButtons() +{ + if (tape_gadget[TAPE_CTRL_ID_PLAY]->mapped) + { + // tape buttons already mapped + RedrawTapeButtons(); + } + else + { + UnmapTapeButtons(); + MapTapeButtons(); + } +} + static void HandleTapeButtonsExt(int id) { if (game_status != GAME_MODE_MAIN && game_status != GAME_MODE_PLAYING)