class
#include <bn_affine_bg_map_item.h>
affine_bg_map_item Contains the required information to generate affine background maps.
The assets conversion tools generate an object of this type in the build folder for each *.bmp file with affine_bg
type.
The map cells are not copied but referenced, so they should outlive the affine_
Constructors, destructors, conversion operators
-
affine_bg_map_item(const affine_
bg_ map_ cell& cells_ref, const size& dimensions) constexpr - Constructor.
-
affine_bg_map_item(const affine_
bg_ map_ cell& cells_ref, const size& dimensions, int maps_count) constexpr - Constructor.
-
affine_bg_map_item(const affine_
bg_ map_ cell& cells_ref, const size& dimensions, compression_ type compression) constexpr - Constructor.
-
affine_bg_map_item(const affine_
bg_ map_ cell& cells_ref, const size& dimensions, compression_ type compression, int maps_count) constexpr - Constructor.
-
affine_bg_map_item(const affine_
bg_ map_ cell& cells_ref, const size& dimensions, compression_ type compression, int maps_count, bool big) constexpr - Constructor.
Public functions
-
auto cells_ptr() const -> const affine_
bg_ map_ cell* constexpr - Returns a pointer to the referenced map cells of the first map.
-
auto cells_ptr(int map_index) const -> const affine_
bg_ map_ cell* constexpr - Returns a pointer to the referenced map cells of the map indicated by map_index.
-
auto cells_ref() const -> const affine_
bg_ map_ cell& constexpr - Returns the referenced map cells of the first map.
-
auto cells_ref(int map_index) const -> const affine_
bg_ map_ cell& constexpr - Returns the referenced map cells of the map indicated by map_index.
- auto dimensions() const -> const size& constexpr
- Returns the size in map cells of the referenced map cells.
- auto big() const -> bool constexpr
- Indicates if maps generated with this item are big or not.
- auto maps_count() const -> int constexpr
- Returns the number of referenced maps.
- auto cells_count() const -> int constexpr
- Returns the number of referenced map cells.
-
auto compression() const -> compression_
type constexpr - Returns the compression type.
- auto cell_index(int map_x, int map_y) const -> int constexpr
- Returns the index of the referenced map cell in the specified map coordinates.
- auto cell_index(const point& map_position) const -> int constexpr
- Returns the index of the referenced map cell in the specified map coordinates.
-
auto cell(int map_x,
int map_y) const -> affine_
bg_ map_ cell constexpr - Returns the referenced map cell in the specified map coordinates.
-
auto cell(int map_index,
int map_x,
int map_y) const -> affine_
bg_ map_ cell constexpr - Returns the referenced map cell in the specified map coordinates.
-
auto cell(const point& map_position) const -> affine_
bg_ map_ cell constexpr - Returns the referenced map cell in the specified map coordinates.
-
auto cell(int map_index,
const point& map_position) const -> affine_
bg_ map_ cell constexpr - Returns the referenced map cell in the specified map coordinates.
-
auto decompress(span<affine_
bg_ map_ cell> decompressed_cells_ref) const -> affine_ bg_ map_ item - Decompresses the stored data in the map cells referenced by decompressed_cells_ref.
-
auto find_map(const affine_
bg_ tiles_ ptr& tiles, const bg_ palette_ ptr& palette) const -> optional<affine_ bg_ map_ ptr> - Searches for an affine_
bg_ map_ ptr which references the information provided by this item. -
auto find_map(const affine_
bg_ tiles_ ptr& tiles, const bg_ palette_ ptr& palette, 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(affine_
bg_ tiles_ ptr tiles, bg_ palette_ ptr palette) 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(affine_
bg_ tiles_ ptr tiles, bg_ palette_ ptr palette, 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_map_optional(affine_
bg_ tiles_ ptr tiles, bg_ palette_ ptr palette) 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(affine_
bg_ tiles_ ptr tiles, bg_ palette_ ptr palette, 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.
Friends
-
auto operator==(const affine_
bg_ map_ item& a, const affine_ bg_ map_ item& b) -> bool defaulted constexpr - Default equal operator.
Function documentation
bn:: affine_bg_map_item:: affine_bg_map_item(const affine_ bg_ map_ cell& cells_ref,
const size& dimensions) constexpr
Constructor.
Parameters | |
---|---|
cells_ref | Reference to one or more affine background map cells. |
dimensions | Size in map cells of the referenced map cells. |
The map cells are not copied but referenced, so they should outlive the affine_
bn:: affine_bg_map_item:: affine_bg_map_item(const affine_ bg_ map_ cell& cells_ref,
const size& dimensions,
int maps_count) constexpr
Constructor.
Parameters | |
---|---|
cells_ref | Reference to one or more affine background map cells. |
dimensions | Size in map cells of each referenced map. |
maps_count | Number of maps contained in cells_ref. |
The map cells are not copied but referenced, so they should outlive the affine_
bn:: affine_bg_map_item:: affine_bg_map_item(const affine_ bg_ map_ cell& cells_ref,
const size& dimensions,
compression_ type compression) constexpr
Constructor.
Parameters | |
---|---|
cells_ref | Reference to one or more affine background map cells. |
dimensions | Size in map cells of the referenced map cells. |
compression | Compression type. |
The map cells are not copied but referenced, so they should outlive the affine_
bn:: affine_bg_map_item:: affine_bg_map_item(const affine_ bg_ map_ cell& cells_ref,
const size& dimensions,
compression_ type compression,
int maps_count) constexpr
Constructor.
Parameters | |
---|---|
cells_ref | Reference to one or more affine background map cells. |
dimensions | Size in map cells of each referenced map. |
compression | Compression type. |
maps_count | Number of maps contained in cells_ref. |
The map cells are not copied but referenced, so they should outlive the affine_
bn:: affine_bg_map_item:: affine_bg_map_item(const affine_ bg_ map_ cell& cells_ref,
const size& dimensions,
compression_ type compression,
int maps_count,
bool big) constexpr
Constructor.
Parameters | |
---|---|
cells_ref | Reference to one or more affine background map cells. |
dimensions | Size in map cells of each referenced map. |
compression | Compression type. |
maps_count | Number of maps contained in cells_ref. |
big | Indicates if maps generated with this item are big or not. |
The map cells are not copied but referenced, so they should outlive the affine_
Big backgrounds are slower CPU wise, but can have any width or height multiple of 256 pixels.
bool bn:: affine_bg_map_item:: big() const constexpr
Indicates if maps 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.
int bn:: affine_bg_map_item:: cell_index(int map_x,
int map_y) const constexpr
Returns the index of the referenced map cell in the specified map coordinates.
Parameters | |
---|---|
map_x | Horizontal position of the map cell [0..dimensions().width()). |
map_y | Vertical position of the map cell [0..dimensions().height()). |
Returns | The index of the referenced map cell. |
The map cells are not copied but referenced, so they should outlive the affine_
int bn:: affine_bg_map_item:: cell_index(const point& map_position) const constexpr
Returns the index of the referenced map cell in the specified map coordinates.
Parameters | |
---|---|
map_position | Position of the map cell. |
Returns | The index of the referenced map cell. |
The map cells are not copied but referenced, so they should outlive the affine_
affine_ bg_ map_ cell bn:: affine_bg_map_item:: cell(int map_x,
int map_y) const constexpr
Returns the referenced map cell in the specified map coordinates.
Parameters | |
---|---|
map_x | Horizontal position of the map cell [0..dimensions().width()). |
map_y | Vertical position of the map cell [0..dimensions().height()). |
Returns | The referenced map cell. |
The map cells are not copied but referenced, so they should outlive the affine_
affine_ bg_ map_ cell bn:: affine_bg_map_item:: cell(int map_index,
int map_x,
int map_y) const constexpr
Returns the referenced map cell in the specified map coordinates.
Parameters | |
---|---|
map_index | Referenced map index. |
map_x | Horizontal position of the map cell [0..dimensions().width()). |
map_y | Vertical position of the map cell [0..dimensions().height()). |
Returns | The referenced map cell. |
The map cells are not copied but referenced, so they should outlive the affine_
affine_ bg_ map_ cell bn:: affine_bg_map_item:: cell(const point& map_position) const constexpr
Returns the referenced map cell in the specified map coordinates.
Parameters | |
---|---|
map_position | Position of the map cell. |
Returns | The referenced map cell. |
The map cells are not copied but referenced, so they should outlive the affine_
affine_ bg_ map_ cell bn:: affine_bg_map_item:: cell(int map_index,
const point& map_position) const constexpr
Returns the referenced map cell in the specified map coordinates.
Parameters | |
---|---|
map_index | Referenced map index. |
map_position | Position of the map cell. |
Returns | The referenced map cell. |
The map cells are not copied but referenced, so they should outlive the affine_
affine_ bg_ map_ item bn:: affine_bg_map_item:: decompress(span<affine_ bg_ map_ cell> decompressed_cells_ref) const
Decompresses the stored data in the map cells referenced by decompressed_cells_ref.
Parameters | |
---|---|
decompressed_cells_ref | Destination of the decompressed map cells. |
Returns | An affine_ |
If the source and destination map cells overlap, the behavior is undefined.
optional<affine_ bg_ map_ ptr> bn:: affine_bg_map_item:: find_map(const affine_ bg_ tiles_ ptr& tiles,
const bg_ palette_ ptr& palette) const
Searches for an affine_
Parameters | |
---|---|
tiles | Referenced tiles of the map to search. |
palette | Referenced color palette of the map to search. |
Returns | affine_ |
optional<affine_ bg_ map_ ptr> bn:: affine_bg_map_item:: find_map(const affine_ bg_ tiles_ ptr& tiles,
const bg_ palette_ ptr& palette,
int map_index) const
Searches for an affine_
Parameters | |
---|---|
tiles | Referenced tiles of the map to search. |
palette | Referenced color palette of the map to search. |
map_index | Index of the referenced map to search. |
Returns | affine_ |
affine_ bg_ map_ ptr bn:: affine_bg_map_item:: create_map(affine_ bg_ tiles_ ptr tiles,
bg_ palette_ ptr palette) const
Searches for an affine_
Parameters | |
---|---|
tiles | Referenced tiles of the map to search or handle. |
palette | Referenced color palette of the 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_map_item:: create_map(affine_ bg_ tiles_ ptr tiles,
bg_ palette_ ptr palette,
int map_index) const
Searches for an affine_
Parameters | |
---|---|
tiles | Referenced tiles of the map to search or handle. |
palette | Referenced color palette of the map to search or handle. |
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_map_item:: create_map_optional(affine_ bg_ tiles_ ptr tiles,
bg_ palette_ ptr palette) const
Searches for an affine_
Parameters | |
---|---|
tiles | Referenced tiles of the map to search or handle. |
palette | Referenced color palette of the 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_map_item:: create_map_optional(affine_ bg_ tiles_ ptr tiles,
bg_ palette_ ptr palette,
int map_index) const
Searches for an affine_
Parameters | |
---|---|
tiles | Referenced tiles of the map to search or handle. |
palette | Referenced color palette of the map to search or handle. |
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_