class
#include <bn_affine_bg_item.h>
affine_bg_item Contains the required information to generate affine backgrounds and their maps.
The assets conversion tools generate an object of this type in the build folder for each *.bmp file with affine_bg
type.
Tiles, colors and map cells are not copied but referenced, so they should outlive the affine_
Constructors, destructors, conversion operators
-
affine_bg_item(const span<const tile>& tiles_ref,
const span<const color>& colors_ref,
const affine_
bg_ map_ cell& map_cells_ref, const size& map_dimensions) constexpr - Constructor.
-
affine_bg_item(const affine_
bg_ tiles_ item& tiles_item, const bg_ palette_ item& palette_item, const affine_ bg_ map_ item& map_item) constexpr - Constructor.
Public functions
-
auto tiles_item() const -> const affine_
bg_ tiles_ item& constexpr - Returns the item used to create the tiles of the output affine backgrounds.
-
auto palette_item() const -> const bg_
palette_ item& constexpr - Returns the item used to create the color palette of the output affine backgrounds.
-
auto map_item() const -> const affine_
bg_ map_ item& constexpr - Returns the item used to create the map of the output affine 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<affine_
bg_ map_ cell> decompressed_cells_ref) const -> affine_ 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 -> affine_
bg_ ptr - Creates an affine_
bg_ ptr using the information contained in this item. -
auto create_bg(int map_index) const -> affine_
bg_ ptr - Creates an affine_
bg_ ptr using the information contained in this item. -
auto create_bg(fixed x,
fixed y) const -> affine_
bg_ ptr - Creates an affine_
bg_ ptr using the information contained in this item. -
auto create_bg(fixed x,
fixed y,
int map_index) const -> affine_
bg_ ptr - Creates an affine_
bg_ ptr using the information contained in this item. -
auto create_bg(const fixed_
point& position) const -> affine_ bg_ ptr - Creates an affine_
bg_ ptr using the information contained in this item. -
auto create_bg(const fixed_
point& position, int map_index) const -> affine_ bg_ ptr - Creates an affine_
bg_ ptr using the information contained in this item. -
auto create_bg_optional() const -> optional<affine_
bg_ ptr> - Creates an affine_
bg_ ptr using the information contained in this item. -
auto create_bg_optional(int map_index) const -> optional<affine_
bg_ ptr> - Creates an affine_
bg_ ptr using the information contained in this item. -
auto create_bg_optional(fixed x,
fixed y) const -> optional<affine_
bg_ ptr> - Creates an affine_
bg_ ptr using the information contained in this item. -
auto create_bg_optional(fixed x,
fixed y,
int map_index) const -> optional<affine_
bg_ ptr> - Creates an affine_
bg_ ptr using the information contained in this item. -
auto create_bg_optional(const fixed_
point& position) const -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr using the information contained in this item. -
auto create_bg_optional(const fixed_
point& position, int map_index) const -> optional<affine_ bg_ ptr> - Creates an affine_
bg_ ptr using the information contained in this item. -
auto find_map() const -> optional<affine_
bg_ map_ ptr> - Searches for an affine_
bg_ map_ ptr which references the information provided by this item. -
auto find_map(int map_index) const -> optional<affine_
bg_ map_ ptr> - Searches for an affine_
bg_ map_ ptr which references the information provided by this item. -
auto create_map() const -> affine_
bg_ map_ ptr - Searches for an affine_
bg_ map_ ptr which references the information provided by this item. If it is not found, it creates an affine_ bg_ map_ ptr which references it. -
auto create_map(int map_index) const -> affine_
bg_ map_ ptr - Searches for an affine_
bg_ map_ ptr which references the information provided by this item. If it is not found, it creates an affine_ bg_ map_ ptr which references it. -
auto create_new_map() const -> affine_
bg_ map_ ptr - Creates an affine_
bg_ map_ ptr which references the information provided by this item. -
auto create_new_map(int map_index) const -> affine_
bg_ map_ ptr - Creates an affine_
bg_ map_ ptr which references the information provided by this item. -
auto create_map_optional() const -> optional<affine_
bg_ map_ ptr> - Searches for an affine_
bg_ map_ ptr which references the information provided by this item. If it is not found, it creates an affine_ bg_ map_ ptr which references it. -
auto create_map_optional(int map_index) const -> optional<affine_
bg_ map_ ptr> - Searches for an affine_
bg_ map_ ptr which references the information provided by this item. If it is not found, it creates an affine_ bg_ map_ ptr which references it. -
auto create_new_map_optional() const -> optional<affine_
bg_ map_ ptr> - Creates an affine_
bg_ map_ ptr which references the information provided by this item. -
auto create_new_map_optional(int map_index) const -> optional<affine_
bg_ map_ ptr> - Creates an affine_
bg_ map_ ptr which references the information provided by this item.
Friends
-
auto operator==(const affine_
bg_ item& a, const affine_ bg_ item& b) -> bool defaulted constexpr - Default equal operator.
Function documentation
bn:: affine_bg_item:: affine_bg_item(const span<const tile>& tiles_ref,
const span<const color>& colors_ref,
const affine_ bg_ map_ cell& map_cells_ref,
const size& map_dimensions) constexpr
Constructor.
Parameters | |
---|---|
tiles_ref | Reference to affine background tiles. |
colors_ref | Reference to an array of multiples of 16 colors. |
map_cells_ref | affine 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 affine_
The colors are not copied but referenced, so they should outlive the affine_
The map cells are not copied but referenced, so they should outlive the affine_
bn:: affine_bg_item:: affine_bg_item(const affine_ bg_ tiles_ item& tiles_item,
const bg_ palette_ item& palette_item,
const affine_ bg_ map_ item& map_item) constexpr
Constructor.
Parameters | |
---|---|
tiles_item | It creates the tiles of the output affine backgrounds. |
palette_item | It creates the color palette of the output affine backgrounds. |
map_item | It creates the map of the output affine backgrounds. |
bool bn:: affine_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.
affine_ bg_ item bn:: affine_bg_item:: decompress(span<tile> decompressed_tiles_ref,
span<color> decompressed_colors_ref,
span<affine_ 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 | An affine_ |
If the source and destination tiles, colors or map cells overlap, the behavior is undefined.
affine_ bg_ ptr bn:: affine_bg_item:: create_bg() const
Creates an affine_
Returns | The requested affine_ |
---|
affine_ bg_ ptr bn:: affine_bg_item:: create_bg(int map_index) const
Creates an affine_
Parameters | |
---|---|
map_index | Index of the map to reference in map_ |
Returns | The requested affine_ |
affine_ bg_ ptr bn:: affine_bg_item:: create_bg(fixed x,
fixed y) const
Creates an affine_
Parameters | |
---|---|
x | Horizontal position of the affine background. |
y | Vertical position of the affine background. |
Returns | The requested affine_ |
affine_ bg_ ptr bn:: affine_bg_item:: create_bg(fixed x,
fixed y,
int map_index) const
Creates an affine_
Parameters | |
---|---|
x | Horizontal position of the affine background. |
y | Vertical position of the affine background. |
map_index | Index of the map to reference in map_ |
Returns | The requested affine_ |
affine_ bg_ ptr bn:: affine_bg_item:: create_bg(const fixed_ point& position) const
Creates an affine_
Parameters | |
---|---|
position | Position of the affine background. |
Returns | The requested affine_ |
affine_ bg_ ptr bn:: affine_bg_item:: create_bg(const fixed_ point& position,
int map_index) const
Creates an affine_
Parameters | |
---|---|
position | Position of the affine background. |
map_index | Index of the map to reference in map_ |
Returns | The requested affine_ |
optional<affine_ bg_ ptr> bn:: affine_bg_item:: create_bg_optional() const
Creates an affine_
Returns | The requested affine_ |
---|
optional<affine_ bg_ ptr> bn:: affine_bg_item:: create_bg_optional(int map_index) const
Creates an affine_
Parameters | |
---|---|
map_index | Index of the map to reference in map_ |
Returns | The requested affine_ |
optional<affine_ bg_ ptr> bn:: affine_bg_item:: create_bg_optional(fixed x,
fixed y) const
Creates an affine_
Parameters | |
---|---|
x | Horizontal position of the affine background. |
y | Vertical position of the affine background. |
Returns | The requested affine_ |
optional<affine_ bg_ ptr> bn:: affine_bg_item:: create_bg_optional(fixed x,
fixed y,
int map_index) const
Creates an affine_
Parameters | |
---|---|
x | Horizontal position of the affine background. |
y | Vertical position of the affine background. |
map_index | Index of the map to reference in map_ |
Returns | The requested affine_ |
optional<affine_ bg_ ptr> bn:: affine_bg_item:: create_bg_optional(const fixed_ point& position) const
Creates an affine_
Parameters | |
---|---|
position | Position of the affine background. |
Returns | The requested affine_ |
optional<affine_ bg_ ptr> bn:: affine_bg_item:: create_bg_optional(const fixed_ point& position,
int map_index) const
Creates an affine_
Parameters | |
---|---|
position | Position of the affine background. |
map_index | Index of the map to reference in map_ |
Returns | The requested affine_ |
optional<affine_ bg_ map_ ptr> bn:: affine_bg_item:: find_map() const
Searches for an affine_
Returns | affine_ |
---|
optional<affine_ bg_ map_ ptr> bn:: affine_bg_item:: find_map(int map_index) const
Searches for an affine_
Parameters | |
---|---|
map_index | Index of the referenced map to search. |
Returns | affine_ |
affine_ bg_ map_ ptr bn:: affine_bg_item:: create_map() const
Searches for an affine_
Returns | affine_ |
---|
The map cells are not copied but referenced, so they should outlive the affine_
affine_ bg_ map_ ptr bn:: affine_bg_item:: create_map(int map_index) const
Searches for an affine_
Parameters | |
---|---|
map_index | Index of the referenced map to search or handle. |
Returns | affine_ |
The map cells are not copied but referenced, so they should outlive the affine_
affine_ bg_ map_ ptr bn:: affine_bg_item:: create_new_map() const
Creates an affine_
Returns | affine_ |
---|
The map system does not support multiple affine_
The map cells are not copied but referenced, so they should outlive the affine_
affine_ bg_ map_ ptr bn:: affine_bg_item:: create_new_map(int map_index) const
Creates an affine_
Parameters | |
---|---|
map_index | Index of the referenced map to handle. |
Returns | affine_ |
The map system does not support multiple affine_
The map cells are not copied but referenced, so they should outlive the affine_
optional<affine_ bg_ map_ ptr> bn:: affine_bg_item:: create_map_optional() const
Searches for an affine_
Returns | affine_ |
---|
The map cells are not copied but referenced, so they should outlive the affine_
optional<affine_ bg_ map_ ptr> bn:: affine_bg_item:: create_map_optional(int map_index) const
Searches for an affine_
Parameters | |
---|---|
map_index | Index of the referenced map to search or handle. |
Returns | affine_ |
The map cells are not copied but referenced, so they should outlive the affine_
optional<affine_ bg_ map_ ptr> bn:: affine_bg_item:: create_new_map_optional() const
Creates an affine_
Returns | affine_ |
---|
The map system does not support multiple affine_
The map cells are not copied but referenced, so they should outlive the affine_
optional<affine_ bg_ map_ ptr> bn:: affine_bg_item:: create_new_map_optional(int map_index) const
Creates an affine_
Parameters | |
---|---|
map_index | Index of the referenced map to handle. |
Returns | affine_ |
The map system does not support multiple affine_
The map cells are not copied but referenced, so they should outlive the affine_