aboutsummaryrefslogtreecommitdiff
path: root/src/render_cpu.c
diff options
context:
space:
mode:
authorLeonard Kugis <leonardkugis@gmail.com>2018-02-01 00:26:36 +0100
committerLeonard Kugis <leonardkugis@gmail.com>2018-02-01 00:26:36 +0100
commitbe4f2582062196dd6ecf393f55566367bc1dfa9f (patch)
tree9c80c556327097f6ab7e4b97b5b195d45167565f /src/render_cpu.c
parent28006d5fa6af63a9bc2f274e7daf7a741eaacde5 (diff)
reorganized configs
Diffstat (limited to 'src/render_cpu.c')
-rw-r--r--src/render_cpu.c8
1 files changed, 4 insertions, 4 deletions
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);