summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--3dmath.c2
-rw-r--r--main_headless.c3
-rw-r--r--ray.c2
3 files changed, 5 insertions, 2 deletions
diff --git a/3dmath.c b/3dmath.c
index eb9c4a8..ece6f83 100644
--- a/3dmath.c
+++ b/3dmath.c
@@ -1,3 +1,5 @@
+#include "3dmath.h"
+
#include <math.h>
#define POW2(x) ((x) * (x))
diff --git a/main_headless.c b/main_headless.c
index c5cd5bd..8fd1dcf 100644
--- a/main_headless.c
+++ b/main_headless.c
@@ -7,7 +7,8 @@
static const size_t kFramesToRender = 100;
-int main(int argc, char** argv) {
+int
+main(int argc, char** argv) {
fprintf(stderr, "Rendering %zu frames\n", kFramesToRender);
unsigned char* buffer = calloc(4, WIDTH * HEIGHT);
diff --git a/ray.c b/ray.c
index 018ace1..45597df 100644
--- a/ray.c
+++ b/ray.c
@@ -102,7 +102,6 @@ thread(void *arg) {
void
trace_scene(float time, unsigned char *buf, int threaded) {
-
objects[0].position[0] = 1.5 * cos(time);
objects[0].position[1] = 1.5 * sin(time);
objects[1].position[0] = 1.5 * cos(time + 1/3. * TAU);
@@ -110,6 +109,7 @@ trace_scene(float time, unsigned char *buf, int threaded) {
objects[3].position[0] = 1.5 * cos(time + 2/3. * TAU);
objects[3].position[1] = 1.5 * sin(time + 2/3. * TAU);
objects[2].position[2] = -3 + 2 * sin(time * 2);
+
if(threaded) {
pthread_attr_t attr;
pthread_attr_init(&attr);