class
#include <bn_regular_bg_map_item.h>
regular_bg_map_item Contains the required information to generate regular background maps.
The assets conversion tools generate an object of this type in the build folder for each *.bmp file with regular_bg
type.
The map cells are not copied but referenced, so they should outlive the regular_
Constructors, destructors, conversion operators
-
regular_bg_map_item(const regular_
bg_ map_ cell& cells_ref, const size& dimensions) constexpr - Constructor.
-
regular_bg_map_item(const regular_
bg_ map_ cell& cells_ref, const size& dimensions, compression_ type compression) constexpr - Constructor.
Public functions
-
auto cells_ptr() const -> const regular_
bg_ map_ cell* constexpr - Returns a pointer to the referenced map cells.
-
auto cells_ref() const -> const regular_
bg_ map_ cell& constexpr - Returns the referenced map cells.
- 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 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 -> regular_
bg_ map_ cell constexpr - Returns the referenced map cell in the specified map coordinates.
-
auto cell(const point& map_position) const -> regular_
bg_ map_ cell constexpr - Returns the referenced map cell in the specified map coordinates.
-
auto decompress(regular_
bg_ map_ cell& decompressed_cells_ref, const size& decompressed_dimensions) const -> regular_ bg_ map_ item - Decompresses the stored data in the map cells referenced by decompressed_cells_ref.
-
auto find_map(const regular_
bg_ tiles_ ptr& tiles, const bg_ palette_ ptr& palette) const -> optional<regular_ bg_ map_ ptr> - Searches for a regular_
bg_ map_ ptr which references the information provided by this item. -
auto create_map(regular_
bg_ tiles_ ptr tiles, bg_ palette_ ptr palette) 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(regular_
bg_ tiles_ ptr tiles, bg_ palette_ ptr palette) const -> regular_ bg_ map_ ptr - Creates a regular_
bg_ map_ ptr which references the information provided by this item. -
auto create_map_optional(regular_
bg_ tiles_ ptr tiles, bg_ palette_ ptr palette) 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(regular_
bg_ tiles_ ptr tiles, bg_ palette_ ptr palette) 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_ map_ item& a, const regular_ bg_ map_ item& b) -> bool defaulted constexpr - Default equal operator.
Function documentation
bn:: regular_bg_map_item:: regular_bg_map_item(const regular_ bg_ map_ cell& cells_ref,
const size& dimensions) constexpr
Constructor.
Parameters | |
---|---|
cells_ref | Reference to one or more regular 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 regular_
bn:: regular_bg_map_item:: regular_bg_map_item(const regular_ bg_ map_ cell& cells_ref,
const size& dimensions,
compression_ type compression) constexpr
Constructor.
Parameters | |
---|---|
cells_ref | Reference to one or more regular 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 regular_
bool bn:: regular_bg_map_item:: big() const constexpr
Indicates if maps generated with this item are big or not.
Big backgrounds are slower CPU wise and don't support wrapping (they can't be moved beyond their boundaries), but can have any width or height multiple of 256 pixels.
int bn:: regular_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 regular_
int bn:: regular_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 regular_
regular_ bg_ map_ cell bn:: regular_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 regular_
regular_ bg_ map_ cell bn:: regular_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 regular_
regular_ bg_ map_ item bn:: regular_bg_map_item:: decompress(regular_ bg_ map_ cell& decompressed_cells_ref,
const size& decompressed_dimensions) const
Decompresses the stored data in the map cells referenced by decompressed_cells_ref.
Parameters | |
---|---|
decompressed_cells_ref | Destination of the decompressed map cells. |
decompressed_dimensions | Size in map cells of the destination data. |
Returns | A regular_ |
If the source and destination map cells overlap, the behavior is undefined.
optional<regular_ bg_ map_ ptr> bn:: regular_bg_map_item:: find_map(const regular_ bg_ tiles_ ptr& tiles,
const bg_ palette_ ptr& palette) const
Searches for a regular_
Parameters | |
---|---|
tiles | Referenced tiles of the map to search. |
palette | Referenced color palette of the map to search. |
Returns | regular_ |
regular_ bg_ map_ ptr bn:: regular_bg_map_item:: create_map(regular_ bg_ tiles_ ptr tiles,
bg_ palette_ ptr palette) const
Searches for a regular_
Parameters | |
---|---|
tiles | Referenced tiles of the map to search or handle. |
palette | Referenced color palette of the 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_map_item:: create_new_map(regular_ bg_ tiles_ ptr tiles,
bg_ palette_ ptr palette) const
Creates a regular_
Parameters | |
---|---|
tiles | Referenced tiles of the map to handle. |
palette | Referenced color palette of the 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_map_item:: create_map_optional(regular_ bg_ tiles_ ptr tiles,
bg_ palette_ ptr palette) const
Searches for a regular_
Parameters | |
---|---|
tiles | Referenced tiles of the map to search or handle. |
palette | Referenced color palette of the 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_map_item:: create_new_map_optional(regular_ bg_ tiles_ ptr tiles,
bg_ palette_ ptr palette) const
Creates a regular_
Parameters | |
---|---|
tiles | Referenced tiles of the map to handle. |
palette | Referenced color palette of the 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_