Skip to content

Commit 6633596

Browse files
committed
Default to post-inrement everywhere
Resolves #1242
1 parent 07b8186 commit 6633596

File tree

10 files changed

+43
-43
lines changed

10 files changed

+43
-43
lines changed

books/RayTracingInOneWeekend.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@
116116

117117
std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n";
118118

119-
for (int j = 0; j < image_height; ++j) {
120-
for (int i = 0; i < image_width; ++i) {
119+
for (int j = 0; j < image_height; j++) {
120+
for (int i = 0; i < image_width; i++) {
121121
auto r = double(i) / (image_width-1);
122122
auto g = double(j) / (image_height-1);
123123
auto b = 0;
@@ -256,7 +256,7 @@
256256
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
257257
std::clog << "\rScanlines remaining: " << (image_height - j) << ' ' << std::flush;
258258
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
259-
for (int i = 0; i < image_width; ++i) {
259+
for (int i = 0; i < image_width; i++) {
260260
auto r = double(i) / (image_width-1);
261261
auto g = double(j) / (image_height-1);
262262
auto b = 0;
@@ -456,9 +456,9 @@
456456

457457
std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n";
458458

459-
for (int j = 0; j < image_height; ++j) {
459+
for (int j = 0; j < image_height; j++) {
460460
std::clog << "\rScanlines remaining: " << (image_height - j) << ' ' << std::flush;
461-
for (int i = 0; i < image_width; ++i) {
461+
for (int i = 0; i < image_width; i++) {
462462
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
463463
auto pixel_color = color(double(i)/(image_width-1), double(j)/(image_height-1), 0);
464464
write_color(std::cout, pixel_color);
@@ -683,9 +683,9 @@
683683

684684
std::cout << "P3\n" << image_width << " " << image_height << "\n255\n";
685685

686-
for (int j = 0; j < image_height; ++j) {
686+
for (int j = 0; j < image_height; j++) {
687687
std::clog << "\rScanlines remaining: " << (image_height - j) << ' ' << std::flush;
688-
for (int i = 0; i < image_width; ++i) {
688+
for (int i = 0; i < image_width; i++) {
689689
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
690690
auto pixel_center = pixel00_loc + (i * pixel_delta_u) + (j * pixel_delta_v);
691691
auto ray_direction = pixel_center - camera_center;
@@ -1484,9 +1484,9 @@
14841484

14851485
std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n";
14861486

1487-
for (int j = 0; j < image_height; ++j) {
1487+
for (int j = 0; j < image_height; j++) {
14881488
std::clog << "\rScanlines remaining: " << (image_height - j) << ' ' << std::flush;
1489-
for (int i = 0; i < image_width; ++i) {
1489+
for (int i = 0; i < image_width; i++) {
14901490
auto pixel_center = pixel00_loc + (i * pixel_delta_u) + (j * pixel_delta_v);
14911491
auto ray_direction = pixel_center - camera_center;
14921492
ray r(camera_center, ray_direction);
@@ -1781,9 +1781,9 @@
17811781

17821782
std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n";
17831783

1784-
for (int j = 0; j < image_height; ++j) {
1784+
for (int j = 0; j < image_height; j++) {
17851785
std::clog << "\rScanlines remaining: " << (image_height - j) << ' ' << std::flush;
1786-
for (int i = 0; i < image_width; ++i) {
1786+
for (int i = 0; i < image_width; i++) {
17871787
auto pixel_center = pixel00_loc + (i * pixel_delta_u) + (j * pixel_delta_v);
17881788
auto ray_direction = pixel_center - center;
17891789
ray r(center, ray_direction);
@@ -2038,12 +2038,12 @@
20382038

20392039
std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n";
20402040

2041-
for (int j = 0; j < image_height; ++j) {
2041+
for (int j = 0; j < image_height; j++) {
20422042
std::clog << "\rScanlines remaining: " << (image_height - j) << ' ' << std::flush;
2043-
for (int i = 0; i < image_width; ++i) {
2043+
for (int i = 0; i < image_width; i++) {
20442044
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
20452045
color pixel_color(0,0,0);
2046-
for (int sample = 0; sample < samples_per_pixel; ++sample) {
2046+
for (int sample = 0; sample < samples_per_pixel; sample++) {
20472047
ray r = get_ray(i, j);
20482048
pixel_color += ray_color(r, world);
20492049
}
@@ -2351,11 +2351,11 @@
23512351

23522352
std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n";
23532353

2354-
for (int j = 0; j < image_height; ++j) {
2354+
for (int j = 0; j < image_height; j++) {
23552355
std::clog << "\rScanlines remaining: " << (image_height - j) << ' ' << std::flush;
2356-
for (int i = 0; i < image_width; ++i) {
2356+
for (int i = 0; i < image_width; i++) {
23572357
color pixel_color(0,0,0);
2358-
for (int sample = 0; sample < samples_per_pixel; ++sample) {
2358+
for (int sample = 0; sample < samples_per_pixel; sample++) {
23592359
ray r = get_ray(i, j);
23602360
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
23612361
pixel_color += ray_color(r, max_depth, world);

books/RayTracingTheNextWeek.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@
10611061
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
10621062
// Build the bounding box of the span of source objects.
10631063
bbox = aabb::empty;
1064-
for (int object_index=start; object_index < end; ++object_index)
1064+
for (int object_index=start; object_index < end; object_index++)
10651065
bbox = aabb(bbox, src_objects[object_index]->bounding_box());
10661066
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
10671067

@@ -1081,7 +1081,7 @@
10811081
bvh_node(const std::vector<shared_ptr<hittable>>& src_objects, size_t start, size_t end) {
10821082
// Build the bounding box of the span of source objects.
10831083
bbox = aabb::empty;
1084-
for (int object_index=start; object_index < end; ++object_index)
1084+
for (int object_index=start; object_index < end; object_index++)
10851085
bbox = aabb(bbox, src_objects[object_index]->bounding_box());
10861086

10871087

@@ -1854,7 +1854,7 @@
18541854
public:
18551855
perlin() {
18561856
ranfloat = new double[point_count];
1857-
for (int i = 0; i < point_count; ++i) {
1857+
for (int i = 0; i < point_count; i++) {
18581858
ranfloat[i] = random_double();
18591859
}
18601860

@@ -2161,7 +2161,7 @@
21612161
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
21622162
ranvec = new vec3[point_count];
21632163
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
2164-
for (int i = 0; i < point_count; ++i) {
2164+
for (int i = 0; i < point_count; i++) {
21652165
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
21662166
ranvec[i] = unit_vector(vec3::random(-1,1));
21672167
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++

books/RayTracingTheRestOfYourLife.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,13 @@
312312

313313
std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n";
314314

315-
for (int j = 0; j < image_height; ++j) {
315+
for (int j = 0; j < image_height; j++) {
316316
std::clog << "\rScanlines remaining: " << (image_height - j) << ' ' << std::flush;
317-
for (int i = 0; i < image_width; ++i) {
317+
for (int i = 0; i < image_width; i++) {
318318
color pixel_color(0,0,0);
319319
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
320-
for (int s_j = 0; s_j < sqrt_spp; ++s_j) {
321-
for (int s_i = 0; s_i < sqrt_spp; ++s_i) {
320+
for (int s_j = 0; s_j < sqrt_spp; s_j++) {
321+
for (int s_i = 0; s_i < sqrt_spp; s_i++) {
322322
ray r = get_ray(i, j, s_i, s_j);
323323
pixel_color += ray_color(r, max_depth, world);
324324
}
@@ -2796,12 +2796,12 @@
27962796
std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n";
27972797

27982798
int sqrt_spp = int(sqrt(samples_per_pixel));
2799-
for (int j = 0; j < image_height; ++j) {
2799+
for (int j = 0; j < image_height; j++) {
28002800
std::clog << "\rScanlines remaining: " << (image_height - j) << ' ' << std::flush;
2801-
for (int i = 0; i < image_width; ++i) {
2801+
for (int i = 0; i < image_width; i++) {
28022802
color pixel_color(0,0,0);
2803-
for (int s_j = 0; s_j < sqrt_spp; ++s_j) {
2804-
for (int s_i = 0; s_i < sqrt_spp; ++s_i) {
2803+
for (int s_j = 0; s_j < sqrt_spp; s_j++) {
2804+
for (int s_i = 0; s_i < sqrt_spp; s_i++) {
28052805
ray r = get_ray(i, j, s_i, s_j);
28062806
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
28072807
pixel_color += ray_color(r, max_depth, world, lights);

src/InOneWeekend/camera.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ class camera {
4040

4141
std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n";
4242

43-
for (int j = 0; j < image_height; ++j) {
43+
for (int j = 0; j < image_height; j++) {
4444
std::clog << "\rScanlines remaining: " << (image_height - j) << ' ' << std::flush;
45-
for (int i = 0; i < image_width; ++i) {
45+
for (int i = 0; i < image_width; i++) {
4646
color pixel_color(0,0,0);
47-
for (int sample = 0; sample < samples_per_pixel; ++sample) {
47+
for (int sample = 0; sample < samples_per_pixel; sample++) {
4848
ray r = get_ray(i, j);
4949
pixel_color += ray_color(r, max_depth, world);
5050
}

src/TheNextWeek/bvh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class bvh_node : public hittable {
2727
bvh_node(const std::vector<shared_ptr<hittable>>& src_objects, size_t start, size_t end) {
2828
// Build the bounding box of the span of source objects.
2929
bbox = aabb::empty;
30-
for (size_t object_index=start; object_index < end; ++object_index)
30+
for (size_t object_index=start; object_index < end; object_index++)
3131
bbox = aabb(bbox, src_objects[object_index]->bounding_box());
3232

3333
int axis = bbox.longest_axis();

src/TheNextWeek/camera.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ class camera {
4141

4242
std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n";
4343

44-
for (int j = 0; j < image_height; ++j) {
44+
for (int j = 0; j < image_height; j++) {
4545
std::clog << "\rScanlines remaining: " << (image_height - j) << ' ' << std::flush;
46-
for (int i = 0; i < image_width; ++i) {
46+
for (int i = 0; i < image_width; i++) {
4747
color pixel_color(0,0,0);
48-
for (int sample = 0; sample < samples_per_pixel; ++sample) {
48+
for (int sample = 0; sample < samples_per_pixel; sample++) {
4949
ray r = get_ray(i, j);
5050
pixel_color += ray_color(r, max_depth, world);
5151
}

src/TheNextWeek/perlin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class perlin {
1818
public:
1919
perlin() {
2020
ranvec = new vec3[point_count];
21-
for (int i = 0; i < point_count; ++i) {
21+
for (int i = 0; i < point_count; i++) {
2222
ranvec[i] = unit_vector(vec3::random(-1,1));
2323
}
2424

src/TheRestOfYourLife/bvh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class bvh_node : public hittable {
2727
bvh_node(const std::vector<shared_ptr<hittable>>& src_objects, size_t start, size_t end) {
2828
// Build the bounding box of the span of source objects.
2929
bbox = aabb::empty;
30-
for (int object_index=start; object_index < end; ++object_index)
30+
for (int object_index=start; object_index < end; object_index++)
3131
bbox = aabb(bbox, src_objects[object_index]->bounding_box());
3232

3333
int axis = bbox.longest_axis();

src/TheRestOfYourLife/camera.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ class camera {
4141

4242
std::cout << "P3\n" << image_width << ' ' << image_height << "\n255\n";
4343

44-
for (int j = 0; j < image_height; ++j) {
44+
for (int j = 0; j < image_height; j++) {
4545
std::clog << "\rScanlines remaining: " << (image_height - j) << ' ' << std::flush;
46-
for (int i = 0; i < image_width; ++i) {
46+
for (int i = 0; i < image_width; i++) {
4747
color pixel_color(0,0,0);
48-
for (int s_j = 0; s_j < sqrt_spp; ++s_j) {
49-
for (int s_i = 0; s_i < sqrt_spp; ++s_i) {
48+
for (int s_j = 0; s_j < sqrt_spp; s_j++) {
49+
for (int s_i = 0; s_i < sqrt_spp; s_i++) {
5050
ray r = get_ray(i, j, s_i, s_j);
5151
pixel_color += ray_color(r, max_depth, world, lights);
5252
}

src/TheRestOfYourLife/perlin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class perlin {
1818
public:
1919
perlin() {
2020
ranvec = new vec3[point_count];
21-
for (int i = 0; i < point_count; ++i) {
21+
for (int i = 0; i < point_count; i++) {
2222
ranvec[i] = unit_vector(vec3::random(-1,1));
2323
}
2424

0 commit comments

Comments
 (0)