class
#include <bn_regular_bg_item.h>
regular_bg_item Contains the required information to generate regular backgrounds and their maps.
The assets conversion tools generate an object of this type in the build folder for each *.bmp file with regular_bg
type.
Tiles, colors and map cells are not copied but referenced, so they should outlive the regular_
Constructors, destructors, conversion operators
-
regular_bg_item(const span<const tile>& tiles_ref,
const span<const color>& colors_ref,
bpp_
mode bpp, const regular_ bg_ map_ cell& map_cells_ref, const size& map_dimensions) constexpr - Constructor.
-
regular_bg_item(const regular_
bg_ tiles_ item& tiles_item, const bg_ palette_ item& palette_item, const regular_ bg_ map_ item& map_item) constexpr - Constructor.
Public functions
-
auto tiles_item() const -> const regular_
bg_ tiles_ item& constexpr - Returns the item used to create the tiles of the output regular backgrounds.
-
auto palette_item() const -> const bg_
palette_ item& constexpr - Returns the item used to create the color palette of the output regular backgrounds.
-
auto map_item() const -> const regular_
bg_ map_ item& constexpr - Returns the item used to create the map of the output regular backgrounds.
- auto big() const -> bool constexpr
- Indicates if backgrounds generated with this item are big or not.
-
auto decompress(span<tile> decompressed_tiles_ref,
span<color> decompressed_colors_ref,
span<regular_
bg_ map_ cell> decompressed_cells_ref) const -> regular_ bg_ item - Decompresses the stored data in the tiles referenced by decompressed_tiles_ref, the colors referenced by decompressed_colors_ref and the map cells referenced by decompressed_cells_ref.
-
auto create_bg() const -> regular_
bg_ ptr - Creates a regular_
bg_ ptr using the information contained in this item. -
auto create_bg(int map_index) const -> regular_
bg_ ptr - Creates a regular_
bg_ ptr using the information contained in this item. -
auto create_bg(fixed x,
fixed y) const -> regular_
bg_ ptr - Creates a regular_
bg_ ptr using the information contained in this item. -
auto create_bg(fixed x,
fixed y,
int map_index) const -> regular_
bg_ ptr - Creates a regular_
bg_ ptr using the information contained in this item. -
auto create_bg(const fixed_
point& position) const -> regular_ bg_ ptr - Creates a regular_
bg_ ptr using the information contained in this item. -
auto create_bg(const fixed_
point& position, int map_index) const -> regular_ bg_ ptr - Creates a regular_
bg_ ptr using the information contained in this item. -
auto create_bg_optional() const -> optional<regular_
bg_ ptr> - Creates a regular_
bg_ ptr using the information contained in this item. -
auto create_bg_optional(int map_index) const -> optional<regular_
bg_ ptr> - Creates a regular_
bg_ ptr using the information contained in this item. -
auto create_bg_optional(fixed x,
fixed y) const -> optional<regular_
bg_ ptr> - Creates a regular_
bg_ ptr using the information contained in this item. -
auto create_bg_optional(fixed x,
fixed y,
int map_index) const -> optional<regular_
bg_ ptr> - Creates a regular_
bg_ ptr using the information contained in this item. -
auto create_bg_optional(const fixed_
point& position) const -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr using the information contained in this item. -
auto create_bg_optional(const fixed_
point& position, int map_index) const -> optional<regular_ bg_ ptr> - Creates a regular_
bg_ ptr using the information contained in this item. -
auto find_map() const -> optional<regular_
bg_ map_ ptr> - Searches for a regular_
bg_ map_ ptr which references the information provided by this item. -
auto find_map(int map_index) const -> optional<regular_
bg_ map_ ptr> - Searches for a regular_
bg_ map_ ptr which references the information provided by this item. -
auto create_map() const -> regular_
bg_ map_ ptr - Searches for a regular_
bg_ map_ ptr which references the information provided by this item. If it is not found, it creates a regular_ bg_ map_ ptr which references it. -
auto create_map(int map_index) const -> regular_
bg_ map_ ptr - Searches for a regular_
bg_ map_ ptr which references the information provided by this item. If it is not found, it creates a regular_ bg_ map_ ptr which references it. -
auto create_new_map() const -> regular_
bg_ map_ ptr - Creates a regular_
bg_ map_ ptr which references the information provided by this item. -
auto create_new_map(int map_index) const -> regular_
bg_ map_ ptr - Creates a regular_
bg_ map_ ptr which references the information provided by this item. -
auto create_map_optional() const -> optional<regular_
bg_ map_ ptr> - Searches for a regular_
bg_ map_ ptr which references the information provided by this item. If it is not found, it creates a regular_ bg_ map_ ptr which references it. -
auto create_map_optional(int map_index) const -> optional<regular_
bg_ map_ ptr> - Searches for a regular_
bg_ map_ ptr which references the information provided by this item. If it is not found, it creates a regular_ bg_ map_ ptr which references it. -
auto create_new_map_optional() const -> optional<regular_
bg_ map_ ptr> - Creates a regular_
bg_ map_ ptr which references the information provided by this item. -
auto create_new_map_optional(int map_index) const -> optional<regular_
bg_ map_ ptr> - Creates a regular_
bg_ map_ ptr which references the information provided by this item.
Friends
-
auto operator==(const regular_
bg_ item& a, const regular_ bg_ item& b) -> bool defaulted constexpr - Default equal operator.
Function documentation
bn:: regular_bg_item:: regular_bg_item(const span<const tile>& tiles_ref,
const span<const color>& colors_ref,
bpp_ mode bpp,
const regular_ bg_ map_ cell& map_cells_ref,
const size& map_dimensions) constexpr
Constructor.
Parameters | |
---|---|
tiles_ref | Reference to regular background tiles. |
colors_ref | Reference to an array of multiples of 16 colors. |
bpp | Bits per pixel of referenced colors. |
map_cells_ref | Regular background map cells to reference. |
map_dimensions | Size in map cells of the referenced map cells. |
The tiles are not copied but referenced, so they should outlive the regular_
The colors are not copied but referenced, so they should outlive the regular_
The map cells are not copied but referenced, so they should outlive the regular_
bn:: regular_bg_item:: regular_bg_item(const regular_ bg_ tiles_ item& tiles_item,
const bg_ palette_ item& palette_item,
const regular_ bg_ map_ item& map_item) constexpr
Constructor.
Parameters | |
---|---|
tiles_item | It creates the tiles of the output regular backgrounds. |
palette_item | It creates the color palette of the output regular backgrounds. |
map_item | It creates the map of the output regular backgrounds. |
bool bn:: regular_bg_item:: big() const constexpr
Indicates if backgrounds generated with this item are big or not.
Big backgrounds are slower CPU wise, but can have any width or height multiple of 256 pixels.
regular_ bg_ item bn:: regular_bg_item:: decompress(span<tile> decompressed_tiles_ref,
span<color> decompressed_colors_ref,
span<regular_ bg_ map_ cell> decompressed_cells_ref) const
Decompresses the stored data in the tiles referenced by decompressed_tiles_ref, the colors referenced by decompressed_colors_ref and the map cells referenced by decompressed_cells_ref.
Parameters | |
---|---|
decompressed_tiles_ref | Destination of the decompressed tiles. |
decompressed_colors_ref | Destination of the decompressed colors. |
decompressed_cells_ref | Destination of the decompressed map cells. |
Returns | A regular_ |
If the source and destination tiles, colors or map cells overlap, the behavior is undefined.
regular_ bg_ ptr bn:: regular_bg_item:: create_bg() const
Creates a regular_
Returns | The requested regular_ |
---|
regular_ bg_ ptr bn:: regular_bg_item:: create_bg(int map_index) const
Creates a regular_
Parameters | |
---|---|
map_index | Index of the map to reference in map_ |
Returns | The requested regular_ |
regular_ bg_ ptr bn:: regular_bg_item:: create_bg(fixed x,
fixed y) const
Creates a regular_
Parameters | |
---|---|
x | Horizontal position of the regular background. |
y | Vertical position of the regular background. |
Returns | The requested regular_ |
regular_ bg_ ptr bn:: regular_bg_item:: create_bg(fixed x,
fixed y,
int map_index) const
Creates a regular_
Parameters | |
---|---|
x | Horizontal position of the regular background. |
y | Vertical position of the regular background. |
map_index | Index of the map to reference in map_ |
Returns | The requested regular_ |
regular_ bg_ ptr bn:: regular_bg_item:: create_bg(const fixed_ point& position) const
Creates a regular_
Parameters | |
---|---|
position | Position of the regular background. |
Returns | The requested regular_ |
regular_ bg_ ptr bn:: regular_bg_item:: create_bg(const fixed_ point& position,
int map_index) const
Creates a regular_
Parameters | |
---|---|
position | Position of the regular background. |
map_index | Index of the map to reference in map_ |
Returns | The requested regular_ |
optional<regular_ bg_ ptr> bn:: regular_bg_item:: create_bg_optional() const
Creates a regular_
Returns | The requested regular_ |
---|
optional<regular_ bg_ ptr> bn:: regular_bg_item:: create_bg_optional(int map_index) const
Creates a regular_
Parameters | |
---|---|
map_index | Index of the map to reference in map_ |
Returns | The requested regular_ |
optional<regular_ bg_ ptr> bn:: regular_bg_item:: create_bg_optional(fixed x,
fixed y) const
Creates a regular_
Parameters | |
---|---|
x | Horizontal position of the regular background. |
y | Vertical position of the regular background. |
Returns | The requested regular_ |
optional<regular_ bg_ ptr> bn:: regular_bg_item:: create_bg_optional(fixed x,
fixed y,
int map_index) const
Creates a regular_
Parameters | |
---|---|
x | Horizontal position of the regular background. |
y | Vertical position of the regular background. |
map_index | Index of the map to reference in map_ |
Returns | The requested regular_ |
optional<regular_ bg_ ptr> bn:: regular_bg_item:: create_bg_optional(const fixed_ point& position) const
Creates a regular_
Parameters | |
---|---|
position | Position of the regular background. |
Returns | The requested regular_ |
optional<regular_ bg_ ptr> bn:: regular_bg_item:: create_bg_optional(const fixed_ point& position,
int map_index) const
Creates a regular_
Parameters | |
---|---|
position | Position of the regular background. |
map_index | Index of the map to reference in map_ |
Returns | The requested regular_ |
optional<regular_ bg_ map_ ptr> bn:: regular_bg_item:: find_map() const
Searches for a regular_
Returns | regular_ |
---|
optional<regular_ bg_ map_ ptr> bn:: regular_bg_item:: find_map(int map_index) const
Searches for a regular_
Parameters | |
---|---|
map_index | Index of the referenced map to search. |
Returns | regular_ |
regular_ bg_ map_ ptr bn:: regular_bg_item:: create_map() const
Searches for a regular_
Returns | regular_ |
---|
The map cells are not copied but referenced, so they should outlive the regular_
regular_ bg_ map_ ptr bn:: regular_bg_item:: create_map(int map_index) const
Searches for a regular_
Parameters | |
---|---|
map_index | Index of the referenced map to search or handle. |
Returns | regular_ |
The map cells are not copied but referenced, so they should outlive the regular_
regular_ bg_ map_ ptr bn:: regular_bg_item:: create_new_map() const
Creates a regular_
Returns | regular_ |
---|
The map system does not support multiple regular_
The map cells are not copied but referenced, so they should outlive the regular_
regular_ bg_ map_ ptr bn:: regular_bg_item:: create_new_map(int map_index) const
Creates a regular_
Parameters | |
---|---|
map_index | Index of the referenced map to handle. |
Returns | regular_ |
The map system does not support multiple regular_
The map cells are not copied but referenced, so they should outlive the regular_
optional<regular_ bg_ map_ ptr> bn:: regular_bg_item:: create_map_optional() const
Searches for a regular_
Returns | regular_ |
---|
The map cells are not copied but referenced, so they should outlive the regular_
optional<regular_ bg_ map_ ptr> bn:: regular_bg_item:: create_map_optional(int map_index) const
Searches for a regular_
Parameters | |
---|---|
map_index | Index of the referenced map to search or handle. |
Returns | regular_ |
The map cells are not copied but referenced, so they should outlive the regular_
optional<regular_ bg_ map_ ptr> bn:: regular_bg_item:: create_new_map_optional() const
Creates a regular_
Returns | regular_ |
---|
The map system does not support multiple regular_
The map cells are not copied but referenced, so they should outlive the regular_
optional<regular_ bg_ map_ ptr> bn:: regular_bg_item:: create_new_map_optional(int map_index) const
Creates a regular_
Parameters | |
---|---|
map_index | Index of the referenced map to handle. |
Returns | regular_ |
The map system does not support multiple regular_
The map cells are not copied but referenced, so they should outlive the regular_