From d9212550c4f64cafce0f7da4f329965c8424821e Mon Sep 17 00:00:00 2001 From: Rasmus Anthin Date: Sun, 17 Nov 2024 19:42:03 +0100 Subject: [PATCH] SpriteHandler.h: * Added BitmapSprite functions flip_ud() and flip_lr() which takes no sim_frame arguments and which flips all the frames in the sprite. --- SpriteHandler.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/SpriteHandler.h b/SpriteHandler.h index 8c5c6c1..1edfc4c 100644 --- a/SpriteHandler.h +++ b/SpriteHandler.h @@ -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); @@ -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);