diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/crepe/api/Animator.h | 1 | ||||
-rw-r--r-- | src/crepe/facade/SDLContext.cpp | 3 | ||||
-rw-r--r-- | src/crepe/system/AnimatorSystem.cpp | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/crepe/api/Animator.h b/src/crepe/api/Animator.h index 36bc9f4..74abd5e 100644 --- a/src/crepe/api/Animator.h +++ b/src/crepe/api/Animator.h @@ -45,7 +45,6 @@ public: //! end frame for cycling (-1 --> use last frame) int cycle_end = -1; - //! offset in pixels. // TODO implement int offset_x = 0; diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index 32461f2..391aa78 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -179,7 +179,8 @@ void SDLContext::set_camera(const Camera & cam, CameraValues & ctx) { float adj_width = zoomed_viewport.x * scale; float bar_width = (cam_data.screen.x - adj_width) / 2; this->black_bars[0] = {0, 0, bar_width, (float) cam_data.screen.y}; - this->black_bars[1] = {(cam_data.screen.x - bar_width), 0, bar_width, (float) cam_data.screen.y}; + this->black_bars[1] + = {(cam_data.screen.x - bar_width), 0, bar_width, (float) cam_data.screen.y}; bar_size = {bar_width, 0}; render_scale.x = render_scale.y = scale; diff --git a/src/crepe/system/AnimatorSystem.cpp b/src/crepe/system/AnimatorSystem.cpp index ff8d2ce..9cf8ba5 100644 --- a/src/crepe/system/AnimatorSystem.cpp +++ b/src/crepe/system/AnimatorSystem.cpp @@ -16,7 +16,7 @@ void AnimatorSystem::update() { for (Animator & a : animations) { if (!a.active) continue; - + Animator::Data & ctx = a.data; double frame_duration = 1.0f / ctx.fps; @@ -28,7 +28,7 @@ void AnimatorSystem::update() { ctx.curr_row = ctx.cycle_start + curr_frame; ctx.spritesheet.mask.x = ctx.curr_row * ctx.spritesheet.mask.w; ctx.spritesheet.mask.y = (ctx.curr_col * ctx.spritesheet.mask.h); - + if (!ctx.looping && curr_frame == total_frames - 1) { a.active = false; } |