bn::sprite_palette_color_hbe_ptr class

std::shared_ptr like smart pointer that retains shared ownership of a H-Blank effect which changes the color of a sprite color palette 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_palette_ptr palette, int color_index, const span<const color>& colors_ref) -> sprite_palette_color_hbe_ptr
Creates a sprite_palette_color_hbe_ptr which changes the color of a sprite color palette in each screen horizontal line.
static auto create_optional(sprite_palette_ptr palette, int color_index, const span<const color>& colors_ref) -> optional<sprite_palette_color_hbe_ptr>
Creates a sprite_palette_color_hbe_ptr which changes the color of a sprite color palette in each screen horizontal line.

Public functions

auto palette() const -> const sprite_palette_ptr&
Returns the sprite color palette modified by this H-Blank effect.
auto color_index() const -> int
Returns the index of the color of the given sprite color palette to be modified.
auto colors_ref() const -> span<const color>
Returns the referenced array of 160 colors to set to the color of a sprite color palette in each screen horizontal line.
void set_colors_ref(const span<const color>& colors_ref)
Sets the reference to an array of 160 colors to set to the color of a sprite color palette in each screen horizontal line.
void reload_colors_ref()
Rereads the content of the referenced colors to set to the color of a sprite color palette in each screen horizontal line.
void swap(sprite_palette_color_hbe_ptr& other)
Exchanges the contents of this sprite_palette_color_hbe_ptr with those of the other one.

Friends

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

Function documentation

static sprite_palette_color_hbe_ptr bn::sprite_palette_color_hbe_ptr::create(sprite_palette_ptr palette, int color_index, const span<const color>& colors_ref)

Creates a sprite_palette_color_hbe_ptr which changes the color of a sprite color palette in each screen horizontal line.

Parameters
palette Sprite color palette to be modified.
color_index Index of the color of the given sprite color palette to be modified.
colors_ref Reference to an array of 160 colors to set to the color of a sprite color palette in each screen horizontal line.
Returns The requested sprite_palette_color_hbe_ptr.

The colors are not copied but referenced, so they should outlive the sprite_palette_color_hbe_ptr to avoid dangling references.

static optional<sprite_palette_color_hbe_ptr> bn::sprite_palette_color_hbe_ptr::create_optional(sprite_palette_ptr palette, int color_index, const span<const color>& colors_ref)

Creates a sprite_palette_color_hbe_ptr which changes the color of a sprite color palette in each screen horizontal line.

Parameters
palette Sprite color palette to be modified.
color_index Index of the color of the given sprite color palette to be modified.
colors_ref Reference to an array of 160 colors to set to the color of a sprite color palette in each screen horizontal line.
Returns The requested sprite_palette_color_hbe_ptr if it could be allocated; bn::nullopt otherwise.

The colors are not copied but referenced, so they should outlive the sprite_palette_color_hbe_ptr to avoid dangling references.

span<const color> bn::sprite_palette_color_hbe_ptr::colors_ref() const

Returns the referenced array of 160 colors to set to the color of a sprite color palette in each screen horizontal line.

The colors are not copied but referenced, so they should outlive the sprite_palette_color_hbe_ptr to avoid dangling references.

void bn::sprite_palette_color_hbe_ptr::set_colors_ref(const span<const color>& colors_ref)

Sets the reference to an array of 160 colors to set to the color of a sprite color palette in each screen horizontal line.

The colors are not copied but referenced, so they should outlive the sprite_palette_color_hbe_ptr to avoid dangling references.

void bn::sprite_palette_color_hbe_ptr::reload_colors_ref()

Rereads the content of the referenced colors to set to the color of a sprite color palette in each screen horizontal line.

The colors are not copied but referenced, so they should outlive the sprite_palette_color_hbe_ptr to avoid dangling references.

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

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

Parameters
other sprite_palette_color_hbe_ptr to exchange the contents with.

void swap(sprite_palette_color_hbe_ptr& a, sprite_palette_color_hbe_ptr& b)

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

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