Răsfoiți Sursa

display: Fix compilation on Windows (can't name variables near/far)

rdb 4 ani în urmă
părinte
comite
c96189e53c

+ 8 - 8
panda/src/display/displayRegion.I

@@ -162,20 +162,20 @@ set_dimensions(const LVecBase4 &dimensions) {
  * larger than the far value.
  */
 INLINE void DisplayRegion::
-set_depth_range(PN_stdfloat near, PN_stdfloat far) {
+set_depth_range(PN_stdfloat near_depth, PN_stdfloat far_depth) {
   CDWriter cdata(_cycler, true);
-  cdata->_depth_range.set(near, far);
+  cdata->_depth_range.set(near_depth, far_depth);
 }
 
 /**
  *
  */
 INLINE void DisplayRegion::
-get_depth_range(PN_stdfloat &near, PN_stdfloat &far) const {
+get_depth_range(PN_stdfloat &near_depth, PN_stdfloat &far_depth) const {
   CDReader cdata(_cycler);
   const LVecBase2 &range = cdata->_depth_range;
-  near = range[0];
-  far = range[1];
+  near_depth = range[0];
+  far_depth = range[1];
 }
 
 /**
@@ -719,10 +719,10 @@ get_top(int i) const {
  *
  */
 INLINE void DisplayRegionPipelineReader::
-get_depth_range(PN_stdfloat &near, PN_stdfloat &far) const {
+get_depth_range(PN_stdfloat &near_depth, PN_stdfloat &far_depth) const {
   const LVecBase2 &range = _cdata->_depth_range;
-  near = range[0];
-  far = range[1];
+  near_depth = range[0];
+  far_depth = range[1];
 }
 
 /**

+ 9 - 9
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -3963,32 +3963,32 @@ prepare_display_region(DisplayRegionPipelineReader *dr) {
     }
   }
 
-  PN_stdfloat near;
-  PN_stdfloat far;
-  dr->get_depth_range(near, far);
+  PN_stdfloat nearv;
+  PN_stdfloat farv;
+  dr->get_depth_range(nearv, farv);
 #ifdef GSG_VERBOSE
   if (GLCAT.is_spam()) {
     GLCAT.spam()
-      << "glDepthRange(" << near << ", " << far << ")" << endl;
+      << "glDepthRange(" << nearv << ", " << farv << ")" << endl;
   }
 #endif
 
 #ifdef OPENGLES
   // OpenGL ES uses a single-precision call.
-  glDepthRangef((GLclampf)near, (GLclampf)far);
+  glDepthRangef((GLclampf)nearv, (GLclampf)farv);
 #else
   // Mainline OpenGL uses a double-precision call.
   if (!_use_remapped_depth_range) {
-    glDepthRange((GLclampd)near, (GLclampd)far);
+    glDepthRange((GLclampd)nearv, (GLclampd)farv);
   } else {
     // If we have a remapped depth range, we should adjust the values to range
     // from -1 to 1.  We need to use an NV extension to pass unclamped values.
-    _glDepthRangedNV(near * 2.0 - 1.0, far * 2.0 - 1.0);
+    _glDepthRangedNV(nearv * 2.0 - 1.0, farv * 2.0 - 1.0);
   }
 #endif  // OPENGLES
   _has_attrib_depth_range = false;
-  _depth_range_near = near;
-  _depth_range_far = far;
+  _depth_range_near = nearv;
+  _depth_range_far = farv;
 
   report_my_gl_errors();
 }