| 1443 | } |
| 1444 | |
| 1445 | static void _write_map_index(const string &filebase, size_t vs, size_t ve, |
| 1446 | time_t mtime) |
| 1447 | { |
| 1448 | const string cfile = filebase + ".idx"; |
| 1449 | FILE *fp = fopen_u(cfile.c_str(), "wb"); |
| 1450 | if (!fp) |
| 1451 | end(1, true, "Unable to open %s for writing", cfile.c_str()); |
| 1452 | |
| 1453 | writer outf(cfile, fp); |
| 1454 | write_save_version(outf, save_version::current()); |
| 1455 | marshallByte(outf, WORD_LEN); |
| 1456 | marshallSigned(outf, mtime); |
| 1457 | marshallShort(outf, ve > vs? ve - vs : 0); |
| 1458 | for (size_t i = vs; i < ve; ++i) |
| 1459 | { |
| 1460 | vdefs[i].write_index(outf); |
| 1461 | marshallString(outf, vdefs[i].description); |
| 1462 | marshallInt(outf, vdefs[i].order); |
| 1463 | vdefs[i].place_loaded_from.clear(); |
| 1464 | vdefs[i].strip(); |
| 1465 | } |
| 1466 | fclose(fp); |
| 1467 | } |
| 1468 | |
| 1469 | static void _write_map_cache(const string &filename, size_t vs, size_t ve, |
| 1470 | time_t mtime) |
no test coverage detected