diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2014-08-10 11:53:55 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2014-08-10 11:53:55 -0400 |
commit | d9e4ce41487b05b0b4514ff339e0a65620516936 (patch) | |
tree | 295a03d13246128922920dbf26756ccf2121792b | |
parent | 0b7731ebb7c06fd73e945cec777960d450e8192c (diff) | |
download | kd-forest-d9e4ce41487b05b0b4514ff339e0a65620516936.tar.xz |
Make frame rate independent of custom widths.
-rw-r--r-- | main.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -390,6 +390,7 @@ generate_bitmap(state_t *state) char filename[strlen(state->options->filename) + 10]; size_t max_size = 0; + unsigned int update_interval = 1U << (state->options->bit_depth + 1)/2; // Do multiple passes to get rid of artifacts in HUE_SORT mode unsigned int bit_depth = state->options->bit_depth; @@ -397,7 +398,7 @@ generate_bitmap(state_t *state) unsigned int stripe = 1 << i; for (unsigned int j = stripe/2 - 1; j < state->options->ncolors; j += stripe, ++progress) { - if (progress % state->options->width == 0) { + if (progress % update_interval == 0) { if (animate) { sprintf(filename, "%s/%04u.png", state->options->filename, frame); write_png(state, filename); |