| 1617 | } |
| 1618 | |
| 1619 | @Override |
| 1620 | public void WriteLevel(String filename) { |
| 1621 | try { |
| 1622 | |
| 1623 | QuakeFile f = new QuakeFile(filename, "rw"); |
| 1624 | |
| 1625 | // write out level_locals_t |
| 1626 | level.write(f); |
| 1627 | |
| 1628 | // write out all the entities |
| 1629 | for (int i = 0; i < num_edicts; i++) { |
| 1630 | SubgameEntity ent = g_edicts[i]; |
| 1631 | if (!ent.inuse) |
| 1632 | continue; |
| 1633 | f.writeInt(i); |
| 1634 | ent.write(f); |
| 1635 | } |
| 1636 | f.writeInt(-1); |
| 1637 | |
| 1638 | f.close(); |
| 1639 | } catch (Exception e) { |
| 1640 | e.printStackTrace(); |
| 1641 | } |
| 1642 | } |
| 1643 | |
| 1644 | @Override |
| 1645 | public void ReadLevel(String filename) { |