Skip to content

Commit

Permalink
SpriteHandler.h:
Browse files Browse the repository at this point in the history
* Added BitmapSprite functions flip_ud() and flip_lr() which takes no sim_frame arguments and which flips all the frames in the sprite.
  • Loading branch information
razterizer committed Nov 17, 2024
1 parent 0ff5fed commit d921255
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions SpriteHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,13 @@ class BitmapSprite : public Sprite
}
}

void flip_ud()
{
auto num_frames = stlutils::sizeI(texture_frames);
for (int anim_frame = 0; anim_frame < num_frames; ++anim_frame)
flip_ud(anim_frame);
}

void flip_lr(int anim_frame)
{
auto* texture = fetch_frame(anim_frame);
Expand All @@ -456,6 +463,13 @@ class BitmapSprite : public Sprite
}
}

void flip_lr()
{
auto num_frames = stlutils::sizeI(texture_frames);
for (int anim_frame = 0; anim_frame < num_frames; ++anim_frame)
flip_lr(anim_frame);
}

drawing::Texture* get_curr_frame(int sim_frame) const
{
int frame_id = func_calc_anim_frame(sim_frame);
Expand Down

0 comments on commit d921255

Please sign in to comment.