aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Animator.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-22 20:04:33 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-22 20:04:33 +0100
commita600cc55468a6513743ce916aa3da129270c23f0 (patch)
tree324eb574298b321dcfba69a5a29c59b0cc18f007 /src/crepe/api/Animator.cpp
parent73dea702bdedf48a2d2d26e7922b5ee935063cfd (diff)
more WIP zapper
Diffstat (limited to 'src/crepe/api/Animator.cpp')
-rw-r--r--src/crepe/api/Animator.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/crepe/api/Animator.cpp b/src/crepe/api/Animator.cpp
index c558d86..5ac0617 100644
--- a/src/crepe/api/Animator.cpp
+++ b/src/crepe/api/Animator.cpp
@@ -36,24 +36,12 @@ void Animator::pause() { this->active = false; }
void Animator::stop() {
this->active = false;
- this->data.col = 0;
- this->data.row = 0;
+ this->data.frame = this->data.cycle_start;
}
void Animator::set_fps(int fps) { this->data.fps = fps; }
void Animator::set_cycle_range(int start, int end) {
- this->data.cycle_start = start, this->data.cycle_end = end;
+ this->data.cycle_start = start;
+ this->data.cycle_end = end;
}
-void Animator::set_anim(int col) {
- Animator::Data & ctx = this->data;
- this->spritesheet.mask.x = ctx.row = 0;
- ctx.col = col;
- this->spritesheet.mask.y = ctx.col * this->spritesheet.mask.h;
-}
-
-void Animator::next_anim() {
- Animator::Data & ctx = this->data;
- ctx.row = ++ctx.row % this->grid_size.x;
- this->spritesheet.mask.x = ctx.row * this->spritesheet.mask.w;
-}