bn::affine_bg_mat_attributes class

Contains the attributes which define the position and the transformation matrix of an affine background.

Constructors, destructors, conversion operators

affine_bg_mat_attributes() defaulted constexpr
Default constructor.
affine_bg_mat_attributes(const fixed_point& position, const fixed_size& half_dimensions, const fixed_point& pivot_position, const affine_mat_attributes& mat_attributes) constexpr
Constructor.

Public functions

auto x() const -> fixed constexpr
Returns the horizontal absolute position of the affine background (ignoring its camera).
void set_x(fixed x) constexpr
Sets the horizontal absolute position of the affine background (ignoring its camera).
auto y() const -> fixed constexpr
Returns the absolute vertical position of the affine background (ignoring its camera).
void set_y(fixed y) constexpr
Sets the absolute vertical position of the affine background (ignoring its camera).
auto position() const -> const fixed_point& constexpr
Returns the absolute position of the affine background (ignoring its camera).
void set_position(fixed x, fixed y) constexpr
Sets the absolute position of the affine background (ignoring its camera).
void set_position(const fixed_point& position) constexpr
Sets the absolute position of the affine background (ignoring its camera).
auto half_dimensions() const -> const fixed_size& constexpr
Returns the half of the affine background size.
void set_half_dimensions(const fixed_size& half_dimensions) constexpr
Sets the half of the affine background size.
auto pivot_x() const -> fixed constexpr
Returns the horizontal position of the affine transformations pivot point.
void set_pivot_x(fixed pivot_x) constexpr
Sets the horizontal position of the affine transformations pivot point.
auto pivot_y() const -> fixed constexpr
Returns the vertical position of the affine transformations pivot point.
void set_pivot_y(fixed pivot_y) constexpr
Sets the vertical position of the affine transformations pivot point.
auto pivot_position() const -> const fixed_point& constexpr
Returns the position of the affine transformations pivot point.
void set_pivot_position(fixed pivot_x, fixed pivot_y) constexpr
Sets the position of the affine transformations pivot point.
void set_pivot_position(const fixed_point& pivot_position) constexpr
Sets the position of the affine transformations pivot point.
auto rotation_angle() const -> fixed constexpr
Returns the rotation angle in degrees.
void set_rotation_angle(fixed rotation_angle) constexpr
Sets the rotation angle in degrees.
auto horizontal_scale() const -> fixed constexpr
Returns the horizontal scale.
void set_horizontal_scale(fixed horizontal_scale) constexpr
Sets the horizontal scale.
auto vertical_scale() const -> fixed constexpr
Returns the vertical scale.
void set_vertical_scale(fixed vertical_scale) constexpr
Sets the vertical scale.
void set_scale(fixed scale) constexpr
Sets the scale.
void set_scale(fixed horizontal_scale, fixed vertical_scale) constexpr
Sets the scale.
auto horizontal_shear() const -> fixed constexpr
Returns the horizontal shear.
void set_horizontal_shear(fixed horizontal_shear) constexpr
Sets the horizontal shear.
auto vertical_shear() const -> fixed constexpr
Returns the vertical shear.
void set_vertical_shear(fixed vertical_shear) constexpr
Sets the vertical shear.
void set_shear(fixed shear) constexpr
Sets the shear.
void set_shear(fixed horizontal_shear, fixed vertical_shear) constexpr
Sets the shear.
auto horizontal_flip() const -> bool constexpr
Indicates if this matrix is flipped in the horizontal axis or not.
void set_horizontal_flip(bool horizontal_flip) constexpr
Sets if this matrix is flipped in the horizontal axis or not.
auto vertical_flip() const -> bool constexpr
Indicates if this matrix is flipped in the vertical axis or not.
void set_vertical_flip(bool vertical_flip) constexpr
Sets if this matrix is flipped in the vertical axis or not.
auto mat_attributes() const -> const affine_mat_attributes& constexpr
Returns the attributes which define the base affine transformation matrix.
void set_mat_attributes(const affine_mat_attributes& mat_attributes) constexpr
Sets the attributes which define the base affine transformation matrix.
auto pa_register_value() const -> int constexpr
Returns the value to commit to the first GBA register of an affine background transformation matrix with these attributes.
auto pb_register_value() const -> int constexpr
Returns the value to commit to the second GBA register of an affine background transformation matrix with these attributes.
auto pc_register_value() const -> int constexpr
Returns the value to commit to the third GBA register of an affine background transformation matrix with these attributes.
auto pd_register_value() const -> int constexpr
Returns the value to commit to the fourth GBA register of an affine background transformation matrix with these attributes.
auto dx_register_value() const -> int constexpr
Returns the value to commit to the fifth GBA register of an affine background transformation matrix with these attributes.
auto dy_register_value() const -> int constexpr
Returns the value to commit to the fifth GBA register of an affine background transformation matrix with these attributes.

Friends

auto operator==(const affine_bg_mat_attributes& a, const affine_bg_mat_attributes& b) -> friend bool constexpr
Equal operator.
auto operator!=(const affine_bg_mat_attributes& a, const affine_bg_mat_attributes& b) -> friend bool constexpr
Not equal operator.

Function documentation

bn::affine_bg_mat_attributes::affine_bg_mat_attributes(const fixed_point& position, const fixed_size& half_dimensions, const fixed_point& pivot_position, const affine_mat_attributes& mat_attributes) constexpr

Constructor.

Parameters
position Affine background absolute position (ignoring its camera).
half_dimensions Half of the affine background size.
pivot_position Position of the affine transformations pivot point.
mat_attributes Attributes which define the base affine transformation matrix.

void bn::affine_bg_mat_attributes::set_position(fixed x, fixed y) constexpr

Sets the absolute position of the affine background (ignoring its camera).

Parameters
x Horizontal absolute position of the affine background.
y Vertical absolute position of the affine background.

void bn::affine_bg_mat_attributes::set_position(const fixed_point& position) constexpr

Sets the absolute position of the affine background (ignoring its camera).

Parameters
position Absolute position of the affine background.

void bn::affine_bg_mat_attributes::set_pivot_position(fixed pivot_x, fixed pivot_y) constexpr

Sets the position of the affine transformations pivot point.

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

void bn::affine_bg_mat_attributes::set_pivot_position(const fixed_point& pivot_position) constexpr

Sets the position of the affine transformations pivot point.

Parameters
pivot_position Position of the pivot point.

void bn::affine_bg_mat_attributes::set_rotation_angle(fixed rotation_angle) constexpr

Sets the rotation angle in degrees.

Parameters
rotation_angle Rotation angle in degrees, in the range [0..360].

void bn::affine_bg_mat_attributes::set_scale(fixed horizontal_scale, fixed vertical_scale) constexpr

Sets the scale.

Parameters
horizontal_scale Horizontal scale.
vertical_scale Vertical scale.

void bn::affine_bg_mat_attributes::set_shear(fixed horizontal_shear, fixed vertical_shear) constexpr

Sets the shear.

Parameters
horizontal_shear Horizontal shear.
vertical_shear Vertical shear.

friend bool operator==(const affine_bg_mat_attributes& a, const affine_bg_mat_attributes& b) constexpr

Equal operator.

Parameters
a First affine_bg_mat_attributes to compare.
b Second affine_bg_mat_attributes to compare.
Returns true if the first affine_bg_mat_attributes is equal to the second one, otherwise false.

friend bool operator!=(const affine_bg_mat_attributes& a, const affine_bg_mat_attributes& b) constexpr

Not equal operator.

Parameters
a First affine_bg_mat_attributes to compare.
b Second affine_bg_mat_attributes to compare.
Returns true if the first affine_bg_mat_attributes is not equal to the second one, otherwise false.