From be4f2582062196dd6ecf393f55566367bc1dfa9f Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Thu, 1 Feb 2018 00:26:36 +0100 Subject: reorganized configs --- src/render_cpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/render_cpu.c') diff --git a/src/render_cpu.c b/src/render_cpu.c index 64fc9ec..ef66e37 100644 --- a/src/render_cpu.c +++ b/src/render_cpu.c @@ -17,7 +17,7 @@ void idle_cpu_dummy(void) glutPostRedisplay(); } -void init_cpu(CpuConfig *config) +void init_cpu(config_t *config) { config_cpu = config; x_min_s = -2.0; @@ -58,10 +58,10 @@ void render_cpu(void) void calculate(d64 x_min, d64 y_min, d64 x_max, d64 y_max, u32 (*sfunc) (d64, d64, u32), u32 *arr) { pthread_t thread; - ThreadArgs *args = (ThreadArgs *) malloc(config_cpu->threads * sizeof(ThreadArgs)); - for(u8 i = 0; i < config_cpu->threads; i++) + ThreadArgs *args = (ThreadArgs *) malloc(config_cpu->config_cpu.threads * sizeof(ThreadArgs)); + for(u8 i = 0; i < config_cpu->config_cpu.threads; i++) { - args[i] = (ThreadArgs) { .tc = config_cpu->threads, .tid = i, .x_min = x_min, .y_min = y_min, .x_max = x_max, .y_max = y_max, .sfunc = sfunc, .arr = arr }; + args[i] = (ThreadArgs) { .tc = config_cpu->config_cpu.threads, .tid = i, .x_min = x_min, .y_min = y_min, .x_max = x_max, .y_max = y_max, .sfunc = sfunc, .arr = arr }; pthread_create(&thread, NULL, calculate_t, (void *)&args[i]); } pthread_join(thread, NULL); -- cgit v1.2.1