Documentation ¶
Index ¶
- func NewCompression1Reader(r io.Reader) io.Reader
- func NewCompression1Writer(w io.Writer) io.Writer
- func ReadHeader(r io.Reader, header *Header, sounds **Sounds) error
- func ReadStringList(r io.Reader) ([]string, error)
- func ReadStringList40d(r io.Reader) ([]string, error)
- func ReadStringListIndex(r io.Reader) ([]string, error)
- func ReadStringListIndex40d(r io.Reader) ([]string, error)
- func ReadStringListWTF23a(r io.Reader) ([]string, error)
- func WriteStringList(w io.Writer, l []string) error
- func WriteStringList40d(w io.Writer, l []string) error
- func WriteStringListIndex(w io.Writer, l []string) error
- func WriteStringListIndex40d(w io.Writer, l []string) error
- func WriteStringListWTF23a(w io.Writer, l []string, header func() wtf23a.Header) error
- type Frame
- type Header
- type Reader
- type Sounds
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCompression1Reader ¶
NewCompression1Reader wraps an io.Reader to decode Dwarf Fortress's chunked zlib format. The format consists of a stream of a uint32 length followed by that many bytes of compressed data.
func NewCompression1Writer ¶
NewCompression1Writer wraps an io.Writer to output Dwarf Fortress's chunked zlib format. Each call to Write outputs its own frame, so the returned io.Writer should be wrapped in bufio.NewWriter if there will be many small writes.
func ReadHeader ¶
ReadHeader reads a CMV header from a file.
func ReadStringList ¶
ReadStringList reads the format used by Dwarf Fortress's announcement, dipscript, and help files.
func ReadStringList40d ¶
ReadStringList40d reads the format used by Dwarf Fortress 40d.
func ReadStringListIndex ¶
ReadStringListIndex reads the format used by Dwarf Fortress's index file.
func ReadStringListIndex40d ¶
ReadStringListIndex40d reads the format used by Dwarf Fortress 40d.
func ReadStringListWTF23a ¶
ReadStringListWTF23a reads the format used by Dwarf Fortress 23a.
func WriteStringList ¶
WriteStringList writes the format used by Dwarf Fortress's announcement, dipscript, and help files.
func WriteStringList40d ¶
WriteStringList40d writes the format used by Dwarf Fortress 40d.
func WriteStringListIndex ¶
WriteStringListIndex writes the format used by Dwarf Fortress's index file.
func WriteStringListIndex40d ¶
WriteStringListIndex40d writes the format used by Dwarf Fortress 40d.
Types ¶
type Frame ¶
type Frame struct {
// contains filtered or unexported fields
}
Frame represents a single frame of a CMV.
func (*Frame) Bg ¶
Bg returns the background color on tile (x, y), where 0≤x<Width and 0≤y<Height. It is guaranteed to be one of the termbox.Color* constants.
func (*Frame) Byte ¶
Byte returns the CP437-encoded character on tile (x, y), where 0≤x<Width and 0≤y<Height.
func (*Frame) Equal ¶
Equal returns true if f and o are from the same reader and have the same characters and colors for each tile.
func (*Frame) Fg ¶
Fg returns the foreground color on tile (x, y), where 0≤x<Width and 0≤y<Height. It is guaranteed to be one of the termbox.Color* constants or one of the termbox.Color* constants ORed with termbox.AttrBold.
type Header ¶
type Header struct { // Version is either 10000 (0x2710) or 10001 (0x2711). The latter // includes Sounds. Version uint32 // Width is the number of columns in each frame of the CMV. Width uint32 // Height is the number of rows in each frame of the CMV. Height uint32 // FrameTicks is the frame rate in hundredths of a second per frame. // It can be 0, in which case the default frame rate is used. FrameTicks uint32 }
Header is the CMV header.