Commits

Cliff Biffle committed b2f26bb

Renamed KVRenderer's "useLighting" property to just "lit" to be more consistent with other properties -- and shorter.

  • Participants
  • Parent commits 9ad5aa1

Comments (0)

Files changed (8)

File KVAbstractRenderer.h

 
 // These properties are synthesized for the benefit of
 // subclasses.
-@property(assign, nonatomic) BOOL useLighting;
+@property(assign, nonatomic) BOOL lit;
 @property(assign, nonatomic) BOOL textured;
 @property(retain, nonatomic) NSColor *color;
 @property(assign, nonatomic) projective_transform_t colorTransform;

File KVAbstractRenderer.m

 
 #pragma mark --- KVRenderer implementation (partial)
 
-@synthesize useLighting;
+@synthesize lit;
 @synthesize color;
 @synthesize colorTransform;
 @synthesize textured;

File KVDepthView.m

   renderer = [newRenderer retain];
   [currentRenderer release];
   
-  renderer.useLighting = lightsOn;
+  renderer.lit = lightsOn;
   renderer.colorTransform = colorTransform;
   [self setNeedsDisplay: YES];
 }
   } else {
     glDisable(GL_LIGHTING);
   }
-  renderer.useLighting = self.lightsOn;
+  renderer.lit = self.lightsOn;
   [self setNeedsDisplay: YES];
 }
 

File KVPointCloudRenderer.m

   // Avoid the property message send for a significant perf win.
   // (Sending a message doubles our render time.)
   BOOL textured = self.textured;
-  BOOL lit = self.useLighting;
+  BOOL lit = self.lit;
   const projective_transform_t xform = self.colorTransform;
   KVAbstractRendererProjector projector =
       (KVAbstractRendererProjector) [self methodForSelector: @selector(projectInto:x:y:z:)];

File KVQuadRenderer.m

                              colors: (const colors_t *)colors {
   // Avoid message send for large performance win.
   BOOL textured = self.textured;
-  BOOL lit = self.useLighting;
+  BOOL lit = self.lit;
   projective_transform_t xform = self.colorTransform;
   KVAbstractRendererProjector projector =
       (KVAbstractRendererProjector) [self methodForSelector: @selector(projectInto:x:y:z:)];

File KVRenderer.h

 // colors to emphasize depth.
 // This won't take effect until the next call to
 // -[drawInCurrentOpenGLContext].
-@property(assign, nonatomic) BOOL useLighting;
+@property(assign, nonatomic) BOOL lit;
 
 // Whether the renderer maps color data from the camera
 // onto the 3D scene.

File KVSinglePlaneDepthMap.m

 }
 
 - (void) drawInCurrentOpenGLContextWithRenderer: (id <KVRenderer>) renderer {
+  NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate];
   [renderer drawInCurrentOpenGLContext: &zs colors: &colors];
+  NSTimeInterval end = [NSDate timeIntervalSinceReferenceDate];
+  
+  NSLog(@"Render (%@, lights=%d, texture=%d) took %.03fµs",
+        [[renderer class] description],
+        renderer.lit,
+        renderer.textured,
+        (end - start) * 1000000.);
 }
 
 #pragma mark --- Internals

File KVTriStripRenderer.m

   
   // Avoid message send for a large performance win.
   BOOL textured = self.textured;
-  BOOL lit = self.useLighting;
+  BOOL lit = self.lit;
   const projective_transform_t xform = self.colorTransform;
 
   KVAbstractRendererProjector projector =