class
#include <bn_regular_bg_builder.h>
regular_bg_builder Creates regular_
If some of the attributes of the regular background to create differs from the default ones, using this class improves performance.
Constructors, destructors, conversion operators
-
regular_bg_builder(const regular_
bg_ & item) explicititem - Constructor.
-
regular_bg_builder(const regular_
bg_ & item, int map_index)item - Constructor.
-
regular_bg_builder(const regular_
bg_ & map) explicitmap_ ptr - Constructor.
-
regular_bg_builder(regular_
bg_ && map) explicitmap_ ptr - Constructor.
Public functions
-
auto item() const -> const optional<regular_
bg_ >&item - Returns the regular_
bg_ containing the required information to generate regular backgrounds if it has one; bn::item nullopt otherwise. - auto map_index() const -> int
- Index of the map to reference in item.map_item() to generate regular backgrounds.
- auto x() const -> fixed
- Returns the horizontal position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_x(fixed x) -> regular_
bg_ &builder - Sets the horizontal position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
- auto y() const -> fixed
- Returns the vertical position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_y(fixed y) -> regular_
bg_ &builder - Sets the vertical position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
-
auto position() const -> const fixed_
point & - Returns the position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_position(fixed x,
fixed y) -> regular_
bg_ &builder - Sets the position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_position(const fixed_
point & position) -> regular_bg_ &builder - Sets the position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
- auto top_left_x() const -> fixed
- Returns the horizontal top-left position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_top_left_x(fixed top_left_x) -> regular_
bg_ &builder - Sets the horizontal top-left position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
- auto top_left_y() const -> fixed
- Returns the vertical top-left position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_top_left_y(fixed top_left_y) -> regular_
bg_ &builder - Sets the vertical top-left position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
-
auto top_left_position() const -> fixed_
point - Returns the top-left position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_top_left_position(fixed top_left_x,
fixed top_left_y) -> regular_
bg_ &builder - Sets the top-left position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_top_left_position(const fixed_
point & top_left_position) -> regular_bg_ &builder - Sets the top-left position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
- auto priority() const -> int
- Returns the priority of the regular backgrounds to generate relative to sprites and other backgrounds.
-
auto set_priority(int priority) -> regular_
bg_ &builder - Sets the priority of the regular backgrounds to generate relative to sprites and other backgrounds.
- auto z_order() const -> int
- Returns the priority of the regular backgrounds to generate relative to other backgrounds, excluding sprites.
-
auto set_z_order(int z_order) -> regular_
bg_ &builder - Sets the priority of the regular backgrounds to generate relative to other backgrounds, excluding sprites.
- auto mosaic_enabled() const -> bool
- Indicates if the mosaic effect must be applied to the regular backgrounds to generate or not.
-
auto set_mosaic_enabled(bool mosaic_enabled) -> regular_
bg_ &builder - Sets if the mosaic effect must be applied to the regular backgrounds to generate or not.
- auto blending_enabled() const -> bool
- Indicates if blending must be applied to the regular backgrounds to generate or not.
-
auto set_blending_enabled(bool blending_enabled) -> regular_
bg_ &builder - Sets if blending must be applied to the regular backgrounds to generate or not.
- auto blending_top_enabled() const -> bool
- Indicates if the regular backgrounds to generate must be part of the blending top layer or not.
-
auto set_blending_top_enabled(bool blending_top_enabled) -> regular_
bg_ &builder - Sets if the regular backgrounds to generate must be part of the blending top layer or not.
- auto blending_bottom_enabled() const -> bool
- Indicates if the regular backgrounds to generate must be part of the blending bottom layer or not.
-
auto set_blending_bottom_enabled(bool blending_bottom_enabled) -> regular_
bg_ &builder - Sets if the regular backgrounds to generate must be part of the blending bottom layer or not.
-
auto green_swap_mode() const -> bn::
green_swap_mode - Indicates how the regular backgrounds to generate must be displayed when green swap is enabled.
-
auto set_green_swap_mode(bn::
green_swap_mode green_swap_mode) -> regular_bg_ &builder - Sets how the regular backgrounds to generate must be displayed when green swap is enabled.
- auto visible() const -> bool
- Indicates if the regular backgrounds to generate must be committed to the GBA or not.
-
auto set_visible(bool visible) -> regular_
bg_ &builder - Sets if the regular backgrounds to generate must be committed to the GBA or not.
-
auto camera() const -> const optional<camera_
ptr >& - Returns the camera_
ptr to attach to the regular backgrounds to generate (if any). -
auto set_camera(const camera_
ptr & camera) -> regular_bg_ &builder - Sets the camera_
ptr to attach to the regular backgrounds to generate. -
auto set_camera(camera_
ptr && camera) -> regular_bg_ &builder - Sets the camera_
ptr to attach to the regular backgrounds to generate. -
auto set_camera(const optional<camera_
ptr >& camera) -> regular_bg_ &builder - Sets or removes the camera_
ptr to attach to the regular backgrounds to generate. -
auto set_camera(optional<camera_
ptr >&& camera) -> regular_bg_ &builder - Sets or removes the camera_
ptr to attach to the regular backgrounds to generate. -
auto remove_camera() -> regular_
bg_ &builder - Removes the camera_
ptr to attach to the regular backgrounds to generate. -
auto release_camera() -> optional<camera_
ptr > - Releases and returns the camera_
ptr to attach to the regular backgrounds to generate (if any). -
auto build() const -> regular_
bg_ ptr - Generates and returns a regular_
bg_ without releasing the acquired resources.ptr -
auto release_build() -> regular_
bg_ ptr - Generates and returns a regular_
bg_ releasing the acquired resources.ptr -
auto build_optional() const -> optional<regular_
bg_ >ptr - Generates and returns a regular_
bg_ without releasing the acquired resources if it could be allocated; bn::ptr nullopt otherwise. -
auto release_build_optional() -> optional<regular_
bg_ >ptr - Generates and returns a regular_
bg_ releasing the acquired resources if it could be allocated; bn::ptr nullopt otherwise. -
auto map() const -> regular_
bg_ map_ ptr - Generates and returns a regular_
bg_ without releasing the acquired resources.map_ ptr -
auto map_optional() const -> optional<regular_
bg_ >map_ ptr - Generates and returns a regular_
bg_ without releasing the acquired resources if it could be allocated; bn::map_ ptr nullopt otherwise. -
auto release_map() -> regular_
bg_ map_ ptr - Generates and returns a regular_
bg_ releasing the acquired resources.map_ ptr -
auto release_map_optional() -> optional<regular_
bg_ >map_ ptr - Generates and returns a regular_
bg_ releasing the acquired resources if it could be allocated; bn::map_ ptr nullopt otherwise.
Function documentation
bn::regular_bg_builder:: regular_bg_builder(const regular_bg_item & item) explicit
Constructor.
Parameters | |
---|---|
item | regular_ |
bn::regular_bg_builder:: regular_bg_builder(const regular_bg_item & item,
int map_index)
Constructor.
Parameters | |
---|---|
item | regular_ |
map_index | Index of the map to reference in item.map_item() to generate regular backgrounds. |
bn::regular_bg_builder:: regular_bg_builder(const regular_bg_map_ptr & map) explicit
Constructor.
Parameters | |
---|---|
map | regular_ |
bn::regular_bg_builder:: regular_bg_builder(regular_bg_map_ptr && map) explicit
Constructor.
Parameters | |
---|---|
map | regular_ |
regular_bg_builder & bn::regular_bg_builder:: set_x(fixed x)
Sets the horizontal position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
x | Horizontal position of the regular backgrounds to generate. |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_y(fixed y)
Sets the vertical position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
y | vertical position of the regular backgrounds to generate. |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_position(fixed x,
fixed y)
Sets the position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
x | Horizontal position of the regular backgrounds to generate. |
y | Vertical position of the regular backgrounds to generate. |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_position(const fixed_point & position)
Sets the position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
position | Position of the regular backgrounds to generate. |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_top_left_x(fixed top_left_x)
Sets the horizontal top-left position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
top_left_x | Horizontal top-left position of the regular backgrounds to generate. |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_top_left_y(fixed top_left_y)
Sets the vertical top-left position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
top_left_y | Vertical top-left position of the regular backgrounds to generate. |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_top_left_position(fixed top_left_x,
fixed top_left_y)
Sets the top-left position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
top_left_x | Horizontal top-left position of the regular backgrounds to generate. |
top_left_y | Vertical top-left position of the regular backgrounds to generate. |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_top_left_position(const fixed_point & top_left_position)
Sets the top-left position of the regular backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
top_left_position | Top-left position of the regular backgrounds to generate. |
Returns | Reference to this. |
int bn::regular_bg_builder:: priority() const
Returns the priority of the regular backgrounds to generate relative to sprites and other backgrounds.
Backgrounds with higher priority are drawn first (and therefore can be covered by later sprites and backgrounds).
regular_bg_builder & bn::regular_bg_builder:: set_priority(int priority)
Sets the priority of the regular backgrounds to generate relative to sprites and other backgrounds.
Parameters | |
---|---|
priority | Priority in the range [0..3]. |
Returns | Reference to this. |
Backgrounds with higher priority are drawn first (and therefore can be covered by later sprites and backgrounds).
int bn::regular_bg_builder:: z_order() const
Returns the priority of the regular backgrounds to generate relative to other backgrounds, excluding sprites.
Backgrounds with higher z orders are drawn first (and therefore can be covered by later backgrounds).
Due to hardware limitations, affine backgrounds can be drawn before regular backgrounds with higher z order.
regular_bg_builder & bn::regular_bg_builder:: set_z_order(int z_order)
Sets the priority of the regular backgrounds to generate relative to other backgrounds, excluding sprites.
Parameters | |
---|---|
z_order | Priority relative to other backgrounds, excluding sprites, in the range [-32767..32767]. |
Returns | Reference to this. |
Backgrounds with higher z orders are drawn first (and therefore can be covered by later backgrounds).
Due to hardware limitations, affine backgrounds can be drawn before regular backgrounds with higher z order.
regular_bg_builder & bn::regular_bg_builder:: set_mosaic_enabled(bool mosaic_enabled)
Sets if the mosaic effect must be applied to the regular backgrounds to generate or not.
Parameters | |
---|---|
mosaic_enabled | true if the mosaic effect must be applied; false otherwise. |
Returns | Reference to this. |
bool bn::regular_bg_builder:: blending_enabled() const
Indicates if blending must be applied to the regular backgrounds to generate or not.
Blending is applied to regular backgrounds by making them part of the blending top layer.
regular_bg_builder & bn::regular_bg_builder:: set_blending_enabled(bool blending_enabled)
Sets if blending must be applied to the regular backgrounds to generate or not.
Parameters | |
---|---|
blending_enabled | true if blending must be applied; false otherwise. |
Returns | Reference to this. |
Blending is applied to regular backgrounds by making them part of the blending top layer.
regular_bg_builder & bn::regular_bg_builder:: set_blending_top_enabled(bool blending_top_enabled)
Sets if the regular backgrounds to generate must be part of the blending top layer or not.
Parameters | |
---|---|
blending_top_enabled | true if generated backgrounds must be part of the blending top layer; false otherwise. |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_blending_bottom_enabled(bool blending_bottom_enabled)
Sets if the regular backgrounds to generate must be part of the blending bottom layer or not.
Parameters | |
---|---|
blending_bottom_enabled | true if generated backgrounds must be part of the blending bottom layer; false otherwise. |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_green_swap_mode(bn::green_swap_mode green_swap_mode)
Sets how the regular backgrounds to generate must be displayed when green swap is enabled.
Parameters | |
---|---|
green_swap_mode | Green swap mode. |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_visible(bool visible)
Sets if the regular backgrounds to generate must be committed to the GBA or not.
Parameters | |
---|---|
visible | true if the regular backgrounds must be committed to the GBA; false otherwise. |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_camera(const camera_ptr & camera)
Sets the camera_
Parameters | |
---|---|
camera | camera_ |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_camera(camera_ptr && camera)
Sets the camera_
Parameters | |
---|---|
camera | camera_ |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_camera(const optional<camera_ptr >& camera)
Sets or removes the camera_
Parameters | |
---|---|
camera | Optional camera_ |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: set_camera(optional<camera_ptr >&& camera)
Sets or removes the camera_
Parameters | |
---|---|
camera | Optional camera_ |
Returns | Reference to this. |
regular_bg_builder & bn::regular_bg_builder:: remove_camera()
Removes the camera_
Returns | Reference to this. |
---|
regular_bg_ptr bn::regular_bg_builder:: release_build()
Generates and returns a regular_
regular_
optional<regular_bg_ptr > bn::regular_bg_builder:: release_build_optional()
Generates and returns a regular_
regular_
regular_bg_map_ptr bn::regular_bg_builder:: release_map()
Generates and returns a regular_
regular_
optional<regular_bg_map_ptr > bn::regular_bg_builder:: release_map_optional()
Generates and returns a regular_
regular_