Commits

Cliff Biffle committed f24f146

Improved documentation in KVRaySpaceFieldModel's solid triangle renderer.

Comments (0)

Files changed (1)

KVRayFieldSpaceModel.m

   
   const uint16_t *sample = [data bytes];
   
+  // gcc 4.2.1 is not clever enough to turn raster two-dimensional
+  // subscripting (e.g. ray[y][x]) into a single incremented induction
+  // variable -- we wind up doing integer multiplications on every
+  // use!  So, we do it by hand: thus |vidx|.
   int vidx = 0;
+  
+  // Cast them rays
   for (int y = 0; y < 480; y++) {
     for (int x = 0; x < 640; x++, vidx++) {
       uint16_t s = sample[vidx];
     }
   }
   
+  // Orient them normals
   for (int y = 0; y < 480 - 1; y++) {
     vidx = 640 * y;
     for (int x = 0; x < 640 - 1; x++, vidx++) {
     }
   }
   
-  
   NSTimeInterval end = [NSDate timeIntervalSinceReferenceDate];
   rayCastingCount++;
   rayCastingTotal += end - start;