bn::sprite_affine_second_attributes_hbe_ptr class

std::shared_ptr like smart pointer that retains shared ownership of a H-Blank effect which changes the attributes to commit to the second GBA register of an affine sprite (with an attached sprite_affine_mat_ptr) in each screen horizontal line.

Base classes

class hbe_ptr
std::shared_ptr like smart pointer that retains shared ownership of a H-Blank effect.

Public static functions

static auto create(sprite_ptr sprite, const span<const sprite_affine_second_attributes>& attributes_ref) -> sprite_affine_second_attributes_hbe_ptr
Creates a sprite_affine_second_attributes_hbe_ptr which changes the attributes to commit to the second GBA register of an affine sprite in each screen horizontal line.
static auto create_optional(sprite_ptr sprite, const span<const sprite_affine_second_attributes>& attributes_ref) -> optional<sprite_affine_second_attributes_hbe_ptr>
Creates a sprite_affine_second_attributes_hbe_ptr which changes the attributes to commit to the second GBA register of an affine sprite in each screen horizontal line.

Public functions

auto sprite() const -> const sprite_ptr&
Returns the affine sprite modified by this H-Blank effect.
auto attributes_ref() const -> span<const sprite_affine_second_attributes>
Returns the referenced array of 160 sprite_affine_second_attributes objects with the attributes to commit to the second GBA register of the given affine sprite in each screen horizontal line.
void set_attributes_ref(const span<const sprite_affine_second_attributes>& attributes_ref)
Sets the reference to an array of 160 sprite_affine_second_attributes objects with the attributes to commit to the second GBA register of the given affine sprite in each screen horizontal line.
void reload_attributes_ref()
Rereads the content of the referenced attributes to commit to the second GBA register of the given affine sprite in each screen horizontal line.
void swap(sprite_affine_second_attributes_hbe_ptr& other)
Exchanges the contents of this sprite_affine_second_attributes_hbe_ptr with those of the other one.

Friends

void swap(sprite_affine_second_attributes_hbe_ptr& a, sprite_affine_second_attributes_hbe_ptr& b)
Exchanges the contents of a sprite_affine_second_attributes_hbe_ptr with those of another one.

Function documentation

static sprite_affine_second_attributes_hbe_ptr bn::sprite_affine_second_attributes_hbe_ptr::create(sprite_ptr sprite, const span<const sprite_affine_second_attributes>& attributes_ref)

Creates a sprite_affine_second_attributes_hbe_ptr which changes the attributes to commit to the second GBA register of an affine sprite in each screen horizontal line.

Parameters
sprite Affine sprite (with an attached sprite_affine_mat_ptr) to be modified.
attributes_ref Reference to an array of 160 sprite_affine_second_attributes objects with the attributes to commit to the second GBA register of the given affine sprite in each screen horizontal line.
Returns The requested sprite_affine_second_attributes_hbe_ptr.

The horizontal position of the attributes are added as a delta to the horizontal position of the sprite. In other words, they are relative instead of absolute.

The attributes are not copied but referenced, so they should outlive sprite_affine_second_attributes_hbe_ptr to avoid dangling references.

static optional<sprite_affine_second_attributes_hbe_ptr> bn::sprite_affine_second_attributes_hbe_ptr::create_optional(sprite_ptr sprite, const span<const sprite_affine_second_attributes>& attributes_ref)

Creates a sprite_affine_second_attributes_hbe_ptr which changes the attributes to commit to the second GBA register of an affine sprite in each screen horizontal line.

Parameters
sprite Affine sprite (with an attached sprite_affine_mat_ptr) to be modified.
attributes_ref Reference to an array of 160 sprite_affine_second_attributes objects with the attributes to commit to the second GBA register of the given affine sprite in each screen horizontal line.
Returns The requested sprite_affine_second_attributes_hbe_ptr if it could be allocated; bn::nullopt otherwise.

The horizontal position of the attributes are added as a delta to the horizontal position of the sprite. In other words, they are relative instead of absolute.

The attributes are not copied but referenced, so they should outlive sprite_affine_second_attributes_hbe_ptr to avoid dangling references.

span<const sprite_affine_second_attributes> bn::sprite_affine_second_attributes_hbe_ptr::attributes_ref() const

Returns the referenced array of 160 sprite_affine_second_attributes objects with the attributes to commit to the second GBA register of the given affine sprite in each screen horizontal line.

The horizontal position of the attributes are added as a delta to the horizontal position of the sprite. In other words, they are relative instead of absolute.

The attributes are not copied but referenced, so they should outlive sprite_affine_second_attributes_hbe_ptr to avoid dangling references.

void bn::sprite_affine_second_attributes_hbe_ptr::set_attributes_ref(const span<const sprite_affine_second_attributes>& attributes_ref)

Sets the reference to an array of 160 sprite_affine_second_attributes objects with the attributes to commit to the second GBA register of the given affine sprite in each screen horizontal line.

The horizontal position of the attributes are added as a delta to the horizontal position of the sprite. In other words, they are relative instead of absolute.

The attributes are not copied but referenced, so they should outlive sprite_affine_second_attributes_hbe_ptr to avoid dangling references.

void bn::sprite_affine_second_attributes_hbe_ptr::reload_attributes_ref()

Rereads the content of the referenced attributes to commit to the second GBA register of the given affine sprite in each screen horizontal line.

The horizontal position of the attributes are added as a delta to the horizontal position of the sprite. In other words, they are relative instead of absolute.

The attributes are not copied but referenced, so they should outlive sprite_affine_second_attributes_hbe_ptr to avoid dangling references.

void bn::sprite_affine_second_attributes_hbe_ptr::swap(sprite_affine_second_attributes_hbe_ptr& other)

Exchanges the contents of this sprite_affine_second_attributes_hbe_ptr with those of the other one.

Parameters
other sprite_affine_second_attributes_hbe_ptr to exchange the contents with.

void swap(sprite_affine_second_attributes_hbe_ptr& a, sprite_affine_second_attributes_hbe_ptr& b)

Exchanges the contents of a sprite_affine_second_attributes_hbe_ptr with those of another one.

Parameters
a First sprite_affine_second_attributes_hbe_ptr to exchange the contents with.
b Second sprite_affine_second_attributes_hbe_ptr to exchange the contents with.