class
#include <bn_affine_bg_builder.h>
affine_bg_builder Creates affine_
If some of the attributes of the affine background to create differs from the default ones, using this class improves performance.
Constructors, destructors, conversion operators
-
affine_bg_builder(const affine_
bg_ item& item) explicit - Constructor.
-
affine_bg_builder(const affine_
bg_ item& item, int map_index) - Constructor.
-
affine_bg_builder(const affine_
bg_ map_ ptr& map) explicit - Constructor.
-
affine_bg_builder(affine_
bg_ map_ ptr&& map) explicit - Constructor.
Public functions
-
auto item() const -> const optional<affine_
bg_ item>& - Returns the affine_
bg_ item containing the required information to generate affine backgrounds if it has one; bn:: nullopt otherwise. - auto map_index() const -> int
- Index of the map to reference in item.map_item() to generate affine backgrounds.
- auto x() const -> fixed
- Returns the horizontal position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_x(fixed x) -> affine_
bg_ builder& - Sets the horizontal position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
- auto y() const -> fixed
- Returns the vertical position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_y(fixed y) -> affine_
bg_ builder& - Sets the vertical position of the affine 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 affine backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_position(fixed x,
fixed y) -> affine_
bg_ builder& - Sets the position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_position(const fixed_
point& position) -> affine_ bg_ builder& - Sets the position of the affine 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 affine backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_top_left_x(fixed top_left_x) -> affine_
bg_ builder& - Sets the horizontal top-left position of the affine 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 affine backgrounds to generate (relative to their camera, if they are going to have one).
-
auto set_top_left_y(fixed top_left_y) -> affine_
bg_ builder& - Sets the vertical top-left position of the affine 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 affine 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) -> affine_
bg_ builder& - Sets the top-left position of the affine 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) -> affine_ bg_ builder& - Sets the top-left position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
- auto rotation_angle() const -> fixed
- Returns the rotation angle in degrees of the affine backgrounds to generate.
-
auto set_rotation_angle(fixed rotation_angle) -> affine_
bg_ builder& - Sets the rotation angle in degrees of the affine backgrounds to generate.
-
auto set_rotation_angle_safe(fixed rotation_angle) -> affine_
bg_ builder& - Sets the rotation angle in degrees of the affine backgrounds to generate.
- auto horizontal_scale() const -> fixed
- Returns the horizontal scale of the affine backgrounds to generate.
-
auto set_horizontal_scale(fixed horizontal_scale) -> affine_
bg_ builder& - Sets the horizontal scale of the affine backgrounds to generate.
- auto vertical_scale() const -> fixed
- Returns the vertical scale of the affine backgrounds to generate.
-
auto set_vertical_scale(fixed vertical_scale) -> affine_
bg_ builder& - Sets the vertical scale of the affine backgrounds to generate.
-
auto set_scale(fixed scale) -> affine_
bg_ builder& - Sets the scale of the affine backgrounds to generate.
-
auto set_scale(fixed horizontal_scale,
fixed vertical_scale) -> affine_
bg_ builder& - Sets the scale of the affine backgrounds to generate.
- auto horizontal_shear() const -> fixed
- Returns the horizontal shear of the affine backgrounds to generate.
-
auto set_horizontal_shear(fixed horizontal_shear) -> affine_
bg_ builder& - Sets the horizontal shear of the affine backgrounds to generate.
- auto vertical_shear() const -> fixed
- Returns the vertical shear of the affine backgrounds to generate.
-
auto set_vertical_shear(fixed vertical_shear) -> affine_
bg_ builder& - Sets the vertical shear of the affine backgrounds to generate.
-
auto set_shear(fixed shear) -> affine_
bg_ builder& - Sets the shear of the affine backgrounds to generate.
-
auto set_shear(fixed horizontal_shear,
fixed vertical_shear) -> affine_
bg_ builder& - Sets the shear of the affine backgrounds to generate.
- auto horizontal_flip() const -> bool
- Indicates if the affine backgrounds to generate are flipped in the horizontal axis or not.
-
auto set_horizontal_flip(bool horizontal_flip) -> affine_
bg_ builder& - Sets if the affine backgrounds to generate must be flipped in the horizontal axis or not.
- auto vertical_flip() const -> bool
- Indicates if the affine backgrounds to generate are flipped in the vertical axis or not.
-
auto set_vertical_flip(bool vertical_flip) -> affine_
bg_ builder& - Sets if the affine backgrounds to generate must be flipped in the vertical axis or not.
- auto pivot_x() const -> fixed
- Returns the horizontal position of the affine transformations pivot point of the affine backgrounds to generate.
- void set_pivot_x(fixed pivot_x)
- Sets the horizontal position of the affine transformations pivot point of the affine backgrounds to generate.
- auto pivot_y() const -> fixed
- Returns the vertical position of the affine transformations pivot point of the affine backgrounds to generate.
- void set_pivot_y(fixed pivot_y)
- Sets the vertical position of the affine transformations pivot point of the affine backgrounds to generate.
-
auto pivot_position() const -> const fixed_
point& - Returns the position of the affine transformations pivot point of the affine backgrounds to generate.
- void set_pivot_position(fixed pivot_x, fixed pivot_y)
- Sets the position of the affine transformations pivot point of the affine backgrounds to generate.
-
void set_pivot_position(const fixed_
point& pivot_position) - Sets the position of the affine transformations pivot point of the affine backgrounds to generate.
-
auto mat_attributes() const -> const affine_
mat_ attributes& - Returns the attributes of the affine transformation matrix of the affine backgrounds to generate.
-
auto set_affine_mat(const affine_
mat_ attributes& mat_attributes) -> affine_ bg_ builder& - Sets the attributes of the affine transformation matrix of the affine backgrounds to generate.
- auto priority() const -> int
- Returns the priority of the affine backgrounds to generate relative to sprites and other backgrounds.
-
auto set_priority(int priority) -> affine_
bg_ builder& - Sets the priority of the affine backgrounds to generate relative to sprites and other backgrounds.
- auto z_order() const -> int
- Returns the priority of the affine backgrounds to generate relative to other backgrounds, excluding sprites.
-
auto set_z_order(int z_order) -> affine_
bg_ builder& - Sets the priority of the affine backgrounds to generate relative to other backgrounds, excluding sprites.
- auto wrapping_enabled() const -> bool
- Indicates if the affine backgrounds to generate wrap around at the edges or not.
-
auto set_wrapping_enabled(bool wrapping_enabled) -> affine_
bg_ builder& - Sets if the affine backgrounds to generate must wrap around at the edges or not.
- auto mosaic_enabled() const -> bool
- Indicates if the mosaic effect must be applied to the affine backgrounds to generate or not.
-
auto set_mosaic_enabled(bool mosaic_enabled) -> affine_
bg_ builder& - Sets if the mosaic effect must be applied to the affine backgrounds to generate or not.
- auto blending_enabled() const -> bool
- Indicates if blending must be applied to the affine backgrounds to generate or not.
-
auto set_blending_enabled(bool blending_enabled) -> affine_
bg_ builder& - Sets if blending must be applied to the affine backgrounds to generate or not.
- auto blending_top_enabled() const -> bool
- Indicates if the affine backgrounds to generate must be part of the blending top layer or not.
-
auto set_blending_top_enabled(bool blending_top_enabled) -> affine_
bg_ builder& - Sets if the affine backgrounds to generate must be part of the blending top layer or not.
- auto blending_bottom_enabled() const -> bool
- Indicates if the affine backgrounds to generate must be part of the blending bottom layer or not.
-
auto set_blending_bottom_enabled(bool blending_bottom_enabled) -> affine_
bg_ builder& - Sets if the affine backgrounds to generate must be part of the blending bottom layer or not.
- auto visible() const -> bool
- Indicates if the affine backgrounds to generate must be committed to the GBA or not.
-
auto set_visible(bool visible) -> affine_
bg_ builder& - Sets if the affine 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 affine backgrounds to generate (if any). -
auto set_camera(const camera_
ptr& camera) -> affine_ bg_ builder& - Sets the camera_
ptr to attach to the affine backgrounds to generate. -
auto set_camera(camera_
ptr&& camera) -> affine_ bg_ builder& - Sets the camera_
ptr to attach to the affine backgrounds to generate. -
auto set_camera(const optional<camera_
ptr>& camera) -> affine_ bg_ builder& - Sets or removes the camera_
ptr to attach to the affine backgrounds to generate. -
auto set_camera(optional<camera_
ptr>&& camera) -> affine_ bg_ builder& - Sets or removes the camera_
ptr to attach to the affine backgrounds to generate. -
auto remove_camera() -> affine_
bg_ builder& - Removes the camera_
ptr to attach to the affine backgrounds to generate. -
auto release_camera() -> optional<camera_
ptr> - Releases and returns the camera_
ptr to attach to the affine backgrounds to generate (if any). -
auto build() const -> affine_
bg_ ptr - Generates and returns an affine_
bg_ ptr without releasing the acquired resources. -
auto release_build() -> affine_
bg_ ptr - Generates and returns an affine_
bg_ ptr releasing the acquired resources. -
auto build_optional() const -> optional<affine_
bg_ ptr> - Generates and returns an affine_
bg_ ptr without releasing the acquired resources if it could be allocated; bn:: nullopt otherwise. -
auto release_build_optional() -> optional<affine_
bg_ ptr> - Generates and returns an affine_
bg_ ptr releasing the acquired resources if it could be allocated; bn:: nullopt otherwise. -
auto map() const -> affine_
bg_ map_ ptr - Generates and returns an affine_
bg_ map_ ptr without releasing the acquired resources. -
auto map_optional() const -> optional<affine_
bg_ map_ ptr> - Generates and returns an affine_
bg_ map_ ptr without releasing the acquired resources if it could be allocated; bn:: nullopt otherwise. -
auto release_map() -> affine_
bg_ map_ ptr - Generates and returns an affine_
bg_ map_ ptr releasing the acquired resources. -
auto release_map_optional() -> optional<affine_
bg_ map_ ptr> - Generates and returns an affine_
bg_ map_ ptr releasing the acquired resources if it could be allocated; bn:: nullopt otherwise.
Function documentation
bn:: affine_bg_builder:: affine_bg_builder(const affine_ bg_ item& item) explicit
Constructor.
Parameters | |
---|---|
item | affine_ |
bn:: affine_bg_builder:: affine_bg_builder(const affine_ bg_ item& item,
int map_index)
Constructor.
Parameters | |
---|---|
item | affine_ |
map_index | Index of the map to reference in item.map_item() to generate affine backgrounds. |
bn:: affine_bg_builder:: affine_bg_builder(const affine_ bg_ map_ ptr& map) explicit
Constructor.
Parameters | |
---|---|
map | affine_ |
bn:: affine_bg_builder:: affine_bg_builder(affine_ bg_ map_ ptr&& map) explicit
Constructor.
Parameters | |
---|---|
map | affine_ |
affine_ bg_ builder& bn:: affine_bg_builder:: set_x(fixed x)
Sets the horizontal position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
x | Horizontal position of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_y(fixed y)
Sets the vertical position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
y | vertical position of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_position(fixed x,
fixed y)
Sets the position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
x | Horizontal position of the affine backgrounds to generate. |
y | Vertical position of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_position(const fixed_ point& position)
Sets the position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
position | Position of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_top_left_x(fixed top_left_x)
Sets the horizontal top-left position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
top_left_x | Horizontal top-left position of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_top_left_y(fixed top_left_y)
Sets the vertical top-left position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
top_left_y | Vertical top-left position of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_top_left_position(fixed top_left_x,
fixed top_left_y)
Sets the top-left position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
top_left_x | Horizontal top-left position of the affine backgrounds to generate. |
top_left_y | Vertical top-left position of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_top_left_position(const fixed_ point& top_left_position)
Sets the top-left position of the affine backgrounds to generate (relative to their camera, if they are going to have one).
Parameters | |
---|---|
top_left_position | Top-left position of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_rotation_angle(fixed rotation_angle)
Sets the rotation angle in degrees of the affine backgrounds to generate.
Parameters | |
---|---|
rotation_angle | Rotation angle in degrees, in the range [0..360]. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_rotation_angle_safe(fixed rotation_angle)
Sets the rotation angle in degrees of the affine backgrounds to generate.
Parameters | |
---|---|
rotation_angle | Rotation angle in degrees, in any range. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_horizontal_scale(fixed horizontal_scale)
Sets the horizontal scale of the affine backgrounds to generate.
Parameters | |
---|---|
horizontal_scale | Horizontal scale of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_vertical_scale(fixed vertical_scale)
Sets the vertical scale of the affine backgrounds to generate.
Parameters | |
---|---|
vertical_scale | Vertical scale of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_scale(fixed scale)
Sets the scale of the affine backgrounds to generate.
Parameters | |
---|---|
scale | Scale of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_scale(fixed horizontal_scale,
fixed vertical_scale)
Sets the scale of the affine backgrounds to generate.
Parameters | |
---|---|
horizontal_scale | Horizontal scale of the affine backgrounds to generate. |
vertical_scale | Vertical scale of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_horizontal_shear(fixed horizontal_shear)
Sets the horizontal shear of the affine backgrounds to generate.
Parameters | |
---|---|
horizontal_shear | Horizontal shear of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_vertical_shear(fixed vertical_shear)
Sets the vertical shear of the affine backgrounds to generate.
Parameters | |
---|---|
vertical_shear | Vertical shear of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_shear(fixed shear)
Sets the shear of the affine backgrounds to generate.
Parameters | |
---|---|
shear | Shear of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_shear(fixed horizontal_shear,
fixed vertical_shear)
Sets the shear of the affine backgrounds to generate.
Parameters | |
---|---|
horizontal_shear | Horizontal shear of the affine backgrounds to generate. |
vertical_shear | Vertical shear of the affine backgrounds to generate. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_horizontal_flip(bool horizontal_flip)
Sets if the affine backgrounds to generate must be flipped in the horizontal axis or not.
Parameters | |
---|---|
horizontal_flip | true if the affine backgrounds must be flipped in the horizontal axis; false otherwise. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_vertical_flip(bool vertical_flip)
Sets if the affine backgrounds to generate must be flipped in the vertical axis or not.
Parameters | |
---|---|
vertical_flip | true if the affine backgrounds must be flipped in the vertical axis; false otherwise. |
Returns | Reference to this. |
void bn:: affine_bg_builder:: set_pivot_position(fixed pivot_x,
fixed pivot_y)
Sets the position of the affine transformations pivot point of the affine backgrounds to generate.
Parameters | |
---|---|
pivot_x | Horizontal position of the pivot point. |
pivot_y | Vertical position of the pivot point. |
void bn:: affine_bg_builder:: set_pivot_position(const fixed_ point& pivot_position)
Sets the position of the affine transformations pivot point of the affine backgrounds to generate.
Parameters | |
---|---|
pivot_position | Position of the pivot point. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_affine_mat(const affine_ mat_ attributes& mat_attributes)
Sets the attributes of the affine transformation matrix of the affine backgrounds to generate.
Parameters | |
---|---|
mat_attributes | affine_ |
Returns | Reference to this. |
int bn:: affine_bg_builder:: priority() const
Returns the priority of the affine 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).
affine_ bg_ builder& bn:: affine_bg_builder:: set_priority(int priority)
Sets the priority of the affine 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:: affine_bg_builder:: z_order() const
Returns the priority of the affine 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.
affine_ bg_ builder& bn:: affine_bg_builder:: set_z_order(int z_order)
Sets the priority of the affine 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.
affine_ bg_ builder& bn:: affine_bg_builder:: set_wrapping_enabled(bool wrapping_enabled)
Sets if the affine backgrounds to generate must wrap around at the edges or not.
Parameters | |
---|---|
wrapping_enabled | true if they must wrap around at the edges; false otherwise. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_mosaic_enabled(bool mosaic_enabled)
Sets if the mosaic effect must be applied to the affine backgrounds to generate or not.
Parameters | |
---|---|
mosaic_enabled | true if the mosaic effect must be applied; false otherwise. |
Returns | Reference to this. |
bool bn:: affine_bg_builder:: blending_enabled() const
Indicates if blending must be applied to the affine backgrounds to generate or not.
Blending is applied to affine backgrounds by making them part of the blending top layer.
affine_ bg_ builder& bn:: affine_bg_builder:: set_blending_enabled(bool blending_enabled)
Sets if blending must be applied to the affine backgrounds to generate or not.
Parameters | |
---|---|
blending_enabled | true if blending must be applied; false otherwise. |
Returns | Reference to this. |
Blending is applied to affine backgrounds by making them part of the blending top layer.
affine_ bg_ builder& bn:: affine_bg_builder:: set_blending_top_enabled(bool blending_top_enabled)
Sets if the affine 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. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_blending_bottom_enabled(bool blending_bottom_enabled)
Sets if the affine 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. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_visible(bool visible)
Sets if the affine backgrounds to generate must be committed to the GBA or not.
Parameters | |
---|---|
visible | true if the affine backgrounds must be committed to the GBA; false otherwise. |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_camera(const camera_ ptr& camera)
Sets the camera_
Parameters | |
---|---|
camera | camera_ |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_camera(camera_ ptr&& camera)
Sets the camera_
Parameters | |
---|---|
camera | camera_ |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_camera(const optional<camera_ ptr>& camera)
Sets or removes the camera_
Parameters | |
---|---|
camera | Optional camera_ |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: set_camera(optional<camera_ ptr>&& camera)
Sets or removes the camera_
Parameters | |
---|---|
camera | Optional camera_ |
Returns | Reference to this. |
affine_ bg_ builder& bn:: affine_bg_builder:: remove_camera()
Removes the camera_
Returns | Reference to this. |
---|
affine_ bg_ ptr bn:: affine_bg_builder:: release_build()
Generates and returns an affine_
affine_
optional<affine_ bg_ ptr> bn:: affine_bg_builder:: release_build_optional()
Generates and returns an affine_
affine_
affine_ bg_ map_ ptr bn:: affine_bg_builder:: release_map()
Generates and returns an affine_
affine_
optional<affine_ bg_ map_ ptr> bn:: affine_bg_builder:: release_map_optional()
Generates and returns an affine_
affine_