Cauldron2D.GameMaker.Chunks (Cauldron2D.GameMaker v0.2.1)

Copy Markdown View Source

The chunks of a GameMaker data file: a FORM holding four-letter named chunks, each a length and its bytes.

{:ok, chunks} = Cauldron2D.GameMaker.Chunks.index(bytes)
{offset, size} = chunks["SPRT"]

Offsets are absolute and point past the chunk's eight-byte header.

Summary

Functions

Whether the file has a chunk called name with anything in it.

Every chunk's offset and size, by name.

Types

t()

@type t() :: %{required(String.t()) => {non_neg_integer(), non_neg_integer()}}

Functions

filled?(chunks, name)

@spec filled?(t(), String.t()) :: boolean()

Whether the file has a chunk called name with anything in it.

index(arg1)

@spec index(binary()) :: {:ok, t()} | {:error, :not_a_data_file}

Every chunk's offset and size, by name.