class
#include <bn_sprite_item.h>
sprite_item Contains the required information to generate sprites.
The assets conversion tools generate an object of this type in the build folder for each *.bmp file with sprite
type.
Tiles and colors are not copied but referenced, so they should outlive the sprite_
Constructors, destructors, conversion operators
-
sprite_item(const sprite_
shape_ size& shape_size, const span<const tile>& tiles_ref, const span<const color>& colors_ref, bpp_ mode bpp, int graphics_count) constexpr - Constructor.
-
sprite_item(const sprite_
shape_ size& shape_size, const sprite_ tiles_ item& tiles_item, const sprite_ palette_ item& palette_item) constexpr - Constructor.
Public functions
-
auto shape_size() const -> const sprite_
shape_ size& constexpr - Returns the shape and size of the output sprites.
-
auto tiles_item() const -> const sprite_
tiles_ item& constexpr - Returns the item used to create the tiles of the output sprites.
-
auto palette_item() const -> const sprite_
palette_ item& constexpr - Returns the item used to create the color palette of the output sprites.
-
auto decompress(span<tile> decompressed_tiles_ref,
span<color> decompressed_colors_ref) const -> sprite_
item - Decompresses the stored data in the tiles referenced by decompressed_tiles_ref and the colors referenced by decompressed_colors_ref.
-
auto create_sprite() const -> sprite_
ptr - Creates a sprite_
ptr using the information contained in this item. -
auto create_sprite(int graphics_index) const -> sprite_
ptr - Creates a sprite_
ptr using the information contained in this item. -
auto create_sprite(fixed x,
fixed y) const -> sprite_
ptr - Creates a sprite_
ptr using the information contained in this item. -
auto create_sprite(fixed x,
fixed y,
int graphics_index) const -> sprite_
ptr - Creates a sprite_
ptr using the information contained in this item. -
auto create_sprite(const fixed_
point& position) const -> sprite_ ptr - Creates a sprite_
ptr using the information contained in this item. -
auto create_sprite(const fixed_
point& position, int graphics_index) const -> sprite_ ptr - Creates a sprite_
ptr using the information contained in this item. -
auto create_sprite_optional() const -> optional<sprite_
ptr> - Creates a sprite_
ptr using the information contained in this item. -
auto create_sprite_optional(int graphics_index) const -> optional<sprite_
ptr> - Creates a sprite_
ptr using the information contained in this item. -
auto create_sprite_optional(fixed x,
fixed y) const -> optional<sprite_
ptr> - Creates a sprite_
ptr using the information contained in this item. -
auto create_sprite_optional(fixed x,
fixed y,
int graphics_index) const -> optional<sprite_
ptr> - Creates a sprite_
ptr using the information contained in this item. -
auto create_sprite_optional(const fixed_
point& position) const -> optional<sprite_ ptr> - Creates a sprite_
ptr using the information contained in this item. -
auto create_sprite_optional(const fixed_
point& position, int graphics_index) const -> optional<sprite_ ptr> - Creates a sprite_
ptr using the information contained in this item.
Friends
-
auto operator==(const sprite_
item& a, const sprite_ item& b) -> bool defaulted constexpr - Default equal operator.
Function documentation
bn:: sprite_item:: sprite_item(const sprite_ shape_ size& shape_size,
const span<const tile>& tiles_ref,
const span<const color>& colors_ref,
bpp_ mode bpp,
int graphics_count) constexpr
Constructor.
Parameters | |
---|---|
shape_size | Shape and size of the output sprites. |
tiles_ref | Reference to one or more sprite tile sets. |
colors_ref | Reference to an array of multiples of 16 colors. |
bpp | Bits per pixel of the output sprites. |
graphics_count | Number of sprite tile sets contained in tiles_ref. |
The tiles are not copied but referenced, so they should outlive the sprite_
The colors are not copied but referenced, so they should outlive the sprite_
bn:: sprite_item:: sprite_item(const sprite_ shape_ size& shape_size,
const sprite_ tiles_ item& tiles_item,
const sprite_ palette_ item& palette_item) constexpr
Constructor.
Parameters | |
---|---|
shape_size | Shape and size of the output sprites. |
tiles_item | It creates the tiles of the output sprites. |
palette_item | It creates the color palette of the output sprites. |
sprite_ item bn:: sprite_item:: decompress(span<tile> decompressed_tiles_ref,
span<color> decompressed_colors_ref) const
Decompresses the stored data in the tiles referenced by decompressed_tiles_ref and the colors referenced by decompressed_colors_ref.
Parameters | |
---|---|
decompressed_tiles_ref | Destination of the decompressed tiles. |
decompressed_colors_ref | Destination of the decompressed colors. |
Returns | A sprite_ |
If the source and destination tiles or colors overlap, the behavior is undefined.
sprite_ ptr bn:: sprite_item:: create_sprite() const
Creates a sprite_
Returns | The requested sprite_ |
---|
sprite_ ptr bn:: sprite_item:: create_sprite(int graphics_index) const
Creates a sprite_
Parameters | |
---|---|
graphics_index | Index of the tile set to reference in tiles_ |
Returns | The requested sprite_ |
sprite_ ptr bn:: sprite_item:: create_sprite(fixed x,
fixed y) const
Creates a sprite_
Parameters | |
---|---|
x | Horizontal position of the sprite. |
y | Vertical position of the sprite. |
Returns | The requested sprite_ |
sprite_ ptr bn:: sprite_item:: create_sprite(fixed x,
fixed y,
int graphics_index) const
Creates a sprite_
Parameters | |
---|---|
x | Horizontal position of the sprite. |
y | Vertical position of the sprite. |
graphics_index | Index of the tile set to reference in tiles_ |
Returns | The requested sprite_ |
sprite_ ptr bn:: sprite_item:: create_sprite(const fixed_ point& position) const
Creates a sprite_
Parameters | |
---|---|
position | Position of the sprite. |
Returns | The requested sprite_ |
sprite_ ptr bn:: sprite_item:: create_sprite(const fixed_ point& position,
int graphics_index) const
Creates a sprite_
Parameters | |
---|---|
position | Position of the sprite. |
graphics_index | Index of the tile set to reference in tiles_ |
Returns | The requested sprite_ |
optional<sprite_ ptr> bn:: sprite_item:: create_sprite_optional() const
Creates a sprite_
Returns | The requested sprite_ |
---|
optional<sprite_ ptr> bn:: sprite_item:: create_sprite_optional(int graphics_index) const
Creates a sprite_
Parameters | |
---|---|
graphics_index | Index of the tile set to reference in tiles_ |
Returns | The requested sprite_ |
optional<sprite_ ptr> bn:: sprite_item:: create_sprite_optional(fixed x,
fixed y) const
Creates a sprite_
Parameters | |
---|---|
x | Horizontal position of the sprite. |
y | Vertical position of the sprite. |
Returns | The requested sprite_ |
optional<sprite_ ptr> bn:: sprite_item:: create_sprite_optional(fixed x,
fixed y,
int graphics_index) const
Creates a sprite_
Parameters | |
---|---|
x | Horizontal position of the sprite. |
y | Vertical position of the sprite. |
graphics_index | Index of the tile set to reference in tiles_ |
Returns | The requested sprite_ |
optional<sprite_ ptr> bn:: sprite_item:: create_sprite_optional(const fixed_ point& position) const
Creates a sprite_
Parameters | |
---|---|
position | Position of the sprite. |
Returns | The requested sprite_ |
optional<sprite_ ptr> bn:: sprite_item:: create_sprite_optional(const fixed_ point& position,
int graphics_index) const
Creates a sprite_
Parameters | |
---|---|
position | Position of the sprite. |
graphics_index | Index of the tile set to reference in tiles_ |
Returns | The requested sprite_ |