From d5a00c0d05030a875ebd85356509ee270bdb7410 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sun, 15 Mar 2015 17:08:55 +0100 Subject: Rewrite color palettes Supports palettes with != 256 colors properly now. A lot of old code still (silently!) relies on that number though. --- main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index c490d50..1b3fba6 100644 --- a/main.c +++ b/main.c @@ -224,9 +224,13 @@ static void do_random (const random_arguments * const arguments) { randctx rc; rand_seed(&rc); + palette_collection pc; + bool bret = palette_read_collection ("flam3-palettes.xml", &pc); + assert (bret); + flam3_genome genome = { .edits = NULL }; int ivars = flam3_variation_random; - flam3_random (&genome, &ivars, 1, arguments->symmetry, 0, &rc); + flam3_random (&genome, &ivars, 1, arguments->symmetry, 0, &pc, &rc); /* random resets genome, adjust before finding appropriate bbox */ genome.width = arguments->width; @@ -299,12 +303,16 @@ static void do_mutate (const mutate_arguments * const arguments) { } assert (ncps == 1); + palette_collection pc; + bool bret = palette_read_collection ("flam3-palettes.xml", &pc); + assert (bret); + flam3_genome * const genome = &cps[0]; int ivars = flam3_variation_random; const double speed = 1.0; flam3_mutate (genome, arguments->method, &ivars, 1, arguments->symmetry, - speed, &rc); + speed, &pc, &rc); print_genome (genome); } -- cgit v1.2.3