From: Holger Schemel Date: Tue, 3 Oct 2006 13:24:13 +0000 (+0200) Subject: rnd-20061003-2-src X-Git-Tag: 3.2.3^2~38 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=7f77c2e8dcb7ad575fcaf89512f4f616846c8b41;p=rocksndiamonds.git rnd-20061003-2-src * fixed bug with un-pausing a paused game by releasing still pressed key * fixed bug with not redrawing screen when toggling to/from fullscreen mode while fast reloading tape (without redrawing playfield contents) * fixed bug with quick-saving tape snapshot despite answering with "no" --- diff --git a/ChangeLog b/ChangeLog index 668f0616..1daa7ca8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-10-03 * fixed bug with not unmapping main menu screen gadgets on other screens + * fixed bug with un-pausing a paused game by releasing still pressed key + * fixed bug with not redrawing screen when toggling to/from fullscreen + mode while fast reloading tape (without redrawing playfield contents) + * fixed bug with quick-saving tape snapshot despite answering with "no" 2006-08-30 * version number set to 3.2.3 diff --git a/src/conftime.h b/src/conftime.h index 6ff19d0f..5a7ed31d 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-10-03 09:59]" +#define COMPILE_DATE_STRING "[2006-10-03 15:21]" diff --git a/src/events.c b/src/events.c index 65b06803..9bd81237 100644 --- a/src/events.c +++ b/src/events.c @@ -667,8 +667,18 @@ void HandleKey(Key key, int key_status) element_dropped[pnr] = FALSE; } } +#if 1 + else if (tape.recording && tape.pausing) + { + /* prevent key release events from un-pausing a paused game */ + if (key_status == KEY_PRESSED && + (key_action & KEY_ACTION)) + TapeTogglePause(TAPE_TOGGLE_MANUAL); + } +#else else if (tape.recording && tape.pausing && (key_action & KEY_ACTION)) TapeTogglePause(TAPE_TOGGLE_MANUAL); +#endif } } else diff --git a/src/files.c b/src/files.c index deff36d6..1287d1ec 100644 --- a/src/files.c +++ b/src/files.c @@ -5276,6 +5276,25 @@ void SaveLevelTemplate() SaveLevelFromFilename(&level, filename); } +boolean SaveLevelChecked(int nr) +{ + char *filename = getDefaultLevelFilename(nr); + boolean new_level = !fileExists(filename); + boolean level_saved = FALSE; + + if (new_level || Request("Save this level and kill the old ?", REQ_ASK)) + { + SaveLevel(nr); + + if (new_level) + Request("Level saved !", REQ_CONFIRM); + + level_saved = TRUE; + } + + return level_saved; +} + void DumpLevel(struct LevelInfo *level) { if (level->no_valid_file) @@ -5704,7 +5723,9 @@ void SaveTape(int nr) { char *filename = getTapeFilename(nr); FILE *file; +#if 0 boolean new_tape = TRUE; +#endif int num_participating_players = 0; int info_chunk_size; int body_chunk_size; @@ -5712,6 +5733,7 @@ void SaveTape(int nr) InitTapeDirectory(leveldir_current->subdir); +#if 0 /* if a tape still exists, ask to overwrite it */ if (fileExists(filename)) { @@ -5719,6 +5741,7 @@ void SaveTape(int nr) if (!Request("Replace old tape ?", REQ_ASK)) return; } +#endif if (!(file = fopen(filename, MODE_WRITE))) { @@ -5758,8 +5781,29 @@ void SaveTape(int nr) tape.changed = FALSE; +#if 0 if (new_tape) Request("Tape saved !", REQ_CONFIRM); +#endif +} + +boolean SaveTapeChecked(int nr) +{ + char *filename = getTapeFilename(nr); + boolean new_tape = !fileExists(filename); + boolean tape_saved = FALSE; + + if (new_tape || Request("Replace old tape ?", REQ_ASK)) + { + SaveTape(nr); + + if (new_tape) + Request("Tape saved !", REQ_CONFIRM); + + tape_saved = TRUE; + } + + return tape_saved; } void DumpTape(struct TapeInfo *tape) diff --git a/src/files.h b/src/files.h index a3781bed..41939ac2 100644 --- a/src/files.h +++ b/src/files.h @@ -39,6 +39,7 @@ void LoadLevelTemplate(int); void SaveLevel(int); void SaveLevelTemplate(); void DumpLevel(struct LevelInfo *); +boolean SaveLevelChecked(int); void CopyNativeLevel_RND_to_Native(struct LevelInfo *); void CopyNativeLevel_Native_to_RND(struct LevelInfo *); @@ -48,6 +49,7 @@ void LoadTape(int); void LoadSolutionTape(int); void SaveTape(int); void DumpTape(struct TapeInfo *); +boolean SaveTapeChecked(int); void LoadScore(int); void SaveScore(int); diff --git a/src/game.c b/src/game.c index a6e1449d..00dff5ed 100644 --- a/src/game.c +++ b/src/game.c @@ -2800,7 +2800,11 @@ void GameEnd() TapeStop(); #endif +#if 1 + SaveTapeChecked(tape.level_nr); /* ask to save tape */ +#else SaveTape(tape.level_nr); /* ask to save tape */ +#endif } if (level_editor_test_game) diff --git a/src/libgame/system.c b/src/libgame/system.c index f3696277..6e3eaaba 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -424,13 +424,16 @@ inline static boolean CheckDrawingArea(int x, int y, int width, int height, if (draw_mask & REDRAW_ALL) return TRUE; - if ((draw_mask & REDRAW_FIELD) && x < gfx.real_sx + gfx.full_sxsize) + if ((draw_mask & REDRAW_FIELD) && + x >= gfx.real_sx && x < gfx.real_sx + gfx.full_sxsize) return TRUE; - if ((draw_mask & REDRAW_DOOR_1) && x >= gfx.dx && y < gfx.dy + gfx.dysize) + if ((draw_mask & REDRAW_DOOR_1) && + x >= gfx.dx && y < gfx.dy + gfx.dysize) return TRUE; - if ((draw_mask & REDRAW_DOOR_2) && x >= gfx.dx && y >= gfx.vy) + if ((draw_mask & REDRAW_DOOR_2) && + x >= gfx.dx && y >= gfx.vy) return TRUE; return FALSE; diff --git a/src/tape.c b/src/tape.c index eb03967a..0bdff153 100644 --- a/src/tape.c +++ b/src/tape.c @@ -919,11 +919,14 @@ void TapeQuickSave() TapeHaltRecording(); /* prepare tape for saving on-the-fly */ if (TAPE_IS_EMPTY(tape)) + { Request("No tape that can be saved !", REQ_CONFIRM); - else - SaveTape(tape.level_nr); - SaveEngineSnapshot(); + return; + } + + if (SaveTapeChecked(tape.level_nr)) + SaveEngineSnapshot(); } void TapeQuickLoad() @@ -954,6 +957,8 @@ void TapeQuickLoad() LoadEngineSnapshot(); + DrawCompleteVideoDisplay(); + tape.playing = TRUE; tape.pausing = TRUE; @@ -1296,18 +1301,22 @@ static void HandleTapeButtons(struct GadgetInfo *gi) { case TAPE_CTRL_ID_EJECT: TapeStop(); + if (TAPE_IS_EMPTY(tape)) { LoadTape(level_nr); + if (TAPE_IS_EMPTY(tape)) Request("No tape for this level !", REQ_CONFIRM); } else { if (tape.changed) - SaveTape(tape.level_nr); + SaveTapeChecked(tape.level_nr); + TapeErase(); } + DrawCompleteVideoDisplay(); break; @@ -1325,6 +1334,7 @@ static void HandleTapeButtons(struct GadgetInfo *gi) } else if (tape.recording) TapeSingleStep(); + break; case TAPE_CTRL_ID_STOP: diff --git a/src/tools.c b/src/tools.c index 7a2fd3e2..7da6d255 100644 --- a/src/tools.c +++ b/src/tools.c @@ -6026,6 +6026,11 @@ void ToggleFullscreenIfNeeded() FreeBitmap(tmp_backbuffer); +#if 1 + /* update visible window/screen */ + BlitBitmap(backbuffer, window, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0); +#else redraw_mask = REDRAW_ALL; +#endif } }