• Jason Rhinelander's avatar
    Use eris::Serialization for data storage · f7672169
    Jason Rhinelander authored
    Most of the nuissance code (block lists, compression, header value
    handling) moved to eris::Serialization; what's left is considerably
    simpler.
    
    XZ compression is now always enabled; removed the option to enable it.
    
    The memory-all option is gone now; with xz compression always enabled,
    it didn't do anything --memory-xz didn't already do (unless you
    actually unxz a file manually and pass it in).
    
    Added --memory CLI option to creativity-gui to let it use more memory
    instead of tmpfiles when running.
    
    Added --tmpdir to various cli tools that didn't already have it; it gets
    used during decompression (when not using --memory-xz/--memory).
    
    Converted BookState values to uint32_t instead of unsigned int.  They
    are probably the same, but being explicit makes sure I'm writing 32-bit
    ints in the data file.
    
    The big-endian/little-endian code is gone (it's now in the
    eris serializer<T> code).
    
    The big mess of constant header locations is gone.  It was a nuissance
    anyway--the new approach is to just register them all in a special
    method, and let Serializer remember which one goes where.
    
    Use full eris_id_t for stored ids.  Originally I truncated these to
    32-bit ints to save space, but with compression enabled that really
    isn't saving much.  It also simplifies the code a bit, by being able to
    serialized eris_id_t values directly without a type cast to uint32_t.
    
    The number of states is no longer stored as a header; it's now just the
    size of the state locations pointer block, which comes right after the
    header.
    
    The reader-libraries outer list is now written when creating a new
    file; previously it was delayed until the first state gets added.  The
    inner list (each reader's library) get created as needed.
    
    Reordered methods in FileStorage.cpp to put the
    readWhatever/writeWhatever pairs adjacent to each other, which makes it
    a bit easier to see that they are reading/writing the same things.
    f7672169