From 6a4515757c46d08d3768c7cf55e859aa237cf1e5 Mon Sep 17 00:00:00 2001 From: Adem Budak Date: Sat, 24 Aug 2019 21:51:48 +0300 Subject: [PATCH 1/3] Change #include float.h to #include --- src/main.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cc b/src/main.cc index 3118f98..e5b1718 100644 --- a/src/main.cc +++ b/src/main.cc @@ -10,14 +10,14 @@ //================================================================================================== #include +#include + #include "sphere.h" #include "hitable_list.h" -#include "float.h" #include "camera.h" #include "material.h" #include "random.h" - vec3 color(const ray& r, hitable *world, int depth) { hit_record rec; if (world->hit(r, 0.001, MAXFLOAT, rec)) { From 1bbbfc7940ae1fc2047ceae3f5d7ad015fef3eb4 Mon Sep 17 00:00:00 2001 From: Adem Budak Date: Sat, 24 Aug 2019 21:52:35 +0300 Subject: [PATCH 2/3] Change math.h and stdlib.h to cmath, cstdlib --- src/vec3.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vec3.h b/src/vec3.h index 5d690a2..a3864e5 100644 --- a/src/vec3.h +++ b/src/vec3.h @@ -11,11 +11,10 @@ // with this software. If not, see . //================================================================================================== -#include -#include +#include +#include #include - class vec3 { public: vec3() {} From 8beba2dd05fb4f1a78b2449e835d116634b6c3e8 Mon Sep 17 00:00:00 2001 From: Adem Budak Date: Sun, 25 Aug 2019 20:12:59 +0300 Subject: [PATCH 3/3] Change white space " " to character ' '. The " " is a string which is `' ' + '\0'` while ' ' is a character. --- src/main.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.cc b/src/main.cc index e5b1718..67d2909 100644 --- a/src/main.cc +++ b/src/main.cc @@ -84,7 +84,11 @@ int main() { int nx = 1200; int ny = 800; int ns = 10; - std::cout << "P3\n" << nx << " " << ny << "\n255\n"; + + std::cout << "P3\n"; + std::cout << nx << ' ' << ny << '\n'; + std::cout << "255\n"; + hitable *world = random_scene(); vec3 lookfrom(13,2,3); @@ -108,7 +112,7 @@ int main() { int ir = int(255.99*col[0]); int ig = int(255.99*col[1]); int ib = int(255.99*col[2]); - std::cout << ir << " " << ig << " " << ib << "\n"; + std::cout << ir << ' ' << ig << ' ' << ib << '\n'; } } }