bn::dp_direct_bitmap_bg_builder class

Creates dp_direct_bitmap_bg_ptr objects with custom attributes.

Public functions

auto x() const -> fixed
Returns the horizontal position of the backgrounds to generate (relative to their camera, if they are going to have one).
auto set_x(fixed x) -> dp_direct_bitmap_bg_builder&
Sets the horizontal position of the backgrounds to generate (relative to their camera, if they are going to have one).
auto y() const -> fixed
Returns the vertical position of the backgrounds to generate (relative to their camera, if they are going to have one).
auto set_y(fixed y) -> dp_direct_bitmap_bg_builder&
Sets the vertical position of the 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 backgrounds to generate (relative to their camera, if they are going to have one).
auto set_position(fixed x, fixed y) -> dp_direct_bitmap_bg_builder&
Sets the position of the backgrounds to generate (relative to their camera, if they are going to have one).
auto set_position(const fixed_point& position) -> dp_direct_bitmap_bg_builder&
Sets the position of the 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 backgrounds to generate (relative to their camera, if they are going to have one).
auto set_top_left_x(fixed top_left_x) -> dp_direct_bitmap_bg_builder&
Sets the horizontal top-left position of the 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 backgrounds to generate (relative to their camera, if they are going to have one).
auto set_top_left_y(fixed top_left_y) -> dp_direct_bitmap_bg_builder&
Sets the vertical top-left position of the 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 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) -> dp_direct_bitmap_bg_builder&
Sets the top-left position of the 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) -> dp_direct_bitmap_bg_builder&
Sets the top-left position of the 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 backgrounds to generate.
auto set_rotation_angle(fixed rotation_angle) -> dp_direct_bitmap_bg_builder&
Sets the rotation angle in degrees of the backgrounds to generate.
auto set_rotation_angle_safe(fixed rotation_angle) -> dp_direct_bitmap_bg_builder&
Sets the rotation angle in degrees of the backgrounds to generate.
auto horizontal_scale() const -> fixed
Returns the horizontal scale of the backgrounds to generate.
auto set_horizontal_scale(fixed horizontal_scale) -> dp_direct_bitmap_bg_builder&
Sets the horizontal scale of the backgrounds to generate.
auto vertical_scale() const -> fixed
Returns the vertical scale of the backgrounds to generate.
auto set_vertical_scale(fixed vertical_scale) -> dp_direct_bitmap_bg_builder&
Sets the vertical scale of the backgrounds to generate.
auto set_scale(fixed scale) -> dp_direct_bitmap_bg_builder&
Sets the scale of the backgrounds to generate.
auto set_scale(fixed horizontal_scale, fixed vertical_scale) -> dp_direct_bitmap_bg_builder&
Sets the scale of the backgrounds to generate.
auto expand() -> dp_direct_bitmap_bg_builder&
Sets the scale of the backgrounds to generate to fill the screen.
auto horizontal_shear() const -> fixed
Returns the horizontal shear of the backgrounds to generate.
auto set_horizontal_shear(fixed horizontal_shear) -> dp_direct_bitmap_bg_builder&
Sets the horizontal shear of the backgrounds to generate.
auto vertical_shear() const -> fixed
Returns the vertical shear of the backgrounds to generate.
auto set_vertical_shear(fixed vertical_shear) -> dp_direct_bitmap_bg_builder&
Sets the vertical shear of the backgrounds to generate.
auto set_shear(fixed shear) -> dp_direct_bitmap_bg_builder&
Sets the shear of the backgrounds to generate.
auto set_shear(fixed horizontal_shear, fixed vertical_shear) -> dp_direct_bitmap_bg_builder&
Sets the shear of the backgrounds to generate.
auto horizontal_flip() const -> bool
Indicates if the backgrounds to generate are flipped in the horizontal axis or not.
auto set_horizontal_flip(bool horizontal_flip) -> dp_direct_bitmap_bg_builder&
Sets if the backgrounds to generate must be flipped in the horizontal axis or not.
auto vertical_flip() const -> bool
Indicates if the backgrounds to generate are flipped in the vertical axis or not.
auto set_vertical_flip(bool vertical_flip) -> dp_direct_bitmap_bg_builder&
Sets if the 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 backgrounds to generate.
void set_pivot_x(fixed pivot_x)
Sets the horizontal position of the affine transformations pivot point of the backgrounds to generate.
auto pivot_y() const -> fixed
Returns the vertical position of the affine transformations pivot point of the backgrounds to generate.
void set_pivot_y(fixed pivot_y)
Sets the vertical position of the affine transformations pivot point of the backgrounds to generate.
auto pivot_position() const -> const fixed_point&
Returns the position of the affine transformations pivot point of the backgrounds to generate.
void set_pivot_position(fixed pivot_x, fixed pivot_y)
Sets the position of the affine transformations pivot point of the backgrounds to generate.
void set_pivot_position(const fixed_point& pivot_position)
Sets the position of the affine transformations pivot point of the backgrounds to generate.
auto mat_attributes() const -> const affine_mat_attributes&
Returns the attributes of the affine transformation matrix of the backgrounds to generate.
auto set_affine_mat(const affine_mat_attributes& mat_attributes) -> dp_direct_bitmap_bg_builder&
Sets the attributes of the affine transformation matrix of the backgrounds to generate.
auto priority() const -> int
Returns the priority of the backgrounds to generate relative to sprites and other backgrounds.
auto set_priority(int priority) -> dp_direct_bitmap_bg_builder&
Sets the priority of the backgrounds to generate relative to sprites and other backgrounds.
auto mosaic_enabled() const -> bool
Indicates if the mosaic effect must be applied to the backgrounds to generate or not.
auto set_mosaic_enabled(bool mosaic_enabled) -> dp_direct_bitmap_bg_builder&
Sets if the mosaic effect must be applied to the backgrounds to generate or not.
auto blending_enabled() const -> bool
Indicates if blending must be applied to the backgrounds to generate or not.
auto set_blending_enabled(bool blending_enabled) -> dp_direct_bitmap_bg_builder&
Sets if blending must be applied to the backgrounds to generate or not.
auto blending_top_enabled() const -> bool
Indicates if the backgrounds to generate must be part of the blending top layer or not.
auto set_blending_top_enabled(bool blending_top_enabled) -> dp_direct_bitmap_bg_builder&
Sets if the backgrounds to generate must be part of the blending top layer or not.
auto blending_bottom_enabled() const -> bool
Indicates if the backgrounds to generate must be part of the blending bottom layer or not.
auto set_blending_bottom_enabled(bool blending_bottom_enabled) -> dp_direct_bitmap_bg_builder&
Sets if the 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 backgrounds to generate must be displayed when green swap is enabled.
auto set_green_swap_mode(bn::green_swap_mode green_swap_mode) -> dp_direct_bitmap_bg_builder&
Sets how the backgrounds to generate must be displayed when green swap is enabled.
auto visible() const -> bool
Indicates if the backgrounds to generate must be committed to the GBA or not.
auto set_visible(bool visible) -> dp_direct_bitmap_bg_builder&
Sets if the 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 backgrounds to generate (if any).
auto set_camera(const camera_ptr& camera) -> dp_direct_bitmap_bg_builder&
Sets the camera_ptr to attach to the backgrounds to generate.
auto set_camera(camera_ptr&& camera) -> dp_direct_bitmap_bg_builder&
Sets the camera_ptr to attach to the backgrounds to generate.
auto set_camera(const optional<camera_ptr>& camera) -> dp_direct_bitmap_bg_builder&
Sets or removes the camera_ptr to attach to the backgrounds to generate.
auto set_camera(optional<camera_ptr>&& camera) -> dp_direct_bitmap_bg_builder&
Sets or removes the camera_ptr to attach to the backgrounds to generate.
auto remove_camera() -> dp_direct_bitmap_bg_builder&
Removes the camera_ptr to attach to the backgrounds to generate.
auto release_camera() -> optional<camera_ptr>
Releases and returns the camera_ptr to attach to the backgrounds to generate (if any).
auto build() const -> dp_direct_bitmap_bg_ptr
Generates and returns a dp_direct_bitmap_bg_ptr without releasing the acquired resources.
auto release_build() -> dp_direct_bitmap_bg_ptr
Generates and returns a dp_direct_bitmap_bg_ptr releasing the acquired resources.
auto build_optional() const -> optional<dp_direct_bitmap_bg_ptr>
Generates and returns a dp_direct_bitmap_bg_ptr without releasing the acquired resources if it could be allocated; bn::nullopt otherwise.
auto release_build_optional() -> optional<dp_direct_bitmap_bg_ptr>
Generates and returns a dp_direct_bitmap_bg_ptr releasing the acquired resources if it could be allocated; bn::nullopt otherwise.

Function documentation

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_x(fixed x)

Sets the horizontal position of the backgrounds to generate (relative to their camera, if they are going to have one).

Parameters
x Horizontal position of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_y(fixed y)

Sets the vertical position of the backgrounds to generate (relative to their camera, if they are going to have one).

Parameters
y vertical position of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_position(fixed x, fixed y)

Sets the position of the backgrounds to generate (relative to their camera, if they are going to have one).

Parameters
x Horizontal position of the backgrounds to generate.
y Vertical position of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_position(const fixed_point& position)

Sets the position of the backgrounds to generate (relative to their camera, if they are going to have one).

Parameters
position Position of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_top_left_x(fixed top_left_x)

Sets the horizontal top-left position of the backgrounds to generate (relative to their camera, if they are going to have one).

Parameters
top_left_x Horizontal top-left position of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_top_left_y(fixed top_left_y)

Sets the vertical top-left position of the backgrounds to generate (relative to their camera, if they are going to have one).

Parameters
top_left_y Vertical top-left position of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_top_left_position(fixed top_left_x, fixed top_left_y)

Sets the top-left position of the backgrounds to generate (relative to their camera, if they are going to have one).

Parameters
top_left_x Horizontal top-left position of the backgrounds to generate.
top_left_y Vertical top-left position of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_top_left_position(const fixed_point& top_left_position)

Sets the top-left position of the backgrounds to generate (relative to their camera, if they are going to have one).

Parameters
top_left_position Top-left position of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_rotation_angle(fixed rotation_angle)

Sets the rotation angle in degrees of the backgrounds to generate.

Parameters
rotation_angle Rotation angle in degrees, in the range [0..360].
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_rotation_angle_safe(fixed rotation_angle)

Sets the rotation angle in degrees of the backgrounds to generate.

Parameters
rotation_angle Rotation angle in degrees, in any range.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_horizontal_scale(fixed horizontal_scale)

Sets the horizontal scale of the backgrounds to generate.

Parameters
horizontal_scale Horizontal scale of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_vertical_scale(fixed vertical_scale)

Sets the vertical scale of the backgrounds to generate.

Parameters
vertical_scale Vertical scale of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_scale(fixed scale)

Sets the scale of the backgrounds to generate.

Parameters
scale Scale of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_scale(fixed horizontal_scale, fixed vertical_scale)

Sets the scale of the backgrounds to generate.

Parameters
horizontal_scale Horizontal scale of the backgrounds to generate.
vertical_scale Vertical scale of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::expand()

Sets the scale of the backgrounds to generate to fill the screen.

Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_horizontal_shear(fixed horizontal_shear)

Sets the horizontal shear of the backgrounds to generate.

Parameters
horizontal_shear Horizontal shear of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_vertical_shear(fixed vertical_shear)

Sets the vertical shear of the backgrounds to generate.

Parameters
vertical_shear Vertical shear of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_shear(fixed shear)

Sets the shear of the backgrounds to generate.

Parameters
shear Shear of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_shear(fixed horizontal_shear, fixed vertical_shear)

Sets the shear of the backgrounds to generate.

Parameters
horizontal_shear Horizontal shear of the backgrounds to generate.
vertical_shear Vertical shear of the backgrounds to generate.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_horizontal_flip(bool horizontal_flip)

Sets if the backgrounds to generate must be flipped in the horizontal axis or not.

Parameters
horizontal_flip true if the backgrounds must be flipped in the horizontal axis; false otherwise.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_vertical_flip(bool vertical_flip)

Sets if the backgrounds to generate must be flipped in the vertical axis or not.

Parameters
vertical_flip true if the backgrounds must be flipped in the vertical axis; false otherwise.
Returns Reference to this.

void bn::dp_direct_bitmap_bg_builder::set_pivot_position(fixed pivot_x, fixed pivot_y)

Sets the position of the affine transformations pivot point of the backgrounds to generate.

Parameters
pivot_x Horizontal position of the pivot point.
pivot_y Vertical position of the pivot point.

void bn::dp_direct_bitmap_bg_builder::set_pivot_position(const fixed_point& pivot_position)

Sets the position of the affine transformations pivot point of the backgrounds to generate.

Parameters
pivot_position Position of the pivot point.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_affine_mat(const affine_mat_attributes& mat_attributes)

Sets the attributes of the affine transformation matrix of the backgrounds to generate.

Parameters
mat_attributes affine_mat_attributes of the backgrounds to generate.
Returns Reference to this.

int bn::dp_direct_bitmap_bg_builder::priority() const

Returns the priority of the 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).

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_priority(int priority)

Sets the priority of the 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).

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_mosaic_enabled(bool mosaic_enabled)

Sets if the mosaic effect must be applied to the backgrounds to generate or not.

Parameters
mosaic_enabled true if the mosaic effect must be applied; false otherwise.
Returns Reference to this.

bool bn::dp_direct_bitmap_bg_builder::blending_enabled() const

Indicates if blending must be applied to the backgrounds to generate or not.

Blending is applied to backgrounds by making them part of the blending top layer.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_blending_enabled(bool blending_enabled)

Sets if blending must be applied to the backgrounds to generate or not.

Parameters
blending_enabled true if blending must be applied; false otherwise.
Returns Reference to this.

Blending is applied to backgrounds by making them part of the blending top layer.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_blending_top_enabled(bool blending_top_enabled)

Sets if the 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.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_blending_bottom_enabled(bool blending_bottom_enabled)

Sets if the 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.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_green_swap_mode(bn::green_swap_mode green_swap_mode)

Sets how the backgrounds to generate must be displayed when green swap is enabled.

Parameters
green_swap_mode Green swap mode.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_visible(bool visible)

Sets if the backgrounds to generate must be committed to the GBA or not.

Parameters
visible true if the backgrounds must be committed to the GBA; false otherwise.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_camera(const camera_ptr& camera)

Sets the camera_ptr to attach to the backgrounds to generate.

Parameters
camera camera_ptr to copy to the builder.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_camera(camera_ptr&& camera)

Sets the camera_ptr to attach to the backgrounds to generate.

Parameters
camera camera_ptr to move to the builder.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_camera(const optional<camera_ptr>& camera)

Sets or removes the camera_ptr to attach to the backgrounds to generate.

Parameters
camera Optional camera_ptr to copy to the builder.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::set_camera(optional<camera_ptr>&& camera)

Sets or removes the camera_ptr to attach to the backgrounds to generate.

Parameters
camera Optional camera_ptr to move to the builder.
Returns Reference to this.

dp_direct_bitmap_bg_builder& bn::dp_direct_bitmap_bg_builder::remove_camera()

Removes the camera_ptr to attach to the backgrounds to generate.

Returns Reference to this.

dp_direct_bitmap_bg_ptr bn::dp_direct_bitmap_bg_builder::release_build()

Generates and returns a dp_direct_bitmap_bg_ptr releasing the acquired resources.

dp_direct_bitmap_bg_ptr generation after calling this method may stop working.

optional<dp_direct_bitmap_bg_ptr> bn::dp_direct_bitmap_bg_builder::release_build_optional()

Generates and returns a dp_direct_bitmap_bg_ptr releasing the acquired resources if it could be allocated; bn::nullopt otherwise.

dp_direct_bitmap_bg_ptr generation after calling this method may stop working.