bn::sprite_third_attributes class

Manages the attributes to commit to the third GBA register of a sprite.

Constructors, destructors, conversion operators

sprite_third_attributes(sprite_tiles_ptr tiles, sprite_palette_ptr palette, int bg_priority)
Constructor.

Public functions

auto tiles() const -> const sprite_tiles_ptr&
Returns the smart pointer to a sprite tile set.
void set_tiles(const sprite_tiles_ptr& tiles)
Sets the smart pointer to a sprite tile set.
void set_tiles(sprite_tiles_ptr&& tiles)
Sets the smart pointer to a sprite tile set.
auto palette() const -> const sprite_palette_ptr&
Returns the smart pointer to a sprite color palette.
void set_palette(const sprite_palette_ptr& palette)
Sets the smart pointer to a sprite color palette.
void set_palette(sprite_palette_ptr&& palette)
Sets the smart pointer to a sprite color palette.
auto bg_priority() const -> int
Returns the priority relative to backgrounds.
void set_bg_priority(int bg_priority)
Sets the priority relative to backgrounds.

Friends

auto operator==(const sprite_third_attributes& a, const sprite_third_attributes& b) -> bool defaulted
Default equal operator.

Function documentation

bn::sprite_third_attributes::sprite_third_attributes(sprite_tiles_ptr tiles, sprite_palette_ptr palette, int bg_priority)

Constructor.

Parameters
tiles Smart pointer to a sprite tile set.
palette Smart pointer to a sprite color palette.
bg_priority Drawing priority relative to backgrounds in the range [0..3].

Sprites with higher priority are drawn first (and therefore can be covered by later sprites and backgrounds). Sprites cover backgrounds of the same priority.

void bn::sprite_third_attributes::set_tiles(const sprite_tiles_ptr& tiles)

Sets the smart pointer to a sprite tile set.

Parameters
tiles Smart pointer to copy.

void bn::sprite_third_attributes::set_tiles(sprite_tiles_ptr&& tiles)

Sets the smart pointer to a sprite tile set.

Parameters
tiles Smart pointer to move.

void bn::sprite_third_attributes::set_palette(const sprite_palette_ptr& palette)

Sets the smart pointer to a sprite color palette.

Parameters
palette Smart pointer to copy.

void bn::sprite_third_attributes::set_palette(sprite_palette_ptr&& palette)

Sets the smart pointer to a sprite color palette.

Parameters
palette Smart pointer to move.

int bn::sprite_third_attributes::bg_priority() const

Returns the priority relative to backgrounds.

Sprites with higher priority are drawn first (and therefore can be covered by later sprites and backgrounds). Sprites cover backgrounds of the same priority.

void bn::sprite_third_attributes::set_bg_priority(int bg_priority)

Sets the priority relative to backgrounds.

Parameters
bg_priority Priority relative to backgrounds in the range [0..3].

Sprites with higher priority are drawn first (and therefore can be covered by later sprites and backgrounds). Sprites cover backgrounds of the same priority.