mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 16:03:05 +00:00
Count amount of save files available so load/save dialog works correctly.
svn-id: r9196
This commit is contained in:
parent
f6984add8f
commit
b8ce60ea18
@ -1422,8 +1422,8 @@ start_over_2:;
|
||||
if (!_savedialog_flag)
|
||||
goto start_over_2;
|
||||
_saveload_row_curpos += 6;
|
||||
// if (_saveload_row_curpos >= _num_savegame_rows)
|
||||
// _saveload_row_curpos = _num_savegame_rows;
|
||||
if (_saveload_row_curpos >= _num_savegame_rows)
|
||||
_saveload_row_curpos = _num_savegame_rows;
|
||||
goto strange_jump;
|
||||
}
|
||||
|
||||
@ -1459,6 +1459,8 @@ start_over_3:;
|
||||
if (!_savedialog_flag)
|
||||
goto start_over_3;
|
||||
_saveload_row_curpos += 6;
|
||||
if (_saveload_row_curpos >= _num_savegame_rows)
|
||||
_saveload_row_curpos = _num_savegame_rows;
|
||||
goto strange_jump;
|
||||
}
|
||||
|
||||
|
@ -2513,6 +2513,21 @@ void SimonEngine::o_load_game() {
|
||||
save_or_load_dialog(true);
|
||||
}
|
||||
|
||||
int SimonEngine::count_savegames() {
|
||||
File f;
|
||||
uint i = 1;
|
||||
|
||||
while (i < 256) {
|
||||
f.open(gen_savename(i), getSavePath());
|
||||
if (f.isOpen() == false)
|
||||
break;
|
||||
|
||||
f.close();
|
||||
i++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
int SimonEngine::display_savegame_list(int curpos, bool load, char *dst) {
|
||||
int slot, last_slot;
|
||||
File in;
|
||||
@ -2601,7 +2616,7 @@ void SimonEngine::save_or_load_dialog(bool load) {
|
||||
|
||||
_copy_partial_mode = 1;
|
||||
|
||||
num = _number_of_savegames;
|
||||
_number_of_savegames = num = count_savegames();
|
||||
if (!load)
|
||||
num++;
|
||||
num -= 6;
|
||||
|
@ -790,6 +790,7 @@ protected:
|
||||
void o_unk_132_helper_2(FillOrCopyStruct *fcs, int x);
|
||||
void savegame_dialog(char *buf);
|
||||
|
||||
int count_savegames();
|
||||
int display_savegame_list(int curpos, bool load, char *dst);
|
||||
|
||||
void show_it(void *buf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user