The game's files, read once and shared by every process: the game directory, the palette and light table, the QuakeC program, and each map, model and sound the first time it is asked for.
{:ok, _} = ElixirQuake.Assets.load("/games/quake")
ElixirQuake.Assets.map("e1m1")
ElixirQuake.Assets.model("progs/player.mdl")Everything is kept in :persistent_term; reading it copies nothing.
Summary
Functions
Open the game directory at path (its id1, or the directory holding one) and read its palette and light table.
The map name (without maps/ or .bsp), as %{bsp:, entities:}, or nil when there is none.
The model file name, as %{kind:, data:, mins:, maxs:}: kind :alias (a
Cauldron3D.Formats.Mdl), :sprite (a Cauldron3D.Formats.Spr), :brush (a map
file's world, as %{bsp:, entities:}) or :missing.
A loose picture file such as gfx/complete.lmp, or nil.
The gfx.wad pictures, by lower-case name; conchars is the 128 by 128 font.
The QuakeC program, progs.dat. Raises ArgumentError when there is none.
The bytes of file name, or nil.
The sound name under sound/ as a TuningFork.Voice, or nil.
Quake's texture kinds by name: sky… is sky, split into a front layer (the left half,
colour 0 see-through) and a back layer; *… is liquid; trigger… and clip… are
hidden; everything else is solid.
Functions
@spec get() :: map()
What load/1 read.
Open the game directory at path (its id1, or the directory holding one) and read its palette and light table.
@spec loaded?() :: boolean()
Whether load/1 has run.
The map name (without maps/ or .bsp), as %{bsp:, entities:}, or nil when there is none.
The model file name, as %{kind:, data:, mins:, maxs:}: kind :alias (a
Cauldron3D.Formats.Mdl), :sprite (a Cauldron3D.Formats.Spr), :brush (a map
file's world, as %{bsp:, entities:}) or :missing.
@spec picture(String.t()) :: Cauldron3D.Texture.t() | nil
A loose picture file such as gfx/complete.lmp, or nil.
@spec pictures() :: %{required(String.t()) => Cauldron3D.Texture.t()}
The gfx.wad pictures, by lower-case name; conchars is the 128 by 128 font.
@spec progs() :: QuakeC.Progs.t()
The QuakeC program, progs.dat. Raises ArgumentError when there is none.
The bytes of file name, or nil.
@spec sound(String.t()) :: TuningFork.Voice.t() | nil
The sound name under sound/ as a TuningFork.Voice, or nil.
@spec texture(String.t(), [Cauldron3D.Texture.t()]) :: map()
Quake's texture kinds by name: sky… is sky, split into a front layer (the left half,
colour 0 see-through) and a back layer; *… is liquid; trigger… and clip… are
hidden; everything else is solid.