Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RandyGaul committed Dec 18, 2024
2 parents 4a50b34 + 6665a47 commit 6edff22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions include/cute_sprite.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,20 +534,16 @@ CF_INLINE void cf_sprite_update(CF_Sprite* sprite)
if (sprite->frame_index < 0) {
if (sprite->loop) {
sprite->loop_count++;
sprite->frame_index = frame_count - 1;
} else {
sprite->frame_index++;
} else {
sprite->frame_index = 0;
}
}
} else {
sprite->frame_index++;
if (sprite->frame_index == frame_count) {
if (sprite->loop) {
sprite->loop_count++;
sprite->frame_index = 0;
} else {
sprite->frame_index--;
}
sprite->loop_count++;
sprite->frame_index--;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cute_graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,8 +1228,8 @@ void cf_destroy_shader(CF_Shader shader_handle)
// if it exists. See `cf_make_draw_shader`.
CF_Shader* blit = (CF_Shader*)draw->draw_shd_to_blit_shd.try_get(shader_handle.id);
if (blit) {
draw->draw_shd_to_blit_shd.remove(shader_handle.id);
cf_destroy_shader(*blit);
draw->draw_shd_to_blit_shd.remove(shader_handle.id);
}

CF_ShaderInternal* shd = (CF_ShaderInternal*)shader_handle.id;
Expand Down

0 comments on commit 6edff22

Please sign in to comment.