File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ class camera {
38
38
initialize ();
39
39
40
40
std::cout << " P3\n " << image_width << ' ' << image_height << " \n 255\n " ;
41
+ std::flush (std::cout);
41
42
42
43
int image_size_in_bytes = sizeof (color) * image_width * image_height;
43
44
color *rendered_image = (color *) mmap (nullptr , image_size_in_bytes,
@@ -61,7 +62,9 @@ class camera {
61
62
}
62
63
}
63
64
64
- for (int i = 0 ; i < remainder; i++) {
65
+ std::clog << processes * lines_per_child << " " << image_height << " \n " ;
66
+
67
+ for (int i = processes * lines_per_child; i < image_height; i++) {
65
68
renderLine (i, world, rendered_image);
66
69
}
67
70
std::clog << " Remainder done. \n " ;
@@ -70,6 +73,8 @@ class camera {
70
73
wait (NULL );
71
74
}
72
75
76
+
77
+
73
78
for (int i = 0 ; i < image_height; i++) {
74
79
for (int j = 0 ; j < image_width; j++) {
75
80
write_color (std::cout, rendered_image[i * image_width + j]);
You can’t perform that action at this time.
0 commit comments