summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-08-10 11:53:55 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-08-10 11:53:55 -0400
commitd9e4ce41487b05b0b4514ff339e0a65620516936 (patch)
tree295a03d13246128922920dbf26756ccf2121792b /main.c
parent0b7731ebb7c06fd73e945cec777960d450e8192c (diff)
downloadkd-forest-d9e4ce41487b05b0b4514ff339e0a65620516936.tar.xz
Make frame rate independent of custom widths.
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.c b/main.c
index 7c0ab56..94a0780 100644
--- a/main.c
+++ b/main.c
@@ -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);