Skip to content

Commit

Permalink
SpriteHandler.h:
Browse files Browse the repository at this point in the history
* Adding more sprite attributes fill-function overloads.
  • Loading branch information
razterizer committed Dec 3, 2024
1 parent df755c6 commit 7040733
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions SpriteHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ class BitmapSprite : public Sprite
texture->fg_colors.assign(area, fg_color);
}

void fill_sprite_fg_colors(int anim_frame, const ttl::Rectangle& bb, Color fg_color)
{
auto* texture = fetch_frame(anim_frame);
fill_sprite_data(texture->fg_colors, bb, fg_color);
}

void fill_sprite_fg_colors_vert(int anim_frame, int r0, int r1, int c, Color fg_color)
{
auto* texture = fetch_frame(anim_frame);
Expand Down Expand Up @@ -362,6 +368,12 @@ class BitmapSprite : public Sprite
texture->bg_colors.assign(area, bg_color);
}

void fill_sprite_bg_colors(int anim_frame, const ttl::Rectangle& bb, Color bg_color)
{
auto* texture = fetch_frame(anim_frame);
fill_sprite_data(texture->bg_colors, bb, bg_color);
}

void fill_sprite_bg_colors_vert(int anim_frame, int r0, int r1, int c, Color bg_color)
{
auto* texture = fetch_frame(anim_frame);
Expand Down Expand Up @@ -405,6 +417,12 @@ class BitmapSprite : public Sprite
texture->materials.assign(area, mat);
}

void fill_sprite_materials(int anim_frame, const ttl::Rectangle& bb, int mat)
{
auto* texture = fetch_frame(anim_frame);
fill_sprite_data(texture->materials, bb, mat);
}

void fill_sprite_materials_vert(int anim_frame, int r0, int r1, int c, int mat)
{
auto* texture = fetch_frame(anim_frame);
Expand Down

0 comments on commit 7040733

Please sign in to comment.