287 // Setup main window |
287 // Setup main window |
288 ResetWindowSystem(); |
288 ResetWindowSystem(); |
289 SetupColorsAndInitialWindow(); |
289 SetupColorsAndInitialWindow(); |
290 |
290 |
291 // Generate a world. |
291 // Generate a world. |
292 snprintf(filename, lengthof(filename), "%sopntitle.dat", _path.data_dir); |
292 snprintf(filename, lengthof(filename), "%sopntitle.dat", _paths.data_dir); |
293 #if defined SECOND_DATA_DIR |
293 #if defined SECOND_DATA_DIR |
294 if (SaveOrLoad(filename, SL_LOAD) != SL_OK) { |
294 if (SaveOrLoad(filename, SL_LOAD) != SL_OK) { |
295 snprintf(filename, lengthof(filename), "%sopntitle.dat", _path.second_data_dir); |
295 snprintf(filename, lengthof(filename), "%sopntitle.dat", _paths.second_data_dir); |
296 } |
296 } |
297 #endif |
297 #endif |
298 if (SaveOrLoad(filename, SL_LOAD) != SL_OK) { |
298 if (SaveOrLoad(filename, SL_LOAD) != SL_OK) { |
299 GenerateWorld(GW_EMPTY, 64, 64); // if failed loading, make empty world. |
299 GenerateWorld(GW_EMPTY, 64, 64); // if failed loading, make empty world. |
300 WaitTillGeneratedWorld(); |
300 WaitTillGeneratedWorld(); |
888 |
888 |
889 if (_patches.keep_all_autosave && _local_player != PLAYER_SPECTATOR) { |
889 if (_patches.keep_all_autosave && _local_player != PLAYER_SPECTATOR) { |
890 const Player *p = GetPlayer(_local_player); |
890 const Player *p = GetPlayer(_local_player); |
891 char* s = buf; |
891 char* s = buf; |
892 |
892 |
893 s += snprintf(buf, lengthof(buf), "%s%s", _path.autosave_dir, PATHSEP); |
893 s += snprintf(buf, lengthof(buf), "%s%s", _paths.autosave_dir, PATHSEP); |
894 |
894 |
895 SetDParam(0, p->name_1); |
895 SetDParam(0, p->name_1); |
896 SetDParam(1, p->name_2); |
896 SetDParam(1, p->name_2); |
897 SetDParam(2, _date); |
897 SetDParam(2, _date); |
898 s = GetString(s, STR_4004, lastof(buf)); |
898 s = GetString(s, STR_4004, lastof(buf)); |
899 strecpy(s, ".sav", lastof(buf)); |
899 strecpy(s, ".sav", lastof(buf)); |
900 } else { /* generate a savegame name and number according to _patches.max_num_autosaves */ |
900 } else { /* generate a savegame name and number according to _patches.max_num_autosaves */ |
901 snprintf(buf, lengthof(buf), "%s%sautosave%d.sav", _path.autosave_dir, PATHSEP, _autosave_ctr); |
901 snprintf(buf, lengthof(buf), "%s%sautosave%d.sav", _paths.autosave_dir, PATHSEP, _autosave_ctr); |
902 |
902 |
903 _autosave_ctr++; |
903 _autosave_ctr++; |
904 if (_autosave_ctr >= _patches.max_num_autosaves) { |
904 if (_autosave_ctr >= _patches.max_num_autosaves) { |
905 // we reached the limit for numbers of autosaves. We will start over |
905 // we reached the limit for numbers of autosaves. We will start over |
906 _autosave_ctr = 0; |
906 _autosave_ctr = 0; |