The weapon in the player's hands and its muzzle flash, drawn over the view as Doom draws its player sprites: placed on Doom's 320 by 168 view stretched to the view's size, lit by the player's sector, unlit when bright, through the fixed light table when one is in force, and as a shimmer while the player is partly invisible.
frame = ElixirDoom.Render.Weapon.draw(frame, graphics, view, {width, height}, fixed)
ElixirDoom.Render.Weapon.sprites(graphics, view, {width, height}, fixed)
Summary
Functions
frame with the weapon drawn over it, the view being width by height.
The weapon and flash pictures to draw for a view width by height: each its picture,
the rectangle it fills in view pixels, its light table, and whether it shimmers.
Types
@type sprite() :: %{ picture: non_neg_integer(), rect: {float(), float(), float(), float()}, light: non_neg_integer(), shimmer: boolean() }
Functions
@spec draw( Cauldron2D.Sectors.Frame.t(), ElixirDoom.Graphics.t(), map(), {pos_integer(), pos_integer()}, integer() | nil ) :: Cauldron2D.Sectors.Frame.t()
frame with the weapon drawn over it, the view being width by height.
@spec sprites( ElixirDoom.Graphics.t(), map(), {pos_integer(), pos_integer()}, integer() | nil ) :: [ sprite() ]
The weapon and flash pictures to draw for a view width by height: each its picture,
the rectangle it fills in view pixels, its light table, and whether it shimmers.